2
0
Эх сурвалжийг харах

added Validators and update mechanism for user data in settings widget

fiffty-50 4 жил өмнө
parent
commit
f0dde9f7c3

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

@@ -21,25 +21,25 @@
 #define DEB(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]+")};
-const auto LASTNAME_VALID = QPair<QString, QRegularExpression> {
+static const auto LASTNAME_VALID = QPair<QString, QRegularExpression> {
     "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]+")};
-const auto EMAIL_VALID = QPair<QString, QRegularExpression> {
+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")};
-const auto ALIAS_VALID = QPair<QString, QRegularExpression> {
-    "aliasLineEdit", QRegularExpression("\\w+")};
-const auto EMPLOYEENR_VALID = QPair<QString, QRegularExpression> {
+static const auto COMPANY_VALID = QPair<QString, QRegularExpression> {
+    "companyLineEdit", QRegularExpression("\\w+")};
+static const auto EMPLOYEENR_VALID = QPair<QString, QRegularExpression> {
     "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,
-                                           ALIAS_VALID,     EMPLOYEENR_VALID});
+                                           COMPANY_VALID,     EMPLOYEENR_VALID});
 
 NewPilot::NewPilot(Db::editRole edRole, QWidget *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++) {
     //    Calc::updateAutoTimes(i);
     //}
-    Calc::updateNightTimes();
+    //Calc::updateNightTimes();
     //DEB(Flight(23));
     //DEB(Pilot(2));
 

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

@@ -23,7 +23,26 @@
 #define DEB(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) :
     QWidget(parent),
@@ -40,7 +59,6 @@ SettingsWidget::SettingsWidget(QWidget *parent) :
 
     fillSettings();
     setupValidators();
-
 }
 
 SettingsWidget::~SettingsWidget()
@@ -91,9 +109,47 @@ void SettingsWidget::fillSettings()
 
 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
-    QValidator *flightNumberPrefixValidator = new QRegExpValidator(flightNumberPrefix_rx, this);
-    ui->prefixLineEdit->setValidator(flightNumberPrefixValidator);
+    DEB("Setting up Validators...");
+    for(const auto& pair : LINE_EDIT_VALIDATORS){
+        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();
     } else {
         settings.setValue("userdata/piclastname",ui->piclastnameLineEdit->text());
+        updatePersonalDetails();
     }
 }
 
@@ -124,25 +181,36 @@ void SettingsWidget::on_picfirstnameLineEdit_editingFinished()
         ui->picfirstnameLineEdit->setFocus();
     } else {
         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()
 {
     QSettings settings;
     settings.setValue("userdata/employeeid",ui->employeeidLineEdit->text());
+    updatePersonalDetails();
 }
 
 void SettingsWidget::on_emailLineEdit_editingFinished()
 {
     QSettings settings;
     settings.setValue("userdata/email",ui->emailLineEdit->text());
+    updatePersonalDetails();
 }
 
 void SettingsWidget::on_phoneLineEdit_editingFinished()
 {
     QSettings settings;
     settings.setValue("userdata/phone",ui->phoneLineEdit->text());
+    updatePersonalDetails();
 }
 
 /*
@@ -153,17 +221,7 @@ void SettingsWidget::on_aliasComboBox_currentIndexChanged(int index)
 {
     QSettings settings;
     settings.setValue("userdata/displayselfas",index);
-    /*QSettings settings;
-    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.");
-    }*/
+    updatePersonalDetails();
 }
 
 void SettingsWidget::on_functionComboBox_currentIndexChanged(const QString &arg1)
