Remove some dialogs geometry size settings

replaced with automatic restoring
This commit is contained in:
Harrissou Sant-anna 2019-06-21 08:08:37 +02:00 committed by Nyall Dawson
parent a14aac2ede
commit 059277ceca
40 changed files with 65 additions and 184 deletions

View File

@ -21,7 +21,6 @@ A generic message view for displaying QGIS messages.
%End
public:
QgsMessageViewer( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, bool deleteOnClose = true );
~QgsMessageViewer();
virtual void setMessage( const QString &message, MessageType msgType );

View File

@ -31,7 +31,6 @@ Runs the dialog and creates a new memory layer
%Docstring
New dialog constructor.
%End
~QgsNewMemoryLayerDialog();
QgsWkbTypes::Type selectedType() const;
%Docstring

View File

@ -21,6 +21,7 @@
#include "qgsfieldexpressionwidget.h"
#include "qgsdoublespinbox.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include "qgslayouttablecolumn.h"
#include <QCheckBox>
@ -885,6 +886,8 @@ QgsLayoutAttributeSelectionDialog::QgsLayoutAttributeSelectionDialog( QgsLayoutI
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mRemoveColumnPushButton, &QPushButton::clicked, this, &QgsLayoutAttributeSelectionDialog::mRemoveColumnPushButton_clicked );
connect( mAddColumnPushButton, &QPushButton::clicked, this, &QgsLayoutAttributeSelectionDialog::mAddColumnPushButton_clicked );
connect( mColumnUpPushButton, &QPushButton::clicked, this, &QgsLayoutAttributeSelectionDialog::mColumnUpPushButton_clicked );
@ -896,9 +899,6 @@ QgsLayoutAttributeSelectionDialog::QgsLayoutAttributeSelectionDialog( QgsLayoutI
connect( mSortColumnUpPushButton, &QPushButton::clicked, this, &QgsLayoutAttributeSelectionDialog::mSortColumnUpPushButton_clicked );
connect( mSortColumnDownPushButton, &QPushButton::clicked, this, &QgsLayoutAttributeSelectionDialog::mSortColumnDownPushButton_clicked );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/AttributeSelectionDialog/geometry" ) ).toByteArray() );
if ( mTable )
{
//set up models, views and delegates
@ -933,12 +933,6 @@ QgsLayoutAttributeSelectionDialog::QgsLayoutAttributeSelectionDialog( QgsLayoutI
mOrderComboBox->insertItem( 1, tr( "Descending" ) );
}
QgsLayoutAttributeSelectionDialog::~QgsLayoutAttributeSelectionDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/AttributeSelectionDialog/geometry" ), saveGeometry() );
}
void QgsLayoutAttributeSelectionDialog::mRemoveColumnPushButton_clicked()
{
//remove selected rows from model

View File

@ -286,8 +286,6 @@ class QgsLayoutAttributeSelectionDialog: public QDialog, private Ui::QgsLayoutAt
public:
QgsLayoutAttributeSelectionDialog( QgsLayoutItemAttributeTable *table, QgsVectorLayer *vLayer, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsLayoutAttributeSelectionDialog() override;
private slots:
void mRemoveColumnPushButton_clicked();
void mAddColumnPushButton_clicked();

View File

@ -19,13 +19,13 @@
#include "qgsmaplayermodel.h"
#include "qgsmaplayerproxymodel.h"
#include "qgssettings.h"
#include "qgsgui.h"
QgsLayoutLegendLayersDialog::QgsLayoutLegendLayersDialog( QWidget *parent )
: QDialog( parent )
{
setupUi( this );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/LayoutLegendLayers/geometry" ) ).toByteArray() );
QgsGui::enableAutoGeometryRestore( this );
mFilterLineEdit->setShowClearButton( true );
mFilterLineEdit->setShowSearchIcon( true );
@ -41,12 +41,6 @@ QgsLayoutLegendLayersDialog::QgsLayoutLegendLayersDialog( QWidget *parent )
connect( mCheckBoxVisibleLayers, &QCheckBox::toggled, this, &QgsLayoutLegendLayersDialog::filterVisible );
}
QgsLayoutLegendLayersDialog::~QgsLayoutLegendLayersDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/LayoutLegendLayers/geometry" ), saveGeometry() );
}
void QgsLayoutLegendLayersDialog::setVisibleLayers( const QList<QgsMapLayer *> &layers )
{
mVisibleLayers = layers;

View File

@ -30,7 +30,6 @@ class QgsLayoutLegendLayersDialog: public QDialog, private Ui::QgsLayoutLegendLa
public:
QgsLayoutLegendLayersDialog( QWidget *parent = nullptr );
~QgsLayoutLegendLayersDialog() override;
/**
* Sets a list of visible \a layers, to use for filtering within the dialog.

View File

@ -19,6 +19,7 @@
#include "qgslayouttable.h"
#include "qgslayout.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QCheckBox>
#include <QPushButton>
@ -28,6 +29,8 @@ QgsLayoutTableBackgroundColorsDialog::QgsLayoutTableBackgroundColorsDialog( QgsL
, mTable( table )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsLayoutTableBackgroundColorsDialog::buttonBox_accepted );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsLayoutTableBackgroundColorsDialog::buttonBox_rejected );
@ -53,18 +56,9 @@ QgsLayoutTableBackgroundColorsDialog::QgsLayoutTableBackgroundColorsDialog( QgsL
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsLayoutTableBackgroundColorsDialog::apply );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ComposerTableBackgroundColorsDialog/geometry" ) ).toByteArray() );
setGuiElementValues();
}
QgsLayoutTableBackgroundColorsDialog::~QgsLayoutTableBackgroundColorsDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/ComposerTableBackgroundColorsDialog/geometry" ), saveGeometry() );
}
void QgsLayoutTableBackgroundColorsDialog::apply()
{
if ( !mTable )

View File

@ -42,8 +42,6 @@ class QgsLayoutTableBackgroundColorsDialog: public QDialog, private Ui::QgsLayou
*/
QgsLayoutTableBackgroundColorsDialog( QgsLayoutTable *table, QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr );
~QgsLayoutTableBackgroundColorsDialog() override;
private slots:
void apply();

View File

@ -47,6 +47,7 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
, mFieldIdx( fieldIdx )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
if ( fieldIdx < 0 )
return;
@ -88,18 +89,12 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
}
);
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ) ).toByteArray() );
constraintExpressionWidget->setAllowEmptyFieldName( true );
constraintExpressionWidget->setLayer( vl );
}
QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ), saveGeometry() );
qDeleteAll( mEditorConfigWidgets );
}

