Browse Source

Added functionality in TotalsWidget to verify and write
changes in the previous experience to the Database

Felix Turowsky 1 year ago
parent
commit
5323648eb9
3 changed files with 253 additions and 345 deletions
  1. 69 163
      src/gui/widgets/totalswidget.cpp
  2. 9 20
      src/gui/widgets/totalswidget.h
  3. 175 162
      src/gui/widgets/totalswidget.ui

+ 69 - 163
src/gui/widgets/totalswidget.cpp

@@ -24,7 +24,7 @@ TotalsWidget::~TotalsWidget()
  * \brief HomeWidget::fillTotals Retreives a Database Summary of Total Flight Time via the OPL::Statistics::totals
  * function and parses the return to fill out the QLineEdits.
  */
-void TotalsWidget::fillTotals(WidgetType widgetType)
+void TotalsWidget::fillTotals(const WidgetType widgetType)
 {
     OPL::RowData_T time_data;
 
@@ -50,12 +50,10 @@ void TotalsWidget::fillTotals(WidgetType widgetType)
             if(le_name.contains("to") || le_name.contains("ldg")) {
                 // line edits for take offs and landings
                 line_edit->setText(field.toString());
-//                DEB << "Setting: " + le_name + ": " + field.toString();
             } else {
                 // line edits for total times
                 const QString time_string = OPL::Time::toString(field.toInt());
                 line_edit->setText(time_string);
-//                DEB << "Setting " + le_name + ": " + time_string;
             }
         }
 
@@ -67,29 +65,33 @@ void TotalsWidget::fillTotals(WidgetType widgetType)
  * \details This widget can be used to either display the totals (in the home widget) or
  * to edit the total previous experience, from previous logbooks (in the settings widget).
  */
-void TotalsWidget::setup(WidgetType widgetType)
+void TotalsWidget::setup(const WidgetType widgetType)
 {
-
-    const auto lineEdits = this->findChildren<QLineEdit *>();
+    const QList<QLineEdit *> lineEdits = this->findChildren<QLineEdit *>();
 
     switch (widgetType) {
     case TotalTimeWidget:
         LOG << "Setting up totals widget";
+        // disable editing
         for (const auto &lineEdit : lineEdits) {
             lineEdit->setFocusPolicy(Qt::FocusPolicy::NoFocus);
         }
+        // populate the UI
         fillTotals(widgetType);
         break;
     case PreviousExperienceWidget:
         LOG << "Setting up previous XP widget";
         for (const auto &lineEdit : lineEdits) {
-            lineEdit->setFocusPolicy(Qt::FocusPolicy::ClickFocus);
-            lineEdit->setValidator(m_timeValidator);
+            lineEdit->setFocusPolicy(Qt::FocusPolicy::StrongFocus);
+            // set a validator for the TO/LDG line edits, the other ones get validated seperately
+            if(lineEdit->objectName().contains(QLatin1String("to")) || lineEdit->objectName().contains(QLatin1String("ldg"))) {
+                lineEdit->setValidator( new QIntValidator(0,  std::numeric_limits<int>::max(), this) );
+            }
         }
         // initialise m_rowData
         m_rowData = DB->getRowData(OPL::DbTable::Flights, TOTALS_DATA_ROW_ID);
 
-        // fill the totals
+        // populate the UI
         fillTotals(widgetType);
         connectSignalsAndSlots();
         break;
@@ -103,41 +105,48 @@ void TotalsWidget::setup(WidgetType widgetType)
  */
 void TotalsWidget::connectSignalsAndSlots()
 {
-    // connect signals and slots that edit the applicable field in the database on editing finished
     connect(ui->tblkLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::totalTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tSPSELineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::spseTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tSPMELineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::spmeTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tMPLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::multipilotTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
 
     connect(ui->tPICLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::picTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tSICLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::sicTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tDUALLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::dualTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tFILineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::fiTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tPICUSLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::picusTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tIFRLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::ifrTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
+    connect(ui->tNIGHTLineEdit, &QLineEdit::editingFinished,
+            this, &TotalsWidget::timeLineEditEditingFinished);
     connect(ui->tSIMLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::simulatorTimeEdited);
+            this, &TotalsWidget::timeLineEditEditingFinished);
 
     connect(ui->toDayLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::toDayEdited);
+            this, &TotalsWidget::movementLineEditEditingFinished);
     connect(ui->toNightLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::toNightedited);
+            this, &TotalsWidget::movementLineEditEditingFinished);
     connect(ui->ldgDayLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::ldgDayEdited);
+            this, &TotalsWidget::movementLineEditEditingFinished);
     connect(ui->ldgNightLineEdit, &QLineEdit::editingFinished,
-            this, &TotalsWidget::ldgNightEdited);
+            this, &TotalsWidget::movementLineEditEditingFinished);
 }
 
