102 changes: 39 additions & 63 deletions src/plugins/dxf2shp_converter/dxf2shpconvertergui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<height>250</height>
<width>353</width>
<height>263</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>220</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string>Dxf Importer</string>
</property>
Expand All @@ -30,20 +18,17 @@
<normaloff/>
</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Input and output</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Input Dxf file</string>
</property>
<property name="buddy">
<cstring>name</cstring>
<string>Input DXF file</string>
</property>
</widget>
</item>
Expand All @@ -62,9 +47,6 @@
<property name="text">
<string>Output file</string>
</property>
<property name="buddy">
<cstring>dirout</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
Expand All @@ -77,7 +59,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="convertTextCheck">
<property name="text">
<string>Export text labels</string>
Expand All @@ -87,42 +69,27 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="title">
<string>Output file type</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="polyline">
<property name="text">
<string>Polyline</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<item>
<widget class="QRadioButton" name="polygon">
<property name="text">
<string>Polygon</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item>
<widget class="QRadioButton" name="point">
<property name="text">
<string>Point</string>
Expand All @@ -132,42 +99,51 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<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>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>name</tabstop>
<tabstop>btnBrowseForFile</tabstop>
<tabstop>dirout</tabstop>
<tabstop>btnBrowseOutputDir</tabstop>
<tabstop>convertTextCheck</tabstop>
<tabstop>polyline</tabstop>
<tabstop>polygon</tabstop>
<tabstop>point</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<resources>
<include location="dxf2shpconverter.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>dxf2shpConverterGui</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>dxf2shpConverterGui</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>223</y>
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>349</x>
<y>194</y>
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
Expand Down
17 changes: 17 additions & 0 deletions src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QMessageBox>
#include <QTextStream>
#include <QFileDialog>
#include <QSettings>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#include <QtSql/QSqlRecord>
Expand All @@ -50,6 +51,8 @@ eVisDatabaseConnectionGui::eVisDatabaseConnectionGui( QList<QTemporaryFile*>* th
{
setupUi( this );

restoreState();

mTempOutputFileList = theTemoraryFileList;

//Initialize varaibles
Expand Down Expand Up @@ -123,6 +126,8 @@ 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 @@ -533,3 +538,15 @@ 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() );
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ 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
15 changes: 15 additions & 0 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget* parent, QgisInt
{
setupUi( this );

restoreState();

mCurrentFeatureIndex = 0;
mInterface = interface;
mDataProvider = 0;
Expand Down Expand Up @@ -455,6 +457,8 @@ 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 @@ -1178,4 +1182,15 @@ 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: 3 additions & 0 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ 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
21 changes: 19 additions & 2 deletions src/plugins/interpolation/qgsinterpolationdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ QgsInterpolationDialog::QgsInterpolationDialog( QWidget* parent, QgisInterface*
{
setupUi( this );

QSettings settings;
restoreGeometry( settings.value( "/Interpolation/geometry" ).toByteArray() );

//enter available layers into the combo box
QMap<QString, QgsMapLayer*> mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
QMap<QString, QgsMapLayer*>::iterator layer_it = mapLayers.begin();
Expand All @@ -56,13 +59,13 @@ QgsInterpolationDialog::QgsInterpolationDialog( QWidget* parent, QgisInterface*
//only inverse distance weighting available for now
mInterpolationMethodComboBox->insertItem( 0, tr( "Triangular interpolation (TIN)" ) );
mInterpolationMethodComboBox->insertItem( 1, tr( "Inverse Distance Weighting (IDW)" ) );
mInterpolationMethodComboBox->setCurrentIndex( settings.value( "/Interpolation/lastMethod", 0 ).toInt() );

enableOrDisableOkButton();
}

QgsInterpolationDialog::~QgsInterpolationDialog()
{

}

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

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

if ( !mInterpolatorDialog )
{
return;
Expand Down Expand Up @@ -202,6 +207,12 @@ 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 @@ -294,7 +305,6 @@ void QgsInterpolationDialog::on_mRemovePushButton_clicked()
enableOrDisableOkButton();
}


void QgsInterpolationDialog::on_mOutputFileButton_clicked()
{
//get last output file dir
Expand Down Expand Up @@ -584,3 +594,10 @@ 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() );
}
6 changes: 3 additions & 3 deletions src/plugins/interpolation/qgsinterpolationdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class QgsInterpolationDialog: public QDialog, private Ui::QgsInterpolationDialog
~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 All @@ -55,8 +55,6 @@ class QgsInterpolationDialog: public QDialog, private Ui::QgsInterpolationDialog
void on_mYMinLineEdit_textEdited( const QString& text );
void on_mYMaxLineEdit_textEdited( const QString& text );



private:
QgisInterface* mIface;
/**Dialog to get input for the current interpolation method*/
Expand All @@ -80,6 +78,8 @@ class QgsInterpolationDialog: public QDialog, private Ui::QgsInterpolationDialog
void setNewCellsizeYOnNRowschange();
void setNColsOnCellsizeXChange();
void setNRowsOnCellsizeYChange();

void saveState();
};

#endif
34 changes: 25 additions & 9 deletions src/plugins/offline_editing/offline_editing_plugin_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,16 @@
#include <QMessageBox>
#include <QSettings>

#define SETTINGS_OFFLINE_DATA_PATH "Plugin-OfflineEditing/offline_data_path"

QgsOfflineEditingPluginGui::QgsOfflineEditingPluginGui( QWidget* parent /*= 0*/, Qt::WFlags fl /*= 0*/ )
: QDialog( parent, fl )
{
setupUi( this );

QDir dir;
QSettings settings;
mOfflineDataPath = settings.value( SETTINGS_OFFLINE_DATA_PATH, dir.absolutePath() ).toString();
restoreState();
mOfflineDbFile = "offline.sqlite";
ui_offlineDataPath->setText( QDir( mOfflineDataPath ).absoluteFilePath( mOfflineDbFile ) );

updateLayerList( checkboxShowEditableLayers->checkState() == Qt::Checked );
updateLayerList( checkboxShowEditableLayers->isChecked() );
}

QgsOfflineEditingPluginGui::~QgsOfflineEditingPluginGui()
Expand Down Expand Up @@ -103,6 +99,10 @@ void QgsOfflineEditingPluginGui::on_butBrowse_clicked()

if ( !fileName.isEmpty() )
{
if ( !fileName.toLower().endsWith( ".sqlite" ) )
{
fileName += ".sqlite";
}
mOfflineDbFile = QFileInfo( fileName ).fileName();
mOfflineDataPath = QFileInfo( fileName ).absolutePath();
ui_offlineDataPath->setText( fileName );
Expand All @@ -112,7 +112,7 @@ void QgsOfflineEditingPluginGui::on_butBrowse_clicked()
void QgsOfflineEditingPluginGui::on_checkboxShowEditableLayers_stateChanged( int state )
{
Q_UNUSED( state );
updateLayerList( checkboxShowEditableLayers->checkState() == Qt::Checked );
updateLayerList( checkboxShowEditableLayers->isChecked() );
}

void QgsOfflineEditingPluginGui::on_buttonBox_accepted()
Expand All @@ -138,14 +138,14 @@ void QgsOfflineEditingPluginGui::on_buttonBox_accepted()
mSelectedLayerIds.append(( *it )->data( Qt::UserRole ).toString() );
}

QSettings settings;
settings.setValue( SETTINGS_OFFLINE_DATA_PATH, mOfflineDataPath );
saveState();

accept();
}

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

Expand All @@ -154,3 +154,19 @@ 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;
mOfflineDataPath = settings.value( "Plugin-OfflineEditing/offline_data_path", QDir().absolutePath() ).toString();
restoreGeometry( settings.value( "Plugin-OfflineEditing/geometry" ).toByteArray() );
checkboxShowEditableLayers->setChecked( settings.value( "Plugin-OfflineEditing/onlyEditableLayers", true ).toBool() );
}
2 changes: 2 additions & 0 deletions src/plugins/offline_editing/offline_editing_plugin_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class QgsOfflineEditingPluginGui : public QDialog, private Ui::QgsOfflineEditing

