mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T219, server list selector signal (changed server)
This commit is contained in:
@@ -33,6 +33,7 @@ namespace BlackGui
|
||||
{
|
||||
m_pendingPreselect = server.getName();
|
||||
}
|
||||
connect(this, &QComboBox::currentTextChanged, this, &CServerListSelector::onServerTextChanged);
|
||||
}
|
||||
|
||||
void CServerListSelector::setServers(const CServerList &servers, bool nameIsCountry)
|
||||
@@ -120,6 +121,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CServerListSelector::onServerTextChanged(const QString &text)
|
||||
{
|
||||
Q_UNUSED(text);
|
||||
emit this->serverChanged(this->currentServer());
|
||||
}
|
||||
|
||||
bool CServerListSelector::knowsAllCountries()
|
||||
{
|
||||
return (sGui && sGui->getWebDataServices() && sGui->getWebDataServices()->getCountriesCount() > 0);
|
||||
|
||||
@@ -46,10 +46,17 @@ namespace BlackGui
|
||||
//! Preselect
|
||||
bool preSelect(const QString &name);
|
||||
|
||||
signals:
|
||||
//! Server has been changed
|
||||
void serverChanged(const BlackMisc::Network::CServer &server);
|
||||
|
||||
private:
|
||||
//! Build the item string descriptions
|
||||
void setServerItems(const BlackMisc::Network::CServerList &servers, bool nameToCountry);
|
||||
|
||||
//! Server index has been changed
|
||||
void onServerTextChanged(const QString &text);
|
||||
|
||||
//! Do we know all countries?
|
||||
static bool knowsAllCountries();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user