swift
serverlistselector.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 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_SERVERLISTSELECTOR_H
7 #define SWIFT_GUI_COMPONENTS_SERVERLISTSELECTOR_H
8 
9 #include <QComboBox>
10 #include <QObject>
11 #include <QStringList>
12 
13 #include "gui/swiftguiexport.h"
14 #include "misc/datacache.h"
17 
18 namespace swift::gui::components
19 {
21  class SWIFT_GUI_EXPORT CServerListSelector : public QComboBox
22  {
23  Q_OBJECT
24 
25  public:
27  explicit CServerListSelector(QWidget *parent = nullptr);
28 
30  void setServers(const swift::misc::network::CServerList &servers);
31 
33  swift::misc::network::CServer currentServer() const;
34 
36  bool preSelect(const QString &name);
37 
38  signals:
41 
42  private:
44  void setServerItems(const swift::misc::network::CServerList &servers);
45 
47  void onServerTextChanged(const QString &text);
48 
50  QStringList m_items;
51  QString m_pendingPreselect;
53  this
54  };
55  };
56 } // namespace swift::gui::components
57 
58 #endif // SWIFT_GUI_COMPONENTS_SERVERLISTSELECTOR_H
void serverChanged(const swift::misc::network::CServer &server)
Server has been changed.
Value object encapsulating information of a server.
Definition: server.h:28
Value object encapsulating a list of servers.
Definition: serverlist.h:23
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.