private:
void updateLayerList( bool filterEditableLayers );
void saveState();
void restoreState();

static const int context_id = 0;
QString mOfflineDataPath;
Expand Down
28 changes: 28 additions & 0 deletions src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ QgsOracleSelectGeoraster::QgsOracleSelectGeoraster( QWidget* parent,
{
setupUi( this );

restoreState();

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

QSettings settings;
QString selected = settings.value( "/Oracle/connections/selected" ).toString();
cmbConnections->setCurrentIndex( cmbConnections->findText( selected ) );
if ( selected == cmbConnections->currentText() )
{
connectToServer();
Expand Down Expand Up @@ -325,3 +328,28 @@ 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: 4 additions & 0 deletions src/plugins/oracle_raster/qgsselectgeoraster_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ QgsRasterTerrainAnalysisDialog::QgsRasterTerrainAnalysisDialog( DisplayMode mode
{
setupUi( this );

QSettings s;
restoreGeometry( s.value( "/RasterTerrainAnalysis/geometry" ).toByteArray() );

if ( mode == HillshadeInput )
{
mReliefColorsGroupBox->setVisible( false );
Expand All @@ -31,8 +34,9 @@ QgsRasterTerrainAnalysisDialog::QgsRasterTerrainAnalysisDialog( DisplayMode mode
mReliefColorsGroupBox->setVisible( false );
mIlluminationGroupBox->setVisible( false );
}
adjustSize();

mZFactorLineEdit->setText( "1.0" );
mZFactorLineEdit->setText( s.value( "/RasterTerrainAnalysis/zfactor", "1.0" ).toString() );
mZFactorLineEdit->setValidator( new QDoubleValidator( this ) );

//insert available raster layers
Expand Down Expand Up @@ -93,7 +97,6 @@ QgsRasterTerrainAnalysisDialog::QgsRasterTerrainAnalysisDialog( DisplayMode mode
}

//and set last used driver in combo box
QSettings s;
QString lastUsedDriver = s.value( "/RasterTerrainAnalysis/lastOutputFormat", "GeoTIFF" ).toString();
int lastDriverIndex = mOutputFormatComboBox->findText( lastUsedDriver );
if ( lastDriverIndex != -1 )
Expand Down Expand Up @@ -409,10 +412,16 @@ void QgsRasterTerrainAnalysisDialog::on_mReliefClassTreeWidget_itemDoubleClicked

void QgsRasterTerrainAnalysisDialog::on_mButtonBox_accepted()
{
//save last output format
// save last output format
QSettings s;
s.setValue( "/RasterTerrainAnalysis/lastOutputFormat", QVariant( mOutputFormatComboBox->currentText() ) );

//save last output directory
// save last output directory
s.setValue( "/RasterTerrainAnalysis/lastOutputDir", QFileInfo( mOutputLayerLineEdit->text() ).absolutePath() );

// save z-factor
s.setValue( "/RasterTerrainAnalysis/zfactor", mZFactorLineEdit->text() );

// save geometry and position
s.setValue( "/RasterTerrainAnalysis/geometry", saveGeometry() );
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>492</width>
<height>473</height>
<width>698</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -208,7 +208,7 @@
</layout>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="7" column="0" colspan="3">
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand Down
36 changes: 12 additions & 24 deletions src/plugins/spatialquery/qgsspatialquerydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ QgsSpatialQueryDialog::QgsSpatialQueryDialog( QWidget* parent, QgisInterface* if
{
setupUi( this );

QSettings settings;
restoreGeometry( settings.value( "SpatialQuery/geometry" ).toByteArray() );

mLayerReference = mLayerTarget = NULL;
mIface = iface;
mRubberSelectId = new QgsRubberSelectId( iface->mapCanvas() );

initGui();
connectAll();

} // QgsSpatialQueryDialog::QgsSpatialQueryDialog( QWidget* parent, QgisInterface* iface )

QgsSpatialQueryDialog::~QgsSpatialQueryDialog()
Expand All @@ -53,7 +55,6 @@ QgsSpatialQueryDialog::~QgsSpatialQueryDialog()
mFeatureResult.clear();
mFeatureInvalidTarget.clear();
mFeatureInvalidReference.clear();

} // QgsSpatialQueryDialog::~QgsSpatialQueryDialog()

bool QgsSpatialQueryDialog::hasPossibleQuery( QString &msg )
Expand Down Expand Up @@ -89,7 +90,6 @@ bool QgsSpatialQueryDialog::hasPossibleQuery( QString &msg )
{
return true;
}

} // bool QgsSpatialQueryDialog::hasPossibleQuery( QString &msg )

void QgsSpatialQueryDialog::initGui()
Expand Down Expand Up @@ -140,7 +140,6 @@ void QgsSpatialQueryDialog::setLayer( bool isTarget, int index )
connect( mLayerReference, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerReference_selectionFeaturesChanged() ) );
}

} // void QgsSpatialQueryDialog::setLayer(bool isTarget, int index)

void QgsSpatialQueryDialog::evaluateCheckBoxLayer( bool isTarget )
Expand All @@ -165,7 +164,6 @@ void QgsSpatialQueryDialog::evaluateCheckBoxLayer( bool isTarget )
? tr( "%n selected geometries", "selected geometries", selectedCount )
: tr( "Selected geometries" );
checkbox->setText( textCheckBox );

} // void QgsSpatialQueryDialog::evaluateCheckBoxLayer(bool isTarget)

void QgsSpatialQueryDialog::runQuery()
Expand Down Expand Up @@ -321,12 +319,10 @@ QString QgsSpatialQueryDialog::getDescriptionLayerShow( bool isTarget )
: tr( "all = %1" ).arg( lyr->featureCount() );

return QString( "%1 (%2)" ).arg( lyr->name() ).arg( sDescFeatures );

} // QString QgsSpatialQueryDialog::getDescriptionLayerShow(bool isTarget)

QString QgsSpatialQueryDialog::getDescriptionInvalidFeaturesShow( bool isTarget )
{

QgsVectorLayer* lyr = NULL;
QCheckBox* checkBox = NULL;
int totalInvalid = 0;
Expand All @@ -343,13 +339,11 @@ QString QgsSpatialQueryDialog::getDescriptionInvalidFeaturesShow( bool isTarget
totalInvalid = mFeatureInvalidReference.size();
}


QString sDescFeatures = checkBox->isChecked()
? tr( "%1 of %2(selected features)" ).arg( totalInvalid ).arg( lyr->selectedFeatureCount() )
: tr( "%1 of %2" ).arg( totalInvalid ).arg( lyr->featureCount() );

return QString( "%1: %2" ).arg( lyr->name() ).arg( sDescFeatures );

} // QString QgsSpatialQueryDialog::getDescriptionInvalidFeatures(bool isTarget)

void QgsSpatialQueryDialog::connectAll()
Expand All @@ -360,7 +354,6 @@ void QgsSpatialQueryDialog::connectAll()
this, SLOT( signal_qgis_layerWillBeRemoved( QString ) ) );
connect( ckbLogProcessing, SIGNAL( clicked( bool ) ),
this, SLOT( on_ckbLogProcessing_clicked( bool ) ) );

} // QgsSpatialQueryDialog::connectAll()

