Allow to refresh "other server" combobox

This commit is contained in:
Klaus Basan
2018-12-07 04:36:26 +01:00
parent 9d85b70307
commit 32b2059d1a
4 changed files with 35 additions and 24 deletions

View File

@@ -88,14 +88,15 @@ namespace BlackGui
this->setLogoffCountdown();
connect(&m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::logoffCountdown);
connect(ui->comp_OtherServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
connect(ui->comp_OtherServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
connect(ui->comp_VatsimServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
connect(ui->pb_RefreshOtherServers, &QToolButton::clicked, this, &CLoginComponent::reloadOtherServersSetup);
connect(ui->tw_Network, &QTabWidget::currentChanged, this, &CLoginComponent::onServerTabWidgetChanged);
connect(ui->pb_Cancel, &QPushButton::clicked, this, &CLoginComponent::loginCancelled);
connect(ui->pb_Ok, &QPushButton::clicked, this, &CLoginComponent::toggleNetworkConnection);
connect(ui->pb_OtherServersGotoSettings, &QPushButton::pressed, this, &CLoginComponent::requestNetworkSettings);
connect(ui->tb_MappingWizard, &QToolButton::clicked, this, &CLoginComponent::mappingWizard);
connect(&m_networkSetup, &CNetworkSetup::setupChanged, this, &CLoginComponent::reloadSetup, Qt::QueuedConnection);
connect(&m_networkSetup, &CNetworkSetup::setupChanged, this, &CLoginComponent::reloadOtherServersSetup, Qt::QueuedConnection);
ui->form_FsdDetails->showEnableInfo(true);
ui->form_FsdDetails->setFsdSetupEnabled(false);
@@ -154,10 +155,9 @@ namespace BlackGui
// inital setup, if data already available
this->validateAircraftValues();
ui->form_Pilot->validate();
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1);
const CServerList otherServers(m_networkSetup.getOtherServersPlusPredefinedServers());
ui->comp_OtherServers->setServers(otherServers);
ui->cb_AutoLogoff->setChecked(m_networkSetup.useAutoLogoff());
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1);
this->reloadOtherServersSetup();
connect(ui->pb_OverrideCredentialsVatsim, &QPushButton::clicked, this, &CLoginComponent::overrideCredentialsToPilot);
connect(ui->pb_OverrideCredentialsOtherServers, &QPushButton::clicked, this, &CLoginComponent::overrideCredentialsToPilot);
@@ -625,9 +625,10 @@ namespace BlackGui
this->validateAircraftValues();
}
void CLoginComponent::reloadSetup()
void CLoginComponent::reloadOtherServersSetup()
{
ui->comp_OtherServers->setServers(m_networkSetup.getOtherServers());
const CServerList otherServers(m_networkSetup.getOtherServersPlusPredefinedServers());
ui->comp_OtherServers->setServers(otherServers);
}
void CLoginComponent::logoffCountdown()

View File

@@ -175,7 +175,7 @@ namespace BlackGui
void changedAirlineIcao(const BlackMisc::Aviation::CAirlineIcaoCode &icao);
//! Settings have been changed
void reloadSetup();
void reloadOtherServersSetup();
//! Logoff countdown
void logoffCountdown();

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<width>329</width>
<height>735</height>
</rect>
</property>
@@ -199,6 +199,17 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pb_RefreshOtherServers">
<property name="text">
<string>reload</string>
</property>
<property name="icon">
<iconset resource="../../blackmisc/blackmisc.qrc">
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_OtherServersGotoSettings">
<property name="text">
@@ -277,7 +288,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>259</width>
<width>293</width>
<height>55</height>
</rect>
</property>
@@ -848,17 +859,6 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BlackGui::CTickLabel</class>
<extends>QLabel</extends>
<header>blackgui/ticklabel.h</header>
</customwidget>
<customwidget>
<class>BlackGui::Editors::CServerForm</class>
<extends>QFrame</extends>
<header>blackgui/editors/serverform.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Editors::CFsdSetupForm</class>
<extends>QFrame</extends>
@@ -871,6 +871,17 @@
<header>blackgui/editors/voicesetupform.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::CTickLabel</class>
<extends>QLabel</extends>
<header>blackgui/ticklabel.h</header>
</customwidget>
<customwidget>
<class>BlackGui::Editors::CServerForm</class>
<extends>QFrame</extends>
<header>blackgui/editors/serverform.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BlackGui::Components::CModelMatcherLogEnable</class>
<extends>QFrame</extends>
@@ -908,7 +919,6 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tw_Network</tabstop>
<tabstop>comp_VatsimServers</tabstop>
<tabstop>pb_OverrideCredentialsVatsim</tabstop>
<tabstop>tw_Details</tabstop>
@@ -929,9 +939,11 @@
<tabstop>pb_Ok</tabstop>
<tabstop>pb_Cancel</tabstop>
<tabstop>comp_OtherServers</tabstop>
<tabstop>pb_RefreshOtherServers</tabstop>
<tabstop>pb_OtherServersGotoSettings</tabstop>
<tabstop>pb_OverrideCredentialsOtherServers</tabstop>
<tabstop>sa_FsdDetails</tabstop>
<tabstop>tw_Network</tabstop>
</tabstops>
<resources>
<include location="../../blackmisc/blackmisc.qrc"/>

View File

@@ -22,8 +22,6 @@
#include <QObject>
#include <QStringList>
class QWidget;
namespace BlackGui
{
namespace Components