QGIS API Documentation  2.12.0-Lyon
qgsauthserverseditor.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthserverseditor.h
3  ---------------------
4  begin : April 26, 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 
17 #ifndef QGSAUTHSERVERSEDITOR_H
18 #define QGSAUTHSERVERSEDITOR_H
19 
20 #include <QWidget>
21 
22 #include "ui_qgsauthserverseditor.h"
23 #include "qgsauthmanager.h"
24 
25 class QgsMessageBar;
26 
30 class GUI_EXPORT QgsAuthServersEditor : public QWidget, private Ui::QgsAuthServersEditor
31 {
32  Q_OBJECT
33 
34  public:
39  explicit QgsAuthServersEditor( QWidget *parent = 0 );
41 
42  private slots:
43  void populateSslConfigsView();
44 
45  void refreshSslConfigsView();
46 
48  void selectionChanged( const QItemSelection& selected, const QItemSelection& deselected );
49 
51  void checkSelection();
52 
53  void handleDoubleClick( QTreeWidgetItem* item, int col );
54 
55  void on_btnAddServer_clicked();
56 
57  void on_btnRemoveServer_clicked();
58 
59  void on_btnEditServer_clicked();
60 
61  void on_btnGroupByOrg_toggled( bool checked );
62 
64  void authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level );
65 
66  protected:
68  void showEvent( QShowEvent *e ) override;
69 
70  private:
71  enum ConfigType
72  {
73  Section = 1000,
74  OrgName = 1001,
75  ServerConfig = 1002,
76  };
77 
78  void setupSslConfigsTree();
79 
80  void populateSslConfigsSection( QTreeWidgetItem *item,
81  const QList<QgsAuthConfigSslServer>& configs,
82  QgsAuthServersEditor::ConfigType conftype );
83 
84  void appendSslConfigsToGroup( const QList<QgsAuthConfigSslServer>& configs,
85  QgsAuthServersEditor::ConfigType conftype,
86  QTreeWidgetItem *parent = 0 );
87 
88  void appendSslConfigsToItem( const QList<QgsAuthConfigSslServer>& configs,
89  QgsAuthServersEditor::ConfigType conftype,
90  QTreeWidgetItem *parent = 0 );
91 
92  QgsMessageBar * messageBar();
93  int messageTimeout();
94 
95  bool mDisabled;
96  QVBoxLayout *mAuthNotifyLayout;
97  QLabel *mAuthNotify;
98 
99  QTreeWidgetItem *mRootSslConfigItem;
100 };
101 
102 #endif // QGSAUTHSERVERSEDITOR_H
Widget for viewing and editing servers in authentication database.
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:42
virtual void showEvent(QShowEvent *event)
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)