@@ -253,7 +311,7 @@ void SettingsWidget::on_acAllowIncompleteComboBox_currentIndexChanged(int index)
         reply = QMessageBox::warning(this, "Warning",
                                       "Enabling incomplete logging will enable you to add aircraft with incomplete data.\n\n"
                                       "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"
                                       "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?",

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

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

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

@@ -14,27 +14,24 @@
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
-   <item row="0" column="0">
+   <item row="0" column="1">
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>2</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="personalTab">
       <attribute name="title">
        <string>Personal</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout">
-       <item row="4" column="1">
-        <widget class="QLineEdit" name="phoneLineEdit">
-         <property name="maxLength">
-          <number>40</number>
-         </property>
-         <property name="placeholderText">
-          <string>optional</string>
+       <item row="0" column="1">
+        <widget class="QLabel" name="lastNameLabel">
+         <property name="text">
+          <string>Last Name</string>
          </property>
         </widget>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <widget class="QLineEdit" name="piclastnameLineEdit">
          <property name="maxLength">
           <number>40</number>
@@ -44,45 +41,54 @@
          </property>
         </widget>
        </item>
-       <item row="3" column="0">
-        <widget class="QLabel" name="emailLabel">
+       <item row="1" column="1">
+        <widget class="QLabel" name="firstNameLabel">
          <property name="text">
-          <string>eMail</string>
+          <string>First Name</string>
          </property>
         </widget>
        </item>
-       <item row="4" column="0">
-        <widget class="QLabel" name="phoneLabel">
-         <property name="text">
-          <string>Phone</string>
+       <item row="1" column="2">
+        <widget class="QLineEdit" name="picfirstnameLineEdit">
+         <property name="maxLength">
+          <number>40</number>
+         </property>
+         <property name="placeholderText">
+          <string>required</string>
          </property>
         </widget>
        </item>
-       <item row="0" column="0">
-        <widget class="QLabel" name="lastNameLabel">
+       <item row="2" column="1">
+        <widget class="QLabel" name="companyLabel">
          <property name="text">
-          <string>Last Name</string>
+          <string>Company</string>
          </property>
         </widget>
        </item>
-       <item row="2" column="0">
-        <widget class="QLabel" name="employeeLabel">
+       <item row="2" column="2">
+        <widget class="QLineEdit" name="companyLineEdit">
+         <property name="focusPolicy">
+          <enum>Qt::StrongFocus</enum>
+         </property>
          <property name="text">
-          <string>Employee ID</string>
+          <string/>
          </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QLineEdit" name="picfirstnameLineEdit">
          <property name="maxLength">
           <number>40</number>
          </property>
          <property name="placeholderText">
-          <string>required</string>
+          <string>optional</string>
          </property>
         </widget>
        </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">
          <property name="focusPolicy">
           <enum>Qt::StrongFocus</enum>
@@ -98,14 +104,14 @@
          </property>
         </widget>
        </item>
-       <item row="1" column="0">
-        <widget class="QLabel" name="firstNameLabel">
+       <item row="4" column="1">
+        <widget class="QLabel" name="emailLabel">
          <property name="text">
-          <string>First Name</string>
+          <string>eMail</string>
          </property>
         </widget>
        </item>
-       <item row="3" column="1">
+       <item row="4" column="2">
         <widget class="QLineEdit" name="emailLineEdit">
          <property name="maxLength">
           <number>40</number>
@@ -115,6 +121,49 @@
          </property>
         </widget>
        </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>
      </widget>
      <widget class="QWidget" name="flightLoggingTab">
@@ -122,14 +171,14 @@
        <string>Flight Logging</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_4">
-       <item row="0" column="0">
+       <item row="0" column="1">
         <widget class="QLabel" name="aliasLabel">
          <property name="text">
           <string>Show own name as</string>
          </property>
         </widget>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <widget class="QComboBox" name="aliasComboBox">
          <item>
           <property name="text">
@@ -148,14 +197,14 @@
          </item>
         </widget>
        </item>
-       <item row="1" column="0">
+       <item row="1" column="1">
         <widget class="QLabel" name="functionLabel">
          <property name="text">
           <string>Function</string>
          </property>
         </widget>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="2">
         <widget class="QComboBox" name="functionComboBox">
          <item>
           <property name="text">
@@ -179,14 +228,14 @@
          </item>
         </widget>
        </item>
-       <item row="2" column="0">
+       <item row="2" column="1">
         <widget class="QLabel" name="rulesLabel">
          <property name="text">
           <string>Flight Rules</string>
          </property>
         </widget>
        </item>
-       <item row="2" column="1">
+       <item row="2" column="2">
         <widget class="QComboBox" name="rulesComboBox">
          <item>
           <property name="text">
@@ -201,13 +250,26 @@
         </widget>
        </item>
        <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">
          <property name="text">
           <string>Approach</string>
          </property>
         </widget>
        </item>
-       <item row="3" column="1">
+       <item row="3" column="2">
         <widget class="QComboBox" name="approachComboBox">
          <item>
           <property name="text">
@@ -316,14 +378,27 @@
          </item>
         </widget>
        </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">
          <property name="text">
           <string>Night Time</string>
          </property>
         </widget>
        </item>
-       <item row="4" column="1">
+       <item row="4" column="2">
         <widget class="QComboBox" name="nightComboBox">
          <item>
           <property name="text">
@@ -342,14 +417,14 @@
          </item>
         </widget>
        </item>
-       <item row="5" column="0">
+       <item row="5" column="1">
         <widget class="QLabel" name="prefixLabel">
          <property name="text">
           <string>Airline Prefix</string>
          </property>
         </widget>
        </item>
-       <item row="5" column="1">
+       <item row="5" column="2">
         <widget class="QLineEdit" name="prefixLineEdit">
          <property name="maxLength">
           <number>10</number>
@@ -366,43 +441,77 @@
        <string>Misc</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_5">
-       <item row="0" column="0">
+       <item row="0" column="1">
         <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">
           <string>Theme</string>
          </property>
         </widget>
        </item>
-       <item row="0" column="1">
+       <item row="0" column="2">
         <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">
           <string>System</string>
          </property>
         </widget>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="2">
         <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">
           <string>Light</string>
          </property>
         </widget>
        </item>
-       <item row="2" column="1">
+       <item row="2" column="2">
         <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">
           <string>Dark</string>
          </property>
         </widget>
        </item>
        <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">
+         <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">
           <string>Logbook Dispay</string>
          </property>
         </widget>
        </item>
-       <item row="3" column="1">
+       <item row="3" column="2">
         <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>
           <property name="text">
            <string>Default</string>
@@ -415,15 +524,37 @@
          </item>
         </widget>
        </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">
+         <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">
           <string>Sort Pilots by</string>
          </property>
         </widget>
        </item>
-       <item row="4" column="1">
+       <item row="4" column="2">
         <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>
           <property name="text">
            <string>ID</string>
@@ -446,15 +577,24 @@
          </item>
         </widget>
        </item>
-       <item row="5" column="0">
+       <item row="5" column="1">
         <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">
           <string>Sort Aircraft by</string>
          </property>
         </widget>
        </item>
-       <item row="5" column="1">
+       <item row="5" column="2">
         <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>
           <property name="text">
            <string>ID</string>
@@ -477,15 +617,21 @@
          </item>
         </widget>
        </item>
-       <item row="6" column="0">
+       <item row="6" column="1">
         <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">
-          <string>Allow incomplete Entries</string>
+          <string>Allow incomplete Entries </string>
          </property>
         </widget>
        </item>
-       <item row="6" column="1">
+       <item row="6" column="2">
         <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>
           <property name="text">
            <string>No</string>
@@ -506,12 +652,38 @@
       </attribute>
       <layout class="QGridLayout" name="gridLayout_3">
        <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">
          <property name="text">
           <string>About openPilotLog</string>
          </property>
         </widget>
        </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>
      </widget>
     </widget>