QGIS API Documentation  2.99.0-Master (53aba61)
qgsnewhttpconnection.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnewhttpconnection.cpp - selector for a new HTTP server for WMS, etc.
3  -------------------
4  begin : 3 April 2005
5  copyright : (C) 2005 by Brendan Morley
6  email : morb at ozemail dot com dot au
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSNEWHTTPCONNECTION_H
19 #define QGSNEWHTTPCONNECTION_H
20 
21 #include "qgis_sip.h"
22 #include "ui_qgsnewhttpconnectionbase.h"
23 #include "qgsguiutils.h"
24 #include "qgis_gui.h"
25 
27 
32 class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpConnectionBase
33 {
34  Q_OBJECT
35 
36  public:
37 
43  {
44  ConnectionWfs = 1 << 1,
45  ConnectionWms = 1 << 2,
46  ConnectionWcs = 1 << 3,
47  ConnectionOther = 1 << 4,
48  };
49  Q_DECLARE_FLAGS( ConnectionTypes, ConnectionType )
50 
51 
55  enum Flag
56  {
57  FlagShowTestConnection = 1 << 1,
58  };
59  Q_DECLARE_FLAGS( Flags, Flag )
60 
61 
70  QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr,
71  QgsNewHttpConnection::ConnectionTypes types = ConnectionWms,
72  const QString &baseKey = "qgis/connections-wms/",
73  const QString &connectionName = QString(),
74  QgsNewHttpConnection::Flags flags = 0,
75  Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
76 
81  QString name() const;
82 
87  QString url() const;
88 
89  public slots:
90 
91  void accept() override;
92 
93  private slots:
94 
95  void nameChanged( const QString & );
96  void urlChanged( const QString & );
97  void updateOkButtonState();
98 
99  protected:
100 
106  virtual bool validate();
107 
112  QPushButton *testConnectButton();
113 
119  virtual QString wfsSettingsKey( const QString &base, const QString &connectionName ) const;
120 
126  virtual QString wmsSettingsKey( const QString &base, const QString &connectionName ) const;
127 
133  void updateServiceSpecificSettings();
134 
135  private:
136 
137  ConnectionTypes mTypes = ConnectionWms;
138 
139  QString mBaseKey;
140  QString mCredentialsBaseKey;
141  QString mOriginalConnName; //store initial name to delete entry in case of rename
142  QgsAuthConfigSelect *mAuthConfigSelect = nullptr;
143  void showHelp();
144 
145 };
146 
147 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsNewHttpConnection::ConnectionTypes )
148 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsNewHttpConnection::Flags )
149 
150 #endif // QGSNEWHTTPCONNECTION_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Flag
Flags controlling dialog behavior.
ConnectionType
Available connection types for configuring in the dialog.
Dialog to allow the user to configure and save connection information for an HTTP Server for WMS...
Selector widget for authentication configs.