View File

@ -21,10 +21,13 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgssettings.h"
#include "qgsgui.h"
QgsDelAttrDialog::QgsDelAttrDialog( const QgsVectorLayer *vl )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
if ( vl )
{
bool canDeleteAttributes = vl->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteAttributes;
@ -57,15 +60,6 @@ QgsDelAttrDialog::QgsDelAttrDialog( const QgsVectorLayer *vl )
mEditModeInfo->setVisible( !vl->isEditable() );
mCanDeleteAttributesInfo->setVisible( !canDeleteAttributes );
}
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsDelAttrDialog/geometry" ) ).toByteArray() );
}
QgsDelAttrDialog::~QgsDelAttrDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/QgsDelAttrDialog/geometry" ), saveGeometry() );
}
QList<int> QgsDelAttrDialog::selectedAttributes()

View File

@ -30,7 +30,7 @@ class APP_EXPORT QgsDelAttrDialog: public QDialog, private Ui::QgsDelAttrDialogB
Q_OBJECT
public:
QgsDelAttrDialog( const QgsVectorLayer *vl );
~QgsDelAttrDialog() override;
//! Returns the selected attribute indices
QList<int> selectedAttributes();
};

View File

@ -60,6 +60,8 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mFromSelectedPushButton, &QPushButton::clicked, this, &QgsMergeAttributesDialog::mFromSelectedPushButton_clicked );
connect( mRemoveFeatureFromSelectionButton, &QPushButton::clicked, this, &QgsMergeAttributesDialog::mRemoveFeatureFromSelectionButton_clicked );
createTableWidgetContents();
@ -75,9 +77,6 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
mFromSelectedPushButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionFromSelectedFeature.svg" ) ) );
mRemoveFeatureFromSelectionButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mActionRemoveSelectedFeature.svg" ) ) );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/MergeAttributes/geometry" ) ).toByteArray() );
connect( mSkipAllButton, &QAbstractButton::clicked, this, &QgsMergeAttributesDialog::setAllToSkip );
connect( mTableWidget, &QTableWidget::cellChanged, this, &QgsMergeAttributesDialog::tableWidgetCellChanged );
}
@ -85,18 +84,14 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur
QgsMergeAttributesDialog::QgsMergeAttributesDialog()
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mFromSelectedPushButton, &QPushButton::clicked, this, &QgsMergeAttributesDialog::mFromSelectedPushButton_clicked );
connect( mRemoveFeatureFromSelectionButton, &QPushButton::clicked, this, &QgsMergeAttributesDialog::mRemoveFeatureFromSelectionButton_clicked );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/MergeAttributes/geometry" ) ).toByteArray() );
}
QgsMergeAttributesDialog::~QgsMergeAttributesDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/MergeAttributes/geometry" ), saveGeometry() );
delete mSelectionRubberBand;
}

