Browse Source

started Refactoring of NewFlightDialog

Refactoring NewFlightDialog to use new db architecture. Redesign from scratch since the old one is a mess.
Felix Turo 4 years ago
parent
commit
1ea7baf8e9

+ 3 - 0
openPilotLog.pro

@@ -35,6 +35,7 @@ SOURCES += \
     src/experimental/aflightentry.cpp \
     src/experimental/apilotentry.cpp \
     src/experimental/atailentry.cpp \
+    src/experimental/expnewflightdialog.cpp \
     src/functions/acalc.cpp \
     src/functions/areadcsv.cpp \
     src/functions/astat.cpp \
@@ -73,6 +74,7 @@ HEADERS += \
     src/experimental/apilotentry.h \
     src/experimental/atailentry.h \
     src/experimental/decl.h \
+    src/experimental/expnewflightdialog.h \
     src/functions/acalc.h \
     src/functions/areadcsv.h \
     src/functions/astat.h \
@@ -93,6 +95,7 @@ HEADERS += \
 
 FORMS += \
     mainwindow.ui \
+    src/experimental/expnewflightdialog.ui \
     src/gui/dialogues/firstrundialog.ui \
     src/gui/dialogues/newflight.ui \
     src/gui/dialogues/newpilot.ui \

+ 17 - 3
src/experimental/adatabase.cpp

@@ -363,7 +363,7 @@ AFlightEntry ADataBase::getFlightEntry(RowId row_id)
     return flight_entry;
 }
 
