Skip to content

Commit

Permalink
save geometry for style DB dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Oct 5, 2014
1 parent 4ce2ade commit 0587872
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsloadstylefromdbdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "qgsloadstylefromdbdialog.h"
#include "qgslogger.h"

#include <QSettings>
#include <QMessageBox>
#include <QVector>

Expand Down Expand Up @@ -44,6 +45,15 @@ QgsLoadStyleFromDBDialog::QgsLoadStyleFromDBDialog( QWidget *parent )
setTabOrder( mOthersTable, mCancelButton );
setTabOrder( mCancelButton, mLoadButton );

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

}

QgsLoadStyleFromDBDialog::~QgsLoadStyleFromDBDialog()
{
QSettings settings;
settings.setValue( "/Windows/loadStyleFromDb/geometry", saveGeometry() );
}

void QgsLoadStyleFromDBDialog::initializeLists( QStringList ids, QStringList names, QStringList descriptions, int sectionLimit )
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsloadstylefromdbdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class APP_EXPORT QgsLoadStyleFromDBDialog : public QDialog, private Ui::QgsLoadS
public:
explicit QgsLoadStyleFromDBDialog( QWidget *parent = 0 );

~QgsLoadStyleFromDBDialog();

void initializeLists( QStringList ids, QStringList names, QStringList descriptions, int sectionLimit );
QString getSelectedStyleId();

Expand Down
21 changes: 14 additions & 7 deletions src/app/qgssavestyletodbdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <QMessageBox>
#include <QDateTime>

QgsSaveStyleToDbDialog::QgsSaveStyleToDbDialog( QWidget *parent ) :
QDialog( parent )
QgsSaveStyleToDbDialog::QgsSaveStyleToDbDialog( QWidget *parent )
: QDialog( parent )
{
setupUi( this );
setWindowTitle( "Save style in database" );
Expand All @@ -25,19 +25,31 @@ QgsSaveStyleToDbDialog::QgsSaveStyleToDbDialog( QWidget *parent ) :
setTabOrder( mDescriptionEdit, mUseAsDefault );
setTabOrder( mUseAsDefault, buttonBox );

QSettings settings;
restoreGeometry( settings.value( "/Windows/saveStyleToDb/geometry" ).toByteArray() );
}

QgsSaveStyleToDbDialog::~QgsSaveStyleToDbDialog()
{
QSettings settings;
settings.setValue( "/Windows/saveStyleToDb/geometry", saveGeometry() );
}

QString QgsSaveStyleToDbDialog::getName()
{
return mNameEdit->text();
}

QString QgsSaveStyleToDbDialog::getDescription()
{
return mDescriptionEdit->toPlainText();
}

bool QgsSaveStyleToDbDialog::isDefault()
{
return mUseAsDefault->isChecked();
}

QString QgsSaveStyleToDbDialog::getUIFileContent()
{
return mUIFileContent;
Expand All @@ -63,10 +75,7 @@ void QgsSaveStyleToDbDialog::on_mFilePickButton_clicked()
{
return;
}


QFileInfo myFI( myFileName );

QFile uiFile( myFI.filePath() );

QString myPath = myFI.path();
Expand All @@ -86,6 +95,4 @@ void QgsSaveStyleToDbDialog::on_mFilePickButton_clicked()
mUIFileContent = content;
mFileNameLabel->setText( myFI.fileName() );
}

}

2 changes: 2 additions & 0 deletions src/app/qgssavestyletodbdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class APP_EXPORT QgsSaveStyleToDbDialog : public QDialog, private Ui::QgsSaveToD
public:
explicit QgsSaveStyleToDbDialog( QWidget *parent = 0 );

~QgsSaveStyleToDbDialog();

signals:

public slots:
Expand Down

0 comments on commit 0587872

Please sign in to comment.