Ver Fonte

UI Redesign

Felix Turo há 3 anos atrás
pai
commit
55671db7fa

+ 4 - 1
CMakeLists.txt

@@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON)
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTORCC ON)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
 set(QT_MIN_VERSION "5.5.1")
@@ -48,6 +48,7 @@ set(PROJECT_SOURCES
     src/functions/adate.cpp
     src/gui/dialogues/firstrundialog.cpp
     src/gui/dialogues/newflightdialog.cpp
+    src/gui/dialogues/newnewflightdialog.cpp
     src/gui/dialogues/newpilotdialog.cpp
     src/gui/dialogues/newtaildialog.cpp
     src/gui/widgets/aircraftwidget.cpp
@@ -89,6 +90,7 @@ set(PROJECT_SOURCES
     src/functions/atime.h
     src/gui/dialogues/firstrundialog.h
     src/gui/dialogues/newflightdialog.h
+    src/gui/dialogues/newnewflightdialog.h
     src/gui/dialogues/newpilotdialog.h
     src/gui/dialogues/newtaildialog.h
     src/gui/widgets/aircraftwidget.h
@@ -103,6 +105,7 @@ set(PROJECT_SOURCES
     mainwindow.ui
     src/gui/dialogues/firstrundialog.ui
     src/gui/dialogues/newflight.ui
+    src/gui/dialogues/newnewflightdialog.ui
     src/gui/dialogues/newpilot.ui
     src/gui/dialogues/newtail.ui
     src/gui/widgets/aircraftwidget.ui

+ 46 - 4
mainwindow.cpp

@@ -15,6 +15,7 @@
  *You should have received a copy of the GNU General Public License
  *along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
+#include <QToolBar>
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
 #include "src/functions/alog.h"
@@ -23,11 +24,13 @@
 #include "src/gui/dialogues/firstrundialog.h"
 #include "src/classes/aentry.h"
 
+
 // Quick and dirty Debug area
-#include "src/testing/importCrewlounge/importcrewlounge.h"
+#include "src/gui/dialogues/newnewflightdialog.h"
 void MainWindow::doDebugStuff()
 {
-    ImportCrewlounge::exec(QString());
+    NewNewFlightDialog nf(completionData, this);
+    nf.exec();
 }
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
@@ -58,6 +61,7 @@ MainWindow::MainWindow(QWidget *parent)
     // retreive completion lists and maps
     completionData.init();
 
+    /*
     // Create a spacer for the toolbar to separate left and right parts
     auto *spacer = new QWidget();
     spacer->setMinimumWidth(1);
@@ -79,6 +83,7 @@ MainWindow::MainWindow(QWidget *parent)
     for (const auto &button : buttons) {
         button->setMinimumWidth(128);
     }
+    */
 
     // Construct Widgets
     homeWidget = new HomeWidget(this);
@@ -102,6 +107,31 @@ MainWindow::MainWindow(QWidget *parent)
     // Startup Screen (Home Screen)
     ui->stackedWidget->setCurrentWidget(homeWidget);
 
+    // Create and set up the toolbar
+    auto *toolBar = new QToolBar(this);
+
+    ui->actionHome->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_HOME));
+    toolBar->addAction(ui->actionHome);
+    ui->actionNewFlight->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_NEW_FLIGHT));
+    toolBar->addAction(ui->actionNewFlight);
+    ui->actionLogbook->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_LOGBOOK));
+    toolBar->addAction(ui->actionLogbook);
+    ui->actionAircraft->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_AIRCRAFT));
+    toolBar->addAction(ui->actionAircraft);
+    ui->actionPilots->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_PILOT));
+    toolBar->addAction(ui->actionPilots);
+    ui->actionBackup->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_BACKUP));
+    toolBar->addAction(ui->actionBackup);
+    ui->actionSettings->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_SETTINGS));
+    toolBar->addAction(ui->actionSettings);
+    ui->actionQuit->setIcon(QIcon(Opl::Assets::ICON_TOOLBAR_QUIT));
+    toolBar->addAction(ui->actionQuit);
+
+    int icon_size = (this->height() / 8) * 0.95;
+    toolBar->setIconSize(QSize(icon_size, icon_size));
+    toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+    addToolBar(Qt::ToolBarArea::LeftToolBarArea, toolBar);
+
 
     // check database version (Debug)
     if (aDB->dbRevision() < aDB->getMinimumDatabaseRevision()) {
@@ -213,8 +243,20 @@ void MainWindow::on_actionHome_triggered()
 void MainWindow::on_actionNewFlight_triggered()
 {
     completionData.update();
-    NewFlightDialog nf(completionData, this);
-    nf.exec();
+    //NewFlightDialog nf(completionData, this);
+    //nf.exec();
+
+    auto* nf = new NewFlightDialog(completionData, this);
+    //QObject::connect(nf,   &QDialog::accepted,
+    //                 this, &AircraftWidget::onNewTailDialog_editingFinished);
+    //QObject::connect(nf,   &QDialog::rejected,
+    //                 this, &AircraftWidget::onNewTailDialog_editingFinished);
+    ui->stackedWidget->addWidget(nf);
+    ui->stackedWidget->setCurrentWidget(nf);
+    nf->setWindowFlag(Qt::Widget);
+    nf->setAttribute(Qt::WA_DeleteOnClose);
+    nf->exec();
+    ui->stackedWidget->setCurrentWidget(logbookWidget);
 }
 
 void MainWindow::on_actionLogbook_triggered()

+ 0 - 37
mainwindow.ui

@@ -40,43 +40,6 @@
    </layout>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
-  <widget class="QToolBar" name="toolBar">
-   <property name="sizePolicy">
-    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>12</width>
-     <height>12</height>
-    </size>
-   </property>
-   <property name="toolButtonStyle">
-    <enum>Qt::ToolButtonTextUnderIcon</enum>
-   </property>
-   <property name="floatable">
-    <bool>false</bool>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionHome"/>
-   <addaction name="actionNewFlight"/>
-   <addaction name="actionLogbook"/>
-   <addaction name="actionAircraft"/>
-   <addaction name="actionPilots"/>
-   <addaction name="actionBackup"/>
-   <addaction name="actionSettings"/>
-   <addaction name="actionQuit"/>
-  </widget>
   <action name="actionNewFlight">
    <property name="text">
     <string>NewFlight</string>

+ 1 - 8
src/classes/aentry.h

@@ -26,13 +26,6 @@
 
 #include "src/database/adatabasetypes.h"
 
-// [G]: Define what data is public and what not. For objects such as
-// DataPosition which are consumable its no biggy. Are entries the same?
-// If so we could avoid getters and setters
-// [F]: In the way we are using the entries atm, we do access and edit the
-// TableData quite frequently. Maybe the data could be public, but the
-// position private? Except for creating a new entry, the position should
-// never really be changed.
 /*!
  * \brief The Entry class encapsulates table metadata(table name, row id)
  *  and data for new and existing entries in the database to operate on.
@@ -43,7 +36,7 @@ protected:
 public:
     RowData_T tableData;
 public:
-    AEntry() = delete; // Demand specificity from default constructor
+    AEntry() = delete;
     AEntry(const AEntry&) = default;
     AEntry& operator=(const AEntry&) = default;
     AEntry(DataPosition position_);

+ 14 - 38
src/database/adatabase.cpp

@@ -35,27 +35,11 @@ const QStringList ADatabase::templateTableNames = {
     QStringLiteral("changelog")
 };
 
-
-ADatabaseError::ADatabaseError(QString msg_)
-    : QSqlError::QSqlError(QString(), msg_, QSqlError::UnknownError, QLatin1String("opl"))
-{}
-
-ADatabaseError::ADatabaseError(QSqlError err_)
-    : QSqlError(err_)
-{};
-
-QString ADatabaseError::text() const
-{
-    return QLatin1String("Database Error: ") + QSqlError::text();
-}
-
 ADatabase* ADatabase::self = nullptr;
 
 ADatabase::ADatabase()
     : databaseFile(QFileInfo(AStandardPaths::directory(AStandardPaths::Database).
-                             absoluteFilePath(QStringLiteral("logbook.db"))
-                             )
-                   )
+                             absoluteFilePath(QStringLiteral("logbook.db"))))
 {}
 
 int ADatabase::dbRevision() const
@@ -130,13 +114,10 @@ void ADatabase::updateLayout()
 
 ADatabase* ADatabase::instance()
 {
-#ifdef __GNUC__
-    return self ?: self = new ADatabase();  // Cheeky business...
-#else
     if(!self)
         self = new ADatabase();
+
     return self;
-#endif
 }
 
 
@@ -201,8 +182,7 @@ bool ADatabase::commit(const AEntry &entry)
 bool ADatabase::remove(const AEntry &entry)
 {
     if (!exists(entry)) {
-        DEB << "Error: Database entry not found.";
-        lastError = ADatabaseError(QStringLiteral("Database entry not found."));
+        LOG << "Error: Database entry not found.";
         return false;
     }
 
@@ -215,7 +195,7 @@ bool ADatabase::remove(const AEntry &entry)
 
     if (query.exec())
     {
-        DEB << "Entry " << entry.getPosition() << " removed.";
+        LOG << "Entry " << entry.getPosition() << " removed.";
         emit dataBaseUpdated();
         return true;
     } else {
@@ -236,7 +216,6 @@ bool ADatabase::removeMany(QList<DataPosition> data_position_list)
 
     for (const auto& data_position : data_position_list) {
         if (!exists(data_position)) {
-            lastError = ADatabaseError("Database entry not found.");
             errorCount++;
         }
         QString statement = QLatin1String("DELETE FROM ") + data_position.tableName +
@@ -253,17 +232,19 @@ bool ADatabase::removeMany(QList<DataPosition> data_position_list)
         query.prepare(QStringLiteral("COMMIT"));
         if(query.exec()) {
             emit dataBaseUpdated();
+            LOG << "Transaction successfull.";
             return true;
         } else {
-            DEB << "Transaction unsuccessful (Interrupted). Error count: "
+            LOG << "Transaction unsuccessful (Interrupted). Error count: "
                         + QString::number(errorCount);
+            DEB << query.lastError().text();
             lastError = query.lastError();
             return false;
         }
     } else {
         query.prepare(QStringLiteral("ROLLBACK"));
         query.exec();
-        DEB << "Transaction unsuccessful (no changes have been made). Error count: "
+        LOG << "Transaction unsuccessful (no changes have been made). Error count: "
                     + QString::number(errorCount);
         return false;
     }
@@ -293,8 +274,7 @@ bool ADatabase::exists(const AEntry &entry)
     if (rowId) {
         return true;
     } else {
-        DEB << "Database entry not found.";
-        lastError = ADatabaseError(QStringLiteral("Database entry not found."));
+        LOG << "Database entry not found.";
         return false;
     }
 }
@@ -315,15 +295,14 @@ bool ADatabase::exists(DataPosition data_position)
     //this returns either 1 or 0 since row ids are unique
     if (!query.isActive()) {
         lastError = query.lastError();
-        DEB << "Query Error: " << query.lastError().text() << statement;
+        LOG << "Query Error: " << query.lastError().text() << statement;
     }
     query.next();
     int rowId = query.value(0).toInt();
     if (rowId) {
         return true;
     } else {
-        DEB << "No entry exists at DataPosition: " << data_position.tableName << data_position.rowId;
-        lastError = ADatabaseError(QStringLiteral("Database entry not found."));
+        LOG << "No entry exists at DataPosition: " << data_position.tableName << data_position.rowId;
         return false;
     }
 }
@@ -446,8 +425,7 @@ RowData_T ADatabase::getEntryData(DataPosition data_position)
     }
     check_query.next();
     if (check_query.value(0).toInt() == 0) {
-        DEB << "No Entry found for row id: " << data_position.rowId;
-        lastError = ADatabaseError("Database entry not found.");
+        LOG << "No Entry found for row id: " << data_position.rowId;
         return RowData_T();
     }
 
@@ -641,8 +619,7 @@ RowId_T ADatabase::getLastEntry(ADatabaseTable table)
     if (query.first()) {
         return query.value(0).toInt();
     } else {
-        lastError = ADatabaseError(QStringLiteral("Database entry not found."));
-        DEB << "No entry found.";
+        LOG << "No entry found. (Database empty?)" << query.lastError().text();
         return 0;
     }
 }
@@ -704,10 +681,9 @@ QVector<QVariant> ADatabase::customQuery(QString statement, int return_values)
     }
 
     if (!query.first()) {
-        DEB << "No result found. Check Query and Error.";
+        LOG << "No result found. Check Query and Error.";
         DEB << "Error: " << query.lastError().text();
         DEB << "Statement: " << statement;
-        lastError = ADatabaseError("No result found.");
         return QVector<QVariant>();
     } else {
         query.first();

+ 1 - 1
src/database/adatabase.h

@@ -149,7 +149,7 @@ private:
     const static int minimumDatabaseRevision;
 public:
     /*!
-     * \brief lastError extends QSqlError. Holds information about the last error that ocurred during
+     * \brief Holds information about the last error that ocurred during
      * a SQL operation. If the error type is QSqlError::UnknownError, the error is related to data
      * from the database (entry not found,...), otherwise the error is related to SQL execution. In this
      * case error.type() provides further information.

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

@@ -49,6 +49,7 @@ NewFlightDialog::NewFlightDialog(ACompletionData &completion_data,
         ui->picNameLineEdit->setText(SELF);
         emit ui->picNameLineEdit->editingFinished();
     }
+    CRIT("Time empty bug - check verification logic");
 }
 
 NewFlightDialog::NewFlightDialog(ACompletionData &completion_data,

+ 66 - 0
src/gui/dialogues/newnewflightdialog.cpp

@@ -0,0 +1,66 @@
+#include "newnewflightdialog.h"
+#include "ui_newnewflightdialog.h"
+#include "src/opl.h"
+#include "src/functions/alog.h"
+#include <QDateTime>
+#include <QCompleter>
+
+NewNewFlightDialog::NewNewFlightDialog(ACompletionData &completion_data,
+                                       QWidget *parent)
+    : QDialog(parent),
+      ui(new Ui::NewNewFlightDialog),
+      completionData(completion_data)
+{
+    ui->setupUi(this);
+    init();
+}
+
+NewNewFlightDialog::~NewNewFlightDialog()
+{
+    delete ui;
+}
+
+void NewNewFlightDialog::init()
+{
+    // Initialise line edit lists
+    QList<QLineEdit*> time_line_edits = {ui->tofbTimeLineEdit, ui->tonbTimeLineEdit};
+    timeLineEdits = &time_line_edits;
+    QList<QLineEdit*> location_line_edits = {ui->deptLocationLineEdit, ui->destLocationLineEdit};
+    locationLineEdits = &location_line_edits;
+    QList<QLineEdit*> pilot_name_line_edits = {ui->picNameLineEdit, ui->sicNameLineEdit, ui->thirdPilotNameLineEdit};
+    pilotNameLineEdits = &pilot_name_line_edits;
+
+    setupRawInputValidation();
+    //setupSignalsAndSlots();
+    //readSettings();
+
+    ui->doftLineEdit->setText(QDate::currentDate().toString(Qt::ISODate));
+}
+
+void NewNewFlightDialog::setupRawInputValidation()
+{
+    for (const auto& line_edit : *timeLineEdits) {
+        DEB << "Setting up: " << line_edit->objectName();
+        auto validator = new QRegularExpressionValidator(QRegularExpression("([01]?[0-9]|2[0-3]):?[0-5][0-9]?"), line_edit);
+        line_edit->setValidator(validator);
+    }
+
+    for (const auto& line_edit : *locationLineEdits) {
+        auto validator = new QRegularExpressionValidator(QRegularExpression("[a-zA-Z0-9]{1,4}"), line_edit);
+        line_edit->setValidator(validator);
+
+        auto completer = new QCompleter(completionData.airportList, line_edit);
+        completer->setCaseSensitivity(Qt::CaseInsensitive);
+        completer->setCompletionMode(QCompleter::PopupCompletion);
+        completer->setFilterMode(Qt::MatchContains);
+        line_edit->setCompleter(completer);
+    }
+
+    for (const auto& line_edit : *pilotNameLineEdits) {
+        auto completer = new QCompleter(completionData.pilotList, line_edit);
+        completer->setCaseSensitivity(Qt::CaseInsensitive);
+        completer->setCompletionMode(QCompleter::PopupCompletion);
+        completer->setFilterMode(Qt::MatchContains);
+        line_edit->setCompleter(completer);
+    }
+}

+ 104 - 0
src/gui/dialogues/newnewflightdialog.h

@@ -0,0 +1,104 @@
+#ifndef NEWNEWFLIGHTDIALOG_H
+#define NEWNEWFLIGHTDIALOG_H
+
+#include <QDialog>
+#include <QDebug>
+#include <QLineEdit>
+#include <QList>
+#include <QBitArray>
+
+#include "src/functions/atime.h"
+#include "src/classes/acompletiondata.h"
+#include "src/classes/aflightentry.h"
+#include "src/classes/apilotentry.h"
+#include "src/classes/atailentry.h"
+#include "src/database/adatabase.h"
+
+/*!
+ * \brief The ValidationItem enum contains the items that are mandatory for logging a flight:
+ * Date of Flight, Departure, Destination, Time Off Blocks, Time On Blocks, Pilot in Command, Aircraft Registration
+ */
+enum ValidationItem {doft, dept, dest, tofb, tonb, pic, acft};
+
+/*!
+ * \brief The ValidationState class encapsulates a QBitArray that has a bit set (or unset) depending on wether the
+ * input for the associated index has been verified. The indexes correspond to the mandatory items enumerated in the
+ * ValidationItem enum.
+ */
+class ValidationState {
+public:
+    ValidationState() = default;
+
+    void validate(ValidationItem line_edit)   { validationArray[line_edit] = true;};
+    void invalidate(ValidationItem line_edit) { validationArray[line_edit] = false;}
+    bool allValid()                           { return validationArray.count(true) == 6;};
+    bool timesValid()                         { return validationArray[ValidationItem::tofb] && validationArray[ValidationItem::tonb];}
+    bool locationsValid()                     { return validationArray[ValidationItem::dept] && validationArray[ValidationItem::dest];}
+    bool acftValid()                          { return validationArray[ValidationItem::acft];}
+
+    // Debug
+    void printValidationStatus(){
+        QString deb_string("Validation State:\tdoft\tdept\tdest\ttofb\ttonb\tpic\tacft\n");
+        deb_string += "\t\t\t\t\t" + QString::number(validationArray[0]);
+        deb_string += "\t" + QString::number(validationArray[1]);
+        deb_string += "\t" + QString::number(validationArray[2]);
+        deb_string += "\t" + QString::number(validationArray[3]);
+        deb_string += "\t" + QString::number(validationArray[4]);
+        deb_string += "\t" + QString::number(validationArray[5]);
+        deb_string += "\t" + QString::number(validationArray[6]);
+        qDebug().noquote() << deb_string;
+    }
+private:
+    QBitArray validationArray = QBitArray(7);
+};
+
+/*!
+ * \brief The ValidationSetupData struct encapsulates the items required to initialise
+ * the line edits with QValidators and QCompleters
+ */
+struct ValidationSetupData
+{
+    ValidationSetupData(const QStringList& completion_data, const QRegularExpression& validation_RegEx)
+        : completionList(completion_data), validationRegEx(validation_RegEx){};
+
+    ValidationSetupData(const QStringList& completion_data)
+        : completionList(completion_data){
+    };
+
+    ValidationSetupData(const QRegularExpression& validation_RegEx)
+        : completionList(nullptr), validationRegEx(validation_RegEx){};
+
+    const QStringList completionList;
+    const QRegularExpression validationRegEx;
+};
+
+namespace Ui {
+class NewNewFlightDialog;
+}
+
+class NewNewFlightDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit NewNewFlightDialog(ACompletionData& completion_data, QWidget *parent = nullptr);
+    ~NewNewFlightDialog();
+
+private:
+    Ui::NewNewFlightDialog *ui;
+    ACompletionData completionData;
+    ValidationState validationState;
+
+    static const inline QList<QLineEdit*>* timeLineEdits;
+    static const inline QList<QLineEdit*>* locationLineEdits;
+    static const inline QList<QLineEdit*>* pilotNameLineEdits;
+    static const inline QLatin1String self = QLatin1String("self");
+
+    void init();
+    void setupRawInputValidation();
+    void setupSignalsAndSlots();
+    void readSettings();
+
+};
+
+#endif // NEWNEWFLIGHTDIALOG_H

