Browse Source

added Validators and update mechanism for user data in settings widget

fiffty-50 4 years ago
parent
commit
f0dde9f7c3

+ 9 - 9
src/gui/dialogues/newpilot.cpp

@@ -21,25 +21,25 @@
 #define DEB(expr) \
 #define DEB(expr) \
     qDebug() << __PRETTY_FUNCTION__ << "\t" << expr
     qDebug() << __PRETTY_FUNCTION__ << "\t" << expr
 
 
-const auto FIRSTNAME_VALID = QPair<QString, QRegularExpression> {
+static const auto FIRSTNAME_VALID = QPair<QString, QRegularExpression> {
     "picfirstnameLineEdit", QRegularExpression("[a-zA-Z]+")};
     "picfirstnameLineEdit", QRegularExpression("[a-zA-Z]+")};
-const auto LASTNAME_VALID = QPair<QString, QRegularExpression> {
+static const auto LASTNAME_VALID = QPair<QString, QRegularExpression> {
     "piclastnameLineEdit", QRegularExpression("\\w+")};
     "piclastnameLineEdit", QRegularExpression("\\w+")};
-const auto PHONE_VALID = QPair<QString, QRegularExpression> {
+static const auto PHONE_VALID = QPair<QString, QRegularExpression> {
     "phoneLineEdit", QRegularExpression("^[+]{0,1}[0-9\\-\\s]+")};
     "phoneLineEdit", QRegularExpression("^[+]{0,1}[0-9\\-\\s]+")};
-const auto EMAIL_VALID = QPair<QString, QRegularExpression> {
+static const auto EMAIL_VALID = QPair<QString, QRegularExpression> {
     "emailLineEdit", QRegularExpression("\\A[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@"
     "emailLineEdit", QRegularExpression("\\A[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@"
                                         "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\z")};
                                         "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\z")};
-const auto ALIAS_VALID = QPair<QString, QRegularExpression> {
+static const auto COMPANY_VALID = QPair<QString, QRegularExpression> {
-    "aliasLineEdit", QRegularExpression("\\w+")};
+    "companyLineEdit", QRegularExpression("\\w+")};
-const auto EMPLOYEENR_VALID = QPair<QString, QRegularExpression> {
+static const auto EMPLOYEENR_VALID = QPair<QString, QRegularExpression> {
     "employeeidLineEdit", QRegularExpression("\\w+")};
     "employeeidLineEdit", QRegularExpression("\\w+")};
 
 
 
 
 
 
-const auto LINE_EDIT_VALIDATORS = QVector({FIRSTNAME_VALID, LASTNAME_VALID,
+static const auto LINE_EDIT_VALIDATORS = QVector({FIRSTNAME_VALID, LASTNAME_VALID,
                                            PHONE_VALID,     EMAIL_VALID,
                                            PHONE_VALID,     EMAIL_VALID,
-                                           ALIAS_VALID,     EMPLOYEENR_VALID});
+                                           COMPANY_VALID,     EMPLOYEENR_VALID});
 
 
 NewPilot::NewPilot(Db::editRole edRole, QWidget *parent) :
 NewPilot::NewPilot(Db::editRole edRole, QWidget *parent) :
     QDialog(parent),
     QDialog(parent),

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

@@ -43,7 +43,7 @@ void HomeWidget::on_pushButton_clicked()
     //for (int i=1;i<25;i++) {
     //for (int i=1;i<25;i++) {
     //    Calc::updateAutoTimes(i);
     //    Calc::updateAutoTimes(i);
     //}
     //}
-    Calc::updateNightTimes();
+    //Calc::updateNightTimes();
     //DEB(Flight(23));
     //DEB(Flight(23));
     //DEB(Pilot(2));
     //DEB(Pilot(2));
 
 

+ 75 - 17
src/gui/widgets/settingswidget.cpp

@@ -23,7 +23,26 @@
 #define DEB(expr) \
 #define DEB(expr) \
     qDebug() << __PRETTY_FUNCTION__ << "\t" << expr
     qDebug() << __PRETTY_FUNCTION__ << "\t" << expr
 
 
