mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +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>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>457</width>
|
<width>361</width>
|
||||||
<height>318</height>
|
<height>371</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -252,7 +252,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1" alignment="Qt::AlignRight">
|
||||||
<widget class="QPushButton" name="pb_Logoff">
|
<widget class="QPushButton" name="pb_Logoff">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>logoff</string>
|
<string>logoff</string>
|
||||||
@@ -275,22 +275,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="lbl_Roles">
|
<widget class="QLabel" name="lbl_Roles">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -318,13 +302,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="le_Info">
|
<widget class="QLineEdit" name="le_Info">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
@@ -335,6 +312,42 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ namespace BlackGui
|
|||||||
connect(ui->selector_AirlineIcaoCode, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CDbQuickMappingWizard::ps_airlineSelected);
|
connect(ui->selector_AirlineIcaoCode, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CDbQuickMappingWizard::ps_airlineSelected);
|
||||||
connect(ui->selector_AirlineName, &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
|
// init if data already available
|
||||||
this->ps_webDataRead();
|
this->ps_webDataRead();
|
||||||
}
|
}
|
||||||
@@ -66,6 +68,20 @@ namespace BlackGui
|
|||||||
return cats;
|
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)
|
void CDbQuickMappingWizard::presetAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
@@ -78,9 +94,7 @@ namespace BlackGui
|
|||||||
QString ms = model.getModelString();
|
QString ms = model.getModelString();
|
||||||
if (!model.getDescription().isEmpty())
|
if (!model.getDescription().isEmpty())
|
||||||
{
|
{
|
||||||
ms += " (";
|
ms += " (" + model.getDescription() + ")";
|
||||||
ms += model.getDescription();
|
|
||||||
ms += ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->presetAircraftIcao(model.getAircraftIcaoCode());
|
this->presetAircraftIcao(model.getAircraftIcaoCode());
|
||||||
@@ -232,7 +246,7 @@ namespace BlackGui
|
|||||||
break;
|
break;
|
||||||
case PageSendStatus:
|
case PageSendStatus:
|
||||||
{
|
{
|
||||||
this->writeModeltoDb();
|
this->writeModelToDb();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -287,7 +301,7 @@ namespace BlackGui
|
|||||||
this->m_model = model;
|
this->m_model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbQuickMappingWizard::writeModeltoDb()
|
void CDbQuickMappingWizard::writeModelToDb()
|
||||||
{
|
{
|
||||||
this->consolidateModel();
|
this->consolidateModel();
|
||||||
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(this->m_model);
|
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(this->m_model);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace BlackGui
|
|||||||
explicit CDbQuickMappingWizard(QWidget *parent = nullptr);
|
explicit CDbQuickMappingWizard(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CDbQuickMappingWizard();
|
virtual ~CDbQuickMappingWizard();
|
||||||
|
|
||||||
//! Preset values
|
//! Preset values
|
||||||
void presetAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao);
|
void presetAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao);
|
||||||
@@ -64,6 +64,10 @@ namespace BlackGui
|
|||||||
//! Log categories
|
//! Log categories
|
||||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//! \copydoc QWizard::keyPressEvent
|
||||||
|
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDbQuickMappingWizard> ui;
|
QScopedPointer<Ui::CDbQuickMappingWizard> ui;
|
||||||
int m_lastId = 0;
|
int m_lastId = 0;
|
||||||
@@ -94,7 +98,7 @@ namespace BlackGui
|
|||||||
void consolidateModel();
|
void consolidateModel();
|
||||||
|
|
||||||
//! Write the model to DB
|
//! Write the model to DB
|
||||||
void writeModeltoDb();
|
void writeModelToDb();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Web data have been read
|
//! Web data have been read
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="lbl_HintAircraftIcao">
|
<widget class="QLabel" name="lbl_HintAircraftIcao">
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user