33 changes: 6 additions & 27 deletions src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ QgsOracleSelectGeoraster::QgsOracleSelectGeoraster( QWidget* parent,
{
setupUi( this );

restoreState();

/*
* Load the list of connection from the registry
*/
Expand All @@ -51,6 +49,9 @@ QgsOracleSelectGeoraster::QgsOracleSelectGeoraster( QWidget* parent,

QSettings settings;
QString selected = settings.value( "/Oracle/connections/selected" ).toString();

restoreGeometry( settings.value( "/Oracle/geometry" ).toByteArray() );

cmbConnections->setCurrentIndex( cmbConnections->findText( selected ) );
if ( selected == cmbConnections->currentText() )
{
Expand All @@ -60,6 +61,9 @@ QgsOracleSelectGeoraster::QgsOracleSelectGeoraster( QWidget* parent,

QgsOracleSelectGeoraster::~QgsOracleSelectGeoraster()
{
QSettings settings;
settings.setValue( "/Oracle/geometry", saveGeometry() );
settings.setValue( "/Oracle/connections/selected", cmbConnections->currentText() );
}

void QgsOracleSelectGeoraster::populateConnectionList()
Expand Down Expand Up @@ -328,28 +332,3 @@ void QgsOracleSelectGeoraster::setConnectionListPosition()
cmbConnections->setCurrentIndex( cmbConnections->count() - 1 );
}
}

void QgsOracleSelectGeoraster::on_buttonBox_accepted()
{
saveState();
accept();
}

void QgsOracleSelectGeoraster::on_buttonBox_rejected()
{
saveState();
reject();
}

void QgsOracleSelectGeoraster::saveState()
{
QSettings settings;
settings.setValue( "/Oracle/geometry", saveGeometry() );
settings.setValue( "/Oracle/connections/selected", cmbConnections->currentText() );
}

void QgsOracleSelectGeoraster::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Oracle/geometry" ).toByteArray() );
}
4 changes: 0 additions & 4 deletions src/plugins/oracle_raster/qgsselectgeoraster_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,13 @@ class QgsOracleSelectGeoraster : public QDialog, private Ui::SelectGeoRasterBase
void connectToServer();
void setConnectionListPosition();
void showSelection( const QString & line );
void saveState();
void restoreState();

public slots:
void on_btnConnect_clicked() { connectToServer(); }
void on_btnNew_clicked();
void on_btnEdit_clicked();
void on_btnDelete_clicked();
void on_listWidget_clicked( QModelIndex Index );
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};

Expand Down
11 changes: 3 additions & 8 deletions src/plugins/spatialquery/qgsspatialquerydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ QgsSpatialQueryDialog::QgsSpatialQueryDialog( QWidget* parent, QgisInterface* if

QgsSpatialQueryDialog::~QgsSpatialQueryDialog()
{
QSettings settings;
settings.setValue( "SpatialQuery/geometry", saveGeometry() );

disconnectAll();
delete mRubberSelectId;
mMapIdVectorLayers.clear();
Expand Down Expand Up @@ -378,7 +381,6 @@ void QgsSpatialQueryDialog::disconnectAll()

void QgsSpatialQueryDialog::reject()
{
saveState();
disconnectAll();

mRubberSelectId->reset();
Expand Down Expand Up @@ -729,7 +731,6 @@ void QgsSpatialQueryDialog::showRubberFeature( QgsVectorLayer* lyr, QgsFeatureId

void QgsSpatialQueryDialog::apply()
{
saveState();
if ( ! mLayerReference )
{
QMessageBox::warning( 0, tr( "Missing reference layer" ), tr( "Select reference layer!" ), QMessageBox::Ok );
Expand Down Expand Up @@ -1080,9 +1081,3 @@ void QgsSpatialQueryDialog::MsgDEBUG( QString sMSg )
{
QMessageBox::warning( 0, tr( "DEBUG" ), sMSg, QMessageBox::Ok );
}

void QgsSpatialQueryDialog::saveState()
{
QSettings settings;
settings.setValue( "SpatialQuery/geometry", saveGeometry() );
}
1 change: 0 additions & 1 deletion src/plugins/spatialquery/qgsspatialquerydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
void zoomFeature( QgsVectorLayer *lyr, QgsFeatureId fid );
//! Show rubber from feature
void showRubberFeature( QgsVectorLayer *lyr, QgsFeatureId id );
void saveState();

//! Pointer to Interface QGIS
QgisInterface* mIface;
Expand Down
19 changes: 4 additions & 15 deletions src/plugins/spit/qgsspit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ QgsSpit::QgsSpit( QWidget *parent, Qt::WFlags fl ) : QDialog( parent, fl )

QgsSpit::~QgsSpit()
{
QSettings settings;
settings.setValue( "/Plugin-Spit/geometry", saveGeometry() );
settings.setValue( "/Plugin-Spit/lastDatabase", cmbConnections->currentText() );

if ( conn )
PQfinish( conn );
}
Expand Down Expand Up @@ -499,8 +503,6 @@ void QgsSpit::dbConnect()

void QgsSpit::import()
{
saveState();

QList<QTableWidgetItem*> selected = tblShapefiles->selectedItems();
for ( int i = 0; i < selected.count(); ++i )
selected[i]->setSelected( false );
Expand Down Expand Up @@ -836,26 +838,13 @@ void QgsSpit::import()
}
}

void QgsSpit::saveState()
{
QSettings settings;
settings.setValue( "/Plugin-Spit/geometry", saveGeometry() );
settings.setValue( "/Plugin-Spit/lastDatabase", cmbConnections->currentText() );
}

void QgsSpit::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Plugin-Spit/geometry" ).toByteArray() );
cmbConnections->setCurrentIndex( cmbConnections->findText( settings.value( "/Plugin-Spit/lastDatabase" ).toString() ) );
}

void QgsSpit::on_buttonBox_rejected()
{
saveState();
reject();
}

QWidget *ShapefileTableDelegate::createEditor( QWidget *parent,
const QStyleOptionViewItem &,
const QModelIndex & index ) const
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/spit/qgsspit.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase
void on_btnRemove_clicked() { removeConnection(); }
void on_buttonBox_accepted() { import(); }
void on_buttonBox_helpRequested() { helpInfo(); }
void on_buttonBox_rejected();
void on_buttonBox_rejected() { reject(); }
void on_btnAddFile_clicked() { addFile(); }
void on_btnRemoveAll_clicked() { removeAllFiles(); }
void on_btnRemoveFile_clicked() { removeFile(); }
Expand All @@ -94,7 +94,6 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase

private:

void saveState();
void restoreState();

// Enum of table columns indexes
Expand Down
35 changes: 9 additions & 26 deletions src/plugins/zonal_statistics/qgszonalstatisticsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,26 @@
QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog(), mIface( iface )
{
setupUi( this );
restoreState();

QSettings settings;
restoreGeometry( settings.value( "Plugin-ZonalStatistics/geometry" ).toByteArray() );

insertAvailableLayers();
mColumnPrefixLineEdit->setText( proposeAttributePrefix() );
}

QgsZonalStatisticsDialog::QgsZonalStatisticsDialog(): QDialog( 0 ), mIface( 0 )
{
setupUi( this );
restoreState();

QSettings settings;
restoreGeometry( settings.value( "Plugin-ZonalStatistics/geometry" ).toByteArray() );
}

QgsZonalStatisticsDialog::~QgsZonalStatisticsDialog()
{
QSettings settings;
settings.setValue( "Plugin-ZonalStatistics/geometry", saveGeometry() );
}

void QgsZonalStatisticsDialog::insertAvailableLayers()
Expand Down Expand Up @@ -133,27 +140,3 @@ bool QgsZonalStatisticsDialog::prefixIsValid( const QString& prefix ) const
}
return true;
}

void QgsZonalStatisticsDialog::on_buttonBox_accepted()
{
saveState();
accept();
}

void QgsZonalStatisticsDialog::on_buttonBox_rejected()
{
saveState();
reject();
}

void QgsZonalStatisticsDialog::saveState()
{
QSettings settings;
settings.setValue( "Plugin-ZonalStatistics/geometry", saveGeometry() );
}

void QgsZonalStatisticsDialog::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "Plugin-ZonalStatistics/geometry" ).toByteArray() );
}
7 changes: 0 additions & 7 deletions src/plugins/zonal_statistics/qgszonalstatisticsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class QgsZonalStatisticsDialog: public QDialog, private Ui::QgsZonalStatisticsDi
QgsVectorLayer* polygonLayer() const;
QString attributePrefix() const;

private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();

private:
QgsZonalStatisticsDialog();
/**Fills the available raster and polygon layers into the combo boxes*/
Expand All @@ -48,9 +44,6 @@ private slots:
/**Check if a prefix can be used for the count, sum and mean attribute*/
bool prefixIsValid( const QString& prefix ) const;

void saveState();
void restoreState();

QgisInterface* mIface;
};

Expand Down