void QgsSpatialQueryDialog::disconnectAll()
Expand All @@ -381,11 +374,11 @@ void QgsSpatialQueryDialog::disconnectAll()
disconnect( mLayerReference, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerReference_selectionFeaturesChanged() ) );
}

} // QgsSpatialQueryDialog::disconnectAll()

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

mRubberSelectId->reset();
Expand All @@ -396,7 +389,6 @@ void QgsSpatialQueryDialog::reject()
mMapIdVectorLayers.clear();

QDialog::reject();

} // QgsSpatialQueryDialog::reject()

QgsVectorLayer * QgsSpatialQueryDialog::getLayerFromCombobox( bool isTarget, int index )
Expand All @@ -406,7 +398,6 @@ QgsVectorLayer * QgsSpatialQueryDialog::getLayerFromCombobox( bool isTarget, int
: cbReferenceLayer->itemData( index );
QgsVectorLayer* lyr = static_cast<QgsVectorLayer*>( data.value<void *>() );
return lyr;

} // QgsVectorLayer * QgsSpatialQueryDialog::getLayerFromCombobox(bool isTarget, int index)

QIcon QgsSpatialQueryDialog::getIconTypeGeometry( QGis::GeometryType geomType )
Expand Down Expand Up @@ -441,7 +432,6 @@ QIcon QgsSpatialQueryDialog::getIconTypeGeometry( QGis::GeometryType geomType )
{
return QIcon();
}

} // QIcon QgsSpatialQueryDialog::getIconTypeGeometry(int typeGeometry)