-const QStringList ADataBase::getCompletionList(ADataBase::CompleterTarget target)
+const QStringList ADataBase::getCompletionList(ADataBase::DatabaseTarget target)
 {
     QString statement;
 
@@ -376,7 +376,7 @@ const QStringList ADataBase::getCompletionList(ADataBase::CompleterTarget target
                          "UNION "
                          "SELECT make||\" \"||model||\"-\"||variant FROM aircraft WHERE variant IS NOT NULL");
         break;
-    case airports:
+    case airport_identifier:
         statement.append("SELECT icao FROM airports UNION SELECT iata FROM airports");
         break;
     case registrations:
@@ -385,6 +385,9 @@ const QStringList ADataBase::getCompletionList(ADataBase::CompleterTarget target
     case companies:
         statement.append("SELECT company FROM pilots");
         break;
+    default:
+        DEB("Not a valid completer target for this function.");
+        return QStringList();
     }
 
     QSqlQuery query;
@@ -406,7 +409,7 @@ const QStringList ADataBase::getCompletionList(ADataBase::CompleterTarget target
     return completer_list;
 }
 
-const QMap<QString, int> ADataBase::getIdMap(ADataBase::CompleterTarget target)
+const QMap<QString, int> ADataBase::getIdMap(ADataBase::DatabaseTarget target)
 {
     QString statement;
 
@@ -419,6 +422,17 @@ const QMap<QString, int> ADataBase::getIdMap(ADataBase::CompleterTarget target)
                          "UNION "
                          "SELECT ROWID, make||\" \"||model||\"-\"||variant FROM aircraft WHERE variant IS NOT NULL");
         break;
+    case airport_identifier:
+        statement.append("SELECT ROWID, icao FROM airports "
+                         "UNION "
+                         "SELECT ROWID, iata FROM airports WHERE iata IS NOT NULL");
+        break;
+    case airport_names:
+        statement.append("SELECT ROWID, name FROM airports");
+        break;
+    case tails:
+        statement.append("SELECT ROWID, registration FROM tails");
+        break;
     default:
         DEB("Not a valid completer target for this function.");
         return QMap<QString, int>();

+ 4 - 4
src/experimental/adatabase.h

@@ -56,7 +56,7 @@ public:
      * \brief The CompleterTarget enum provides the items for which QCompleter
      * completion lists are provided from the database.
      */
-    enum CompleterTarget {airports, pilots, registrations, aircraft, companies};
+    enum DatabaseTarget {airport_identifier, airport_names, pilots, registrations, aircraft, companies, tails};
 
     /*!
      * \brief Connect to the database and populate database information.
@@ -169,14 +169,14 @@ public:
      * QCompleter based on database values
      * \return
      */
-    const QStringList getCompletionList(CompleterTarget);
+    const QStringList getCompletionList(DatabaseTarget);
 
     /*!
-     * \brief getIdMap returns a map of a human-readable database value and
+     * \brief returns a QMap<QString, int> of a human-readable database value and
      * its row id. Used in the Dialogs to map user input to unique database entries.
      * \return
      */
-    const QMap<QString, int> getIdMap(CompleterTarget);
+    const QMap<QString, int> getIdMap(DatabaseTarget);
 signals:
     void sqlSuccessful();
 

+ 195 - 0
src/experimental/expnewflightdialog.cpp

@@ -0,0 +1,195 @@
+#include "expnewflightdialog.h"
+#include "ui_expnewflightdialog.h"
+
+using namespace experimental;
+
+static const auto IATA_RX = QLatin1String("[a-zA-Z0-9]{3}");
+static const auto ICAO_RX = QLatin1String("[a-zA-Z0-9]{4}");
+static const auto NAME_RX = QLatin1String("(\\p{L}+('|\\-)?)");//(\\p{L}+(\\s|'|\\-)?\\s?(\\p{L}+)?\\s?)
+static const auto ADD_NAME_RX = QLatin1String("(\\s?(\\p{L}+('|\\-)?))?");
+static const auto SELF_RX = QLatin1String("(self|SELF)");
+
+/// Raw Input validation
+static const auto TIME_VALID_RGX       = QRegularExpression("([01]?[0-9]|2[0-3]):?[0-5][0-9]?");// We only want to allow inputs that make sense as a time, e.g. 99:99 is not a valid time
+static const auto LOC_VALID_RGX        = QRegularExpression(IATA_RX + "|" + ICAO_RX);
+static const auto AIRCRAFT_VALID_RGX   = QRegularExpression("[A-Z0-9]+\\-?[A-Z0-9]+");
+static const auto NAME_VALID_RGX = QRegularExpression(SELF_RX + QLatin1Char('|')
+                                                     + NAME_RX + ADD_NAME_RX + ADD_NAME_RX + ADD_NAME_RX + ",?\\s?" // up to 4 first names
+                                                     + NAME_RX + ADD_NAME_RX + ADD_NAME_RX + ADD_NAME_RX );// up to 4 last names
+static const auto DATE_VALID_RGX       = QRegularExpression("^([1-9][0-9]{3}).?(1[0-2]|0[1-9]).?(3[01]|0[1-9]|[12][0-9])?$");// . allows all seperators, still allows for 2020-02-31, additional verification via QDate::isValid()
+
+
+ExpNewFlightDialog::ExpNewFlightDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::ExpNewFlightDialog)
+{
+    ui->setupUi(this);
+    flightEntry = AFlightEntry();
+    setupRawInputValidation();
+    setupMandatoryLineEdits();
+}
+
+ExpNewFlightDialog::ExpNewFlightDialog(int row_id, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::ExpNewFlightDialog)
+{
+    ui->setupUi(this);
+    flightEntry = aDB()->getFlightEntry(row_id);
+    setupRawInputValidation();
+    setupMandatoryLineEdits();
+}
+
+ExpNewFlightDialog::~ExpNewFlightDialog()
+{
+    delete ui;
+}
+
+void ExpNewFlightDialog::onGoodInputReceived(QLineEdit *line_edit)
+{
+    DEB(line_edit->objectName() << " - Good input received - " << line_edit->text());
+    mandatoryLineEditsGood.setBit(mandatoryLineEdits.indexOf(line_edit), true);
+    DEB("Mandatory Good: " << mandatoryLineEditsGood);
+}
+
+void ExpNewFlightDialog::onBadInputReceived(QLineEdit *line_edit)
+{
+    DEB(line_edit->objectName() << " - Bad input received - " << line_edit->text());
+    mandatoryLineEditsGood.setBit(mandatoryLineEdits.indexOf(line_edit), false);
+    DEB("Mandatory Good: " << mandatoryLineEditsGood);
+}
+
+void ExpNewFlightDialog::setupRawInputValidation()
+{
+    //get Completer Lists
+    pilotList   = aDB()->getCompletionList(ADataBase::pilots);
+    tailsList   = aDB()->getCompletionList(ADataBase::registrations);
+    airportList = aDB()->getCompletionList(ADataBase::airport_identifier);
+    // define tuples
+    const std::tuple<QString, QStringList*, QRegularExpression>
+            location_line_edit_settings = {"Loc", &airportList, LOC_VALID_RGX};
+    const std::tuple<QString, QStringList*, QRegularExpression>
+            name_line_edit_settings = {"Name", &pilotList, NAME_VALID_RGX};
+    const std::tuple<QString, QStringList*, QRegularExpression>
+            acft_line_edit_settings = {"acft", &tailsList, AIRCRAFT_VALID_RGX};
+    const QList<std::tuple<QString, QStringList*, QRegularExpression>> line_edit_settings = {
+        location_line_edit_settings,
+        name_line_edit_settings,
+        acft_line_edit_settings
+    };
+
+    //get line edits, set up completers and validators
+    auto line_edits = ui->flightDataTab_2->findChildren<QLineEdit*>();
+
+    for (const auto &item : line_edit_settings) {
+        for (const auto &line_edit : line_edits) {
+            if(line_edit->objectName().contains(std::get<0>(item))) {
+                DEB("Setting up: " << line_edit->objectName());
+                auto completer = new QCompleter(*std::get<1>(item), line_edit);
+                completer->setCaseSensitivity(Qt::CaseInsensitive);
+                completer->setCompletionMode(QCompleter::PopupCompletion);
+                completer->setFilterMode(Qt::MatchContains);
+                auto validator = new AStrictRxValidator(std::get<2>(item), line_edit);
+                line_edit->setCompleter(completer);
+                line_edit->setValidator(validator);
+            }
+        }
+    }
+    // get Maps
+    pilotsIdMap = aDB()->getIdMap(ADataBase::pilots);
+    tailsIdMap  = aDB()->getIdMap(ADataBase::tails);
+    airportIdentifierIdMap = aDB()->getIdMap(ADataBase::airport_identifier);
+    airportNameIdMap = aDB()->getIdMap(ADataBase::airport_names);
+}
+
+void ExpNewFlightDialog::setupMandatoryLineEdits()
+{
+    QObject::connect(this, &ExpNewFlightDialog::goodInputReceived,
+                     this, &ExpNewFlightDialog::onGoodInputReceived);
+    QObject::connect(this, &ExpNewFlightDialog::badInputReceived,
+                     this, &ExpNewFlightDialog::onBadInputReceived);
+    this->mandatoryLineEdits = {
+        ui->doftLineEdit_2,
+        ui->deptLocLineEdit_2,
+        ui->destLocLineEdit_2,
+        ui->tofbTimeLineEdit_2,
+        ui->tonbTimeLineEdit_2,
+        ui->picNameLineEdit_2,
+        ui->acftLineEdit_2,
+    };
+    mandatoryLineEditsGood.resize(mandatoryLineEdits.size());
+    DEB("Mandatory Good: " << mandatoryLineEditsGood);
+
+    for(const auto &line_edit : mandatoryLineEdits){
+        QObject::connect(line_edit, &QLineEdit::inputRejected,
+                         this, &ExpNewFlightDialog::onInputRejected);
+        if(line_edit->objectName().contains("Loc") || line_edit->objectName().contains("acft")){
+            QObject::connect(line_edit, &QLineEdit::textChanged,
+                             this, &ExpNewFlightDialog::onTextChangedToUpper);
+        }
+    }
+}
+
+void ExpNewFlightDialog::on_deptLocLineEdit_2_editingFinished()
+{
+    auto line_edit = ui->deptLocLineEdit_2;
+    const auto &text = line_edit->text();
+
+    if (airportIdentifierIdMap.value(text) != 0) {
+        ui->deptNameLabel_2->setText(airportNameIdMap.key(airportIdentifierIdMap.value(text)));
+        emit goodInputReceived(line_edit);
+    } else {
+        emit badInputReceived(line_edit);
+    }
+}
+
+void ExpNewFlightDialog::on_destLocLineEdit_2_editingFinished()
+{
+    auto line_edit = ui->destLocLineEdit_2;
+    const auto &text = line_edit->text();
+    if (airportIdentifierIdMap.value(text) != 0) {
+        ui->destNameLabel_2->setText(airportNameIdMap.key(airportIdentifierIdMap.value(text)));
+        emit goodInputReceived(line_edit);
+    } else {
+        emit badInputReceived(line_edit);
+    }
+}
+
+void ExpNewFlightDialog::onInputRejected()
+{
+    auto sender_object = sender();
+    auto line_edit = this->findChild<QLineEdit*>(sender_object->objectName());
+    DEB(line_edit->objectName() << "Input Rejected - " << line_edit->text());
+    {
+        const QSignalBlocker blocker(line_edit);
+        auto text = line_edit->text();
+        line_edit->setText(text);
+        if(line_edit->objectName().contains("Loc") || line_edit->objectName().contains("acft"))
+            line_edit->setText(text.toUpper());
+    }
+    emit badInputReceived(line_edit);
+}
+
+void ExpNewFlightDialog::onTextChangedToUpper(const QString &text)
+{
+    auto sender_object = sender();
+    auto line_edit = this->findChild<QLineEdit*>(sender_object->objectName());
+    DEB("Text changed - " << line_edit->objectName() << line_edit->text());
+    {
+        const QSignalBlocker blocker(line_edit);
+        line_edit->setText(text.toUpper());
+    }
+}
+
+void ExpNewFlightDialog::on_acftLineEdit_2_editingFinished()
+{
+    DEB(sender()->objectName() << "Editing Finished!");
+    auto line_edit = ui->acftLineEdit_2;
+    line_edit->setText(line_edit->completer()->currentCompletion());
+
+    if(tailsIdMap.value(line_edit->text()) == 0) {
+        emit badInputReceived(line_edit);
+        // to do: promp user to add new
+    } else {
+        emit goodInputReceived(line_edit);
+    }
+}