+ 520 - 0
src/gui/dialogues/newnewflightdialog.ui

@@ -0,0 +1,520 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>NewNewFlightDialog</class>
+ <widget class="QDialog" name="NewNewFlightDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>943</width>
+    <height>288</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_4">
+   <item row="0" column="0">
+    <spacer name="leftSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>48</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="5">
+    <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>
+   <item row="0" column="1" colspan="5">
+    <layout class="QGridLayout" name="gridLayout_3">
+     <item row="0" column="0">
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="1" column="0">
+        <widget class="QLabel" name="deptLabel">
+         <property name="text">
+          <string>Departure</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="tofbLabel">
+         <property name="text">
+          <string>Off Blocks</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2">
+        <widget class="QLabel" name="destNameLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>DestName</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="5">
+        <widget class="QLabel" name="remarksSpacerLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>invis</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="3">
+        <widget class="QLabel" name="picLabel">
+         <property name="text">
+          <string>PIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLineEdit" name="doftLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="4">
+        <widget class="QLineEdit" name="thirdPilotNameLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="5">
+        <widget class="QLabel" name="sicNameDisplayLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>SicName</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="4">
+        <widget class="QLineEdit" name="remarksLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <widget class="QLabel" name="deptNameLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>DeptName</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="2">
+        <widget class="QLabel" name="submissionReadyLabel">
+         <property name="text">
+          <string>Data Missing</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="5">
+        <widget class="QLabel" name="picNameDisplayLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>PicName</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLineEdit" name="deptLocationLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="4">
+        <widget class="QLineEdit" name="picNameLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QPushButton" name="calendarPushButton">
+         <property name="text">
+          <string>Calendar</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QLineEdit" name="tonbTimeLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="5">
+        <widget class="QLabel" name="flightNumberSpacerLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>invis</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0">
+        <widget class="QLabel" name="doftLabel">
+         <property name="text">
+          <string>Date of flight</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="3">
+        <widget class="QLabel" name="acftLabel">
+         <property name="text">
+          <string>Aircraft</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="destLabel">
+         <property name="text">
+          <string>Destination</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="tonbLabel">
+         <property name="text">
+          <string>On Blocks</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QLineEdit" name="tofbTimeLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="3">
+        <widget class="QLabel" name="flightNumberLabel">
+         <property name="text">
+          <string>Flight Number</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="5">
+        <widget class="QLabel" name="acftDisplayLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>AircraftName</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QLineEdit" name="destLocationLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="4">
+        <widget class="QLineEdit" name="flightNumberLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="2">
+        <widget class="QLabel" name="tonbSpacerLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>invis</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0">
+        <widget class="QLabel" name="tblkLabel">
+         <property name="text">
+          <string>Total Time</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="3">
+        <widget class="QLabel" name="thirdPilotLabel">
+         <property name="text">
+          <string>Third Pilot</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="4">
+        <widget class="QLineEdit" name="sicNameLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="3">
+        <widget class="QLabel" name="remarksLabel">
+         <property name="text">
+          <string>Remarks</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1">
+        <widget class="QLabel" name="tblkDisplayLabel">
+         <property name="text">
+          <string>00:00</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2">
+        <widget class="QLabel" name="tofbSpacerLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>invis</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="4">
+        <widget class="QLineEdit" name="acftLineEdit">
+         <property name="maximumSize">
+          <size>
+           <width>120</width>
+           <height>16777215</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="3">
+        <widget class="QLabel" name="sicLabel">
+         <property name="text">
+          <string>SIC</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="5">
+        <widget class="QLabel" name="thirdPilotNameDisplayLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>ThirdName</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item row="0" column="1">
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0" colspan="2">
+        <widget class="QCheckBox" name="pilotFlyingCheckBox">
+         <property name="text">
+          <string>Pilot Flying</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QCheckBox" name="ifrCheckBox">
+         <property name="text">
+          <string>IFR</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="takeOffLabel">
+         <property name="text">
+          <string>Take Off</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QSpinBox" name="takeOffSpinBox"/>
+       </item>
+       <item row="1" column="2">
+        <widget class="QCheckBox" name="toNightCheckBox">
+         <property name="text">
+          <string>Night</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="landingLabel">
+         <property name="text">
+          <string>Landing</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QSpinBox" name="landingSpinBox"/>
+       </item>
+       <item row="2" column="2">
+        <widget class="QCheckBox" name="ldgNightCheckBox">
+         <property name="text">
+          <string>Night</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="functionLabel">
+         <property name="text">
+          <string>Function</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" colspan="2">
+        <widget class="QComboBox" name="functionComboBox">
+         <item>
+          <property name="text">
+           <string>PIC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>SIC</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>FI</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>DUAL</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="approachLabel">
+         <property name="text">
+          <string>Approach</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1" colspan="2">
+        <widget class="QComboBox" name="approachComboBox"/>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="6">
+    <spacer name="rightSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>48</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="pushButton_2">
+     <property name="text">
+      <string>Details</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QToolButton" name="toolButton">
+     <property name="text">
+      <string>?</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>NewNewFlightDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>NewNewFlightDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

