Browse Source

Added warning about expiries

The user ca choose to be warned about impending expiries. This is now implemented in the settings dialog as well as the CurrencyWidget.
Felix Turowsky 1 year ago
parent
commit
8ab6b657f2

+ 0 - 7
src/classes/settings.cpp

@@ -43,13 +43,6 @@ void Settings::resetToDefaults()
     setCurrencyWarningThreshold(90);
     setPilotSortColumn(0);
     setTailSortColumn(0);
-    setShowCurrency(OPL::CurrencyEntry::TakeOffLanding, true);
-    setShowCurrency(OPL::CurrencyEntry::Licence, false);
-    setShowCurrency(OPL::CurrencyEntry::TypeRating, false);
-    setShowCurrency(OPL::CurrencyEntry::LineCheck, false);
-    setShowCurrency(OPL::CurrencyEntry::Medical, false);
-    setShowCurrency(OPL::CurrencyEntry::Custom1, false);
-    setShowCurrency(OPL::CurrencyEntry::Custom2, false);
     sync();
 }
 

+ 0 - 12
src/classes/settings.h

@@ -186,18 +186,6 @@ public:
      */
     static void setFlightNumberPrefix(const QString &value) { settingsInstance->setValue(LOG_PREFIX, value); }
 
-    // TODO test these
-
-    /*!
-     * \brief returns whether the Currency passed as a parameter is shown on the Home screen
-     */
-    static bool getShowCurrency(OPL::CurrencyEntry::Currency currency) { return settingsInstance->value(CURRENCY_STUB.arg(CURRENCIES.value(currency))).toBool(); }
-
-    /*!
-     * \brief sets whether the Currency passed as a parameter is shown on the home screen
-     */
-    static void setShowCurrency(OPL::CurrencyEntry::Currency currency, bool value) { settingsInstance->setValue(CURRENCY_STUB.arg(CURRENCIES.value(currency)), value); }
-
     /*!
      * \brief sets how the logbook owner is shown in the view
      * \details

+ 1 - 1
src/gui/dialogues/firstrundialog.ui

@@ -175,7 +175,7 @@
        <item row="0" column="0" colspan="2">
         <widget class="QLabel" name="label_6">
          <property name="text">
-          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;Welcome to openPilotLog!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;The Free and Open Source Logbook application&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If you would like to keep track of your license and/or medical expiration dates, you can enter them here. By default, only Take-Off and Landing currency is shown on the home page, but any other currency can also be shown as well. This can be enabled in the settings menu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;Welcome to openPilotLog!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;The Free and Open Source Logbook application&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If you would like to keep track of your license and/or medical expiration dates, you can enter them here. Your currencies are tracked and you will be warned about impending expiries. These warnings can be disabled in the Settings Menu.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
          </property>
          <property name="textFormat">
           <enum>Qt::RichText</enum>

+ 25 - 2
src/gui/widgets/currencywidget.cpp

@@ -21,6 +21,12 @@ CurrencyWidget::CurrencyWidget(QWidget *parent)
 
     fillTakeOffAndLandingCurrencies();
     fillFlightTimeLimitations();
+
+    // warn the user about impending currencies if warning threshold > 0
+    int warningThreshold = Settings::getCurrencyWarningThreshold();
+    if(warningThreshold) {
+        warnAboutExpiries(warningThreshold);
+    }
 }
 
 void CurrencyWidget::setupModelAndView()
@@ -28,8 +34,8 @@ void CurrencyWidget::setupModelAndView()
     model = new QSqlTableModel(this, DB->database());
     model->setTable(OPL::GLOBALS->getDbTableName(OPL::DbTable::Currencies));
     model->select();
-    model->setHeaderData(2, Qt::Horizontal, tr("Expiry Date"));
-    model->setHeaderData(3, Qt::Horizontal, tr("Name"));
+    model->setHeaderData(EXPIRY_DATE_COLUMN, Qt::Horizontal, tr("Expiry Date"));
+    model->setHeaderData(CURRENCY_NAME_COLUMN, Qt::Horizontal, tr("Name"));
 
     tableView = new QTableView(this);
     tableView->setModel(model);
@@ -204,6 +210,23 @@ void CurrencyWidget::displayNameEditRequested(QModelIndex index)
     model->submitAll();
 }
 
+void CurrencyWidget::warnAboutExpiries(int warningThreshold)
+{
+    const QDate today = QDate::currentDate();
+
+    for(int i = 0; i < model->rowCount(); i++) {
+        const QModelIndex dateIndex = model->index(i, EXPIRY_DATE_COLUMN);
+        QDate date = QDate::fromString(dateIndex.data().toString(), Qt::ISODate);
+
+        if(date.addDays(warningThreshold) > today) {
+            const QString dateString = date.toString(Qt::ISODate);
+            const QString nameString = model->index(i, CURRENCY_NAME_COLUMN).data().toString();
+            QString msg = tr("%1 expires on<br><br>%2").arg(nameString, dateString);
+            WARN(msg);
+        }
+    }
+}
+
 QFrame *CurrencyWidget::getHorizontalLine()
 {
     QFrame* newFrame = new QFrame(this);

+ 4 - 0
src/gui/widgets/currencywidget.h

@@ -16,11 +16,15 @@ class CurrencyWidget : public QWidget
     QString dateFormat;
     QModelIndex lastSelection;
 
+    int EXPIRY_DATE_COLUMN = 2;
+    int CURRENCY_NAME_COLUMN = 3;
+
     void setupModelAndView();
     void setupUI();
     void fillTakeOffAndLandingCurrencies();
     void fillFlightTimeLimitations();
     void displayNameEditRequested(QModelIndex index);
+    void warnAboutExpiries(int warningThreshold);
 
     QFrame *getHorizontalLine();
     QLabel *takeOffLandingHeaderLabel   		= new QLabel(tr("<b>Take-off and Landing Currency<\b>"), this);

+ 8 - 207
src/gui/widgets/settingswidget.cpp

@@ -23,7 +23,6 @@
 #include "src/classes/settings.h"
 #include "src/database/database.h"
 #include "src/opl.h"
-#include "src/functions/datetime.h"
 #include "src/gui/widgets/backupwidget.h"
 
 SettingsWidget::SettingsWidget(QWidget *parent) :
@@ -36,7 +35,6 @@ SettingsWidget::SettingsWidget(QWidget *parent) :
     loadBackupWidget();
     loadPreviousExperienceWidget();
     setupComboBoxes();
-    setupDateEdits();
     setupValidators();
     readSettings();
 }
@@ -62,37 +60,9 @@ void SettingsWidget::setupComboBoxes(){
         OPL::GLOBALS->loadPilotFunctios(ui->functionComboBox);
         OPL::GLOBALS->fillViewNamesComboBox(ui->logbookViewComboBox);
         OPL::GLOBALS->fillLanguageComboBox(ui->languageComboBox);
-    }
-}
 
-
-void SettingsWidget::setupDateEdits()
-{
-    // Read Display Format Setting
-    const QString dateFormatString = OPL::DateTime::getFormatString(Settings::getDateFormat());
-    const auto date_edits = this->findChildren<QDateEdit*>();
-    for (const auto &date_edit : date_edits) {
-        date_edit->setDisplayFormat(dateFormatString);
-    }
-    // Fill currencies
-    const QList<QPair<OPL::CurrencyEntry::Currency, QDateEdit*>> currencies_list = {
-        {OPL::CurrencyEntry::Licence,    ui->currLicDateEdit},
-        {OPL::CurrencyEntry::TypeRating, ui->currTrDateEdit},
-        {OPL::CurrencyEntry::LineCheck,  ui->currLckDateEdit},
-        {OPL::CurrencyEntry::Medical,    ui->currMedDateEdit},
-        {OPL::CurrencyEntry::Custom1,    ui->currCustom1DateEdit},
-        {OPL::CurrencyEntry::Custom2,    ui->currCustom2DateEdit},
-    };
-    for (const auto &pair : currencies_list) {
-        const QSignalBlocker signal_blocker(pair.second);
-        const auto entry = DB->getCurrencyEntry(pair.first);
-        if (entry.isValid()) { // set date
-            const auto date = entry.getExpiryDate();
-            if(date.isValid())
-                pair.second->setDate(date);
-        } else { // set current date
-            pair.second->setDate(QDate::currentDate());
-        }
+        // Set up the currency warning threshold spin box
+        ui->currencyWarningDaysSpinBox->setValue(Settings::getCurrencyWarningThreshold());
     }
 }
 
@@ -140,17 +110,6 @@ void SettingsWidget::readSettings()
     ui->logbookViewComboBox->setCurrentIndex(static_cast<int>(Settings::getLogbookView()));
     ui->aliasComboBox->setCurrentIndex(Settings::getShowSelfAs());
 
-    // Currencies Tab
-    ui->currToLdgCheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::TakeOffLanding));
-    ui->currLicCheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::LineCheck));
-    ui->currTrCheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::TypeRating));
-    ui->currLckCheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::TypeRating));
-    ui->currMedCheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::Medical));
-    ui->currCustom1CheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::Custom1));
-    ui->currCustom2CheckBox->setChecked(Settings::getShowCurrency(OPL::CurrencyEntry::Custom2));
-
-    ui->currCustom1LineEdit->setText(DB->getCurrencyEntry(OPL::CurrencyEntry::Custom1).getDisplayName());
-    ui->currCustom2LineEdit->setText(DB->getCurrencyEntry(OPL::CurrencyEntry::Custom2).getDisplayName());
     // Misc Tab
     ui->acftSortComboBox->setCurrentIndex(Settings::getTailSortColumn());
     ui->pilotSortComboBox->setCurrentIndex(Settings::getPilotSortColumn());
@@ -456,7 +415,6 @@ void SettingsWidget::on_fontCheckBox_stateChanged(int arg1)
     {
         ui->fontComboBox->setEnabled(true);
         ui->fontSpinBox->setEnabled(true);
-//        Settings::write(Settings::Main::UseSystemFont, false);
         Settings::setUseSystemFont(false);
         QFont font(ui->fontComboBox->currentFont());
         font.setPointSize(ui->fontSpinBox->value());
@@ -468,7 +426,6 @@ void SettingsWidget::on_fontCheckBox_stateChanged(int arg1)
     {
         ui->fontComboBox->setEnabled(false);
         ui->fontSpinBox->setEnabled(false);
-//        Settings::write(Settings::Main::UseSystemFont, true);
         Settings::setUseSystemFont(true);
         INFO(tr("The application will be restarted for this change to take effect."));
         qApp->quit();
@@ -499,167 +456,6 @@ void SettingsWidget::on_resetStylePushButton_clicked()
     ui->fontCheckBox->setChecked(true);
 }
 
-void SettingsWidget::on_currLicDateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Licence);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currTrDateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::TypeRating);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currLckDateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::LineCheck);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currMedDateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Medical);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom1DateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Custom1);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom2DateEdit_userDateChanged(const QDate &date)
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Custom2);
-    entry.setExpiryDate(date);
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currToLdgCheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::TakeOffLanding, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::TakeOffLanding, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currLicCheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Licence, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Licence, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currTrCheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::TypeRating, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::TypeRating, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currLckCheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::LineCheck, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::LineCheck, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currMedCheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Medical, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Medical, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom1CheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Custom1, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Custom1, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom2CheckBox_stateChanged(int arg1)
-{
-    switch (arg1) {
-    case Qt::CheckState::Checked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Custom2, true);
-        break;
-    case Qt::CheckState::Unchecked:
-        Settings::setShowCurrency(OPL::CurrencyEntry::Custom2, false);
-        break;
-    default:
-        break;
-    }
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom1LineEdit_editingFinished()
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Custom1);
-    entry.setDisplayName(ui->currCustom1LineEdit->text());
-    emit settingChanged(HomeWidget);
-}
-
-void SettingsWidget::on_currCustom2LineEdit_editingFinished()
-{
-    auto entry = DB->getCurrencyEntry(OPL::CurrencyEntry::Custom2);
-    entry.setDisplayName(ui->currCustom2LineEdit->text());
-    emit settingChanged(HomeWidget);
-}
-
 void SettingsWidget::on_languageComboBox_activated(int arg1)
 {
     if (arg1 != 0) {
@@ -670,10 +466,15 @@ void SettingsWidget::on_languageComboBox_activated(int arg1)
     }
 }
 
-
 void SettingsWidget::on_exportPushButton_clicked()
 {
     auto exp = new ExportToCsvDialog(this);
     exp->exec();
 }
 
+
+void SettingsWidget::on_currencyWarningDaysSpinBox_valueChanged(int arg1)
+{
+    Settings::setCurrencyWarningThreshold(arg1);
+}
+

+ 2 - 17
src/gui/widgets/settingswidget.h

@@ -74,24 +74,11 @@ private slots:
     void on_fontSpinBox_valueChanged(int arg1);
     void on_fontCheckBox_stateChanged(int arg1);
     void on_resetStylePushButton_clicked();
-    void on_currLicDateEdit_userDateChanged(const QDate &date);
-    void on_currTrDateEdit_userDateChanged(const QDate &date);
-    void on_currLckDateEdit_userDateChanged(const QDate &date);
-    void on_currMedDateEdit_userDateChanged(const QDate &date);
-    void on_currCustom1DateEdit_userDateChanged(const QDate &date);
-    void on_currCustom2DateEdit_userDateChanged(const QDate &date);
-    void on_currToLdgCheckBox_stateChanged(int arg1);
-    void on_currLicCheckBox_stateChanged(int arg1);
-    void on_currTrCheckBox_stateChanged(int arg1);
-    void on_currLckCheckBox_stateChanged(int arg1);
-    void on_currMedCheckBox_stateChanged(int arg1);
-    void on_currCustom1CheckBox_stateChanged(int arg1);
-    void on_currCustom2CheckBox_stateChanged(int arg1);
-    void on_currCustom1LineEdit_editingFinished();
-    void on_currCustom2LineEdit_editingFinished();
     void on_languageComboBox_activated(int arg1);
     void on_exportPushButton_clicked();
 
+    void on_currencyWarningDaysSpinBox_valueChanged(int arg1);
+
 private:
     Ui::SettingsWidget *ui;
 
@@ -101,8 +88,6 @@ private:
 
     void setupComboBoxes();
 
-    void setupDateEdits();
-
     void loadBackupWidget();
 
     void loadPreviousExperienceWidget();

+ 254 - 663
src/gui/widgets/settingswidget.ui

@@ -17,8 +17,261 @@
    <item row="0" column="0">
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>4</number>
+      <number>0</number>
      </property>
+     <widget class="QWidget" name="generalTab">
+      <attribute name="title">
+       <string>General</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_3">
+       <item row="0" column="0">
+        <widget class="QLabel" name="currencyLeftLabel">
+         <property name="toolTip">
+          <string>Setting this value to 0 disables warnings.</string>
+         </property>
+         <property name="text">
+          <string>Warn about expiring currencies</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="styleLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>Style</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QPushButton" name="resetStylePushButton">
+         <property name="text">
+          <string>Reset to Default</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <widget class="QComboBox" name="styleComboBox"/>
+       </item>
+       <item row="2" column="0">
+        <widget class="QLabel" name="fontLabel">
+         <property name="text">
+          <string>Font</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QCheckBox" name="fontCheckBox">
+         <property name="text">
+          <string>Use System Font</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2">
+        <widget class="QFontComboBox" name="fontComboBox">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="3">
+        <widget class="QSpinBox" name="fontSpinBox">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>80</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="minimum">
+          <number>8</number>
+         </property>
+         <property name="maximum">
+          <number>18</number>
+         </property>
+         <property name="value">
+          <number>10</number>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="pilotSortLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <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="3" 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>Last Name</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>First Name</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Company</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="4" column="0">
+        <widget class="QLabel" name="acftSortLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <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="4" column="2">
+        <widget class="QComboBox" name="acftSortComboBox">
+         <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>Registration</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Type</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Company</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="5" column="0">
+        <widget class="QLabel" name="logbookViewLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <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 Display</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" 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>
+        </widget>
+       </item>
+       <item row="6" column="0">
+        <widget class="QLabel" name="aliasLabel">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How your own name is displayed in your logbook&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="text">
+          <string>Show own name as</string>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="2">
+        <widget class="QComboBox" name="aliasComboBox">
+         <item>
+          <property name="text">
+           <string>self</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>SELF</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>Lastname, Firstname</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="7" column="0">
+        <widget class="QLabel" name="languageLabel">
+         <property name="text">
+          <string>Language</string>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="2">
+        <widget class="QComboBox" name="languageComboBox"/>
+       </item>
+       <item row="0" column="1">
+        <widget class="QSpinBox" name="currencyWarningDaysSpinBox">
+         <property name="toolTip">
+          <string>Setting this value to 0 disables warnings.</string>
+         </property>
+         <property name="value">
+          <number>30</number>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QLabel" name="currencyRightLabel">
+         <property name="toolTip">
+          <string>Setting this value to 0 disables warnings.</string>
+         </property>
+         <property name="text">
+          <string>days before expiry</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="personalTab">
       <attribute name="title">
        <string>Personal</string>
@@ -320,668 +573,6 @@
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="currenciesTab">
-      <attribute name="title">
-       <string>Currencies</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_6">
-       <item row="3" column="3">
-        <widget class="QCheckBox" name="currToLdgCheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="8" column="0">
-        <widget class="QLineEdit" name="currCustom1LineEdit">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-         <property name="placeholderText">
-          <string>custom currency</string>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="3">
-        <widget class="QCheckBox" name="currTrCheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="0">
-        <widget class="QLabel" name="currToLdgLabel">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Take-off / Landing (days)</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>168</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="4" column="2">
-        <widget class="QDateEdit" name="currLicDateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="2">
-        <widget class="QDateEdit" name="currTrDateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="9" column="3">
-        <widget class="QCheckBox" name="currCustom2CheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="7" column="2">
-        <widget class="QDateEdit" name="currMedDateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="2">
-        <widget class="QSpinBox" name="currToLdgSpinBox">
-         <property name="toolTip">
-          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of days for TO/LDG currency. Default 90&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="value">
-          <number>90</number>
-         </property>
-        </widget>
-       </item>
-       <item row="7" column="0">
-        <widget class="QLabel" name="currMedLabel">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Medical</string>
-         </property>
-        </widget>
-       </item>
-       <item row="8" column="3">
-        <widget class="QCheckBox" name="currCustom1CheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="9" column="0">
-        <widget class="QLineEdit" name="currCustom2LineEdit">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="placeholderText">
-          <string>custom currency</string>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="2">
-        <widget class="QDateEdit" name="currLckDateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="0">
-        <widget class="QLabel" name="currLckLabel">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Line Check</string>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="0">
-        <widget class="QLabel" name="currTrLabel">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Type Rating</string>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="0">
-        <widget class="QLabel" name="currLicLabel">
-         <property name="minimumSize">
-          <size>
-           <width>280</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Licence</string>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="3">
-        <widget class="QCheckBox" name="currLckCheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="10" column="1">
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>167</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="9" column="2">
-        <widget class="QDateEdit" name="currCustom2DateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="3">
-        <widget class="QCheckBox" name="currLicCheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="8" column="2">
-        <widget class="QDateEdit" name="currCustom1DateEdit">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="currentSection">
-          <enum>QDateTimeEdit::MonthSection</enum>
-         </property>
-         <property name="displayFormat">
-          <string>MM/dd/yyyy</string>
-         </property>
-         <property name="calendarPopup">
-          <bool>true</bool>
-         </property>
-         <property name="timeSpec">
-          <enum>Qt::UTC</enum>
-         </property>
-         <property name="date">
-          <date>
-           <year>2020</year>
-           <month>1</month>
-           <day>1</day>
-          </date>
-         </property>
-        </widget>
-       </item>
-       <item row="7" column="3">
-        <widget class="QCheckBox" name="currMedCheckBox">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="layoutDirection">
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text">
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="3">
-        <widget class="QLabel" name="headerShowLabel">
-         <property name="minimumSize">
-          <size>
-           <width>140</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Show on Home Page</string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="appearanceTab">
-      <attribute name="title">
-       <string>Appearance</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_4">
-       <item row="0" column="0">
-        <widget class="QLabel" name="styleLabel">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="text">
-          <string>Style</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QPushButton" name="resetStylePushButton">
-         <property name="text">
-          <string>Reset to Default</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <widget class="QComboBox" name="styleComboBox"/>
-       </item>
-       <item row="1" column="0">
-        <widget class="QLabel" name="fontLabel">
-         <property name="text">
-          <string>Font</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QCheckBox" name="fontCheckBox">
-         <property name="text">
-          <string>Use System Font</string>
-         </property>
-         <property name="checked">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="2">
-        <widget class="QFontComboBox" name="fontComboBox">
-         <property name="enabled">
-          <bool>false</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="3">
-        <widget class="QSpinBox" name="fontSpinBox">
-         <property name="enabled">
-          <bool>false</bool>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>80</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="minimum">
-          <number>8</number>
-         </property>
-         <property name="maximum">
-          <number>18</number>
-         </property>
-         <property name="value">
-          <number>10</number>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0">
-        <widget class="QLabel" name="pilotSortLabel">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <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="2" 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>Last Name</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>First Name</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Company</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-       <item row="3" column="0">
-        <widget class="QLabel" name="acftSortLabel">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <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="3" column="2">
-        <widget class="QComboBox" name="acftSortComboBox">
-         <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>Registration</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Type</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Company</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-       <item row="4" column="0">
-        <widget class="QLabel" name="logbookViewLabel">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <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 Display</string>
-         </property>
-        </widget>
-       </item>
-       <item row="4" 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>
-        </widget>
-       </item>
-       <item row="5" column="0">
-        <widget class="QLabel" name="aliasLabel">
-         <property name="toolTip">
-          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How your own name is displayed in your logbook&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="text">
-          <string>Show own name as</string>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="2">
-        <widget class="QComboBox" name="aliasComboBox">
-         <item>
-          <property name="text">
-           <string>self</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>SELF</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Lastname, Firstname</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-       <item row="6" column="0">
-        <widget class="QLabel" name="languageLabel">
-         <property name="text">
-          <string>Language</string>
-         </property>
-        </widget>
-       </item>
-       <item row="6" column="2">
-        <widget class="QComboBox" name="languageComboBox"/>
-       </item>
-      </layout>
-     </widget>
      <widget class="QWidget" name="backupTab">
       <attribute name="title">
        <string>Backups</string>