View File

@ -21,6 +21,7 @@
#include "qgslayertreeutils.h"
#include "qgssettings.h"
#include "qgsziputils.h"
#include "qgsgui.h"
#include <QDomDocument>
#include <QFileDialog>
@ -48,6 +49,7 @@ QgsProjectLayerGroupDialog::QgsProjectLayerGroupDialog( QWidget *parent, const Q
, mRootGroup( new QgsLayerTree )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
QgsEmbeddedLayerTreeModel *model = new QgsEmbeddedLayerTreeModel( mRootGroup, this );
mTreeView->setModel( model );
@ -74,21 +76,13 @@ QgsProjectLayerGroupDialog::QgsProjectLayerGroupDialog( QWidget *parent, const Q
}
connect( mProjectFileWidget, &QgsFileWidget::fileChanged, this, &QgsProjectLayerGroupDialog::changeProjectFile );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsProjectLayerGroupDialog::mButtonBox_accepted );
restoreGeometry( settings.value( QStringLiteral( "Windows/EmbedLayer/geometry" ) ).toByteArray() );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsProjectLayerGroupDialog::showHelp );
}
QgsProjectLayerGroupDialog::~QgsProjectLayerGroupDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/EmbedLayer/geometry" ), saveGeometry() );
delete mRootGroup;
}

View File

