Skip to content

Commit 1237fb6

Browse files
committed
[needs-docs][ui] Move 'add saved file to map' option away from data settings
1 parent 5603546 commit 1237fb6

4 files changed

+112
-41
lines changed

src/gui/ogr/qgsvectorlayersaveasdialog.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, i
8888
mExtentGroupBox->hide();
8989

9090
mSelectedOnly->setEnabled( layer && layer->selectedFeatureCount() != 0 );
91-
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
91+
mButtonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
9292
}
9393

9494
void QgsVectorLayerSaveAsDialog::setup()
@@ -104,7 +104,16 @@ void QgsVectorLayerSaveAsDialog::setup()
104104
connect( mDeselectAllAttributes, &QPushButton::clicked, this, &QgsVectorLayerSaveAsDialog::mDeselectAllAttributes_clicked );
105105
connect( mReplaceRawFieldValues, &QCheckBox::stateChanged, this, &QgsVectorLayerSaveAsDialog::mReplaceRawFieldValues_stateChanged );
106106
connect( mAttributeTable, &QTableWidget::itemChanged, this, &QgsVectorLayerSaveAsDialog::mAttributeTable_itemChanged );
107-
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
107+
108+
#ifdef Q_OS_WIN
109+
mHelpButtonBox->setVisible( false );
110+
mButtonBox->addButton( QDialogButtonBox::Help );
111+
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
112+
#else
113+
connect( mHelpButtonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
114+
#endif
115+
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsVectorLayerSaveAsDialog::accept );
116+
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsVectorLayerSaveAsDialog::reject );
108117

109118
const QList< QgsVectorFileWriter::DriverDetails > drivers = QgsVectorFileWriter::ogrDriverList();
110119
mFormatComboBox->blockSignals( true );
@@ -174,7 +183,7 @@ void QgsVectorLayerSaveAsDialog::setup()
174183
QFileInfo fileInfo( filePath );
175184
leLayername->setText( fileInfo.baseName() );
176185
}
177-
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
186+
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
178187
} );
179188
}
180189

src/gui/qgsrasterlayersaveasdialog.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,15 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
149149
okButton->setEnabled( false );
150150
}
151151

152+
#ifdef Q_OS_WIN
153+
mHelpButtonBox->setVisible( false );
154+
mButtonBox->addButton( QDialogButtonBox::Help );
152155
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterLayerSaveAsDialog::showHelp );
156+
#else
157+
connect( mHelpButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterLayerSaveAsDialog::showHelp );
158+
#endif
159+
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsRasterLayerSaveAsDialog::accept );
160+
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsRasterLayerSaveAsDialog::reject );
153161

154162
mExtentGroupBox->setOutputCrs( outputCrs() );
155163
mExtentGroupBox->setOriginalExtent( mDataProvider->extent(), mLayerCrs );

src/ui/qgsrasterlayersaveasdialogbase.ui

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,6 @@ datasets with maximum width and height specified below.</string>
147147
</property>
148148
</widget>
149149
</item>
150-
<item row="5" column="0" colspan="2">
151-
<widget class="QCheckBox" name="mAddToCanvas">
152-
<property name="text">
153-
<string>Add saved file to map</string>
154-
</property>
155-
<property name="checked">
156-
<bool>true</bool>
157-
</property>
158-
</widget>
159-
</item>
160150
<item row="3" column="0">
161151
<widget class="QLabel" name="label_3">
162152
<property name="text">
@@ -665,14 +655,51 @@ datasets with maximum width and height specified below.</string>
665655
</widget>
666656
</item>
667657
<item>
668-
<widget class="QDialogButtonBox" name="mButtonBox">
669-
<property name="orientation">
670-
<enum>Qt::Horizontal</enum>
671-
</property>
672-
<property name="standardButtons">
673-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
674-
</property>
675-
</widget>
658+
<layout class="QHBoxLayout" name="horizontalLayout_10">
659+
<item>
660+
<widget class="QDialogButtonBox" name="mHelpButtonBox">
661+
<property name="orientation">
662+
<enum>Qt::Horizontal</enum>
663+
</property>
664+
<property name="standardButtons">
665+
<set>QDialogButtonBox::Help</set>
666+
</property>
667+
</widget>
668+
</item>
669+
<item>
670+
<spacer name="horizontalSpacer">
671+
<property name="orientation">
672+
<enum>Qt::Horizontal</enum>
673+
</property>
674+
<property name="sizeHint" stdset="0">
675+
<size>
676+
<width>20</width>
677+
<height>10</height>
678+
</size>
679+
</property>
680+
</spacer>
681+
</item>
682+
<item>
683+
<widget class="QCheckBox" name="mAddToCanvas">
684+
<property name="text">
685+
<string>Add saved file to map</string>
686+
</property>
687+
<property name="checked">
688+
<bool>true</bool>
689+
</property>
690+
</widget>
691+
</item>
692+
<item>
693+
<widget class="QDialogButtonBox" name="mButtonBox">
694+
<property name="orientation">
695+
<enum>Qt::Horizontal</enum>
696+
</property>
697+
<property name="standardButtons">
698+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
699+
</property>
700+
</widget>
701+
</item>
702+
</layout>
676703
</item>
677704
</layout>
678705
</widget>
@@ -728,7 +755,6 @@ datasets with maximum width and height specified below.</string>
728755
<tabstop>mFilename</tabstop>
729756
<tabstop>mLayerName</tabstop>
730757
<tabstop>mCrsSelector</tabstop>
731-
<tabstop>mAddToCanvas</tabstop>
732758
<tabstop>mScrollArea</tabstop>
733759
<tabstop>mResolutionRadioButton</tabstop>
734760
<tabstop>mXResolutionLineEdit</tabstop>
@@ -750,6 +776,7 @@ datasets with maximum width and height specified below.</string>
750776
<tabstop>mRemoveSelectedNoDataToolButton</tabstop>
751777
<tabstop>mLoadTransparentNoDataToolButton</tabstop>
752778
<tabstop>mRemoveAllNoDataToolButton</tabstop>
779+
<tabstop>mAddToCanvas</tabstop>
753780
</tabstops>
754781
<resources>
755782
<include location="../../images/images.qrc"/>

