Skip to content

Commit

Permalink
[needs-docs][ui] Move 'add saved file to map' option away from data s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
nirvn committed Nov 21, 2018
1 parent 5603546 commit 1237fb6
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 41 deletions.
15 changes: 12 additions & 3 deletions src/gui/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -88,7 +88,7 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, i
mExtentGroupBox->hide();

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

void QgsVectorLayerSaveAsDialog::setup()
Expand All @@ -104,7 +104,16 @@ void QgsVectorLayerSaveAsDialog::setup()
connect( mDeselectAllAttributes, &QPushButton::clicked, this, &QgsVectorLayerSaveAsDialog::mDeselectAllAttributes_clicked );
connect( mReplaceRawFieldValues, &QCheckBox::stateChanged, this, &QgsVectorLayerSaveAsDialog::mReplaceRawFieldValues_stateChanged );
connect( mAttributeTable, &QTableWidget::itemChanged, this, &QgsVectorLayerSaveAsDialog::mAttributeTable_itemChanged );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );

#ifdef Q_OS_WIN
mHelpButtonBox->setVisible( false );
mButtonBox->addButton( QDialogButtonBox::Help );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
#else
connect( mHelpButtonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
#endif
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsVectorLayerSaveAsDialog::accept );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsVectorLayerSaveAsDialog::reject );

const QList< QgsVectorFileWriter::DriverDetails > drivers = QgsVectorFileWriter::ogrDriverList();
mFormatComboBox->blockSignals( true );
Expand Down Expand Up @@ -174,7 +183,7 @@ void QgsVectorLayerSaveAsDialog::setup()
QFileInfo fileInfo( filePath );
leLayername->setText( fileInfo.baseName() );
}
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
} );
}

Expand Down
8 changes: 8 additions & 0 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -149,7 +149,15 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
okButton->setEnabled( false );
}

#ifdef Q_OS_WIN
mHelpButtonBox->setVisible( false );
mButtonBox->addButton( QDialogButtonBox::Help );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterLayerSaveAsDialog::showHelp );
#else
connect( mHelpButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterLayerSaveAsDialog::showHelp );
#endif
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsRasterLayerSaveAsDialog::accept );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsRasterLayerSaveAsDialog::reject );

mExtentGroupBox->setOutputCrs( outputCrs() );
mExtentGroupBox->setOriginalExtent( mDataProvider->extent(), mLayerCrs );
Expand Down
65 changes: 46 additions & 19 deletions src/ui/qgsrasterlayersaveasdialogbase.ui
Expand Up @@ -147,16 +147,6 @@ datasets with maximum width and height specified below.</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add saved file to map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
Expand Down Expand Up @@ -665,14 +655,51 @@ datasets with maximum width and height specified below.</string>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QDialogButtonBox" name="mHelpButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Help</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add saved file to map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -728,7 +755,6 @@ datasets with maximum width and height specified below.</string>
<tabstop>mFilename</tabstop>
<tabstop>mLayerName</tabstop>
<tabstop>mCrsSelector</tabstop>
<tabstop>mAddToCanvas</tabstop>
<tabstop>mScrollArea</tabstop>
<tabstop>mResolutionRadioButton</tabstop>
<tabstop>mXResolutionLineEdit</tabstop>
Expand All @@ -750,6 +776,7 @@ datasets with maximum width and height specified below.</string>
<tabstop>mRemoveSelectedNoDataToolButton</tabstop>
<tabstop>mLoadTransparentNoDataToolButton</tabstop>
<tabstop>mRemoveAllNoDataToolButton</tabstop>
<tabstop>mAddToCanvas</tabstop>
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
Expand Down
65 changes: 46 additions & 19 deletions src/ui/qgsvectorlayersaveasdialogbase.ui
Expand Up @@ -126,16 +126,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add saved file to map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="mAttributesSelection">
<property name="title">
Expand Down Expand Up @@ -417,14 +407,51 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDialogButtonBox" name="mHelpButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Help</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add saved file to map</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -480,11 +507,11 @@
<tabstop>mGeometryTypeComboBox</tabstop>
<tabstop>mForceMultiCheckBox</tabstop>
<tabstop>mIncludeZCheckBox</tabstop>
<tabstop>mAddToCanvas</tabstop>
<tabstop>mAttributeTable</tabstop>
<tabstop>mReplaceRawFieldValues</tabstop>
<tabstop>mOgrDatasourceOptions</tabstop>
<tabstop>mOgrLayerOptions</tabstop>
<tabstop>mAddToCanvas</tabstop>
</tabstops>
<resources/>
<connections>
Expand Down

0 comments on commit 1237fb6

Please sign in to comment.