@ -21,6 +21,7 @@
#include "qgssettings.h"
#include "qgsmessagebar.h"
#include "qgsexpressioncontextutils.h"
#include "qgsgui.h"
QgsSelectByFormDialog::QgsSelectByFormDialog( QgsVectorLayer *layer, const QgsAttributeEditorContext &context, QWidget *parent, Qt::WindowFlags fl )
@ -44,18 +45,11 @@ QgsSelectByFormDialog::QgsSelectByFormDialog( QgsVectorLayer *layer, const QgsAt
connect( mForm, &QgsAttributeForm::closed, this, &QWidget::close );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/SelectByForm/geometry" ) ).toByteArray() );
QgsGui::enableAutoGeometryRestore( this );
setWindowTitle( tr( "Select Features by Value" ) );
}
QgsSelectByFormDialog::~QgsSelectByFormDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/SelectByForm/geometry" ), saveGeometry() );
}
void QgsSelectByFormDialog::setMessageBar( QgsMessageBar *messageBar )
{
mMessageBar = messageBar;

View File

@ -49,8 +49,6 @@ class APP_EXPORT QgsSelectByFormDialog : public QDialog
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr );
~QgsSelectByFormDialog() override;
/**
* Sets the message bar to display feedback from the form in. This is used in the search/filter
* mode to display the count of selected features.

View File

@ -20,6 +20,7 @@
#include "qgsvectorlayer.h"
#include "qgssettings.h"
#include "qgshelp.h"
#include "qgsgui.h"
#include "qgsmaplayerstylecategoriesmodel.h"
QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *layer, QWidget *parent )
@ -27,6 +28,8 @@ QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *la
, mLayer( layer )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
QgsSettings settings;
QString providerName = mLayer->providerType();
@ -81,7 +84,6 @@ QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *la
mModel->setCategories( lastStyleCategories );
mStyleCategoriesListView->setModel( mModel );
restoreGeometry( settings.value( QStringLiteral( "Windows/vectorLayerSaveStyle/geometry" ) ).toByteArray() );
mStyleCategoriesListView->adjustSize();
}
@ -98,12 +100,6 @@ void QgsVectorLayerSaveStyleDialog::updateSaveButtonState()
( type != QgsVectorLayerProperties::DB && !mFileWidget->filePath().isEmpty() ) );
}
QgsVectorLayerSaveStyleDialog::~QgsVectorLayerSaveStyleDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/vectorLayerSaveStyle/geometry" ), saveGeometry() );
}
QgsVectorLayerSaveStyleDialog::SaveToDbSettings QgsVectorLayerSaveStyleDialog::saveToDbSettings() const
{
SaveToDbSettings settings;

View File

@ -40,7 +40,6 @@ class QgsVectorLayerSaveStyleDialog : public QDialog, private Ui::QgsVectorLayer
};
explicit QgsVectorLayerSaveStyleDialog( QgsVectorLayer *layer, QWidget *parent = nullptr );
~QgsVectorLayerSaveStyleDialog() override;
SaveToDbSettings saveToDbSettings() const;
QString outputFilePath() const;

View File

@ -23,6 +23,7 @@
#include "qgsogrhelperfunctions.h"
#include "qgsapplication.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <ogr_api.h>
#include <cpl_error.h>
@ -33,13 +34,14 @@ QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString &connTy
, mOriginalConnName( connName )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( btnConnect, &QPushButton::clicked, this, &QgsNewOgrConnection::btnConnect_clicked );
Q_NOWARN_DEPRECATED_PUSH
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewOgrConnection::showHelp );
Q_NOWARN_DEPRECATED_POP
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/OGRDatabaseConnection/geometry" ) ).toByteArray() );
//add database drivers
QStringList dbDrivers = QgsProviderRegistry::instance()->databaseDrivers().split( ';' );
@ -80,12 +82,6 @@ QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString &connTy
mAuthSettingsDatabase->showStoreCheckboxes( true );
}
QgsNewOgrConnection::~QgsNewOgrConnection()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/OGRDatabaseConnection/geometry" ), saveGeometry() );
}
void QgsNewOgrConnection::testConnection()
{
QString uri;

View File

@ -41,7 +41,6 @@ class GUI_EXPORT QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConn
//! Constructor
QgsNewOgrConnection( QWidget *parent = nullptr, const QString &connType = QString(), const QString &connName = QString(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
~QgsNewOgrConnection() override;
//! Tests the connection using the parameters supplied
void testConnection();

View File

@ -20,6 +20,7 @@
#include "qgssymbollayerutils.h"
#include "qgsapplication.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QPushButton>
#include <QMenu>
@ -35,13 +36,12 @@ QgsColorDialog::QgsColorDialog( QWidget *parent, Qt::WindowFlags fl, const QColo
, mPreviousColor( color )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsColorDialog::mButtonBox_accepted );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsColorDialog::mButtonBox_rejected );
connect( mButtonBox, &QDialogButtonBox::clicked, this, &QgsColorDialog::mButtonBox_clicked );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ColorDialog/geometry" ) ).toByteArray() );
if ( mPreviousColor.isValid() )
{
QPushButton *resetButton = new QPushButton( tr( "Reset" ) );
@ -110,13 +110,11 @@ QColor QgsColorDialog::getColor( const QColor &initialColor, QWidget *parent, co
void QgsColorDialog::mButtonBox_accepted()
{
saveSettings();
accept();
}
void QgsColorDialog::mButtonBox_rejected()
{
saveSettings();
reject();
}
@ -133,12 +131,6 @@ void QgsColorDialog::discardColor()
mColorWidget->setDiscarded( true );
}
void QgsColorDialog::saveSettings()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/ColorDialog/geometry" ), saveGeometry() );
}
void QgsColorDialog::setColor( const QColor &color )
{
if ( !color.isValid() )
@ -159,7 +151,6 @@ void QgsColorDialog::setColor( const QColor &color )
void QgsColorDialog::closeEvent( QCloseEvent *e )
{
saveSettings();
QDialog::closeEvent( e );
}

View File

@ -114,11 +114,6 @@ class GUI_EXPORT QgsColorDialog : public QDialog, private Ui::QgsColorDialogBase
bool mAllowOpacity = true;
/**
* Saves all dialog and widget settings
*/
void saveSettings();
};
#endif // #ifndef QGSCOLORDIALOG_H