+ 82 - 0
src/experimental/expnewflightdialog.h

@@ -0,0 +1,82 @@
+#ifndef EXPNEWFLIGHTDIALOG_H
+#define EXPNEWFLIGHTDIALOG_H
+
+#include <QDialog>
+#include <QRegularExpression>
+#include <QMessageBox>
+#include <QDebug>
+#include <QCompleter>
+#include <QLatin1Char>
+#include <QStringList>
+#include <QStringListModel>
+#include <QSortFilterProxyModel>
+#include <QButtonGroup>
+#include <QBitArray>
+#include <QLineEdit>
+#include <QCalendarWidget>
+#include <QTabWidget>
+
+#include "src/classes/astrictrxvalidator.h"
+
+#include "src/experimental/adatabase.h"
+#include "src/experimental/aflightentry.h"
+#include "src/experimental/apilotentry.h"
+#include "src/experimental/atailentry.h"
+
+namespace Ui {
+class ExpNewFlightDialog;
+}
+
+class ExpNewFlightDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit ExpNewFlightDialog(QWidget *parent = nullptr);
+    explicit ExpNewFlightDialog(int row_id, QWidget *parent = nullptr);
+    ~ExpNewFlightDialog();
+
+signals:
+    void goodInputReceived(QLineEdit*);
+    void badInputReceived(QLineEdit*);
+
+private slots:
+
+    void onGoodInputReceived(QLineEdit*);
+    void onBadInputReceived(QLineEdit*);
+
+    void on_deptLocLineEdit_2_editingFinished();
+
+    void onInputRejected();
+
+    void onTextChangedToUpper(const QString&);
+
+    void on_acftLineEdit_2_editingFinished();
+
+    void on_destLocLineEdit_2_editingFinished();
+
+private:
+    Ui::ExpNewFlightDialog *ui;
+
+    experimental::AFlightEntry flightEntry;
+
+    QList<QLineEdit*> mandatoryLineEdits;
+
+    QBitArray mandatoryLineEditsGood;
+
+    QStringList pilotList;
+    QStringList tailsList;
+    QStringList airportList;
+
+    QMap<QString, int> pilotsIdMap;
+    QMap<QString, int> tailsIdMap;
+    QMap<QString, int> airportIdentifierIdMap;
+    QMap<QString, int> airportNameIdMap;
+
+    void setupRawInputValidation();
+    void setupMandatoryLineEdits();
+
+    void setupValidators();
+};
+
+#endif // EXPNEWFLIGHTDIALOG_H

