mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Ref T659, some utility functions and style adjustments for login dialog
This commit is contained in:
@@ -39,7 +39,7 @@ namespace BlackGui
|
|||||||
connect(ui->le_modelString, &QLineEdit::editingFinished, this, &CAircraftModelStringCompleter::onTextChanged);
|
connect(ui->le_modelString, &QLineEdit::editingFinished, this, &CAircraftModelStringCompleter::onTextChanged);
|
||||||
connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbModelsRead, this, &CAircraftModelStringCompleter::onSwiftModelDataRead);
|
connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbModelsRead, this, &CAircraftModelStringCompleter::onSwiftModelDataRead);
|
||||||
connect(ui->rb_Db, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
connect(ui->rb_Db, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
||||||
connect(ui->rb_ModelSet, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
connect(ui->rb_ModelSet, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
||||||
connect(ui->rb_OwnModels, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
connect(ui->rb_OwnModels, &QRadioButton::clicked, this, &CAircraftModelStringCompleter::initGui);
|
||||||
connect(&m_modelCaches, &CModelCaches::cacheChanged, this, &CAircraftModelStringCompleter::setSimulator, Qt::QueuedConnection);
|
connect(&m_modelCaches, &CModelCaches::cacheChanged, this, &CAircraftModelStringCompleter::setSimulator, Qt::QueuedConnection);
|
||||||
|
|
||||||
@@ -58,6 +58,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->setSimulator(simulator);
|
this->setSimulator(simulator);
|
||||||
|
this->initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftModelStringCompleter::~CAircraftModelStringCompleter()
|
CAircraftModelStringCompleter::~CAircraftModelStringCompleter()
|
||||||
@@ -95,8 +96,8 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
switch (source)
|
switch (source)
|
||||||
{
|
{
|
||||||
case DB: ui->rb_Db->setChecked(true); break;
|
case DB: ui->rb_Db->setChecked(true); break;
|
||||||
case ModelSet: ui->rb_ModelSet->setChecked(true); break;
|
case ModelSet: ui->rb_ModelSet->setChecked(true); break;
|
||||||
case OwnModels: ui->rb_OwnModels->setChecked(true); break;
|
case OwnModels: ui->rb_OwnModels->setChecked(true); break;
|
||||||
default: ui->rb_ModelSet->setChecked(true); break;
|
default: ui->rb_ModelSet->setChecked(true); break;
|
||||||
}
|
}
|
||||||
@@ -104,7 +105,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CAircraftModelStringCompleter::setSimulator(const CSimulatorInfo &simulator)
|
bool CAircraftModelStringCompleter::setSimulator(const CSimulatorInfo &simulator)
|
||||||
{
|
{
|
||||||
if (simulator.isSingleSimulator()) { return false; }
|
if (simulator.isSingleSimulator()) { return false; }
|
||||||
if (this->getSimulator() == simulator) { return false; }
|
if (this->getSimulator() == simulator) { return false; }
|
||||||
m_currentSimulator = simulator;
|
m_currentSimulator = simulator;
|
||||||
QPointer<CAircraftModelStringCompleter> myself(this);
|
QPointer<CAircraftModelStringCompleter> myself(this);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace BlackGui
|
|||||||
explicit CAircraftModelStringCompleter(QWidget *parent = nullptr);
|
explicit CAircraftModelStringCompleter(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CAircraftModelStringCompleter();
|
virtual ~CAircraftModelStringCompleter() override;
|
||||||
|
|
||||||
//! The model string
|
//! The model string
|
||||||
QString getModelString() const;
|
QString getModelString() const;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<string>Enables / disables future message logging</string>
|
<string>Enables / disables future message logging</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable:</string>
|
<string>Enable</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="lbl_VatsimUdpPort">
|
<widget class="QLabel" name="lbl_VatsimUdpPort">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Voice UDP Port:</string>
|
<string>Voice UDP Port</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lbl_VoiceSetup">
|
<widget class="QLabel" name="lbl_VoiceSetup">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Voice setup:</string>
|
<string>Voice setup</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -100,6 +100,13 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CStatusMessageList::addValidationMessage(const QString &validationText, CStatusMessage::StatusSeverity severity)
|
||||||
|
{
|
||||||
|
static const CLogCategoryList cats({ CLogCategory::validation() });
|
||||||
|
const CStatusMessage msg(cats, severity, validationText);
|
||||||
|
this->push_back(msg);
|
||||||
|
}
|
||||||
|
|
||||||
void CStatusMessageList::setCategory(const CLogCategory &category)
|
void CStatusMessageList::setCategory(const CLogCategory &category)
|
||||||
{
|
{
|
||||||
for (auto &msg : *this)
|
for (auto &msg : *this)
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ namespace BlackMisc
|
|||||||
//! Add some categories to all messages in the list
|
//! Add some categories to all messages in the list
|
||||||
void addCategories(const CLogCategoryList &categories);
|
void addCategories(const CLogCategoryList &categories);
|
||||||
|
|
||||||
|
//! Convenience function to push back a validation message
|
||||||
|
void addValidationMessage(const QString &validationText, CStatusMessage::StatusSeverity severity);
|
||||||
|
|
||||||
//! Reset the category of all messages in the list
|
//! Reset the category of all messages in the list
|
||||||
void setCategory(const CLogCategory &category);
|
void setCategory(const CLogCategory &category);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user