View File

@ -17,11 +17,14 @@
#include "qgsmessageviewer.h"
#include "qgssettings.h"
#include "qgsgui.h"
QgsMessageViewer::QgsMessageViewer( QWidget *parent, Qt::WindowFlags fl, bool deleteOnClose )
: QDialog( parent, fl )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( checkBox, &QCheckBox::toggled, this, &QgsMessageViewer::checkBox_toggled );
if ( deleteOnClose )
{
@ -31,19 +34,10 @@ QgsMessageViewer::QgsMessageViewer( QWidget *parent, Qt::WindowFlags fl, bool de
setCheckBoxVisible( false );
setCheckBoxState( Qt::Unchecked );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/MessageViewer/geometry" ) ).toByteArray() );
txtMessage->setTextInteractionFlags( Qt::TextBrowserInteraction );
txtMessage->setOpenExternalLinks( true );
}
QgsMessageViewer::~QgsMessageViewer()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/MessageViewer/geometry" ), saveGeometry() );
}
void QgsMessageViewer::setMessageAsHtml( const QString &msg )
{
txtMessage->setHtml( msg );

View File

@ -34,7 +34,6 @@ class GUI_EXPORT QgsMessageViewer: public QDialog, public QgsMessageOutput, priv
Q_OBJECT
public:
QgsMessageViewer( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, bool deleteOnClose = true );
~QgsMessageViewer() override;
void setMessage( const QString &message, MessageType msgType ) override;

View File

@ -24,6 +24,7 @@
#include "qgsvectorlayer.h"
#include "qgssettings.h"
#include "qgsmemoryproviderutils.h"
#include "qgsgui.h"
#include <QPushButton>
#include <QComboBox>
@ -50,9 +51,7 @@ QgsNewMemoryLayerDialog::QgsNewMemoryLayerDialog( QWidget *parent, Qt::WindowFla
: QDialog( parent, fl )
{
setupUi( this );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/NewMemoryLayer/geometry" ) ).toByteArray() );
QgsGui::enableAutoGeometryRestore( this );
mGeometryTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconTableLayer.svg" ) ), tr( "No geometry" ), QgsWkbTypes::NoGeometry );
mGeometryTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconPointLayer.svg" ) ), tr( "Point" ), QgsWkbTypes::Point );
@ -72,12 +71,6 @@ QgsNewMemoryLayerDialog::QgsNewMemoryLayerDialog( QWidget *parent, Qt::WindowFla
geometryTypeChanged( mGeometryTypeBox->currentIndex() );
}
QgsNewMemoryLayerDialog::~QgsNewMemoryLayerDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/NewMemoryLayer/geometry" ), saveGeometry() );
}
QgsWkbTypes::Type QgsNewMemoryLayerDialog::selectedType() const
{
QgsWkbTypes::Type geomType = QgsWkbTypes::Unknown;

View File

@ -47,7 +47,6 @@ class GUI_EXPORT QgsNewMemoryLayerDialog: public QDialog, private Ui::QgsNewMemo
* New dialog constructor.
*/
QgsNewMemoryLayerDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
~QgsNewMemoryLayerDialog() override;
//! Returns the selected geometry type
QgsWkbTypes::Type selectedType() const;

View File

@ -16,6 +16,7 @@
#include "qgssublayersdialog.h"
#include "qgslogger.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QTableWidgetItem>
#include <QPushButton>
@ -47,6 +48,7 @@ QgsSublayersDialog::QgsSublayersDialog( ProviderType providerType, const QString
, mName( name )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
if ( providerType == QgsSublayersDialog::Ogr )
{
@ -75,9 +77,6 @@ QgsSublayersDialog::QgsSublayersDialog( ProviderType providerType, const QString
connect( button, &QAbstractButton::pressed, layersTable, &QTreeView::selectAll );
// connect( pbnSelectNone, SIGNAL( pressed() ), SLOT( layersTable->selectNone() ) );
QgsSettings settings;
restoreGeometry( settings.value( "/Windows/" + mName + "SubLayers/geometry" ).toByteArray() );
// Checkbox about adding sublayers to a group
mCheckboxAddToGroup = new QCheckBox( tr( "Add layers to a group" ), this );
buttonBox->addButton( mCheckboxAddToGroup, QDialogButtonBox::ActionRole );
@ -87,7 +86,6 @@ QgsSublayersDialog::QgsSublayersDialog( ProviderType providerType, const QString
QgsSublayersDialog::~QgsSublayersDialog()
{
QgsSettings settings;
settings.setValue( "/Windows/" + mName + "SubLayers/geometry", saveGeometry() );
settings.setValue( "/Windows/" + mName + "SubLayers/headerState",
layersTable->header()->saveState() );
}

View File

@ -18,6 +18,8 @@
***************************************************************************/
#include "qgssubstitutionlistwidget.h"
#include "qgsgui.h"
#include <QDialogButtonBox>
#include <QCheckBox>
#include <QFileDialog>
@ -28,6 +30,8 @@ QgsSubstitutionListWidget::QgsSubstitutionListWidget( QWidget *parent )
: QgsPanelWidget( parent )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mButtonAdd, &QToolButton::clicked, this, &QgsSubstitutionListWidget::mButtonAdd_clicked );
connect( mButtonRemove, &QToolButton::clicked, this, &QgsSubstitutionListWidget::mButtonRemove_clicked );
connect( mButtonExport, &QToolButton::clicked, this, &QgsSubstitutionListWidget::mButtonExport_clicked );

View File

@ -86,6 +86,7 @@ QgsRendererPropertiesDialog::QgsRendererPropertiesDialog( QgsVectorLayer *layer,
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
mLayerRenderingGroupBox->setSettingGroup( QStringLiteral( "layerRenderingGroupBox" ) );
// can be embedded in vector layer properties

View File

@ -20,6 +20,7 @@
#include "qgsgeometrychecker.h"
#include "qgsfeaturepool.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QCloseEvent>
#include <QVBoxLayout>
@ -30,9 +31,7 @@ QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidge
mIface = iface;
setWindowTitle( tr( "Check Geometries" ) );
QgsSettings s;
restoreGeometry( s.value( QStringLiteral( "/Plugin-GeometryChecker/Window/geometry" ) ).toByteArray() );
QgsGui::enableAutoGeometryRestore( this );
mTabWidget = new QTabWidget();
mButtonBox = new QDialogButtonBox( QDialogButtonBox::Close | QDialogButtonBox::Help, Qt::Horizontal );
@ -52,12 +51,6 @@ QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidge
connect( dynamic_cast< QgsGeometryCheckerSetupTab * >( mTabWidget->widget( 0 ) ), &QgsGeometryCheckerSetupTab::checkerFinished, this, &QgsGeometryCheckerDialog::onCheckerFinished );
}
QgsGeometryCheckerDialog::~QgsGeometryCheckerDialog()
{
QgsSettings s;
s.setValue( QStringLiteral( "/Plugin-GeometryChecker/Window/geometry" ), saveGeometry() );
}
void QgsGeometryCheckerDialog::onCheckerStarted( QgsGeometryChecker *checker )
{
delete mTabWidget->widget( 1 );

View File

@ -34,7 +34,7 @@ class QgsGeometryCheckerDialog : public QDialog
Q_OBJECT
public:
QgsGeometryCheckerDialog( QgisInterface *iface, QWidget *parent = nullptr );
~QgsGeometryCheckerDialog() override;
private:
QgisInterface *mIface = nullptr;

View File

@ -18,17 +18,17 @@
#include "qgssettings.h"
#include "qgsgeorefconfigdialog.h"
#include "qgis.h"
#include "qgsgui.h"
QgsGeorefConfigDialog::QgsGeorefConfigDialog( QWidget *parent )
: QDialog( parent )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsGeorefConfigDialog::buttonBox_accepted );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsGeorefConfigDialog::buttonBox_rejected );
QgsSettings s;
restoreGeometry( s.value( QStringLiteral( "/Plugin-GeoReferencer/ConfigWindow/geometry" ) ).toByteArray() );
mPaperSizeComboBox->addItem( tr( "A5 (148x210 mm)" ), QSizeF( 148, 210 ) );
mPaperSizeComboBox->addItem( tr( "A4 (210x297 mm)" ), QSizeF( 210, 297 ) );
mPaperSizeComboBox->addItem( tr( "A3 (297x420 mm)" ), QSizeF( 297, 420 ) );
@ -58,12 +58,6 @@ QgsGeorefConfigDialog::QgsGeorefConfigDialog( QWidget *parent )
readSettings();
}
QgsGeorefConfigDialog::~QgsGeorefConfigDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "/Plugin-GeoReferencer/ConfigWindow/geometry" ), saveGeometry() );
}
void QgsGeorefConfigDialog::changeEvent( QEvent *e )
{
QDialog::changeEvent( e );

View File

@ -23,7 +23,6 @@ class QgsGeorefConfigDialog : public QDialog, private Ui::QgsGeorefConfigDialogB
Q_OBJECT
public:
explicit QgsGeorefConfigDialog( QWidget *parent = nullptr );
~QgsGeorefConfigDialog() override;
protected:
void changeEvent( QEvent *e ) override;

View File

@ -20,6 +20,7 @@
#include "qgsmapcoordsdialog.h"
#include "qgssettings.h"
#include "qgsmapmouseevent.h"
#include "qgsgui.h"
QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas *qgisCanvas, const QgsPointXY &pixelCoords, QWidget *parent )
: QDialog( parent, Qt::Dialog )
@ -27,10 +28,9 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas *qgisCanvas, const QgsPoint
, mPixelCoords( pixelCoords )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsMapCoordsDialog::buttonBox_accepted );
QgsGui::enableAutoGeometryRestore( this );
QgsSettings s;
restoreGeometry( s.value( QStringLiteral( "/Plugin-GeoReferencer/MapCoordsWindow/geometry" ) ).toByteArray() );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsMapCoordsDialog::buttonBox_accepted );
setAttribute( Qt::WA_DeleteOnClose );
@ -46,7 +46,8 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas *qgisCanvas, const QgsPoint
mToolEmitPoint = new QgsGeorefMapToolEmitPoint( qgisCanvas );
mToolEmitPoint->setButton( mPointFromCanvasPushButton );
mMinimizeWindowCheckBox->setChecked( s.value( QStringLiteral( "/Plugin-GeoReferencer/Config/Minimize" ), QStringLiteral( "1" ) ).toBool() );
QgsSettings settings;
mMinimizeWindowCheckBox->setChecked( settings.value( QStringLiteral( "/Plugin-GeoReferencer/Config/Minimize" ), QStringLiteral( "1" ) ).toBool() );
connect( mPointFromCanvasPushButton, &QAbstractButton::clicked, this, &QgsMapCoordsDialog::setToolEmitPoint );
@ -64,7 +65,6 @@ QgsMapCoordsDialog::~QgsMapCoordsDialog()
delete mToolEmitPoint;
QgsSettings settings;
settings.setValue( QStringLiteral( "/Plugin-GeoReferencer/MapCoordsWindow/geometry" ), saveGeometry() );
settings.setValue( QStringLiteral( "/Plugin-GeoReferencer/Config/Minimize" ), mMinimizeWindowCheckBox->isChecked() );
}