+ 80 - 50
src/gui/widgets/logbookwidget.cpp

@@ -22,6 +22,7 @@
 #include "src/database/adatabase.h"
 #include "src/classes/asettings.h"
 #include "src/gui/dialogues/newflightdialog.h"
+#include "src/gui/dialogues/newnewflightdialog.h"
 #include "src/functions/alog.h"
 #include "src/functions/alog.h"
 
@@ -40,7 +41,6 @@ LogbookWidget::LogbookWidget(ACompletionData& completion_data, QWidget *parent)
     completionData(completion_data)
 {
     ui->setupUi(this);
-    ui->newFlightButton->setFocus();
 
     //customContextMenu for tablewidget
     menu  = new QMenu(this);
@@ -130,54 +130,56 @@ void LogbookWidget::flightsTableView_selectionChanged()
         selectedFlights.append(row.data().toInt());
         DEB << "Selected Flight(s) with ID: " << selectedFlights;
     }
+    if (selectedFlights.length() == 1)
+        on_actionEdit_Flight_triggered();
 }
 
 /*!
  * \brief LogbookWidget::on_newFlightButton_clicked opens a NewFlightDialog
  */
-void LogbookWidget::on_newFlightButton_clicked()
-{
-    auto old_state = aDB->getUserDataState();
-
-    NewFlightDialog nf(completionData, this);
-    nf.exec();
-
-    auto new_state = aDB->getUserDataState();
-    if (old_state != new_state)
-        completionData.update();
-
-    displayModel->select();
-}
+//void LogbookWidget::on_newFlightButton_clicked()
+//{
+//    auto old_state = aDB->getUserDataState();
+//
+//    NewFlightDialog nf(completionData, this);
+//    nf.exec();
+//
+//    auto new_state = aDB->getUserDataState();
+//    if (old_state != new_state)
+//        completionData.update();
+//
+//    displayModel->select();
+//}
 
 /*!
  * \brief LogbookWidget::on_editFlightButton_clicked opens a NewFlightDialog and
  * pre-fills the data from the selected flight.
  */
