QGIS API Documentation  3.6.0-Noosa (5873452)
qgsauthcertificatemanager.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthcertificatemanager.cpp
3  ---------------------
4  begin : September, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
18 #include "qgssettings.h"
19 
20 #include <QDialog>
21 #include <QDialogButtonBox>
22 #include <QPushButton>
23 
25  : QWidget( parent )
26 {
27  setupUi( this );
28  QgsSettings settings;
29  tabWidget->setCurrentIndex( settings.value( QStringLiteral( "AuthCertEditorsSelectedTab" ), 0, QgsSettings::Section::Auth ).toInt() );
30 }
31 
33 {
34  QgsSettings settings;
35  settings.setValue( QStringLiteral( "AuthCertEditorsSelectedTab" ), tabWidget->currentIndex(), QgsSettings::Section::Auth );
36 }
37 
38 
40  : QDialog( parent )
41 {
42  setWindowTitle( tr( "Certificate Manager" ) );
43  QVBoxLayout *layout = new QVBoxLayout( this );
44  layout->setMargin( 6 );
45 
46  mCertEditors = new QgsAuthCertEditors( this );
47  layout->addWidget( mCertEditors );
48 
49  QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Close,
50  Qt::Horizontal, this );
51  buttonBox->button( QDialogButtonBox::Close )->setDefault( true );
52  connect( buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close );
53  layout->addWidget( buttonBox );
54 
55  setLayout( layout );
56 }
This class is a composition of two QSettings instances:
Definition: qgssettings.h:58
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
QgsAuthCertEditors(QWidget *parent=nullptr)
Construct a widget to contain various certificate editors.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
~QgsAuthCertEditors() override
Destructor: store last selected tab.
Wrapper widget to manage available certificate editors.
QgsAuthCertManager(QWidget *parent=nullptr)
Construct a dialog wrapper for widget to manage available certificate editors.