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