void QgsSpatialQueryDialog::addCbLayer( bool isTarget, QgsVectorLayer* lyr )
Expand All @@ -452,16 +442,14 @@ void QgsSpatialQueryDialog::addCbLayer( bool isTarget, QgsVectorLayer* lyr )
QIcon icon = getIconTypeGeometry( lyr->geometryType() );
cmb->addItem( icon, lyr->name(), item );
cmb->setItemData( idNew, QVariant( lyr->source() ), Qt::ToolTipRole );

} // void QgsSpatialQueryDialog::removeLayerCombobox(bool isTarget, QgsVectorLayer* lyr)

int QgsSpatialQueryDialog::getCbIndexLayer( bool isTarget, QgsVectorLayer* lyr )
{
QVariant item = QVariant::fromValue(( void * )lyr );
QComboBox * cmb = isTarget ? cbTargetLayer : cbReferenceLayer;
return cmb->findData( item );

} //
}

void QgsSpatialQueryDialog::removeLayer( bool isTarget, QgsVectorLayer* lyr )
{
Expand Down Expand Up @@ -501,7 +489,6 @@ void QgsSpatialQueryDialog::removeLayer( bool isTarget, QgsVectorLayer* lyr )
}
}
cmb->blockSignals( false );

} // void QgsSpatialQueryDialog::removeLayer(bool isTarget, QgsVectorLayer* lyr)

