mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 22:29:13 +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();
|
m_pendingPreselect = server.getName();
|
||||||
}
|
}
|
||||||
|
connect(this, &QComboBox::currentTextChanged, this, &CServerListSelector::onServerTextChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CServerListSelector::setServers(const CServerList &servers, bool nameIsCountry)
|
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()
|
bool CServerListSelector::knowsAllCountries()
|
||||||
{
|
{
|
||||||
return (sGui && sGui->getWebDataServices() && sGui->getWebDataServices()->getCountriesCount() > 0);
|
return (sGui && sGui->getWebDataServices() && sGui->getWebDataServices()->getCountriesCount() > 0);
|
||||||
|
|||||||
@@ -46,10 +46,17 @@ namespace BlackGui
|
|||||||
//! Preselect
|
//! Preselect
|
||||||
bool preSelect(const QString &name);
|
bool preSelect(const QString &name);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
//! Server has been changed
|
||||||
|
void serverChanged(const BlackMisc::Network::CServer &server);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Build the item string descriptions
|
//! Build the item string descriptions
|
||||||
void setServerItems(const BlackMisc::Network::CServerList &servers, bool nameToCountry);
|
void setServerItems(const BlackMisc::Network::CServerList &servers, bool nameToCountry);
|
||||||
|
|
||||||
|
//! Server index has been changed
|
||||||
|
void onServerTextChanged(const QString &text);
|
||||||
|
|
||||||
//! Do we know all countries?
|
//! Do we know all countries?
|
||||||
static bool knowsAllCountries();
|
static bool knowsAllCountries();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user