mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 14:45:42 +08:00
refs #288, adjusted server and network views
* aircraft settings are gone, move to login screen * no selected server needed anymore * marked outdated methods as deprecated
This commit is contained in:
committed by
Roland Winklmeier
parent
d1d02d6c3c
commit
44d0cd002b
@@ -52,31 +52,11 @@ namespace BlackGui
|
|||||||
return ui->comp_AudioSetup->playNotificationSounds();
|
return ui->comp_AudioSetup->playNotificationSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Update own ICAO data from GUI
|
|
||||||
*/
|
|
||||||
void CSettingsComponent::setOwnAircraftIcaoDataFromGui(CAircraftIcao &icao) const
|
|
||||||
{
|
|
||||||
icao.setAirlineDesignator(this->ui->le_SettingsIcaoAirlineDesignator->text());
|
|
||||||
icao.setAircraftDesignator(this->ui->le_SettingsIcaoAircraftDesignator->text());
|
|
||||||
icao.setAircraftCombinedType(this->ui->le_SettingsIcaoCombinedType->text());
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSettingsComponent::setGuiOpacity(double value)
|
void CSettingsComponent::setGuiOpacity(double value)
|
||||||
{
|
{
|
||||||
this->ui->hs_SettingsGuiOpacity->setValue(value);
|
this->ui->hs_SettingsGuiOpacity->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSettingsComponent::loginAsObserver() const
|
|
||||||
{
|
|
||||||
return this->ui->rb_SettingsLoginStealthMode->isChecked();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSettingsComponent::loginStealth() const
|
|
||||||
{
|
|
||||||
return this->ui->rb_SettingsLoginStealthMode->isChecked();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CSettingsComponent::getAtcUpdateIntervalSeconds() const
|
int CSettingsComponent::getAtcUpdateIntervalSeconds() const
|
||||||
{
|
{
|
||||||
return this->ui->hs_SettingsGuiAtcRefreshTime->value();
|
return this->ui->hs_SettingsGuiAtcRefreshTime->value();
|
||||||
@@ -92,11 +72,6 @@ namespace BlackGui
|
|||||||
return this->ui->hs_SettingsGuiUserRefreshTime->value();
|
return this->ui->hs_SettingsGuiUserRefreshTime->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CSettingsComponent::getOwnCallsignFromGui() const
|
|
||||||
{
|
|
||||||
return this->ui->le_SettingsAircraftCallsign->text();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reload settings
|
* Reload settings
|
||||||
*/
|
*/
|
||||||
@@ -106,7 +81,6 @@ namespace BlackGui
|
|||||||
CSettingsNetwork nws = this->getIContextSettings()->getNetworkSettings();
|
CSettingsNetwork nws = this->getIContextSettings()->getNetworkSettings();
|
||||||
|
|
||||||
// update servers
|
// update servers
|
||||||
this->ui->tvp_SettingsTnServers->setSelectedServer(nws.getCurrentTrafficNetworkServer());
|
|
||||||
this->ui->tvp_SettingsTnServers->updateContainer(nws.getTrafficNetworkServers());
|
this->ui->tvp_SettingsTnServers->updateContainer(nws.getTrafficNetworkServers());
|
||||||
|
|
||||||
// update hot keys
|
// update hot keys
|
||||||
@@ -130,14 +104,12 @@ namespace BlackGui
|
|||||||
this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CSettingsComponent::ps_changedSettings);
|
this->connect(this->getIContextSettings(), &IContextSettings::changedSettings, this, &CSettingsComponent::ps_changedSettings);
|
||||||
|
|
||||||
// Opacity, intervals
|
// Opacity, intervals
|
||||||
bool connected = false;
|
|
||||||
this->connect(this->ui->hs_SettingsGuiOpacity, &QSlider::valueChanged, this, &CSettingsComponent::changedWindowsOpacity);
|
this->connect(this->ui->hs_SettingsGuiOpacity, &QSlider::valueChanged, this, &CSettingsComponent::changedWindowsOpacity);
|
||||||
this->connect(this->ui->hs_SettingsGuiAircraftRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAircraftsUpdateInterval);
|
this->connect(this->ui->hs_SettingsGuiAircraftRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAircraftsUpdateInterval);
|
||||||
this->connect(this->ui->hs_SettingsGuiAtcRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAtcStationsUpdateInterval);
|
this->connect(this->ui->hs_SettingsGuiAtcRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedAtcStationsUpdateInterval);
|
||||||
this->connect(this->ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedUsersUpdateInterval);
|
this->connect(this->ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this, &CSettingsComponent::changedUsersUpdateInterval);
|
||||||
|
|
||||||
// Settings server
|
// Settings server
|
||||||
this->connect(this->ui->pb_SettingsTnCurrentServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
|
||||||
this->connect(this->ui->pb_SettingsTnRemoveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
this->connect(this->ui->pb_SettingsTnRemoveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
||||||
this->connect(this->ui->pb_SettingsTnSaveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
this->connect(this->ui->pb_SettingsTnSaveServer, &QPushButton::released, this, &CSettingsComponent::ps_alterTrafficServer);
|
||||||
this->connect(this->ui->tvp_SettingsTnServers, &QTableView::clicked, this, &CSettingsComponent::ps_networkServerSelected);
|
this->connect(this->ui->tvp_SettingsTnServers, &QTableView::clicked, this, &CSettingsComponent::ps_networkServerSelected);
|
||||||
@@ -154,7 +126,7 @@ namespace BlackGui
|
|||||||
this->ui->cb_SettingsGuiFontSize->setCurrentText(QString::number(font.pointSize()));
|
this->ui->cb_SettingsGuiFontSize->setCurrentText(QString::number(font.pointSize()));
|
||||||
this->m_fontColor = QColor(CStyleSheetUtility::instance().fontColor());
|
this->m_fontColor = QColor(CStyleSheetUtility::instance().fontColor());
|
||||||
this->ui->le_SettingsGuiFontColor->setText(this->m_fontColor.name());
|
this->ui->le_SettingsGuiFontColor->setText(this->m_fontColor.name());
|
||||||
connected = this->connect(this->ui->cb_SettingsGuiFont, SIGNAL(currentFontChanged(QFont)), this, SLOT(ps_fontChanged()));
|
bool connected = this->connect(this->ui->cb_SettingsGuiFont, SIGNAL(currentFontChanged(QFont)), this, SLOT(ps_fontChanged()));
|
||||||
Q_ASSERT(connected);
|
Q_ASSERT(connected);
|
||||||
connected = this->connect(this->ui->cb_SettingsGuiFontSize, SIGNAL(currentIndexChanged(QString)), this, SLOT(ps_fontChanged()));
|
connected = this->connect(this->ui->cb_SettingsGuiFontSize, SIGNAL(currentIndexChanged(QString)), this, SLOT(ps_fontChanged()));
|
||||||
Q_ASSERT(connected);
|
Q_ASSERT(connected);
|
||||||
@@ -169,7 +141,7 @@ namespace BlackGui
|
|||||||
void CSettingsComponent::ps_networkServerSelected(QModelIndex index)
|
void CSettingsComponent::ps_networkServerSelected(QModelIndex index)
|
||||||
{
|
{
|
||||||
const CServer clickedServer = this->ui->tvp_SettingsTnServers->at<CServer>(index);
|
const CServer clickedServer = this->ui->tvp_SettingsTnServers->at<CServer>(index);
|
||||||
this->ps_updateGuiSelectedServerTextboxes(clickedServer);
|
this->ui->frp_ServerForm->setServer(clickedServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -177,20 +149,17 @@ namespace BlackGui
|
|||||||
*/
|
*/
|
||||||
void CSettingsComponent::ps_alterTrafficServer()
|
void CSettingsComponent::ps_alterTrafficServer()
|
||||||
{
|
{
|
||||||
CServer server = this->ps_selectedServerFromTextboxes();
|
CServer server = this->ui->frp_ServerForm->getServer();
|
||||||
if (!server.isValidForLogin())
|
CStatusMessageList msgs = server.validate();
|
||||||
|
if (!msgs.isEmpty())
|
||||||
{
|
{
|
||||||
CLogMessage().validationWarning("Wrong settings for server");
|
CLogMessage(this).validations(msgs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString path = CSettingUtilities::appendPaths(IContextSettings::PathNetworkSettings(), CSettingsNetwork::ValueTrafficServers());
|
const QString path = CSettingUtilities::appendPaths(IContextSettings::PathNetworkSettings(), CSettingsNetwork::ValueTrafficServers());
|
||||||
QObject *sender = QObject::sender();
|
QObject *sender = QObject::sender();
|
||||||
if (sender == this->ui->pb_SettingsTnCurrentServer)
|
if (sender == this->ui->pb_SettingsTnRemoveServer)
|
||||||
{
|
|
||||||
this->getIContextSettings()->value(path, CSettingsNetwork::CmdSetCurrentServer(), server.toQVariant());
|
|
||||||
}
|
|
||||||
else if (sender == this->ui->pb_SettingsTnRemoveServer)
|
|
||||||
{
|
{
|
||||||
this->getIContextSettings()->value(path, CSettingUtilities::CmdRemove(), server.toQVariant());
|
this->getIContextSettings()->value(path, CSettingUtilities::CmdRemove(), server.toQVariant());
|
||||||
}
|
}
|
||||||
@@ -210,42 +179,6 @@ namespace BlackGui
|
|||||||
Q_UNUSED(type);
|
Q_UNUSED(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Textboxes from server
|
|
||||||
*/
|
|
||||||
void CSettingsComponent::ps_updateGuiSelectedServerTextboxes(const CServer &server)
|
|
||||||
{
|
|
||||||
this->ui->le_SettingsTnCsName->setText(server.getName());
|
|
||||||
this->ui->le_SettingsTnCsDescription->setText(server.getDescription());
|
|
||||||
this->ui->le_SettingsTnCsAddress->setText(server.getAddress());
|
|
||||||
this->ui->le_SettingsTnCsPort->setText(QString::number(server.getPort()));
|
|
||||||
this->ui->le_SettingsTnCsRealName->setText(server.getUser().getRealName());
|
|
||||||
this->ui->le_SettingsTnCsNetworkId->setText(server.getUser().getId());
|
|
||||||
this->ui->le_SettingsTnCsPassword->setText(server.getUser().getPassword());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Server settings from textboxes
|
|
||||||
*/
|
|
||||||
CServer CSettingsComponent::ps_selectedServerFromTextboxes() const
|
|
||||||
{
|
|
||||||
CServer server;
|
|
||||||
bool portOk = false;
|
|
||||||
server.setName(this->ui->le_SettingsTnCsName->text());
|
|
||||||
server.setDescription(this->ui->le_SettingsTnCsDescription->text());
|
|
||||||
server.setAddress(this->ui->le_SettingsTnCsAddress->text());
|
|
||||||
server.setPort(this->ui->le_SettingsTnCsPort->text().toInt(&portOk));
|
|
||||||
if (!portOk) server.setPort(-1);
|
|
||||||
|
|
||||||
CUser user;
|
|
||||||
user.setRealName(this->ui->le_SettingsTnCsRealName->text());
|
|
||||||
user.setId(this->ui->le_SettingsTnCsNetworkId->text());
|
|
||||||
user.setPassword(this->ui->le_SettingsTnCsPassword->text());
|
|
||||||
server.setUser(user);
|
|
||||||
|
|
||||||
return server;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the hotkeys
|
* Save the hotkeys
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -56,18 +56,9 @@ namespace BlackGui
|
|||||||
//! \copydoc CAudioSetupComponent::playNotificationSounds
|
//! \copydoc CAudioSetupComponent::playNotificationSounds
|
||||||
bool playNotificationSounds() const;
|
bool playNotificationSounds() const;
|
||||||
|
|
||||||
//! ICAO data from GUI
|
|
||||||
void setOwnAircraftIcaoDataFromGui(BlackMisc::Aviation::CAircraftIcao &icao) const;
|
|
||||||
|
|
||||||
//! GUI Opacity 0-100%
|
//! GUI Opacity 0-100%
|
||||||
void setGuiOpacity(double value);
|
void setGuiOpacity(double value);
|
||||||
|
|
||||||
//! Login as observer
|
|
||||||
bool loginAsObserver() const;
|
|
||||||
|
|
||||||
//! Login as observer
|
|
||||||
bool loginStealth() const;
|
|
||||||
|
|
||||||
//! ATC refresh time
|
//! ATC refresh time
|
||||||
int getAtcUpdateIntervalSeconds() const;
|
int getAtcUpdateIntervalSeconds() const;
|
||||||
|
|
||||||
@@ -77,9 +68,6 @@ namespace BlackGui
|
|||||||
//! Aircraft refresh time
|
//! Aircraft refresh time
|
||||||
int getUsersUpdateIntervalSeconds() const;
|
int getUsersUpdateIntervalSeconds() const;
|
||||||
|
|
||||||
//! Own callsign
|
|
||||||
QString getOwnCallsignFromGui() const;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Change the windows opacity 0..100
|
//! Change the windows opacity 0..100
|
||||||
void changedWindowsOpacity(int opacity);
|
void changedWindowsOpacity(int opacity);
|
||||||
@@ -112,15 +100,6 @@ namespace BlackGui
|
|||||||
//! Alter traffic server
|
//! Alter traffic server
|
||||||
void ps_alterTrafficServer();
|
void ps_alterTrafficServer();
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Update the selected server textboxes
|
|
||||||
* \param server to be displayed
|
|
||||||
*/
|
|
||||||
void ps_updateGuiSelectedServerTextboxes(const BlackMisc::Network::CServer &server);
|
|
||||||
|
|
||||||
//! Selected server from textboxes
|
|
||||||
BlackMisc::Network::CServer ps_selectedServerFromTextboxes() const;
|
|
||||||
|
|
||||||
//! Settings have been changed
|
//! Settings have been changed
|
||||||
void ps_changedSettings(uint typeValue);
|
void ps_changedSettings(uint typeValue);
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>338</width>
|
<width>359</width>
|
||||||
<height>323</height>
|
<height>269</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<string>Settings</string>
|
<string>Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -44,6 +44,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Views::CServerView" name="tvp_SettingsTnServers">
|
<widget class="BlackGui::Views::CServerView" name="tvp_SettingsTnServers">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||||
</property>
|
</property>
|
||||||
@@ -59,119 +65,26 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="fl_SettingsTnCurrentServer">
|
<widget class="BlackGui::CServerForm" name="frp_ServerForm">
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="sizePolicy">
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="minimumSize">
|
||||||
<number>6</number>
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="frameShape">
|
||||||
<number>6</number>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="frameShadow">
|
||||||
<number>6</number>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
</widget>
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsName">
|
|
||||||
<property name="text">
|
|
||||||
<string>Name</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsName">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsDescription">
|
|
||||||
<property name="text">
|
|
||||||
<string>Description</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsDescription"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsAddress">
|
|
||||||
<property name="text">
|
|
||||||
<string>Address</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsAddress"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsPort">
|
|
||||||
<property name="text">
|
|
||||||
<string>Port</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsPort">
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsRealName">
|
|
||||||
<property name="text">
|
|
||||||
<string>Real name</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsRealName">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsNetworkId">
|
|
||||||
<property name="text">
|
|
||||||
<string>Id:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsNetworkId">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsTnCsPassword">
|
|
||||||
<property name="text">
|
|
||||||
<string>Password</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsTnCsPassword">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>32</number>
|
|
||||||
</property>
|
|
||||||
<property name="echoMode">
|
|
||||||
<enum>QLineEdit::Password</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="fr_SettingsTnButtons">
|
<widget class="QFrame" name="fr_SettingsTnButtons">
|
||||||
@@ -188,6 +101,19 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="hs_SettingsTnSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pb_SettingsTnSaveServer">
|
<widget class="QPushButton" name="pb_SettingsTnSaveServer">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -214,143 +140,11 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pb_SettingsTnCurrentServer">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Current server</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tb_SettingsAircraft">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Aircraft</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="fl_SettingsAircraft">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsAircraftCallsign">
|
|
||||||
<property name="text">
|
|
||||||
<string>Callsign</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsAircraftCallsign">
|
|
||||||
<property name="inputMethodHints">
|
|
||||||
<set>Qt::ImhLatinOnly|Qt::ImhUppercaseOnly</set>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>BLACK</string>
|
|
||||||
</property>
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsIcaoAircraftDesignator">
|
|
||||||
<property name="text">
|
|
||||||
<string>ICAO type (e.g. A320)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsIcaoAircraftDesignator">
|
|
||||||
<property name="inputMethodHints">
|
|
||||||
<set>Qt::ImhUppercaseOnly</set>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>C172</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsIcaoAirlineDesignator">
|
|
||||||
<property name="text">
|
|
||||||
<string>ICAO airline (e.g.DLH)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsIcaoAirlineDesignator">
|
|
||||||
<property name="text">
|
|
||||||
<string>SGN</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsIcaoCombinedType">
|
|
||||||
<property name="text">
|
|
||||||
<string>Aircraft type (e.g. L2J)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_SettingsIcaoCombinedType">
|
|
||||||
<property name="text">
|
|
||||||
<string>L1P</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_SettingsModes">
|
|
||||||
<property name="text">
|
|
||||||
<string>Login modes</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QGroupBox" name="gb_LoginModes">
|
|
||||||
<property name="title">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rb_SetttingsNormalLoginMode">
|
|
||||||
<property name="text">
|
|
||||||
<string>Normal</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rb_SettingsLoginStealthMode">
|
|
||||||
<property name="text">
|
|
||||||
<string>Stealth mode</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rb_SettingsLoginObserver">
|
|
||||||
<property name="text">
|
|
||||||
<string>Observer</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tb_SettingsAudio">
|
<widget class="QWidget" name="tb_SettingsAudio">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Audio</string>
|
<string>Audio</string>
|
||||||
@@ -826,6 +620,12 @@
|
|||||||
<header>blackgui/components/settingssimulatorcomponent.h</header>
|
<header>blackgui/components/settingssimulatorcomponent.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CServerForm</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/serverform.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -37,29 +37,5 @@ namespace BlackGui
|
|||||||
(void)QT_TRANSLATE_NOOP("ViewServerList", "userid");
|
(void)QT_TRANSLATE_NOOP("ViewServerList", "userid");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Special functions
|
|
||||||
*/
|
|
||||||
QVariant CServerListModel::data(const QModelIndex &index, int role) const
|
|
||||||
{
|
|
||||||
if (role == Qt::BackgroundRole)
|
|
||||||
{
|
|
||||||
if (!this->hasSelectedServer()) return QVariant();
|
|
||||||
CServer currentRow = this->at(index);
|
|
||||||
if (currentRow == this->getSelectedServer())
|
|
||||||
{
|
|
||||||
QBrush background(Qt::green);
|
|
||||||
return background;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return CListModelBase::data(index, role);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // class
|
} // class
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ namespace BlackGui
|
|||||||
class CServerListModel : public CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList>
|
class CServerListModel : public CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList>
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
|
||||||
BlackMisc::Network::CServer m_selectedServer;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
@@ -34,27 +31,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CServerListModel() {}
|
virtual ~CServerListModel() {}
|
||||||
|
|
||||||
//! Has selected server?
|
|
||||||
bool hasSelectedServer() const
|
|
||||||
{
|
|
||||||
return this->m_selectedServer.isValidForLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Get selected server
|
|
||||||
const BlackMisc::Network::CServer &getSelectedServer() const
|
|
||||||
{
|
|
||||||
return this->m_selectedServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Set selected server
|
|
||||||
void setSelectedServer(const BlackMisc::Network::CServer &selectedServer)
|
|
||||||
{
|
|
||||||
this->m_selectedServer = selectedServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \copydoc CListModelBase::data
|
|
||||||
virtual QVariant data(const QModelIndex &index, int role) const override;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,5 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
this->standardInit(new CServerListModel(this));
|
this->standardInit(new CServerListModel(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CServerView::setSelectedServer(const Network::CServer &selectedServer)
|
|
||||||
{
|
|
||||||
Q_ASSERT(this->m_model);
|
|
||||||
this->m_model->setSelectedServer(selectedServer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CServerView(QWidget *parent = nullptr);
|
explicit CServerView(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! \copydoc CServerListModel::setSelectedServer
|
|
||||||
void setSelectedServer(const BlackMisc::Network::CServer &selectedServer);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,13 +54,7 @@ namespace BlackMisc
|
|||||||
void CSettingsNetwork::initDefaultValues()
|
void CSettingsNetwork::initDefaultValues()
|
||||||
{
|
{
|
||||||
this->m_trafficNetworkServers.clear();
|
this->m_trafficNetworkServers.clear();
|
||||||
CServer currentServer(CServer("Testserver", "Client project testserver", "vatsim-germany.org", 6809, CUser("guest", "Guest Client project", "", "guest")));
|
this->addTrafficNetworkServer(CServer("Testserver", "Client project testserver", "vatsim-germany.org", 6809, CUser("guest", "Guest Client project", "", "guest")));
|
||||||
this->setCurrentNetworkServer(currentServer);
|
|
||||||
this->addTrafficNetworkServer(this->getCurrentTrafficNetworkServer());
|
|
||||||
this->addTrafficNetworkServer(CServer("Europe C2", "VATSIM Server", "88.198.19.202", 6809, CUser("vatsimid", "Black Client", "", "vatsimpw")));
|
|
||||||
this->addTrafficNetworkServer(CServer("Europe CC", "VATSIM Server", "5.9.155.43", 6809, CUser("vatsimid", "Black Client", "", "vatsimpw")));
|
|
||||||
this->addTrafficNetworkServer(CServer("UK", "VATSIM Server", "109.169.48.148", 6809, CUser("vatsimid", "Black Client", "", "vatsimpw")));
|
|
||||||
this->addTrafficNetworkServer(CServer("USA-W", "VATSIM Server", "64.151.108.52", 6809, CUser("vatsimid", "Black Client", "", "vatsimpw")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ namespace BlackMisc
|
|||||||
//! Default constructor.
|
//! Default constructor.
|
||||||
CSettingsNetwork();
|
CSettingsNetwork();
|
||||||
|
|
||||||
//! Update
|
//! Destructor.
|
||||||
|
virtual ~CSettingsNetwork() {}
|
||||||
|
|
||||||
|
//! Current server
|
||||||
|
//! \deprecated shall not be used anymore
|
||||||
static const QString &CmdSetCurrentServer()
|
static const QString &CmdSetCurrentServer()
|
||||||
{
|
{
|
||||||
static const QString cmd("currenttrafficserver");
|
static const QString cmd("currenttrafficserver");
|
||||||
@@ -64,6 +68,7 @@ namespace BlackMisc
|
|||||||
BlackMisc::Network::CServerList getTrafficNetworkServers() const { return m_trafficNetworkServers; }
|
BlackMisc::Network::CServerList getTrafficNetworkServers() const { return m_trafficNetworkServers; }
|
||||||
|
|
||||||
//! Selected traffic network server
|
//! Selected traffic network server
|
||||||
|
//! \deprecated Shall not be used anymore
|
||||||
BlackMisc::Network::CServer getCurrentTrafficNetworkServer() const { return m_trafficNetworkServerCurrent; }
|
BlackMisc::Network::CServer getCurrentTrafficNetworkServer() const { return m_trafficNetworkServerCurrent; }
|
||||||
|
|
||||||
//! URL of booking service
|
//! URL of booking service
|
||||||
|
|||||||
Reference in New Issue
Block a user