View File

@ -27,6 +27,7 @@
#include "qgsvectorlayer.h"
#include "qgssettings.h"
#include "qgsapplication.h"
#include "qgsgui.h"
#include <QFileDialog>
#include <QMessageBox>
@ -99,6 +100,8 @@ QgsOfflineEditingPluginGui::QgsOfflineEditingPluginGui( QWidget *parent, Qt::Win
: QDialog( parent, fl )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mBrowseButton, &QPushButton::clicked, this, &QgsOfflineEditingPluginGui::mBrowseButton_clicked );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOfflineEditingPluginGui::buttonBox_accepted );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOfflineEditingPluginGui::buttonBox_rejected );
@ -122,7 +125,6 @@ QgsOfflineEditingPluginGui::QgsOfflineEditingPluginGui( QWidget *parent, Qt::Win
QgsOfflineEditingPluginGui::~QgsOfflineEditingPluginGui()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "OfflineEditing/geometry" ), saveGeometry(), QgsSettings::Section::Plugins );
settings.setValue( QStringLiteral( "OfflineEditing/offline_data_path" ), mOfflineDataPath, QgsSettings::Section::Plugins );
}
@ -246,7 +248,6 @@ void QgsOfflineEditingPluginGui::restoreState()
{
QgsSettings settings;
mOfflineDataPath = settings.value( QStringLiteral( "OfflineEditing/offline_data_path" ), QDir::homePath(), QgsSettings::Section::Plugins ).toString();
restoreGeometry( settings.value( QStringLiteral( "OfflineEditing/geometry" ), QgsSettings::Section::Plugins ).toByteArray() );
}
void QgsOfflineEditingPluginGui::selectAll()