+ 1390 - 0
src/experimental/expnewflightdialog.ui

@@ -0,0 +1,1390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ExpNewFlightDialog</class>
+ <widget class="QDialog" name="ExpNewFlightDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1614</width>
+    <height>790</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_7">
+   <item row="0" column="0" colspan="3">
+    <widget class="QTabWidget" name="flightDataTabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="flightDataTab_2">
+      <attribute name="title">
+       <string>Flight Data</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="9" column="0" colspan="6">
+        <widget class="Line" name="line_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="5">
+        <widget class="QLineEdit" name="RemarksLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="placeholderText">
+          <string>optional</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="3">
+        <widget class="QLabel" name="autoPicusLabel_2">
+         <property name="text">
+          <string>PICus</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="4">
+        <widget class="QLabel" name="tonbLabel_2">
+         <property name="text">
+          <string>Time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="15" column="3">
+        <widget class="QLabel" name="autoFILabel_2">
+         <property name="text">
+          <string>Instructor</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="2">
+        <widget class="QLabel" name="tSPMELabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="0">
+        <widget class="QLabel" name="autoSPMELabel_2">
+         <property name="text">
+          <string>SP / ME</string>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="0">
+        <widget class="QLabel" name="autoTotalLabel_2">
+         <property name="text">
+          <string>Total Time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QLabel" name="placeLabel2_2">
+         <property name="text">
+          <string>Place</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="0">
+        <widget class="QLabel" name="FlightNumberLabel_2">
+         <property name="text">
+          <string>Flight number</string>
+         </property>
+        </widget>
+       </item>
+       <item row="15" column="4" colspan="2">
+        <widget class="QLabel" name="tFILabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="3">
+        <widget class="QLabel" name="picLabel_2">
+         <property name="text">
+          <string>Name PIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0">
+        <widget class="QLabel" name="acftLabel_2">
+         <property name="text">
+          <string>Aircraft</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0">
+        <widget class="QLabel" name="doftLabel_2">
+         <property name="text">
+          <string>Date of Flight</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="3">
+        <widget class="QComboBox" name="deptTZ_2">
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;UTC - Universal Time Coordinated&lt;/p&gt;&lt;p&gt;LOCAL - Local time at Airfield&lt;/p&gt;&lt;p&gt;BASE - Local time at Home Base&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <item>
+          <property name="text">
+           <string>UTC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Local</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="1" column="5">
+        <widget class="QLineEdit" name="tofbTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#a8abb0;&quot;&gt;Enter a valid time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; color:#a8abb0;&quot;&gt;e.g.: 845 0845 8:45 08:45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="whatsThis">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="maxLength">
+          <number>5</number>
+         </property>
+         <property name="placeholderText">
+          <string>00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="13" column="0">
+        <widget class="QLabel" name="autoMPLabel_2">
+         <property name="text">
+          <string>Multi Pilot</string>
+         </property>
+        </widget>
+       </item>
+       <item row="14" column="2">
+        <widget class="QLabel" name="tIFRLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="2">
+        <widget class="QLineEdit" name="acftLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="placeholderText">
+          <string>D-LMAO</string>
+         </property>
+        </widget>
+       </item>
+       <item row="14" column="4" colspan="2">
+        <widget class="QLabel" name="tDUALLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLabel" name="placeLabel1_2">
+         <property name="text">
+          <string>Place</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="destLabel_2">
+         <property name="text">
+          <string>Destination</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2">
+        <widget class="QLineEdit" name="destLocLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>Enter the ICAO 4-letter Identifier of the Airport</string>
+         </property>
+         <property name="inputMethodHints">
+          <set>Qt::ImhNone</set>
+         </property>
+         <property name="inputMask">
+          <string/>
+         </property>
+         <property name="maxLength">
+          <number>4</number>
+         </property>
+         <property name="placeholderText">
+          <string>EDDF</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <widget class="QLineEdit" name="deptLocLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>Enter the ICAO 4-letter Identifier of the Airport</string>
+         </property>
+         <property name="inputMethodHints">
+          <set>Qt::ImhNone</set>
+         </property>
+         <property name="inputMask">
+          <string/>
+         </property>
+         <property name="maxLength">
+          <number>4</number>
+         </property>
+         <property name="placeholderText">
+          <string>KJFK</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="0">
+        <widget class="QLabel" name="secondPilotLabel_2">
+         <property name="text">
+          <string>Second Pilot</string>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="0">
+        <widget class="QLabel" name="autoSPSELabel_2">
+         <property name="text">
+          <string>SP / SE</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="3">
+        <widget class="QComboBox" name="destTZ_2">
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;UTC - Universal Time Coordinated&lt;/p&gt;&lt;p&gt;LOCAL - Local time at Airfield&lt;/p&gt;&lt;p&gt;BASE - Local time at Home Base&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <item>
+          <property name="text">
+           <string>UTC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Local</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="6" column="2">
+        <widget class="QLabel" name="acftTypeLabel_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="3">
+        <widget class="QLabel" name="autoPICLabel_2">
+         <property name="text">
+          <string>PIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="deptLabel_2">
+         <property name="text">
+          <string>Departure</string>
+         </property>
+        </widget>
+       </item>
+       <item row="14" column="3">
+        <widget class="QLabel" name="autoDualLabel_2">
+         <property name="text">
+          <string>Dual</string>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="4" colspan="2">
+        <widget class="QLabel" name="tPICLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2">
+        <widget class="QLabel" name="deptNameLabel_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="13" column="2">
+        <widget class="QLabel" name="tMPLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="15" column="2">
+        <widget class="QLabel" name="tNIGHTLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="2">
+        <widget class="QLineEdit" name="secondPilotNameLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="placeholderText">
+          <string>optional</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="2">
+        <widget class="QLineEdit" name="FlightNumberLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="placeholderText">
+          <string>optional</string>
+         </property>
+        </widget>
+       </item>
+       <item row="13" column="4" colspan="2">
+        <widget class="QLabel" name="tSICLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="3">
+        <widget class="QLabel" name="thirdPilotLabel_2">
+         <property name="text">
+          <string>Third Pilot</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="4" colspan="2">
+        <widget class="QLabel" name="tPICUSLabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="5">
+        <widget class="QLineEdit" name="tonbTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#a8abb0;&quot;&gt;Enter a valid time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; color:#a8abb0;&quot;&gt;e.g.: 845 0845 8:45 08:45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="whatsThis">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="placeholderText">
+          <string>00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="5">
+        <widget class="QLineEdit" name="picNameLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="placeholderText">
+          <string>self</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="4">
+        <widget class="QLabel" name="tofbLabel_2">
+         <property name="text">
+          <string>Time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="5">
+        <widget class="QLineEdit" name="thirdPilotNameLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="placeholderText">
+          <string>optional</string>
+         </property>
+        </widget>
+       </item>
+       <item row="15" column="0">
+        <widget class="QLabel" name="autoNightLabel_2">
+         <property name="text">
+          <string>Night</string>
+         </property>
+        </widget>
+       </item>
+       <item row="14" column="0">
+        <widget class="QLabel" name="autoIFRLabel_2">
+         <property name="text">
+          <string>IFR</string>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="2">
+        <widget class="QLabel" name="tSPSELabel_2">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true"/>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QLineEdit" name="doftLineEdit_2"/>
+       </item>
+       <item row="8" column="3">
+        <widget class="QLabel" name="RemarksLabel_2">
+         <property name="text">
+          <string>Remarks</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="2">
+        <widget class="QLabel" name="destNameLabel_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="2">
+        <widget class="QLabel" name="tblkLabel_3">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Once all the required items are filled out, the total time of flight will be displayed here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">color: yellow;</string>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::NoFrame</enum>
+         </property>
+         <property name="frameShadow">
+          <enum>QFrame::Plain</enum>
+         </property>
+         <property name="text">
+          <string> 00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="13" column="3">
+        <widget class="QLabel" name="autoSICLabel_2">
+         <property name="text">
+          <string>SIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="5">
+        <widget class="QLabel" name="doftDisplayLabel_2">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="autoLoggingTab_2">
+      <attribute name="title">
+       <string>Auto-Logging</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_5">
+       <item row="0" column="0">
+        <widget class="QLabel" name="FunctionLabel_2">
+         <property name="text">
+          <string>Function</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QComboBox" name="FunctionComboBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>140</width>
+           <height>20</height>
+          </size>
+         </property>
+         <item>
+          <property name="text">
+           <string>PIC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>PICUS</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>SIC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Dual</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Instructor</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="0" column="3">
+        <widget class="QLabel" name="TaskLabel_2">
+         <property name="text">
+          <string>Task</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="4">
+        <widget class="QCheckBox" name="PilotFlyingCheckBox_2">
+         <property name="toolTip">
+          <string>Assumes T/O and LDG performed. If not, edit details.</string>
+         </property>
+         <property name="text">
+          <string>PF</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+         <property name="autoExclusive">
+          <bool>false</bool>
+         </property>
+         <property name="tristate">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>Approach </string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QComboBox" name="ApproachComboBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>140</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="currentText">
+          <string>ILS CAT I</string>
+         </property>
+         <item>
+          <property name="text">
+           <string>ILS CAT I</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>ILS CAT II</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>ILS CAT III</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Visual</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>RNAV</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>RNAV (RNP)</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>RNAV (RNP AR)</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>VOR</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>NDB</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>LOC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>GLS</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>MLS</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>SRA</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="1" column="4">
+        <widget class="QCheckBox" name="PilotMonitoringCheckBox_2">
+         <property name="text">
+          <string>PM</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QCheckBox" name="TakeoffCheckBox_2">
+         <property name="toolTip">
+          <string/>
+         </property>
+         <property name="text">
+          <string>Take Off</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QSpinBox" name="TakeoffSpinBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>140</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="value">
+          <number>1</number>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="3">
+        <widget class="QLabel" name="RulesLabel_2">
+         <property name="text">
+          <string>Rules</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="4">
+        <widget class="QCheckBox" name="VfrCheckBox_2">
+         <property name="text">
+          <string>VFR</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QCheckBox" name="LandingCheckBox_2">
+         <property name="text">
+          <string>Landing</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QSpinBox" name="LandingSpinBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>140</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="value">
+          <number>1</number>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="4">
+        <widget class="QCheckBox" name="IfrCheckBox_2">
+         <property name="toolTip">
+          <string/>
+         </property>
+         <property name="text">
+          <string>IFR</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0">
+        <widget class="QCheckBox" name="AutolandCheckBox_2">
+         <property name="text">
+          <string>Autoland</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QSpinBox" name="AutolandSpinBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>140</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0">
+        <widget class="QPushButton" name="setAsDefaultButton_2">
+         <property name="toolTip">
+          <string>Set current selection as default</string>
+         </property>
+         <property name="text">
+          <string>Set As Default</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1">
+        <widget class="QPushButton" name="restoreDefaultButton_2">
+         <property name="toolTip">
+          <string>Restore previously stored default selection</string>
+         </property>
+         <property name="text">
+          <string>Restore Default</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="0" colspan="5">
+        <widget class="Line" name="line_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="1">
+        <widget class="QCheckBox" name="manualEditingCheckBox_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Enable Manual Editing</string>
+         </property>
+         <property name="checkable">
+          <bool>true</bool>
+         </property>
+         <property name="autoRepeat">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="0">
+        <widget class="QLabel" name="spse_Label_2">
+         <property name="text">
+          <string>SP SE</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="1">
+        <widget class="QLineEdit" name="tSPSETimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="2">
+        <widget class="QLabel" name="picTimeLabel_3">
+         <property name="text">
+          <string>PIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="4">
+        <widget class="QLineEdit" name="tPICTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="0">
+        <widget class="QLabel" name="spmeLabel_2">
+         <property name="text">
+          <string>SP ME</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="1">
+        <widget class="QLineEdit" name="tSPMETimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="2">
+        <widget class="QLabel" name="picTimeLabel_4">
+         <property name="text">
+          <string>PICUS</string>
+         </property>
+        </widget>
+       </item>
+       <item row="9" column="4">
+        <widget class="QLineEdit" name="tPICUSTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="0">
+        <widget class="QLabel" name="mpLabel_2">
+         <property name="text">
+          <string>MP</string>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="1">
+        <widget class="QLineEdit" name="tMPTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="2">
+        <widget class="QLabel" name="coPilotTimeLabel_2">
+         <property name="text">
+          <string>Co-Pilot</string>
+         </property>
+        </widget>
+       </item>
+       <item row="10" column="4">
+        <widget class="QLineEdit" name="tSICTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="0">
+        <widget class="QLabel" name="ifrLabel_2">
+         <property name="text">
+          <string>IFR</string>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="1">
+        <widget class="QLineEdit" name="tIFRTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="2">
+        <widget class="QLabel" name="dualTimeLabel_2">
+         <property name="text">
+          <string>Dual</string>
+         </property>
+        </widget>
+       </item>
+       <item row="11" column="4">
+        <widget class="QLineEdit" name="tDUALTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="0">
+        <widget class="QLabel" name="nightLabel_2">
+         <property name="text">
+          <string>Night</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="1">
+        <widget class="QLineEdit" name="tNIGHTTimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="2">
+        <widget class="QLabel" name="fiTimeLabel_2">
+         <property name="text">
+          <string>FI</string>
+         </property>
+        </widget>
+       </item>
+       <item row="12" column="4">
+        <widget class="QLineEdit" name="tFITimeLineEdit_2">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="2">
+        <widget class="QLabel" name="tblkLabel_4">
+         <property name="text">
+          <string>Total</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="4">
+        <widget class="QLineEdit" name="tblkTimeLineEdit_2"/>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="calendarTab_2">
+      <attribute name="title">
+       <string>Calendar</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_6">
+       <item row="0" column="0">
+        <widget class="QCalendarWidget" name="calendarWidget_2">
+         <property name="gridVisible">
+          <bool>false</bool>
+         </property>
+         <property name="horizontalHeaderFormat">
+          <enum>QCalendarWidget::SingleLetterDayNames</enum>
+         </property>
+         <property name="verticalHeaderFormat">
+          <enum>QCalendarWidget::NoVerticalHeader</enum>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="verifyButton">
+     <property name="text">
+      <string>DebugButton</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QLineEdit" name="verifyEdit">
+     <property name="placeholderText">
+      <string>Debug Text</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 15 - 1
src/gui/dialogues/newflightdialog.cpp

