swift
src
gui
components
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
"
15
#include "
misc/network/data/lastserver.h
"
16
#include "
misc/network/serverlist.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:
40
void
serverChanged
(
const
swift::misc::network::CServer
&server);
41
42
private
:
44
void
setServerItems(
const
swift::misc::network::CServerList
&servers);
45
47
void
onServerTextChanged(
const
QString &text);
48
49
swift::misc::network::CServerList
m_servers;
50
QStringList m_items;
51
QString m_pendingPreselect;
52
swift::misc::CData<swift::misc::network::data::TLastServer>
m_lastServer {
53
this
54
};
55
};
56
}
// namespace swift::gui::components
57
58
#endif
// SWIFT_GUI_COMPONENTS_SERVERLISTSELECTOR_H
swift::gui::components::CServerListSelector
List of servers.
Definition:
serverlistselector.h:22
swift::gui::components::CServerListSelector::serverChanged
void serverChanged(const swift::misc::network::CServer &server)
Server has been changed.
swift::misc::CData< swift::misc::network::data::TLastServer >
swift::misc::network::CServer
Value object encapsulating information of a server.
Definition:
server.h:28
swift::misc::network::CServerList
Value object encapsulating a list of servers.
Definition:
serverlist.h:23
datacache.h
lastserver.h
swift::gui::components
High level reusable GUI components.
Definition:
aboutdialog.cpp:13
serverlist.h
swiftguiexport.h
SWIFT_GUI_EXPORT
#define SWIFT_GUI_EXPORT
Export a class or function from the library.
Definition:
swiftguiexport.h:19
Generated on Mon Mar 24 2025 16:42:20 for swift by
1.9.1