-void LogbookWidget::on_editFlightButton_clicked()
-{
-    if(selectedFlights.length() == 1){
-        auto old_state = aDB->getUserDataState();
-
-        auto ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
-        ef->exec();
-
-        auto new_state = aDB->getUserDataState();
-        if (old_state != new_state)
-            completionData.update();
-        displayModel->select();
-    } else if (selectedFlights.isEmpty()) {
-        WARN(tr("<br>No flight selected.<br>"));
-    } else {
-        WARN(tr("<br>More than one flight selected."
-                               "<br><br>Editing multiple entries is not yet supported."));
-    }
-}
+//void LogbookWidget::on_editFlightButton_clicked()
+//{
+//    if(selectedFlights.length() == 1){
+//        auto old_state = aDB->getUserDataState();
+//
+//        auto ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
+//        ef->exec();
+//
+//        auto new_state = aDB->getUserDataState();
+//        if (old_state != new_state)
+//            completionData.update();
+//        displayModel->select();
+//    } else if (selectedFlights.isEmpty()) {
+//        WARN(tr("<br>No flight selected.<br>"));
+//    } else {
+//        WARN(tr("<br>More than one flight selected."
+//                               "<br><br>Editing multiple entries is not yet supported."));
+//    }
+//}
 
 /*!
- * \brief LogbookWidget::on_deleteFlightPushButton_clicked If a row is selected, query information
+ * \brief If a row is selected, query information
  * about the affected row(s) and ask the user to confirm deletion.
  */