@@ -108,6 +108,20 @@ NewFlightDialog::NewFlightDialog(QWidget *parent, Flight oldFlight, Db::editRole
     formFiller(oldFlight);
 }
 
+NewFlightDialog::NewFlightDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::NewFlight)
+{
+    DEB("Not implemented atm.");
+}
+
+NewFlightDialog::NewFlightDialog(QWidget *parent, int old_flight) :
+    QDialog(parent),
+    ui(new Ui::NewFlight)
+{
+    DEB("Not implemented atm. old flight: " << old_flight);
+}
+
 NewFlightDialog::~NewFlightDialog()
 {
     DEB("Deleting NewFlight\n");
@@ -185,7 +199,7 @@ void NewFlightDialog::setup(){
     //fill Lists
     pilots   = experimental::aDB()->getCompletionList(experimental::ADataBase::pilots);
     tails    = experimental::aDB()->getCompletionList(experimental::ADataBase::registrations);
-    airports = experimental::aDB()->getCompletionList(experimental::ADataBase::airports);
+    airports = experimental::aDB()->getCompletionList(experimental::ADataBase::airport_identifier);
 
     QString statement = "SELECT iata, icao FROM airports";
     auto result = Db::customQuery(statement,2);

+ 2 - 0
src/gui/dialogues/newflightdialog.h

@@ -85,6 +85,8 @@ class NewFlightDialog : public QDialog
 public:
     explicit NewFlightDialog(QWidget *parent, Db::editRole edRole);
     explicit NewFlightDialog(QWidget *parent, Flight oldFlight, Db::editRole edRole);
+    explicit NewFlightDialog(QWidget *parent);
+    explicit NewFlightDialog(QWidget *parent, int old_flight);
     ~NewFlightDialog();
 
     //QStringList* getResult();

+ 1 - 1
src/gui/widgets/aircraftwidget.cpp

@@ -128,7 +128,7 @@ void AircraftWidget::on_deleteButton_clicked()
     }
 }
 