+/*!
+ * \brief TotalsWidget::verifyUserTimeInput verify the user input is correct or can be fixed
+ * \param line_edit the line edit that has been edited
+ * \param input the user input
+ * \return if the input is valid or can be fixed
+ */
 bool TotalsWidget::verifyUserTimeInput(QLineEdit *line_edit, const TimeInput &input)
 {
     if(!input.isValid()) {
@@ -154,163 +163,60 @@ bool TotalsWidget::verifyUserTimeInput(QLineEdit *line_edit, const TimeInput &in
     return true;
 }
 
-bool TotalsWidget::updateDatabase(const QString &db_field, const QString &value) {
-    m_rowData.insert(db_field, value);
-    const OPL::FlightEntry entry = OPL::FlightEntry(TOTALS_DATA_ROW_ID, m_rowData);
-
-    return DB->commit(entry);
-}
-
-void TotalsWidget::totalTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
-
-void TotalsWidget::spseTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
-
-void TotalsWidget::spmeTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
-
-void TotalsWidget::multipilotTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
-
-void TotalsWidget::picTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
+/*!
+ * \brief TotalsWidget::updateTimeEntry Updates the DB with a time entry
+ * \param line_edit The time line edit that has been edited
+ * \return true on success
+ */
+bool TotalsWidget::updateTimeEntry(const QLineEdit* line_edit) {
+    const QString db_field = line_edit->objectName().remove(QLatin1String("LineEdit"));
+    const QVariant value = OPL::Time::toMinutes(line_edit->text());
 
-void TotalsWidget::sicTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
+    m_rowData.insert(db_field, value);
 
-void TotalsWidget::dualTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
+    const auto previous_experience = OPL::FlightEntry(TOTALS_DATA_ROW_ID, m_rowData);
+    return DB->commit(previous_experience);
 }
 
-void TotalsWidget::fiTimeEdited()
+/*!
+ * \brief TotalsWidget::updateMovementEntry Updates the DB with a movement (TO or LDG) entry
+ * \param line_edit The line edit that has been edited
+ * \return true on success
+ */
+bool TotalsWidget::updateMovementEntry(const QLineEdit *line_edit)
 {
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
+    const QString db_field = line_edit->objectName().remove(QLatin1String("LineEdit"));
+    const QVariant value = line_edit->text().toInt();
 
-void TotalsWidget::picusTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
+    m_rowData.insert(db_field, value);
 
-void TotalsWidget::ifrTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
+    const auto previous_experience = OPL::FlightEntry(TOTALS_DATA_ROW_ID, m_rowData);
+    return DB->commit(previous_experience);
 }
 
-void TotalsWidget::nightTimeEdited()
+void TotalsWidget::timeLineEditEditingFinished()
 {
     LOG << sender()->objectName() + "Editing finished.";
     QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
-    }
-}
 
-void TotalsWidget::simulatorTimeEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-    QLineEdit* line_edit = this->findChild<QLineEdit*>(sender()->objectName());
-    if (verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
-        // write to DB
-    } else {
-        // (re-) set to previous value from DB (or 0)
+    // verify and if possible fix the user input
+    if (!verifyUserTimeInput(line_edit, TimeInput(line_edit->text()))) {
+        // (re-) set to previous value from DB
+        WARN(tr("Invalid time entry. Please use the following format:<br><br><tt> hh:mm </tt>"));
+        int old_value = m_rowData.value(line_edit->objectName().remove(QLatin1String("LineEdit"))).toInt();
+        line_edit->setText(OPL::Time::toString(old_value));
+        return;
     }
-}
 
-void TotalsWidget::toDayEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-}
-
-void TotalsWidget::toNightedited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
-}
+    // write the updated value to the database
+    updateTimeEntry(line_edit);
 
-void TotalsWidget::ldgDayEdited()
-{
-    LOG << sender()->objectName() + "Editing finished.";
 }
 
