mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #911, wizard improvements
* disable enter button for next * role QTextEdit size (logoff UI) * no filter bar for log
This commit is contained in:
committed by
Mathew Sutcliffe
parent
304c552872
commit
693d9631ff
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>457</width>
|
||||
<height>318</height>
|
||||
<width>361</width>
|
||||
<height>371</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -252,7 +252,7 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1" alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="pb_Logoff">
|
||||
<property name="text">
|
||||
<string>logoff</string>
|
||||
@@ -275,22 +275,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="hs_Logoff">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_Roles">
|
||||
<property name="text">
|
||||
@@ -318,13 +302,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Info">
|
||||
<property name="text">
|
||||
<string>Info:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="le_Info">
|
||||
<property name="readOnly">
|
||||
@@ -335,6 +312,42 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_Info">
|
||||
<property name="text">
|
||||
<string>Info:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="hs_Logoff">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="vs_Logoff">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace BlackGui
|
||||
connect(ui->selector_AirlineIcaoCode, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CDbQuickMappingWizard::ps_airlineSelected);
|
||||
connect(ui->selector_AirlineName, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CDbQuickMappingWizard::ps_airlineSelected);
|
||||
|
||||
ui->comp_Log->showFilterDialog(); // filter for log normally not needed, so dialog (not bar)
|
||||
|
||||
// init if data already available
|
||||
this->ps_webDataRead();
|
||||
}
|
||||
@@ -66,6 +68,20 @@ namespace BlackGui
|
||||
return cats;
|
||||
}
|
||||
|
||||
void CDbQuickMappingWizard::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
Qt::Key key = static_cast<Qt::Key>(event->key());
|
||||
if (key == Qt::Key_Enter || key == Qt::Key_Return)
|
||||
{
|
||||
// disable enter, interferes with filter returnPressed
|
||||
event->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
QWizard::keyPressEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void CDbQuickMappingWizard::presetAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao)
|
||||
{
|
||||
this->clear();
|
||||
@@ -78,9 +94,7 @@ namespace BlackGui
|
||||
QString ms = model.getModelString();
|
||||
if (!model.getDescription().isEmpty())
|
||||
{
|
||||
ms += " (";
|
||||
ms += model.getDescription();
|
||||
ms += ")";
|
||||
ms += " (" + model.getDescription() + ")";
|
||||
}
|
||||
|
||||
this->presetAircraftIcao(model.getAircraftIcaoCode());
|
||||
@@ -232,7 +246,7 @@ namespace BlackGui
|
||||
break;
|
||||
case PageSendStatus:
|
||||
{
|
||||
this->writeModeltoDb();
|
||||
this->writeModelToDb();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -287,7 +301,7 @@ namespace BlackGui
|
||||
this->m_model = model;
|
||||
}
|
||||
|
||||
void CDbQuickMappingWizard::writeModeltoDb()
|
||||
void CDbQuickMappingWizard::writeModelToDb()
|
||||
{
|
||||
this->consolidateModel();
|
||||
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(this->m_model);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackGui
|
||||
explicit CDbQuickMappingWizard(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CDbQuickMappingWizard();
|
||||
virtual ~CDbQuickMappingWizard();
|
||||
|
||||
//! Preset values
|
||||
void presetAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao);
|
||||
@@ -64,6 +64,10 @@ namespace BlackGui
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
protected:
|
||||
//! \copydoc QWizard::keyPressEvent
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbQuickMappingWizard> ui;
|
||||
int m_lastId = 0;
|
||||
@@ -94,7 +98,7 @@ namespace BlackGui
|
||||
void consolidateModel();
|
||||
|
||||
//! Write the model to DB
|
||||
void writeModeltoDb();
|
||||
void writeModelToDb();
|
||||
|
||||
private slots:
|
||||
//! Web data have been read
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="lbl_HintAircraftIcao">
|
||||
<property name="text">
|
||||
<string>Hint: You can also search on the next page</string>
|
||||
<string>Hint: You can also search for the aircraft ICAO on the next page.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user