-void AircraftWidget::on_newButton_clicked()
+void AircraftWidget::on_newAircraftButton_clicked()
 {
     auto nt = NewTailDialog(QString(), this);
     connect(&nt, SIGNAL(accepted()), this, SLOT(acft_editing_finished()));

+ 1 - 1
src/gui/widgets/aircraftwidget.h

@@ -49,7 +49,7 @@ private slots:
 
     void on_deleteButton_clicked();
 
-    void on_newButton_clicked();
+    void on_newAircraftButton_clicked();
 
     void acft_editing_finished();
 

+ 1 - 1
src/gui/widgets/aircraftwidget.ui

@@ -153,7 +153,7 @@
     </layout>
    </item>
    <item row="1" column="0">
-    <widget class="QPushButton" name="newButton">
+    <widget class="QPushButton" name="newAircraftButton">
      <property name="text">
       <string>New Aircraft</string>
      </property>

+ 3 - 1
src/gui/widgets/debugwidget.cpp

@@ -164,7 +164,9 @@ void DebugWidget::on_importCsvPushButton_clicked()
 
 void DebugWidget::on_debugPushButton_clicked()
 {
-
+    using namespace experimental;
+    auto nf = new ExpNewFlightDialog(7, this);
+    nf->exec();
 }
 
 /* //Comparing two functions template

+ 1 - 0
src/gui/widgets/debugwidget.h

@@ -17,6 +17,7 @@
 #include "src/experimental/adatabase.h"
 #include "src/experimental/aentry.h"
 #include "src/experimental/apilotentry.h"
+#include "src/experimental/expnewflightdialog.h"
 
 #include "src/testing/abenchmark.h"
 #include "src/testing/atimer.h"

+ 1 - 1
src/gui/widgets/logbookwidget.cpp

@@ -289,7 +289,7 @@ void LogbookWidget::on_tableView_doubleClicked()
     emit ui->editFlightButton->clicked();
 }
 
-void LogbookWidget::on_flightSearchComboBox_currentIndexChanged()
+void LogbookWidget::on_flightSearchComboBox_currentIndexChanged(int)
 {
     emit ui->showAllButton->clicked();
 }

+ 1 - 1
src/gui/widgets/logbookwidget.h

@@ -69,7 +69,7 @@ private slots:
 
     void on_flightSearchLlineEdit_textChanged(const QString &arg1);
 
-    void on_flightSearchComboBox_currentIndexChanged();
+    void on_flightSearchComboBox_currentIndexChanged(int);
 
 private:
     Ui::LogbookWidget *ui;

+ 2 - 2
src/gui/widgets/pilotswidget.cpp

@@ -111,7 +111,7 @@ void PilotsWidget::tableView_headerClicked(int column)
     ASettings::write("userdata/pilSortColumn", column);
 }
 
-void PilotsWidget::on_newButton_clicked()
+void PilotsWidget::on_newPilotButton_clicked()
 {
     NewPilotDialog* np = new NewPilotDialog(this);
     QObject::connect(np,   &QDialog::accepted,
@@ -122,7 +122,7 @@ void PilotsWidget::on_newButton_clicked()
     np->exec();
 }
 
-void PilotsWidget::on_deletePushButton_clicked()
+void PilotsWidget::on_deletePilotButton_clicked()
 {
     if (selectedPilots.length() == 0) {
         auto mb = QMessageBox(this);

+ 2 - 2
src/gui/widgets/pilotswidget.h

@@ -45,9 +45,9 @@ private slots:
 
     void tableView_headerClicked(int);
 
-    void on_newButton_clicked();
+    void on_newPilotButton_clicked();
 
-    void on_deletePushButton_clicked();
+    void on_deletePilotButton_clicked();
 
     void on_deleteUnsuccessful();
 

+ 2 - 2
src/gui/widgets/pilotswidget.ui

@@ -139,14 +139,14 @@
     </layout>
    </item>
    <item row="1" column="0">
-    <widget class="QPushButton" name="newPilotPushButton">
+    <widget class="QPushButton" name="newPilotButton">
      <property name="text">
       <string>New Pilot</string>
      </property>
     </widget>
    </item>
    <item row="2" column="0">
-    <widget class="QPushButton" name="deletPilotButton">
+    <widget class="QPushButton" name="deletePilotButton">
      <property name="text">
       <string>Delete Pilot</string>
      </property>