-
+static const auto FIRSTNAME_VALID = QPair<QString, QRegularExpression> {
+    "picfirstnameLineEdit", QRegularExpression("[a-zA-Z]+")};
+static const auto LASTNAME_VALID = QPair<QString, QRegularExpression> {
+    "piclastnameLineEdit", QRegularExpression("\\w+")};
+static const auto PHONE_VALID = QPair<QString, QRegularExpression> {
+    "phoneLineEdit", QRegularExpression("^[+]{0,1}[0-9\\-\\s]+")};
+static const auto EMAIL_VALID = QPair<QString, QRegularExpression> {
+    "emailLineEdit", QRegularExpression("\\A[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@"
+                                        "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\z")};
+static const auto COMPANY_VALID = QPair<QString, QRegularExpression> {
+    "companyLineEdit", QRegularExpression("\\w+")};
+static const auto EMPLOYEENR_VALID = QPair<QString, QRegularExpression> {
+    "employeeidLineEdit", QRegularExpression("\\w+")};
+static const auto PREFIX_VALID = QPair<QString, QRegularExpression> {
+    "prefixLineEdit", QRegularExpression("[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]")};
+
+static const auto LINE_EDIT_VALIDATORS = QVector({FIRSTNAME_VALID, LASTNAME_VALID,
+                                           PHONE_VALID,     EMAIL_VALID,
+                                           COMPANY_VALID,     EMPLOYEENR_VALID,
+                                           PREFIX_VALID});
 
 
 SettingsWidget::SettingsWidget(QWidget *parent) :
 SettingsWidget::SettingsWidget(QWidget *parent) :
     QWidget(parent),
     QWidget(parent),
@@ -40,7 +59,6 @@ SettingsWidget::SettingsWidget(QWidget *parent) :
 
 
     fillSettings();
     fillSettings();
     setupValidators();
     setupValidators();
-
 }
 }
 
 
 SettingsWidget::~SettingsWidget()
 SettingsWidget::~SettingsWidget()
@@ -91,9 +109,47 @@ void SettingsWidget::fillSettings()
 
 
 void SettingsWidget::setupValidators()
 void SettingsWidget::setupValidators()
 {
 {
-    QRegExp flightNumberPrefix_rx("[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]"); // allow max 3 letters (upper and lower) and numbers
+    DEB("Setting up Validators...");
-    QValidator *flightNumberPrefixValidator = new QRegExpValidator(flightNumberPrefix_rx, this);
+    for(const auto& pair : LINE_EDIT_VALIDATORS){
-    ui->prefixLineEdit->setValidator(flightNumberPrefixValidator);
+        auto line_edit = parent()->findChild<QLineEdit*>(pair.first);
+        auto validator = new QRegularExpressionValidator(pair.second,line_edit);
+        line_edit->setValidator(validator);
+    }
+}
+
+void SettingsWidget::updatePersonalDetails()
+{
+    QSettings settings;
+    QMap<QString,QString> data;
+    switch (ui->aliasComboBox->currentIndex()) {
+    case 0:
+        data.insert("displayname","self");
+        break;
+    case 1:
+        data.insert("displayname","SELF");
+        break;
+    case 2:{
+        QString name;
+        name.append(ui->piclastnameLineEdit->text());
+        name.append(QLatin1String(", "));
+        name.append(ui->picfirstnameLineEdit->text().left(1));
+        name.append(QLatin1Char('.'));
+        data.insert("displayname",name);
+    }
+        break;
+    default:
+        break;
+    }
+    data.insert("piclastname",ui->piclastnameLineEdit->text());
+    data.insert("picfirstname",ui->picfirstnameLineEdit->text());
+    data.insert("company",ui->companyLineEdit->text());
+    data.insert("employeeid",ui->employeeidLineEdit->text());
+    data.insert("phone",ui->phoneLineEdit->text());
+    data.insert("email",ui->emailLineEdit->text());
+
+    Pilot pic(1);
+    pic.setData(data);
+    pic.commit();
 }
 }
 
 
 /*
 /*
@@ -113,6 +169,7 @@ void SettingsWidget::on_piclastnameLineEdit_editingFinished()
         ui->piclastnameLineEdit->setFocus();
         ui->piclastnameLineEdit->setFocus();
     } else {
     } else {
         settings.setValue("userdata/piclastname",ui->piclastnameLineEdit->text());
         settings.setValue("userdata/piclastname",ui->piclastnameLineEdit->text());
+        updatePersonalDetails();
     }
     }
 }
 }
 
 
@@ -124,25 +181,36 @@ void SettingsWidget::on_picfirstnameLineEdit_editingFinished()
         ui->picfirstnameLineEdit->setFocus();
         ui->picfirstnameLineEdit->setFocus();
     } else {
     } else {
         settings.setValue("userdata/picfirstname",ui->picfirstnameLineEdit->text());
         settings.setValue("userdata/picfirstname",ui->picfirstnameLineEdit->text());
+        updatePersonalDetails();
     }
     }
 }
 }
 
 
+void SettingsWidget::on_companyLineEdit_editingFinished()
+{
+    QSettings settings;
+    settings.setValue("userdata/company",ui->companyLineEdit->text());
+    updatePersonalDetails();
+}
+
 void SettingsWidget::on_employeeidLineEdit_editingFinished()
 void SettingsWidget::on_employeeidLineEdit_editingFinished()
 {
 {
     QSettings settings;
     QSettings settings;
     settings.setValue("userdata/employeeid",ui->employeeidLineEdit->text());
     settings.setValue("userdata/employeeid",ui->employeeidLineEdit->text());
+    updatePersonalDetails();
 }
 }
 
 
 void SettingsWidget::on_emailLineEdit_editingFinished()
 void SettingsWidget::on_emailLineEdit_editingFinished()
 {
 {
     QSettings settings;
     QSettings settings;
     settings.setValue("userdata/email",ui->emailLineEdit->text());
     settings.setValue("userdata/email",ui->emailLineEdit->text());
+    updatePersonalDetails();
 }
 }
 
 
 void SettingsWidget::on_phoneLineEdit_editingFinished()
 void SettingsWidget::on_phoneLineEdit_editingFinished()
 {
 {
     QSettings settings;
     QSettings settings;
     settings.setValue("userdata/phone",ui->phoneLineEdit->text());
     settings.setValue("userdata/phone",ui->phoneLineEdit->text());
+    updatePersonalDetails();
 }
 }
 
 
 /*
 /*
@@ -153,17 +221,7 @@ void SettingsWidget::on_aliasComboBox_currentIndexChanged(int index)
 {
 {
     QSettings settings;
     QSettings settings;
     settings.setValue("userdata/displayselfas",index);
     settings.setValue("userdata/displayselfas",index);
-    /*QSettings settings;
+    updatePersonalDetails();
-    switch (index) {
-    case 0:
-        settings.setValue("userdata/displayselfas","self");
-        break;
-    case 1:
-        settings.setValue("userdata/displayselfas","SELF");
-        break;
-    default:
-        settings.setValue("userdata/displayselfas","Last,F.");
-    }*/
 }
 }
 
 
 void SettingsWidget::on_functionComboBox_currentIndexChanged(const QString &arg1)
 void SettingsWidget::on_functionComboBox_currentIndexChanged(const QString &arg1)