View File

@ -23,6 +23,7 @@
#include "qgslogger.h"
#include "qgsdockwidget.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include "layertree/qgslayertreeview.h"
#include <QMainWindow>
@ -35,6 +36,7 @@ QgsTileScaleWidget::QgsTileScaleWidget( QgsMapCanvas *mapCanvas, QWidget *parent
, mMapCanvas( mapCanvas )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( mSlider, &QSlider::valueChanged, this, &QgsTileScaleWidget::mSlider_valueChanged );
connect( mMapCanvas, &QgsMapCanvas::scaleChanged, this, &QgsTileScaleWidget::scaleChanged );

View File

@ -37,6 +37,7 @@
#include "qgswmscapabilities.h"
#include "qgsapplication.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QButtonGroup>
#include <QFileDialog>
@ -58,6 +59,8 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
, mDefaultCRS( GEO_EPSG_CRS_AUTHID )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
connect( btnNew, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnNew_clicked );
connect( btnEdit, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnEdit_clicked );
connect( btnDelete, &QPushButton::clicked, this, &QgsWMSSourceSelect::btnDelete_clicked );
@ -144,17 +147,8 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
// set up the WMS connections we already know about
populateConnectionList();
QgsSettings settings;
QgsDebugMsg( QStringLiteral( "restoring geometry" ) );
restoreGeometry( settings.value( QStringLiteral( "Windows/WMSSourceSelect/geometry" ) ).toByteArray() );
}
QgsWMSSourceSelect::~QgsWMSSourceSelect()
{
QgsSettings settings;
QgsDebugMsg( QStringLiteral( "saving geometry" ) );
settings.setValue( QStringLiteral( "Windows/WMSSourceSelect/geometry" ), saveGeometry() );
}
void QgsWMSSourceSelect::refresh()
{

View File

@ -51,8 +51,6 @@ class QgsWMSSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsWM
//! Constructor
QgsWMSSourceSelect( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
~QgsWMSSourceSelect() override;
public slots:
//! Triggered when the provider's connections need to be refreshed

View File

@ -18,6 +18,7 @@
#include "qgswmsprovider.h"
#include "qgswmtsdimensions.h"
#include "qgssettings.h"
#include "qgsgui.h"
#include <QComboBox>
@ -46,17 +47,7 @@ QgsWmtsDimensions::QgsWmtsDimensions( const QgsWmtsTileLayer &layer, QWidget *pa
cb->setCurrentIndex( idx < 0 ? 0 : idx );
mDimensions->setCellWidget( i, 4, cb );
}
QgsSettings settings;
QgsDebugMsg( QStringLiteral( "restoring geometry" ) );
restoreGeometry( settings.value( QStringLiteral( "Windows/WMTSDimensions/geometry" ) ).toByteArray() );
}
QgsWmtsDimensions::~QgsWmtsDimensions()
{
QgsSettings settings;
QgsDebugMsg( QStringLiteral( "saving geometry" ) );
settings.setValue( QStringLiteral( "Windows/WmtsDimensions/geometry" ), saveGeometry() );
QgsGui::enableAutoGeometryRestore( this );
}
void QgsWmtsDimensions::selectedDimensions( QHash<QString, QString> &selected )

View File

@ -38,8 +38,6 @@ class QgsWmtsDimensions : public QDialog, private Ui::QgsWmtsDimensionsBase
//! Constructor
QgsWmtsDimensions( const QgsWmtsTileLayer &layer, QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr );
~QgsWmtsDimensions() override;
void selectedDimensions( QHash<QString, QString> &dims );
};

View File

@ -15,11 +15,13 @@
#include "qgsxyzconnectiondialog.h"
#include "qgsxyzconnection.h"
#include "qgsgui.h"
QgsXyzConnectionDialog::QgsXyzConnectionDialog( QWidget *parent )
: QDialog( parent )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );
// Behavior for min and max zoom checkbox
connect( mCheckBoxZMin, &QCheckBox::toggled, mSpinZMin, &QSpinBox::setEnabled );