-void LogbookWidget::on_deleteFlightPushButton_clicked()
+void LogbookWidget::on_actionDelete_Flight_triggered()
 {
     DEB << "Flights selected: " << selectedFlights.length();
     if (selectedFlights.length() == 0) {
@@ -231,7 +233,7 @@ void LogbookWidget::on_deleteFlightPushButton_clicked()
                            ).arg(QString::number(selectedFlights.length())));
         if(confirm.exec() == QMessageBox::Yes) {
             QList<DataPosition> selected_flights;
-            for (const auto& flight_id : selectedFlights) {
+            for (const auto& flight_id : qAsConst(selectedFlights)) {
                 selected_flights.append({QStringLiteral("flights"), flight_id});
             }
             if (!aDB->removeMany(selected_flights)) {
@@ -252,24 +254,52 @@ void LogbookWidget::on_tableView_customContextMenuRequested(const QPoint &pos)
     menu->popup(ui->tableView->viewport()->mapToGlobal(pos));
 }
 
-void LogbookWidget::on_actionDelete_Flight_triggered()
-{
-    emit ui->deleteFlightPushButton->clicked();
-}
-
 void LogbookWidget::on_actionEdit_Flight_triggered()
 {
-    emit ui->editFlightButton->clicked();
+    if(selectedFlights.length() == 1){
+        auto old_state = aDB->getUserDataState();
+
+        //auto ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
+        //ef->exec();
+
+        //!
+        //! \brief new_state
+        //auto* ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
+        //ui->stackedWidget->addWidget(ef);
+        //ui->stackedWidget->setCurrentWidget(ef);
+        //ef->setWindowFlag(Qt::Widget);
+        //ef->setAttribute(Qt::WA_DeleteOnClose);
+        //ef->exec();
+        //ui->stackedWidget->setCurrentWidget(logbookWidget);
+        //!
+        //! \brief new_state
+        NewNewFlightDialog nff(completionData, this);
+        ui->stackedWidget->addWidget(&nff);
+        ui->stackedWidget->setCurrentWidget(&nff);
+        nff.setWindowFlag(Qt::Widget);
+        //nff.setAttribute(Qt::WA_DeleteOnClose);
+        nff.exec();
+
+        auto new_state = aDB->getUserDataState();
+        if (old_state != new_state)
+            completionData.update();
+        displayModel->select();
+    } else if (selectedFlights.isEmpty()) {
+        WARN(tr("<br>No flight selected.<br>"));
+    } else {
+        WARN(tr("<br>More than one flight selected."
+                               "<br><br>Editing multiple entries is not yet supported."));
+    }
 }
 
 void LogbookWidget::on_tableView_doubleClicked()
 {
-    emit ui->editFlightButton->clicked();
+    on_actionEdit_Flight_triggered();
 }
 
 void LogbookWidget::on_flightSearchComboBox_currentIndexChanged(int)
 {
-    emit ui->showAllButton->clicked();
+    //emit ui->showAllButton->clicked();
 }
 
 /*!
@@ -287,12 +317,12 @@ void LogbookWidget::onLogbookWidget_viewSelectionChanged(SettingsWidget::Setting
         setupModelAndView(ASettings::read(ASettings::Main::LogbookView).toInt());
 }
 
-void LogbookWidget::on_showAllButton_clicked()
-{
-    ui->flightSearchLlineEdit->setText(QString());
-    displayModel->setFilter(QString());
-    displayModel->select();
-}
+//void LogbookWidget::on_showAllButton_clicked()
+//{
+//    ui->flightSearchLlineEdit->setText(QString());
+//    displayModel->setFilter(QString());
+//    displayModel->select();
+//}
 
 /*!
  * \brief LogbookWidget::on_flightSearchLlineEdit_textChanged applies a filter to the

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

@@ -52,10 +52,10 @@ public:
     ~LogbookWidget();
 
 private slots:
-    void on_newFlightButton_clicked();
-    void on_editFlightButton_clicked();
-    void on_deleteFlightPushButton_clicked();
-    void on_showAllButton_clicked();
+    //void on_newFlightButton_clicked();
+    //void on_editFlightButton_clicked();
+    //void on_deleteFlightPushButton_clicked();
+    //void on_showAllButton_clicked();
     void flightsTableView_selectionChanged();
     void on_tableView_customContextMenuRequested(const QPoint &pos);
     void on_actionDelete_Flight_triggered();

+ 110 - 132
src/gui/widgets/logbookwidget.ui

@@ -14,7 +14,7 @@
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" colspan="3">
+   <item row="0" column="0">
     <widget class="QTableView" name="tableView">
      <property name="font">
       <font>
@@ -32,140 +32,118 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="0" rowspan="2">
-    <widget class="QPushButton" name="newFlightButton">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>New Flight</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QLabel" name="flightSearchLabel">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Search Flight</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="2">
-    <widget class="QLineEdit" name="flightSearchLlineEdit">
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter the searchterm you want to filter your flights by.&lt;/p&gt;&lt;p&gt;For dates, make sure to use the format YYYY-MM-DD&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>
-    </widget>
-   </item>
-   <item row="2" column="2" rowspan="2">
-    <widget class="QComboBox" name="flightSearchComboBox">
-     <item>
-      <property name="text">
-       <string>Date of Flight</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Departure Airport</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Destination Airport</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Aircraft Registration</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Pilot Name</string>
-      </property>
-     </item>
-    </widget>
-   </item>
-   <item row="3" column="0">
-    <widget class="QPushButton" name="editFlightButton">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Edit Flight</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <widget class="QLabel" name="flightSearchInLabel">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Search in</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="0">
-    <widget class="QPushButton" name="deleteFlightPushButton">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Delete Flight</string>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="1">
-    <widget class="QLabel" name="spacerLabel">
-     <property name="minimumSize">
-      <size>
-       <width>200</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="2">
-    <widget class="QPushButton" name="showAllButton">
-     <property name="text">
-      <string>Show All Flights</string>
-     </property>
+   <item row="1" column="0">
+    <widget class="QStackedWidget" name="stackedWidget">
+     <widget class="QWidget" name="defaultPage">
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0">
+        <widget class="QLabel" name="flightSearchLabel">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Search Flight</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLineEdit" name="flightSearchLlineEdit">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter the searchterm you want to filter your flights by.&lt;/p&gt;&lt;p&gt;For dates, make sure to use the format YYYY-MM-DD&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>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="flightSearchInLabel">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Search by</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QComboBox" name="flightSearchComboBox">
+         <item>
+          <property name="text">
+           <string>Date of Flight</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Departure Airport</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Destination Airport</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Aircraft Registration</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Pilot Name</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="2" column="0" colspan="2">
+        <widget class="QLabel" name="label">
+         <property name="text">
+          <string>Select a Flight from the list to show or edit details.</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
   </layout>
+  <widget class="QLabel" name="spacerLabel">
+   <property name="geometry">
+    <rect>
+     <x>284</x>
+     <y>410</y>
+     <width>200</width>
+     <height>16</height>
+    </rect>
+   </property>
+   <property name="minimumSize">
+    <size>
+     <width>200</width>
+     <height>0</height>
+    </size>
+   </property>
+   <property name="text">
+    <string/>
+   </property>
+   <property name="alignment">
+    <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+   </property>
+  </widget>
   <action name="actionEdit_Flight">
    <property name="text">
     <string>Edit Flight</string>