-void TotalsWidget::ldgNightEdited()
+void TotalsWidget::movementLineEditEditingFinished()
 {
+    // input validation is already done by the QValidator
     LOG << sender()->objectName() + "Editing finished.";
+    updateMovementEntry(this->findChild<QLineEdit*>(sender()->objectName()));
 }
 
-

+ 9 - 20
src/gui/widgets/totalswidget.h

@@ -24,33 +24,22 @@ public:
 
 private:
     Ui::TotalsWidget *ui;
+    /*!
+     * \brief m_rowData holds the data displayed in the line edits
+     */
     OPL::RowData_T m_rowData;
-    const QRegularExpressionValidator *m_timeValidator = new QRegularExpressionValidator(QRegularExpression("([01]?[0-9]|2[0-3]):?[0-5][0-9]?"), this);
     const static int TOTALS_DATA_ROW_ID = 1;
 
-    void fillTotals(WidgetType widgetType);
-    void setup(WidgetType widgetType);
+    void fillTotals(const WidgetType widgetType);
+    void setup(const WidgetType widgetType);
     void connectSignalsAndSlots();
     bool verifyUserTimeInput(QLineEdit *line_edit, const TimeInput &input);
-    bool updateDatabase(const QString &db_field, const QString &value);
+    bool updateTimeEntry(const QLineEdit* line_edit);
+    bool updateMovementEntry(const QLineEdit* line_edit);
 
 private slots:
-    void totalTimeEdited();
-    void spseTimeEdited();
-    void spmeTimeEdited();
-    void multipilotTimeEdited();
-    void picTimeEdited();
-    void sicTimeEdited();
-    void dualTimeEdited();
-    void fiTimeEdited();
-    void picusTimeEdited();
-    void ifrTimeEdited();
-    void nightTimeEdited();
-    void simulatorTimeEdited();
-    void toDayEdited();
-    void toNightedited();
-    void ldgDayEdited();
-    void ldgNightEdited();
+    void timeLineEditEditingFinished();
+    void movementLineEditEditingFinished();
 };
 
 #endif // TOTALSWIDGET_H

+ 175 - 162
src/gui/widgets/totalswidget.ui

@@ -16,8 +16,8 @@
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
     <layout class="QGridLayout" name="gridLayout_3">
-     <item row="0" column="0">
-      <widget class="QLabel" name="totalLabel">
+     <item row="2" column="2">
+      <widget class="QLabel" name="nightLabel_2">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -25,12 +25,25 @@
         </size>
        </property>
        <property name="text">
-        <string>Total</string>
+        <string>Night</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="tblkLineEdit">
+     <item row="7" column="2">
+      <widget class="QLabel" name="ldgnightLabel">
+       <property name="maximumSize">
+        <size>
+         <width>120</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>LDG Night</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="3">
+      <widget class="QLineEdit" name="toNightLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -43,21 +56,16 @@
          <height>16777215</height>
         </size>
        </property>
-       <property name="font">
-        <font>
-         <family>.AppleSystemUIFont</family>
-        </font>
-       </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
        <property name="text">
-        <string/>
+        <string>0</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="2">
-      <widget class="QLabel" name="picusLabel">
+     <item row="2" column="0">
+      <widget class="QLabel" name="spmeLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -65,12 +73,12 @@
         </size>
        </property>
        <property name="text">
-        <string>PICus</string>
+        <string>SP ME</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="3">
-      <widget class="QLineEdit" name="tPICUSLineEdit">
+     <item row="6" column="3">
+      <widget class="QLineEdit" name="ldgDayLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -84,25 +92,34 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
+       </property>
+       <property name="text">
+        <string>0</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="spseLabel">
+     <item row="3" column="1">
+      <widget class="QLineEdit" name="tMPLineEdit">
+       <property name="minimumSize">
+        <size>
+         <width>100</width>
+         <height>0</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="text">
-        <string>SP SE</string>
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="1" column="1">
-      <widget class="QLineEdit" name="tSPSELineEdit">
+     <item row="7" column="1">
+      <widget class="QLineEdit" name="tFILineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -116,12 +133,12 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="1" column="2">
-      <widget class="QLabel" name="ifrLabel">
+     <item row="6" column="0">
+      <widget class="QLabel" name="dualLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -129,44 +146,44 @@
         </size>
        </property>
        <property name="text">
