swift
serverform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_COMPONENTS_NETWORKSERVERFORM_H
7 #define SWIFT_GUI_COMPONENTS_NETWORKSERVERFORM_H
8 
9 #include <QFrame>
10 #include <QObject>
11 #include <QScopedPointer>
12 #include <QString>
13 
14 #include "gui/editors/form.h"
15 #include "gui/swiftguiexport.h"
16 #include "misc/network/server.h"
17 #include "misc/statusmessagelist.h"
18 
19 namespace Ui
20 {
21  class CNetworkServerForm;
22 }
23 namespace swift::gui::editors
24 {
27  {
28  Q_OBJECT
29 
30  public:
32  explicit CServerForm(QWidget *parent = nullptr);
33 
35  virtual ~CServerForm() override;
36 
38  void setServer(const swift::misc::network::CServer &server);
39 
41  swift::misc::network::CServer getServer() const;
42 
44  swift::misc::network::CServer::ServerType getServerType() const;
45 
47  void resetToFirstTab();
48 
51  virtual void setReadOnly(bool readonly) override;
52  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
54 
56  void showPasswordField(bool show);
57 
58  private:
59  void initServerTypes();
60  void onChangedServerType(const QString &text);
61  void onChangedEcoSystem(const QString &text);
62  void tempUnhidePassword();
63 
64  QScopedPointer<Ui::CNetworkServerForm> ui;
65  QString m_passwordNameLabel;
66  };
67 } // namespace swift::gui::editors
68 
69 #endif // SWIFT_GUI_COMPONENTS_NETWORKSERVERFORM_H
Form base class.
Definition: form.h:27
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of a server.
Definition: server.h:28
#define SWIFT_GUI_EXPORT
Export a class or function from the library.