Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
follow up 2e7867a
  • Loading branch information
alexbruy committed Jan 18, 2012
1 parent 7747d1f commit fbe2d99
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 187 deletions.
11 changes: 2 additions & 9 deletions src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -91,6 +91,8 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui( QgisInterface * _qI, QWidg

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

void QgsDelimitedTextPluginGui::on_btnBrowseForFile_clicked()
Expand Down Expand Up @@ -144,8 +146,6 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
emit drawVectorLayer( QString::fromAscii( url.toEncoded() ), txtLayerName->text(), "delimitedtext" );

// store the settings
saveState();

QSettings settings;
QString key = "/Plugin-DelimitedText";
settings.setValue( key + "/geometry", saveGeometry() );
Expand All @@ -172,7 +172,6 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()

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

Expand Down Expand Up @@ -504,9 +503,3 @@ QString QgsDelimitedTextPluginGui::readLine( QTextStream &stream )
}
return buffer;
}

void QgsDelimitedTextPluginGui::saveState()
{
QSettings settings;
settings.setValue( "/Plugin-DelimitedText/geometry", saveGeometry() );
}
1 change: 0 additions & 1 deletion src/plugins/delimited_text/qgsdelimitedtextplugingui.h
Expand Up @@ -38,7 +38,6 @@ class QgsDelimitedTextPluginGui : public QDialog, private Ui::QgsDelimitedTextPl
void updateFieldLists();
void getOpenFileName();
QString selectedChars();
void saveState();

QgisInterface * qI;
QAbstractButton *pbnOK;
Expand Down
11 changes: 2 additions & 9 deletions src/plugins/dxf2shp_converter/dxf2shpconvertergui.cpp
Expand Up @@ -37,12 +37,12 @@ dxf2shpConverterGui::dxf2shpConverterGui( QWidget *parent, Qt::WFlags fl ):

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

void dxf2shpConverterGui::on_buttonBox_accepted()
{
saveState();

QString inf = name->text();
QString outd = dirout->text();

Expand Down Expand Up @@ -120,7 +120,6 @@ void dxf2shpConverterGui::on_buttonBox_accepted()

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

Expand Down Expand Up @@ -185,12 +184,6 @@ void dxf2shpConverterGui::getOutputDir()
}
}

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