void QgsSpatialQueryDialog::populateCbResulFor()
Expand Down Expand Up @@ -566,7 +553,6 @@ void QgsSpatialQueryDialog::populateCbTargetLayer()
}
cbTargetLayer->setCurrentIndex( 0 );
cbTargetLayer->blockSignals( false );

} // void QgsSpatialQueryDialog::populateCbTargetLayer()

void QgsSpatialQueryDialog::populateCbReferenceLayer()
Expand Down Expand Up @@ -601,7 +587,6 @@ void QgsSpatialQueryDialog::populateCbReferenceLayer()
}
cbReferenceLayer->setCurrentIndex( idCurrent );
cbReferenceLayer->blockSignals( false );

} // QgsSpatialQueryDialog::populateCbReferenceLayer()

void QgsSpatialQueryDialog::populateCbOperation()
Expand Down Expand Up @@ -641,7 +626,6 @@ void QgsSpatialQueryDialog::populateCbOperation()
}
cbOperation->setCurrentIndex( idCurrent );
cbOperation->blockSignals( false );

} // QgsSpatialQueryDialog::populatecbOperation()

void QgsSpatialQueryDialog::setSelectedGui()
Expand Down Expand Up @@ -745,6 +729,7 @@ 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 @@ -1031,7 +1016,6 @@ void QgsSpatialQueryDialog::signal_qgis_layerWasAdded( QgsMapLayer* mapLayer )
}
addCbLayer( false, lyr );
mMapIdVectorLayers.insert( lyr->id(), lyr );

} // QgsSpatialQueryDialog::signal_qgis_layerWasAdded(QgsMapLayer* mapLayer)

void QgsSpatialQueryDialog::signal_qgis_layerWillBeRemoved( QString idLayer )
Expand Down Expand Up @@ -1077,7 +1061,6 @@ void QgsSpatialQueryDialog::signal_qgis_layerWillBeRemoved( QString idLayer )
{
populateCbOperation();
}

} // QgsSpatialQueryDialog::signal_qgis_layerWillBeRemoved(QString idLayer)

//! Slots for signals of Layers (Target or Reference)
Expand All @@ -1091,10 +1074,15 @@ void QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged()
void QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged()
{
evaluateCheckBoxLayer( false );

} // void QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged()

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: 1 addition & 0 deletions src/plugins/spatialquery/qgsspatialquerydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ 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
25 changes: 25 additions & 0 deletions src/plugins/spit/qgsspit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ QgsSpit::QgsSpit( QWidget *parent, Qt::WFlags fl ) : QDialog( parent, fl )
tblShapefiles->horizontalHeader()->setStretchLastSection( true );

populateConnectionList();

restoreState();

defSrid = -1;
defGeom = "the_geom";
total_features = 0;
Expand Down Expand Up @@ -496,6 +499,8 @@ 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 @@ -831,6 +836,26 @@ 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
5 changes: 4 additions & 1 deletion 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() { reject(); }
void on_buttonBox_rejected();
void on_btnAddFile_clicked() { addFile(); }
void on_btnRemoveAll_clicked() { removeAllFiles(); }
void on_btnRemoveFile_clicked() { removeFile(); }
Expand All @@ -94,6 +94,9 @@ class QgsSpit : public QDialog, private Ui::QgsSpitBase

private:

void saveState();
void restoreState();

// Enum of table columns indexes
enum ShpTableColumns
{
Expand Down
29 changes: 28 additions & 1 deletion src/plugins/zonal_statistics/qgszonalstatisticsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,24 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"

#include <QSettings>

QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog(), mIface( iface )
{
setupUi( this );
restoreState();
insertAvailableLayers();
mColumnPrefixLineEdit->setText( proposeAttributePrefix() );
}

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

QgsZonalStatisticsDialog::~QgsZonalStatisticsDialog()
{

}

void QgsZonalStatisticsDialog::insertAvailableLayers()
Expand Down Expand Up @@ -130,3 +133,27 @@ 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: 7 additions & 0 deletions src/plugins/zonal_statistics/qgszonalstatisticsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ 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 @@ -44,6 +48,9 @@ class QgsZonalStatisticsDialog: public QDialog, private Ui::QgsZonalStatisticsDi
/**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