-        <string>IFR</string>
+        <string>DUAL</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="3">
-      <widget class="QLineEdit" name="tIFRLineEdit">
-       <property name="minimumSize">
-        <size>
-         <width>100</width>
-         <height>0</height>
-        </size>
-       </property>
+     <item row="5" column="2">
+      <widget class="QLabel" name="tonightLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+       <property name="text">
+        <string>TO Night</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="spmeLabel">
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="tSPSELineEdit">
+       <property name="minimumSize">
+        <size>
+         <width>100</width>
+         <height>0</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="text">
-        <string>SP ME</string>
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="QLineEdit" name="tSPMELineEdit">
+     <item row="5" column="1">
+      <widget class="QLineEdit" name="tSICLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -180,25 +197,31 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="2" column="2">
-      <widget class="QLabel" name="nightLabel_2">
+     <item row="6" column="1">
+      <widget class="QLineEdit" name="tDUALLineEdit">
+       <property name="minimumSize">
+        <size>
+         <width>100</width>
+         <height>0</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="text">
-        <string>Night</string>
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="2" column="3">
-      <widget class="QLineEdit" name="tNIGHTLineEdit">
+     <item row="7" column="3">
+      <widget class="QLineEdit" name="ldgNightLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -212,12 +235,15 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
+       </property>
+       <property name="text">
+        <string>0</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="multipilotLabel">
+     <item row="4" column="0">
+      <widget class="QLabel" name="piclabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -225,31 +251,25 @@
         </size>
        </property>
        <property name="text">
-        <string>Multi Pilot</string>
+        <string>PIC</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="1">
-      <widget class="QLineEdit" name="tMPLineEdit">
-       <property name="minimumSize">
-        <size>
-         <width>100</width>
-         <height>0</height>
-        </size>
-       </property>
+     <item row="0" column="2">
+      <widget class="QLabel" name="picusLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+       <property name="text">
+        <string>PICus</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="2">
-      <widget class="QLabel" name="simLabel">
+     <item row="1" column="2">
+      <widget class="QLabel" name="ifrLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -257,12 +277,12 @@
         </size>
        </property>
        <property name="text">
-        <string>Simulator</string>
+        <string>IFR</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="3">
-      <widget class="QLineEdit" name="tSIMLineEdit">
+     <item row="0" column="3">
+      <widget class="QLineEdit" name="tPICUSLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -276,12 +296,12 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="4" column="0">
-      <widget class="QLabel" name="piclabel">
+     <item row="3" column="0">
+      <widget class="QLabel" name="multipilotLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -289,12 +309,12 @@
         </size>
        </property>
        <property name="text">
-        <string>PIC</string>
+        <string>Multi Pilot</string>
        </property>
       </widget>
      </item>
-     <item row="4" column="1">
-      <widget class="QLineEdit" name="tPICLineEdit">
+     <item row="2" column="3">
+      <widget class="QLineEdit" name="tNIGHTLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -308,20 +328,7 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="2">
-      <widget class="QLabel" name="todayLabel">
-       <property name="maximumSize">
-        <size>
-         <width>120</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <property name="text">
-        <string>TO Day</string>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
@@ -340,15 +347,15 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
        <property name="text">
         <string>0</string>
        </property>
       </widget>
      </item>
-     <item row="5" column="0">
-      <widget class="QLabel" name="sicLabel">
+     <item row="6" column="2">
+      <widget class="QLabel" name="ldgdayLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -356,31 +363,12 @@
         </size>
        </property>
        <property name="text">
-        <string>SIC</string>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="1">
-      <widget class="QLineEdit" name="tSICLineEdit">
-       <property name="minimumSize">
-        <size>
-         <width>100</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>120</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <string>LDG Day</string>
        </property>
       </widget>
      </item>
-     <item row="5" column="2">
-      <widget class="QLabel" name="tonightLabel">
+     <item row="3" column="2">
+      <widget class="QLabel" name="simLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -388,12 +376,12 @@
         </size>
        </property>
        <property name="text">
-        <string>TO Night</string>
+        <string>Simulator</string>
        </property>
       </widget>
      </item>
