[auth] Certs manager remembers (in the settings) the last opened tab

This is a minor UX/UI change that remembers the latest opened
tab in the certificates manager window
This commit is contained in:
Alessandro Pasotti 2017-09-25 11:51:04 +02:00
parent 5f11793b17
commit d6743903e7
3 changed files with 19 additions and 0 deletions

View File

@ -27,6 +27,11 @@ class QgsAuthCertEditors : QWidget
\param parent Parent widget
%End
~QgsAuthCertEditors( );
%Docstring
Destructor: store last selected tab
%End
};

View File

@ -15,6 +15,7 @@
***************************************************************************/
#include "qgsauthcertificatemanager.h"
#include "qgssettings.h"
#include <QDialog>
#include <QDialogButtonBox>
@ -24,6 +25,14 @@ QgsAuthCertEditors::QgsAuthCertEditors( QWidget *parent )
: QWidget( parent )
{
setupUi( this );
QgsSettings settings;
tabWidget->setCurrentIndex( settings.value( QStringLiteral( "AuthCertEditorsSelectedTab" ), 0, QgsSettings::Section::Auth ).toInt() );
}
QgsAuthCertEditors::~QgsAuthCertEditors()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "AuthCertEditorsSelectedTab" ), tabWidget->currentIndex(), QgsSettings::Section::Auth );
}

View File

@ -40,6 +40,11 @@ class GUI_EXPORT QgsAuthCertEditors : public QWidget, private Ui::QgsAuthCertMan
*/
explicit QgsAuthCertEditors( QWidget *parent SIP_TRANSFERTHIS = 0 );
/**
* Destructor: store last selected tab
*/
~QgsAuthCertEditors( );
};