void dxf2shpConverterGui::restoreState()
{
QSettings settings;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/dxf2shp_converter/dxf2shpconvertergui.h
Expand Up @@ -34,7 +34,6 @@ class dxf2shpConverterGui: public QDialog, private Ui::dxf2shpConverterGui
void getOutputFileName();
void getOutputDir();

void saveState();
void restoreState();

private slots:
Expand Down
20 changes: 4 additions & 16 deletions src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp
Expand Up @@ -51,7 +51,8 @@ eVisDatabaseConnectionGui::eVisDatabaseConnectionGui( QList<QTemporaryFile*>* th
{
setupUi( this );

restoreState();
QSettings settings;
restoreGeometry( settings.value( "/eVis/db-geometry" ).toByteArray() );

mTempOutputFileList = theTemoraryFileList;

Expand Down Expand Up @@ -88,9 +89,10 @@ eVisDatabaseConnectionGui::eVisDatabaseConnectionGui( QList<QTemporaryFile*>* th
*/
eVisDatabaseConnectionGui::~eVisDatabaseConnectionGui( )
{
QSettings settings;
settings.setValue( "/eVis/db-geometry", saveGeometry() );
}


/*
*
* Public and Private Slots
Expand Down Expand Up @@ -126,8 +128,6 @@ void eVisDatabaseConnectionGui::drawNewVectorLayer( QString layerName, QString x
*/
void eVisDatabaseConnectionGui::on_buttonBox_accepted( )
{
saveState();

//Deallocate memory, basically a predescructor
if ( 0 != mDatabaseConnection )
{
Expand Down Expand Up @@ -538,15 +538,3 @@ void eVisDatabaseConnectionGui::on_pbtnRunQuery_clicked( )
}
}
}

void eVisDatabaseConnectionGui::saveState()
{
QSettings settings;
settings.setValue( "/eVis/db-geometry", saveGeometry() );
}

void eVisDatabaseConnectionGui::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/eVis/db-geometry" ).toByteArray() );
}
Expand Up @@ -68,9 +68,6 @@ class eVisDatabaseConnectionGui : public QDialog, private Ui::eVisDatabaseConnec
/** \brief Pointer to a QMap which will hold the definition of preexisting query that can be loaded from an xml file */
QMap<int, eVisQueryDefinition>* mQueryDefinitionMap;

void saveState();
void restoreState();

private slots:
/** \brief Slot called after the user selects the x, y fields in the field selection gui component */
void drawNewVectorLayer( QString, QString, QString );
Expand Down
21 changes: 5 additions & 16 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Expand Up @@ -55,7 +55,8 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget* parent, QgisInt
{
setupUi( this );

restoreState();
QSettings settings;
restoreGeometry( settings.value( "/eVis/browser-geometry" ).toByteArray() );

mCurrentFeatureIndex = 0;
mInterface = interface;
Expand Down Expand Up @@ -112,6 +113,9 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget* parent, QgsMapC
*/
eVisGenericEventBrowserGui::~eVisGenericEventBrowserGui( )
{
QSettings settings;
settings.setValue( "/eVis/browser-geometry", saveGeometry() );

//Clean up, disconnect the highlighting routine and refesh the canvase to clear highlighting symbol
if ( 0 != mCanvas )
{
Expand Down Expand Up @@ -457,8 +461,6 @@ void eVisGenericEventBrowserGui::accept( )
myQSettings.setValue( "/eVis/applypathrulestodocs", chkboxApplyPathRulesToDocs->isChecked( ) );
}

saveState();

myQSettings.remove( "/eVis/filetypeassociations" );
myQSettings.beginWriteArray( "/eVis/filetypeassociations" );
int myIterator = 0;
Expand Down Expand Up @@ -1181,16 +1183,3 @@ void eVisGenericEventBrowserGui::renderSymbol( QPainter* thePainter )
}
}
}

void eVisGenericEventBrowserGui::saveState()
{
QSettings settings;
settings.setValue( "/eVis/browser-geometry", saveGeometry() );
}

void eVisGenericEventBrowserGui::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/eVis/browser-geometry" ).toByteArray() );
}

3 changes: 0 additions & 3 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h
Expand Up @@ -152,9 +152,6 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB
/** \brief Sets the base path to the path of the data source */
void setBasePathToDataSource( );

void saveState();
void restoreState();