src/ui/qgsvectorlayersaveasdialogbase.ui

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@
126126
</property>
127127
</widget>
128128
</item>
129-
<item>
130-
<widget class="QCheckBox" name="mAddToCanvas">
131-
<property name="text">
132-
<string>Add saved file to map</string>
133-
</property>
134-
<property name="checked">
135-
<bool>true</bool>
136-
</property>
137-
</widget>
138-
</item>
139129
<item>
140130
<widget class="QgsCollapsibleGroupBox" name="mAttributesSelection">
141131
<property name="title">
@@ -417,14 +407,51 @@
417407
</widget>
418408
</item>
419409
<item>
420-
<widget class="QDialogButtonBox" name="buttonBox">
421-
<property name="orientation">
422-
<enum>Qt::Horizontal</enum>
423-
</property>
424-
<property name="standardButtons">
425-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
426-
</property>
427-
</widget>
410+
<layout class="QHBoxLayout" name="horizontalLayout">
411+
<item>
412+
<widget class="QDialogButtonBox" name="mHelpButtonBox">
413+
<property name="orientation">
414+
<enum>Qt::Horizontal</enum>
415+
</property>
416+
<property name="standardButtons">
417+
<set>QDialogButtonBox::Help</set>
418+
</property>
419+
</widget>
420+
</item>
421+
<item>
422+
<spacer name="horizontalSpacer">
423+
<property name="orientation">
424+
<enum>Qt::Horizontal</enum>
425+
</property>
426+
<property name="sizeHint" stdset="0">
427+
<size>
428+
<width>20</width>
429+
<height>10</height>
430+
</size>
431+
</property>
432+
</spacer>
433+
</item>
434+
<item>
435+
<widget class="QCheckBox" name="mAddToCanvas">
436+
<property name="text">
437+
<string>Add saved file to map</string>
438+
</property>
439+
<property name="checked">
440+
<bool>true</bool>
441+
</property>
442+
</widget>
443+
</item>
444+
<item>
445+
<widget class="QDialogButtonBox" name="mButtonBox">
446+
<property name="orientation">
447+
<enum>Qt::Horizontal</enum>
448+
</property>
449+
<property name="standardButtons">
450+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
451+
</property>
452+
</widget>
453+
</item>
454+
</layout>
428455
</item>
429456
</layout>
430457
</widget>
@@ -480,11 +507,11 @@
480507
<tabstop>mGeometryTypeComboBox</tabstop>
481508
<tabstop>mForceMultiCheckBox</tabstop>
482509
<tabstop>mIncludeZCheckBox</tabstop>
483-
<tabstop>mAddToCanvas</tabstop>
484510
<tabstop>mAttributeTable</tabstop>
485511
<tabstop>mReplaceRawFieldValues</tabstop>
486512
<tabstop>mOgrDatasourceOptions</tabstop>
487513
<tabstop>mOgrLayerOptions</tabstop>
514+
<tabstop>mAddToCanvas</tabstop>
488515
</tabstops>
489516
<resources/>
490517
<connections>

0 commit comments

Comments
 (0)