-     <item row="5" column="3">
-      <widget class="QLineEdit" name="toNightLineEdit">
+     <item row="3" column="3">
+      <widget class="QLineEdit" name="tSIMLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -407,15 +395,12 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
-       </property>
-       <property name="text">
-        <string>0</string>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="6" column="0">
-      <widget class="QLabel" name="dualLabel">
+     <item row="0" column="0">
+      <widget class="QLabel" name="totalLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -423,31 +408,38 @@
         </size>
        </property>
        <property name="text">
-        <string>DUAL</string>
+        <string>Total</string>
        </property>
       </widget>
      </item>
-     <item row="6" column="1">
-      <widget class="QLineEdit" name="tDUALLineEdit">
-       <property name="minimumSize">
+     <item row="1" column="0">
+      <widget class="QLabel" name="spseLabel">
+       <property name="maximumSize">
         <size>
-         <width>100</width>
-         <height>0</height>
+         <width>120</width>
+         <height>16777215</height>
         </size>
        </property>
+       <property name="text">
+        <string>SP SE</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="0">
+      <widget class="QLabel" name="sicLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+       <property name="text">
+        <string>SIC</string>
        </property>
       </widget>
      </item>
-     <item row="6" column="2">
-      <widget class="QLabel" name="ldgdayLabel">
+     <item row="7" column="0">
+      <widget class="QLabel" name="fiLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
@@ -455,12 +447,12 @@
         </size>
        </property>
        <property name="text">
-        <string>LDG Day</string>
+        <string>FI</string>
        </property>
       </widget>
      </item>
-     <item row="6" column="3">
-      <widget class="QLineEdit" name="ldgDayLineEdit">
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="tblkLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -474,41 +466,34 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
        </property>
        <property name="text">
-        <string>0</string>
+        <string/>
        </property>
       </widget>
      </item>
-     <item row="7" column="0">
-      <widget class="QLabel" name="fiLabel">
-       <property name="maximumSize">
+     <item row="1" column="3">
+      <widget class="QLineEdit" name="tIFRLineEdit">
+       <property name="minimumSize">
         <size>
-         <width>120</width>
-         <height>16777215</height>
+         <width>100</width>
+         <height>0</height>
         </size>
        </property>
-       <property name="text">
-        <string>FI</string>
-       </property>
-      </widget>
-     </item>
-     <item row="7" column="2">
-      <widget class="QLabel" name="ldgnightLabel">
        <property name="maximumSize">
         <size>
          <width>120</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="text">
-        <string>LDG Night</string>
+       <property name="focusPolicy">
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="7" column="3">
-      <widget class="QLineEdit" name="ldgNightLineEdit">
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="tSPMELineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -522,15 +507,12 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
-       </property>
-       <property name="text">
-        <string>0</string>
+        <enum>Qt::TabFocus</enum>
        </property>
       </widget>
      </item>
-     <item row="7" column="1">
-      <widget class="QLineEdit" name="tFILineEdit">
+     <item row="4" column="1">
+      <widget class="QLineEdit" name="tPICLineEdit">
        <property name="minimumSize">
         <size>
          <width>100</width>
@@ -544,7 +526,20 @@
         </size>
        </property>
        <property name="focusPolicy">
-        <enum>Qt::NoFocus</enum>
+        <enum>Qt::TabFocus</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="2">
+      <widget class="QLabel" name="todayLabel">
+       <property name="maximumSize">
+        <size>
+         <width>120</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>TO Day</string>
        </property>
       </widget>
      </item>
@@ -552,6 +547,24 @@
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>tblkLineEdit</tabstop>
+  <tabstop>tSPSELineEdit</tabstop>
+  <tabstop>tSPMELineEdit</tabstop>
+  <tabstop>tMPLineEdit</tabstop>
+  <tabstop>tPICLineEdit</tabstop>
+  <tabstop>tSICLineEdit</tabstop>
+  <tabstop>tDUALLineEdit</tabstop>
+  <tabstop>tFILineEdit</tabstop>
+  <tabstop>tPICUSLineEdit</tabstop>
+  <tabstop>tIFRLineEdit</tabstop>
+  <tabstop>tNIGHTLineEdit</tabstop>
+  <tabstop>tSIMLineEdit</tabstop>
+  <tabstop>toDayLineEdit</tabstop>
+  <tabstop>toNightLineEdit</tabstop>
+  <tabstop>ldgDayLineEdit</tabstop>
+  <tabstop>ldgNightLineEdit</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>