private slots:
void launchExternalApplication( QTreeWidgetItem *, int );
void on_buttonboxOptions_clicked( QAbstractButton* );
Expand Down
13 changes: 3 additions & 10 deletions src/plugins/gps_importer/qgsgpsplugingui.cpp
Expand Up @@ -80,12 +80,13 @@ QgsGPSPluginGui::QgsGPSPluginGui( const BabelMap& importers,

QgsGPSPluginGui::~QgsGPSPluginGui()
{
QSettings settings;
settings.setValue( "/Plugin-GPS/geometry", saveGeometry() );
settings.setValue( "/Plugin-GPS/lastTab", tabWidget->currentIndex() );
}

void QgsGPSPluginGui::on_buttonBox_accepted()
{
saveState();

// what should we do?
switch ( tabWidget->currentIndex() )
{
Expand Down Expand Up @@ -243,7 +244,6 @@ void QgsGPSPluginGui::enableRelevantControls()

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

Expand Down Expand Up @@ -444,13 +444,6 @@ void QgsGPSPluginGui::devicesUpdated()
populateIMPBabelFormats();
}

void QgsGPSPluginGui::saveState()
{
QSettings settings;
settings.setValue( "/Plugin-GPS/geometry", saveGeometry() );
settings.setValue( "/Plugin-GPS/lastTab", tabWidget->currentIndex() );
}

void QgsGPSPluginGui::restoreState()
{
QSettings settings;
Expand Down
18 changes: 3 additions & 15 deletions src/plugins/interpolation/qgsinterpolationdialog.cpp
Expand Up @@ -66,6 +66,9 @@ QgsInterpolationDialog::QgsInterpolationDialog( QWidget* parent, QgisInterface*

QgsInterpolationDialog::~QgsInterpolationDialog()
{
QSettings settings;
settings.setValue( "/Interpolation/geometry", saveGeometry() );
settings.setValue( "/Interpolation/lastMethod", mInterpolationMethodComboBox->currentIndex() );
}

void QgsInterpolationDialog::enableOrDisableOkButton()
Expand All @@ -92,8 +95,6 @@ void QgsInterpolationDialog::enableOrDisableOkButton()

void QgsInterpolationDialog::on_buttonBox_accepted()
{
saveState();

if ( !mInterpolatorDialog )
{
return;
Expand Down Expand Up @@ -207,12 +208,6 @@ void QgsInterpolationDialog::on_buttonBox_accepted()
delete theInterpolator;
}

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

void QgsInterpolationDialog::on_mInputLayerComboBox_currentIndexChanged( const QString& text )
{
Q_UNUSED( text );
Expand Down Expand Up @@ -594,10 +589,3 @@ QgsRectangle QgsInterpolationDialog::currentBoundingBox()

return QgsRectangle( xMin, yMin, xMax, yMax );
}

void QgsInterpolationDialog::saveState()
{
QSettings settings;
settings.setValue( "/Interpolation/geometry", saveGeometry() );
settings.setValue( "/Interpolation/lastMethod", mInterpolationMethodComboBox->currentIndex() );
}
3 changes: 0 additions & 3 deletions src/plugins/interpolation/qgsinterpolationdialog.h
Expand Up @@ -35,7 +35,6 @@ class QgsInterpolationDialog: public QDialog, private Ui::QgsInterpolationDialog

private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_mInputLayerComboBox_currentIndexChanged( const QString& text );
void on_mOutputFileButton_clicked();
void on_mOutputFileLineEdit_textChanged();
Expand Down Expand Up @@ -78,8 +77,6 @@ class QgsInterpolationDialog: public QDialog, private Ui::QgsInterpolationDialog
void setNewCellsizeYOnNRowschange();
void setNColsOnCellsizeXChange();
void setNRowsOnCellsizeYChange();

void saveState();
};

#endif
16 changes: 5 additions & 11 deletions src/plugins/offline_editing/offline_editing_plugin_gui.cpp
Expand Up @@ -34,6 +34,7 @@ QgsOfflineEditingPluginGui::QgsOfflineEditingPluginGui( QWidget* parent /*= 0*/,
setupUi( this );

restoreState();

mOfflineDbFile = "offline.sqlite";
ui_offlineDataPath->setText( QDir( mOfflineDataPath ).absoluteFilePath( mOfflineDbFile ) );

Expand All @@ -42,6 +43,10 @@ QgsOfflineEditingPluginGui::QgsOfflineEditingPluginGui( QWidget* parent /*= 0*/,

QgsOfflineEditingPluginGui::~QgsOfflineEditingPluginGui()
{
QSettings settings;
settings.setValue( "Plugin-OfflineEditing/geometry", saveGeometry() );
settings.setValue( "Plugin-OfflineEditing/offline_data_path", mOfflineDataPath );
settings.setValue( "Plugin-OfflineEditing/onlyEditableLayers", checkboxShowEditableLayers->isChecked() );
}

QString QgsOfflineEditingPluginGui::offlineDataPath()
Expand Down Expand Up @@ -138,14 +143,11 @@ void QgsOfflineEditingPluginGui::on_buttonBox_accepted()
mSelectedLayerIds.append(( *it )->data( Qt::UserRole ).toString() );
}

saveState();

accept();
}

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

Expand All @@ -155,14 +157,6 @@ void QgsOfflineEditingPluginGui::on_buttonBox_helpRequested()
QgsContextHelp::run( context_id );
}

void QgsOfflineEditingPluginGui::saveState()
{
QSettings settings;
settings.setValue( "Plugin-OfflineEditing/geometry", saveGeometry() );
settings.setValue( "Plugin-OfflineEditing/offline_data_path", mOfflineDataPath );
settings.setValue( "Plugin-OfflineEditing/onlyEditableLayers", checkboxShowEditableLayers->isChecked() );
}

void QgsOfflineEditingPluginGui::restoreState()
{
QSettings settings;
Expand Down

0 comments on commit fbe2d99

Please sign in to comment.