@@ -253,7 +311,7 @@ void SettingsWidget::on_acAllowIncompleteComboBox_currentIndexChanged(int index)
         reply = QMessageBox::warning(this, "Warning",
         reply = QMessageBox::warning(this, "Warning",
                                       "Enabling incomplete logging will enable you to add aircraft with incomplete data.\n\n"
                                       "Enabling incomplete logging will enable you to add aircraft with incomplete data.\n\n"
                                       "If you do not fill out the aircraft details, "
                                       "If you do not fill out the aircraft details, "
-                                      "it will be impossible to automatically determine Single/Multi Pilot Times or Single/Multi Engine Time."
+                                      "it will be impossible to automatically determine Single/Multi Pilot Times or Single/Multi Engine Time. "
                                       "This will also impact statistics and auto-logging capabilites as well as jeopardise database integrity.\n\n"
                                       "This will also impact statistics and auto-logging capabilites as well as jeopardise database integrity.\n\n"
                                       "It is highly recommended to keep this option off unless you have a specific reason not to.\n\n"
                                       "It is highly recommended to keep this option off unless you have a specific reason not to.\n\n"
                                       "Are you sure you want to proceed?",
                                       "Are you sure you want to proceed?",

+ 6 - 0
src/gui/widgets/settingswidget.h

@@ -26,7 +26,9 @@
 #include <QProcess>
 #include <QProcess>
 #include <QDebug>
 #include <QDebug>
 #include <QSettings>
 #include <QSettings>
+#include <QCloseEvent>
 #include "src/database/db.h"
 #include "src/database/db.h"
+#include "src/classes/pilot.h"
 
 
 namespace Ui {
 namespace Ui {
 class SettingsWidget;
 class SettingsWidget;
@@ -76,12 +78,16 @@ private slots:
 
 
     void on_logbookViewComboBox_currentIndexChanged(int index);
     void on_logbookViewComboBox_currentIndexChanged(int index);
 
 
+    void on_companyLineEdit_editingFinished();
+
 private:
 private:
     Ui::SettingsWidget *ui;
     Ui::SettingsWidget *ui;
 
 
     void fillSettings();
     void fillSettings();
 
 
     void setupValidators();
     void setupValidators();
+
+    void updatePersonalDetails();
 };
 };
 
 
 #endif // SETTINGSWIDGET_H
 #endif // SETTINGSWIDGET_H

+ 228 - 56
src/gui/widgets/settingswidget.ui

@@ -14,27 +14,24 @@
    <string>Form</string>
    <string>Form</string>
   </property>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
   <layout class="QGridLayout" name="gridLayout_2">
-   <item row="0" column="0">
+   <item row="0" column="1">
     <widget class="QTabWidget" name="tabWidget">
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
      <property name="currentIndex">
-      <number>2</number>
+      <number>0</number>
      </property>
      </property>
      <widget class="QWidget" name="personalTab">
      <widget class="QWidget" name="personalTab">
       <attribute name="title">
       <attribute name="title">
        <string>Personal</string>
        <string>Personal</string>
       </attribute>
       </attribute>
       <layout class="QGridLayout" name="gridLayout">
       <layout class="QGridLayout" name="gridLayout">
-       <item row="4" column="1">
+       <item row="0" column="1">
-        <widget class="QLineEdit" name="phoneLineEdit">
+        <widget class="QLabel" name="lastNameLabel">
-         <property name="maxLength">
+         <property name="text">
-          <number>40</number>
+          <string>Last Name</string>
-         </property>
-         <property name="placeholderText">
-          <string>optional</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <widget class="QLineEdit" name="piclastnameLineEdit">
         <widget class="QLineEdit" name="piclastnameLineEdit">
          <property name="maxLength">
          <property name="maxLength">
           <number>40</number>
           <number>40</number>
@@ -44,45 +41,54 @@
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="3" column="0">
+       <item row="1" column="1">
-        <widget class="QLabel" name="emailLabel">
+        <widget class="QLabel" name="firstNameLabel">
          <property name="text">
          <property name="text">
-          <string>eMail</string>
+          <string>First Name</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="4" column="0">
+       <item row="1" column="2">
-        <widget class="QLabel" name="phoneLabel">
+        <widget class="QLineEdit" name="picfirstnameLineEdit">
-         <property name="text">
+         <property name="maxLength">
-          <string>Phone</string>
+          <number>40</number>
+         </property>
+         <property name="placeholderText">
+          <string>required</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="0" column="0">
+       <item row="2" column="1">
-        <widget class="QLabel" name="lastNameLabel">
+        <widget class="QLabel" name="companyLabel">
          <property name="text">
          <property name="text">
-          <string>Last Name</string>
+          <string>Company</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="2" column="0">
+       <item row="2" column="2">
-        <widget class="QLabel" name="employeeLabel">
+        <widget class="QLineEdit" name="companyLineEdit">
+         <property name="focusPolicy">
+          <enum>Qt::StrongFocus</enum>
+         </property>
          <property name="text">
          <property name="text">
-          <string>Employee ID</string>
+          <string/>
          </property>
          </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QLineEdit" name="picfirstnameLineEdit">
          <property name="maxLength">
          <property name="maxLength">
           <number>40</number>
           <number>40</number>
          </property>
          </property>
          <property name="placeholderText">
          <property name="placeholderText">
-          <string>required</string>
+          <string>optional</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="2" column="1">
+       <item row="3" column="1">
+        <widget class="QLabel" name="employeeLabel">
+         <property name="text">
+          <string>Employee ID</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="2">
         <widget class="QLineEdit" name="employeeidLineEdit">
         <widget class="QLineEdit" name="employeeidLineEdit">
          <property name="focusPolicy">
          <property name="focusPolicy">
           <enum>Qt::StrongFocus</enum>
           <enum>Qt::StrongFocus</enum>
@@ -98,14 +104,14 @@
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="1" column="0">
+       <item row="4" column="1">
-        <widget class="QLabel" name="firstNameLabel">
+        <widget class="QLabel" name="emailLabel">
          <property name="text">
          <property name="text">
-          <string>First Name</string>
+          <string>eMail</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="3" column="1">
+       <item row="4" column="2">
         <widget class="QLineEdit" name="emailLineEdit">
         <widget class="QLineEdit" name="emailLineEdit">
          <property name="maxLength">
          <property name="maxLength">
           <number>40</number>
           <number>40</number>
@@ -115,6 +121,49 @@
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
+       <item row="5" column="0">
+        <spacer name="horizontalSpacer_5">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>191</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="5" column="1">
+        <widget class="QLabel" name="phoneLabel">
+         <property name="text">
+          <string>Phone</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="2">
+        <widget class="QLineEdit" name="phoneLineEdit">
+         <property name="maxLength">
+          <number>40</number>
+         </property>
+         <property name="placeholderText">
+          <string>optional</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="3">
+        <spacer name="horizontalSpacer_6">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>191</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
       </layout>
      </widget>
      </widget>
      <widget class="QWidget" name="flightLoggingTab">
      <widget class="QWidget" name="flightLoggingTab">
@@ -122,14 +171,14 @@
        <string>Flight Logging</string>
        <string>Flight Logging</string>
       </attribute>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_4">
       <layout class="QGridLayout" name="gridLayout_4">
-       <item row="0" column="0">
+       <item row="0" column="1">
         <widget class="QLabel" name="aliasLabel">
         <widget class="QLabel" name="aliasLabel">
          <property name="text">
          <property name="text">
           <string>Show own name as</string>
           <string>Show own name as</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <widget class="QComboBox" name="aliasComboBox">
         <widget class="QComboBox" name="aliasComboBox">
          <item>
          <item>
           <property name="text">
           <property name="text">
@@ -148,14 +197,14 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="1" column="0">
+       <item row="1" column="1">
         <widget class="QLabel" name="functionLabel">
         <widget class="QLabel" name="functionLabel">
          <property name="text">
          <property name="text">
           <string>Function</string>
           <string>Function</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="2">
         <widget class="QComboBox" name="functionComboBox">
         <widget class="QComboBox" name="functionComboBox">
          <item>
          <item>
           <property name="text">
           <property name="text">
@@ -179,14 +228,14 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="2" column="0">
+       <item row="2" column="1">
         <widget class="QLabel" name="rulesLabel">
         <widget class="QLabel" name="rulesLabel">
          <property name="text">
          <property name="text">
           <string>Flight Rules</string>
           <string>Flight Rules</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="2" column="1">
+       <item row="2" column="2">
         <widget class="QComboBox" name="rulesComboBox">
         <widget class="QComboBox" name="rulesComboBox">
          <item>
          <item>
           <property name="text">
           <property name="text">
@@ -201,13 +250,26 @@
         </widget>
         </widget>
        </item>
        </item>
        <item row="3" column="0">
        <item row="3" column="0">
+        <spacer name="horizontalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>176</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="3" column="1">
         <widget class="QLabel" name="approachLabel">
         <widget class="QLabel" name="approachLabel">
          <property name="text">
          <property name="text">
           <string>Approach</string>
           <string>Approach</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="3" column="1">
+       <item row="3" column="2">
         <widget class="QComboBox" name="approachComboBox">
         <widget class="QComboBox" name="approachComboBox">
          <item>
          <item>
           <property name="text">
           <property name="text">
@@ -316,14 +378,27 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="4" column="0">
+       <item row="3" column="3">
+        <spacer name="horizontalSpacer_4">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>175</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="4" column="1">
         <widget class="QLabel" name="nightLabel">
         <widget class="QLabel" name="nightLabel">
          <property name="text">
          <property name="text">
           <string>Night Time</string>
           <string>Night Time</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="4" column="1">
+       <item row="4" column="2">
         <widget class="QComboBox" name="nightComboBox">
         <widget class="QComboBox" name="nightComboBox">
          <item>
          <item>
           <property name="text">
           <property name="text">
@@ -342,14 +417,14 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="5" column="0">
+       <item row="5" column="1">
         <widget class="QLabel" name="prefixLabel">
         <widget class="QLabel" name="prefixLabel">
          <property name="text">
          <property name="text">
           <string>Airline Prefix</string>
           <string>Airline Prefix</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="5" column="1">
+       <item row="5" column="2">
         <widget class="QLineEdit" name="prefixLineEdit">
         <widget class="QLineEdit" name="prefixLineEdit">
          <property name="maxLength">
          <property name="maxLength">
           <number>10</number>
           <number>10</number>
@@ -366,43 +441,77 @@
        <string>Misc</string>
        <string>Misc</string>
       </attribute>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_5">
       <layout class="QGridLayout" name="gridLayout_5">
-       <item row="0" column="0">
+       <item row="0" column="1">
         <widget class="QLabel" name="themeLabel">
         <widget class="QLabel" name="themeLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Changes the theme of the application.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Theme</string>
           <string>Theme</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <widget class="QCheckBox" name="systemThemeCheckBox">
         <widget class="QCheckBox" name="systemThemeCheckBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Uses your default system theme.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>System</string>
           <string>System</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="2">
         <widget class="QCheckBox" name="lightThemeCheckBox">
         <widget class="QCheckBox" name="lightThemeCheckBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Uses the Breeze light theme.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Light</string>
           <string>Light</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="2" column="1">
+       <item row="2" column="2">
         <widget class="QCheckBox" name="darkThemeCheckBox">
         <widget class="QCheckBox" name="darkThemeCheckBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Uses the breeze dark theme (night mode)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Dark</string>
           <string>Dark</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
        <item row="3" column="0">
        <item row="3" column="0">
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>173</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="3" column="1">
         <widget class="QLabel" name="logbookViewLabel">
         <widget class="QLabel" name="logbookViewLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines how your logbook is displayed in the logbook tab. This has no influence on what details are logged, just on what is displayed by default.&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;Determines how your logbook is displayed in the logbook tab. This has no influence on what details are logged, just on what is displayed by default.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Logbook Dispay</string>
           <string>Logbook Dispay</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="3" column="1">
+       <item row="3" column="2">
         <widget class="QComboBox" name="logbookViewComboBox">
         <widget class="QComboBox" name="logbookViewComboBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines how your logbook is displayed in the logbook tab. This has no influence on what details are logged, just on what is displayed by default.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <item>
          <item>
           <property name="text">
           <property name="text">
            <string>Default</string>
            <string>Default</string>
@@ -415,15 +524,37 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="4" column="0">
+       <item row="3" column="3">
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>173</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="4" column="1">
         <widget class="QLabel" name="pilotSortLabel">
         <widget class="QLabel" name="pilotSortLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines by which column to sort the display of Pilots in the Pilots Tab.&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;Determines by which column to sort the display of Pilots in the Pilots Tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Sort Pilots by</string>
           <string>Sort Pilots by</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="4" column="1">
+       <item row="4" column="2">
         <widget class="QComboBox" name="pilotSortComboBox">
         <widget class="QComboBox" name="pilotSortComboBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines by which column to sort the display of Pilots in the Pilots Tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <item>
          <item>
           <property name="text">
           <property name="text">
            <string>ID</string>
            <string>ID</string>
@@ -446,15 +577,24 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="5" column="0">
+       <item row="5" column="1">
         <widget class="QLabel" name="acSortLabel">
         <widget class="QLabel" name="acSortLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines by which column to sort the display of Aircaft in the Aircraft Tab.&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;Determines by which column to sort the display of Aircaft in the Aircraft Tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
           <string>Sort Aircraft by</string>
           <string>Sort Aircraft by</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="5" column="1">
+       <item row="5" column="2">
         <widget class="QComboBox" name="acSortComboBox">
         <widget class="QComboBox" name="acSortComboBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines by which column to sort the display of Aircaft in the Aircraft Tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <item>
          <item>
           <property name="text">
           <property name="text">
            <string>ID</string>
            <string>ID</string>
@@ -477,15 +617,21 @@
          </item>
          </item>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="6" column="0">
+       <item row="6" column="1">
         <widget class="QLabel" name="acAllowIncompleteLabel">
         <widget class="QLabel" name="acAllowIncompleteLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines whether incomplete database entries are permitted. It is highly recommended to keep this option off.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <property name="text">
          <property name="text">
-          <string>Allow incomplete Entries</string>
+          <string>Allow incomplete Entries </string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
-       <item row="6" column="1">
+       <item row="6" column="2">
         <widget class="QComboBox" name="acAllowIncompleteComboBox">
         <widget class="QComboBox" name="acAllowIncompleteComboBox">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines whether incomplete database entries are permitted. It is highly recommended to keep this option off.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
          <item>
          <item>
           <property name="text">
           <property name="text">
            <string>No</string>
            <string>No</string>
@@ -506,12 +652,38 @@
       </attribute>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_3">
       <layout class="QGridLayout" name="gridLayout_3">
        <item row="0" column="0">
        <item row="0" column="0">
+        <spacer name="horizontalSpacer_7">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>259</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="0" column="1">
         <widget class="QPushButton" name="aboutPushButton">
         <widget class="QPushButton" name="aboutPushButton">
          <property name="text">
          <property name="text">
           <string>About openPilotLog</string>
           <string>About openPilotLog</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
+       <item row="0" column="2">
+        <spacer name="horizontalSpacer_8">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>259</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
       </layout>
      </widget>
      </widget>
     </widget>
     </widget>