Skip to content
Permalink
Browse files

save geometry for style DB dialogs

  • Loading branch information
slarosa committed Oct 5, 2014
1 parent 4ce2ade commit 05878722783621b735b2d138ee49c76d50da70c7
@@ -10,6 +10,7 @@
#include "qgsloadstylefromdbdialog.h"
#include "qgslogger.h"

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

@@ -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 )
@@ -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();

@@ -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" );
@@ -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;
@@ -63,10 +75,7 @@ void QgsSaveStyleToDbDialog::on_mFilePickButton_clicked()
{
return;
}


QFileInfo myFI( myFileName );

QFile uiFile( myFI.filePath() );

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

}

@@ -21,6 +21,8 @@ class APP_EXPORT QgsSaveStyleToDbDialog : public QDialog, private Ui::QgsSaveToD
public:
explicit QgsSaveStyleToDbDialog( QWidget *parent = 0 );

~QgsSaveStyleToDbDialog();

signals:

public slots:

0 comments on commit 0587872

Please sign in to comment.
You can’t perform that action at this time.