Browse Source

Added opl icons and logos

- Added opl icons and logos
  - AppIcon (preview, taskbar etc)
  - Logo (Homescreen)
- Added alog.h for logging to console
- Minor fixes and improvements
Felix Turo 4 years ago
parent
commit
aa793ff678

+ 1 - 0
CMakeLists.txt

@@ -66,6 +66,7 @@ set(PROJECT_SOURCES
     src/database/adatabasetypes.h
     src/functions/acalc.h
     src/functions/adatetime.h
+    src/functions/alog.h
     src/functions/areadcsv.h
     src/functions/astat.h
     src/functions/atime.h

+ 4 - 1
assets/icons.qrc

@@ -12,6 +12,9 @@
         <file>ionicon-icons/settings-outline.png</file>
         <file>ionicon-icons/power.png</file>
         <file>ionicon-icons/power-outline.png</file>
-        <file>ionicon-icons/pilot.png</file>
+        <file>opl-icons/pilot.png</file>
+        <file>opl-icons/appicon_round_transparent.svg</file>
+        <file>opl-icons/appicon_round_gradient.svg</file>
+        <file>opl-icons/opl_logo.svg</file>
     </qresource>
 </RCC>

File diff suppressed because it is too large
+ 1 - 0
assets/opl-icons/appicon_round_gradient.svg


File diff suppressed because it is too large
+ 1 - 0
assets/opl-icons/appicon_round_transparent.svg


BIN
assets/opl-icons/opl_logo.png


File diff suppressed because it is too large
+ 0 - 0
assets/opl-icons/opl_logo.svg


+ 0 - 0
assets/ionicon-icons/pilot.png → assets/opl-icons/pilot.png


+ 7 - 5
main.cpp

@@ -23,6 +23,8 @@
 #include "src/classes/astandardpaths.h"
 #include "src/classes/asettings.h"
 #include "src/classes/astyle.h"
+#include "src/oplconstants.h"
+#include "src/functions/alog.h"
 #include <QApplication>
 #include <QProcess>
 #include <QSettings>
@@ -42,7 +44,7 @@ int main(int argc, char *argv[])
     QCoreApplication::setApplicationName(APPNAME);
 
     if(!AStandardPaths::setup()){
-        DEB << "Standard paths not valid.";
+        LOG << "Unable to create directories.\n";
         return 1;
     }
 
@@ -51,13 +53,13 @@ int main(int argc, char *argv[])
     AStyle::setup();
 
     if (!aDB->connect()) {
-        DEB << "Error establishing database connection";
+        LOG << "Error establishing database connection\n";
         return 2;
     }
 
     if (!ASettings::read(ASettings::Main::SetupComplete).toBool()) {
         if(FirstRunDialog().exec() == QDialog::Rejected){
-            DEB << "First run not accepted. Exiting.";
+            LOG << "Initial setup incomplete or unsuccessfull. Exiting.\n";
             return 3;
         }
         ASettings::write(ASettings::Main::SetupComplete, true);
@@ -66,12 +68,12 @@ int main(int argc, char *argv[])
 
     ARunGuard guard(QStringLiteral("opl_single_key"));
     if ( !guard.tryToRun() ){
-        DEB << "Another Instance of openPilotLog is already running. Exiting.";
+        LOG << "Another Instance of openPilotLog is already running. Exiting.\n";
         return 0;
     }
 
-
     MainWindow w;
+    w.setWindowIcon(QIcon(Opl::Assets::APP_ICON_FILLED));
     //w.showMaximized();
     w.show();
     return openPilotLog.exec();

+ 1 - 33
mainwindow.cpp

@@ -26,14 +26,13 @@ MainWindow::MainWindow(QWidget *parent)
     , ui(new Ui::MainWindow)
 {
     ui->setupUi(this);
-    readSettings();
 
     // Set up Toolbar
     ui->actionHome->setIcon(QIcon(":/icons/ionicon-icons/home-outline.png"));
     ui->actionNewFlight->setIcon(QIcon(":/icons/ionicon-icons/airplane-outline.png"));
     ui->actionLogbook->setIcon(QIcon(":/icons/ionicon-icons/book-outline.png"));
     ui->actionAircraft->setIcon(QIcon(":/icons/ionicon-icons/airplane-outline.png"));
-    ui->actionPilots->setIcon(QIcon(":/icons/ionicon-icons/pilot.png"));
+    ui->actionPilots->setIcon(QIcon(Opl::Assets::PILOT_ICON));
     ui->actionSettings->setIcon(QIcon(":/icons/ionicon-icons/settings-outline.png"));
     ui->actionQuit->setIcon(QIcon(":/icons/ionicon-icons/power-outline.png"));
     ui->toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
@@ -137,37 +136,6 @@ void MainWindow::connectWidgets()
                      logbookWidget, &LogbookWidget::onLogbookWidget_viewSelectionChanged);
 }
 
-void MainWindow::readSettings()
-{
-    // Set application style
-    auto style_setting = ASettings::read(ASettings::Main::Style).toString();
-
-    if (style_setting == QLatin1String("Dark-Palette")) {
-        AStyle::setStyle(AStyle::darkPalette());
-        return;
-    }
-    for (const auto &style_name : AStyle::styles) {
-        if (style_setting == style_name) {
-            AStyle::setStyle(style_name);
-            return;
-        }
-    }
-
-    for (const auto &style_sheet : AStyle::styleSheets) {
-        if (style_setting == style_sheet.styleSheetName) {
-            AStyle::setStyle(style_sheet);
-            return;
-        }
-    }
-
-    if (!ASettings::read(ASettings::Main::UseSystemFont).toBool()) {
-        QFont font(ASettings::read(ASettings::Main::Font).toString());
-        font.setPointSize(ASettings::read(ASettings::Main::FontSize).toUInt());
-        qApp->setFont(font);
-        DEB << "Font set:" << font;
-    }
-}
-
 void MainWindow::on_actionSettings_triggered()
 {
     ui->stackedWidget->setCurrentWidget(settingsWidget);

+ 0 - 2
mainwindow.h

@@ -95,8 +95,6 @@ private:
 
     void connectWidgets();
 
-    void readSettings();
-
     int checkDbVersion();
 
 protected:

+ 1 - 0
openPilotLog.pro

@@ -65,6 +65,7 @@ HEADERS += \
     src/database/adatabasetypes.h \
     src/functions/acalc.h \
     src/functions/adatetime.h \
+    src/functions/alog.h \
     src/functions/areadcsv.h \
     src/functions/astat.h \
     src/functions/atime.h \

+ 2 - 2
src/classes/astandardpaths.cpp

@@ -25,9 +25,9 @@ bool AStandardPaths::setup()
     directories = {
         {Database, QDir(QStandardPaths::writableLocation(data_location))},
         {Templates, QDir(QStandardPaths::writableLocation(data_location)
-         + QStringLiteral("/templates"))},
+         + QLatin1String("/templates"))},
         {Backup, QDir(QStandardPaths::writableLocation(data_location)
-         + QStringLiteral("/backup"))}
+         + QLatin1String("/backup"))}
     };
     if (scan_directories())
         return true;

+ 15 - 5
src/classes/astyle.cpp

@@ -24,8 +24,10 @@
 #include <QStyle>
 #include <QStyleFactory>
 #include <QApplication>
+#include <QFont>
 #include "src/testing/adebug.h"
 #include "src/classes/asettings.h"
+#include "src/functions/alog.h"
 
 const QString AStyle::defaultStyle = QLatin1String("Fusion");
 
@@ -40,10 +42,18 @@ const QList<StyleSheet> AStyle::styleSheets = {
 QString AStyle::currentStyle = defaultStyle;
 
 /*!
- * \brief Setup style and stylesheet by reading from openPilotLog.ini
+ * \brief Setup Application style by reading from openPilotLog.ini
  */
 void AStyle::setup()
 {
+    // Set Font
+    if (!ASettings::read(ASettings::Main::UseSystemFont).toBool()) {
+        QFont font(ASettings::read(ASettings::Main::Font).toString());
+        font.setPointSize(ASettings::read(ASettings::Main::FontSize).toUInt());
+        qApp->setFont(font);
+        LOG << "Application Font set:\t" << font.toString().splitRef(',').first() << "\n";
+    }
+    // Set style, stylesheet or palette
     QString style_setting = ASettings::read(ASettings::Main::Style).toString();
 
     if (style_setting == QLatin1String("Dark-Palette")) {
@@ -60,7 +70,7 @@ void AStyle::setup()
     }
     for (const auto &style_sheet : styleSheets) {
         if (style_setting == style_sheet.styleSheetName) {
-            setStyle(style_sheet.styleSheetName);
+            setStyle(style_sheet);
             currentStyle = style_sheet.styleSheetName;
             return;
         }
@@ -78,7 +88,7 @@ void AStyle::resetStyle()
 void AStyle::setStyle(const QString &style_key)
 {
     resetStyle();
-    DEB << "Setting style: " << style_key;
+    LOG << "Setting style:\t" << style_key << "\n";
     QApplication::setStyle(QStyleFactory::create(style_key));
     currentStyle = style_key;
 }
@@ -86,7 +96,7 @@ void AStyle::setStyle(const QString &style_key)
 void AStyle::setStyle(const StyleSheet &style_sheet)
 {
     resetStyle();
-    DEB << "Setting stylesheet: " << style_sheet.styleSheetName;
+    LOG << "Setting stylesheet:\t" << style_sheet.styleSheetName << "\n";
     qApp->setStyleSheet(read_stylesheet(style_sheet.fileName));
     currentStyle = style_sheet.styleSheetName;
 }
@@ -94,7 +104,7 @@ void AStyle::setStyle(const StyleSheet &style_sheet)
 void AStyle::setStyle(const QPalette &palette)
 {
     resetStyle();
-    DEB << "Setting Palette...";
+    LOG << "Setting Colour Palette...\n";
     qApp->setPalette(palette);
 }
 

+ 3 - 2
src/database/adatabase.cpp

@@ -19,6 +19,7 @@
 #include "src/testing/adebug.h"
 #include "src/classes/astandardpaths.h"
 #include "src/oplconstants.h"
+#include "src/functions/alog.h"
 
 
 ADatabaseError::ADatabaseError(QString msg_)
@@ -109,7 +110,7 @@ bool ADatabase::connect()
     if (!db.open())
         return false;
 
-    DEB << "Database connection established." << db.lastError().text();
+    LOG << "Database connection established.\n";
     // Enable foreign key restrictions
     QSqlQuery query(QStringLiteral("PRAGMA foreign_keys = ON;"));
     updateLayout();
@@ -120,7 +121,7 @@ void ADatabase::disconnect()
 {
     auto db = ADatabase::database();
     db.close();
-    DEB << "Database connection closed.";
+    LOG << "Database connection closed.\n";
 }
 
 QSqlDatabase ADatabase::database()

+ 30 - 0
src/functions/alog.h

@@ -0,0 +1,30 @@
+/*
+ *openPilotLog - A FOSS Pilot Logbook Application
+ *Copyright (C) 2020-2021 Felix Turowsky
+ *
+ *This program is free software: you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation, either version 3 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+#ifndef ALOG_H
+#define ALOG_H
+
+/* Use QTextStream to print status messages. These messages
+ * are oriented towards end-users and will persist even when
+ * compiling a release without enabling qDebug. As such, LOG
+ * should be used to document "important" enough steps that
+ * the user would care about or that are "milestones" that
+ * the program runs through.
+ */
+#define LOG QTextStream(stdout) << "openPilotLog - "
+
+#endif // ALOG_H

+ 2 - 4
src/gui/widgets/aircraftwidget.cpp

@@ -28,7 +28,6 @@ AircraftWidget::AircraftWidget(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::AircraftWidget)
 {
-    DEB << "New AircraftWidet";
     ui->setupUi(this);
     ui->stackedWidget->addWidget(this->findChild<QWidget*>("welcomePageTails"));
     ui->stackedWidget->setCurrentWidget(this->findChild<QWidget*>("welcomePageTails"));
@@ -38,7 +37,6 @@ AircraftWidget::AircraftWidget(QWidget *parent) :
 
 AircraftWidget::~AircraftWidget()
 {
-    DEB << "Deleting NewAircraftWidget";
     delete ui;
 }
 
@@ -140,9 +138,9 @@ void AircraftWidget::onDeleteUnsuccessful()
     } else {
         QString constrained_flights_string;
         for (int i=0; i<constrained_flights.length(); i++) {
-            constrained_flights_string.append(constrained_flights[i].summary() + QStringLiteral("&nbsp;&nbsp;&nbsp;&nbsp;<br>"));
+            constrained_flights_string.append(constrained_flights[i].summary() + QLatin1String("&nbsp;&nbsp;&nbsp;&nbsp;<br>"));
             if (i>10) {
-                constrained_flights_string.append("<br>[...]<br>");
+                constrained_flights_string.append(QLatin1String("<br>[...]<br>"));
                 break;
             }
         }

+ 2 - 0
src/gui/widgets/homewidget.cpp

@@ -38,6 +38,8 @@ HomeWidget::HomeWidget(QWidget *parent) :
     today = QDate::currentDate();
     currWarningThreshold = ASettings::read(ASettings::UserData::CurrWarningThreshold).toInt();
     ftlWarningThreshold = ASettings::read(ASettings::UserData::FtlWarningThreshold).toDouble();
+    auto logo = QPixmap(Opl::Assets::LOGO);
+    ui->logoLabel->setPixmap(logo);
     ui->welcomeLabel->setText(tr("Welcome to openPilotLog, %1!").arg(userName()));
 
 

+ 125 - 115
src/gui/widgets/homewidget.ui

@@ -14,8 +14,29 @@
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_4">
-   <item row="9" column="0">
-    <widget class="QLabel" name="limitationsLabel">
+   <item row="3" column="0">
+    <widget class="Line" name="line_7">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="Line" name="line_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="0">
+    <widget class="Line" name="line_4">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="totalsLabel">
      <property name="font">
       <font>
        <weight>75</weight>
@@ -23,7 +44,7 @@
       </font>
      </property>
      <property name="text">
-      <string>Limitations</string>
+      <string>Your Totals</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignBottom|Qt::AlignHCenter</set>
@@ -31,14 +52,17 @@
     </widget>
    </item>
    <item row="1" column="0">
-    <widget class="Line" name="line_2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
+    <widget class="QLabel" name="welcomeLabel">
+     <property name="text">
+      <string>Welcome to openPilotLog!</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
      </property>
     </widget>
    </item>
-   <item row="3" column="0">
-    <widget class="QLabel" name="totalsLabel">
+   <item row="7" column="0">
+    <widget class="QLabel" name="currencyLabel">
      <property name="font">
       <font>
        <weight>75</weight>
@@ -46,21 +70,108 @@
       </font>
      </property>
      <property name="text">
-      <string>Your Totals</string>
+      <string>Currency</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignBottom|Qt::AlignHCenter</set>
      </property>
     </widget>
    </item>
-   <item row="2" column="0">
-    <widget class="Line" name="line_7">
+   <item row="5" column="0">
+    <widget class="Line" name="line">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
-   <item row="8" column="0">
+   <item row="11" column="0">
+    <widget class="Line" name="line_3">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="12" column="0">
+    <layout class="QGridLayout" name="gridLayout_2">
+     <item row="0" column="0">
+      <widget class="QLabel" name="FlightTime28dLabel">
+       <property name="text">
+        <string>Flight Time (last 28 days)</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLabel" name="FlightTime28dDisplayLabel">
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text">
+        <string>0</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="FlightTimeCalYearLabel">
+       <property name="text">
+        <string>Flight Time (this calendar year)</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLabel" name="FlightTimeCalYearDisplayLabel">
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text">
+        <string>0</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="FlightTime12mLabel">
+       <property name="text">
+        <string>Flight Time (last 12 calendar months)</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QLabel" name="FlightTime12mDisplayLabel">
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text">
+        <string>0</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="10" column="0">
+    <widget class="QLabel" name="limitationsLabel">
+     <property name="font">
+      <font>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
+     <property name="text">
+      <string>Limitations</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignBottom|Qt::AlignHCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="0">
     <layout class="QGridLayout" name="gridLayout_3">
      <item row="0" column="0">
       <widget class="QLabel" name="TakeOffLabel">
@@ -312,101 +423,7 @@
      </item>
     </layout>
    </item>
-   <item row="11" column="0">
-    <layout class="QGridLayout" name="gridLayout_2">
-     <item row="0" column="0">
-      <widget class="QLabel" name="FlightTime28dLabel">
-       <property name="text">
-        <string>Flight Time (last 28 days)</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="FlightTime28dDisplayLabel">
-       <property name="layoutDirection">
-        <enum>Qt::LeftToRight</enum>
-       </property>
-       <property name="text">
-        <string>0</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="FlightTimeCalYearLabel">
-       <property name="text">
-        <string>Flight Time (this calendar year)</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLabel" name="FlightTimeCalYearDisplayLabel">
-       <property name="layoutDirection">
-        <enum>Qt::LeftToRight</enum>
-       </property>
-       <property name="text">
-        <string>0</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="FlightTime12mLabel">
-       <property name="text">
-        <string>Flight Time (last 12 calendar months)</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLabel" name="FlightTime12mDisplayLabel">
-       <property name="layoutDirection">
-        <enum>Qt::LeftToRight</enum>
-       </property>
-       <property name="text">
-        <string>0</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
    <item row="6" column="0">
-    <widget class="QLabel" name="currencyLabel">
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
-     <property name="text">
-      <string>Currency</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignBottom|Qt::AlignHCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="10" column="0">
-    <widget class="Line" name="line_3">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="7" column="0">
-    <widget class="Line" name="line_4">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0">
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="totalLabel">
@@ -938,22 +955,15 @@
     </layout>
    </item>
    <item row="0" column="0">
-    <widget class="QLabel" name="welcomeLabel">
+    <widget class="QLabel" name="logoLabel">
      <property name="text">
-      <string>Welcome to openPilotLog!</string>
+      <string/>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
     </widget>
    </item>
-   <item row="4" column="0">
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <resources/>

+ 4 - 3
src/gui/widgets/logbookwidget.cpp

@@ -23,6 +23,7 @@
 #include "src/classes/asettings.h"
 #include "src/gui/dialogues/newflightdialog.h"
 #include "src/testing/adebug.h"
+#include "src/functions/alog.h"
 
 const QMap<int, QString> FILTER_MAP = {
     {0, QStringLiteral("Date LIKE \"%")},
@@ -69,17 +70,17 @@ void LogbookWidget::prepareModelAndView(int view_id)
 {
     switch (view_id) {
     case 0:
-        DEB << "Loading Default View...";
+        LOG << "Loading Default View...\n";
         displayModel->setTable(QStringLiteral("viewDefault"));
         displayModel->select();
         break;
     case 1:
-        DEB << "Loading Default View...";
+        LOG << "Loading Default View...\n";
         displayModel->setTable(QStringLiteral("viewEASA"));
         displayModel->select();
         break;
     default:
-        DEB << "Loading Default View...";
+        LOG << "Loading Default View...\n";
         displayModel->setTable(QStringLiteral("viewDefault"));
         displayModel->select();
     }

+ 11 - 3
src/gui/widgets/settingswidget.cpp

@@ -142,6 +142,7 @@ void SettingsWidget::readSettings()
     ui->pilotSortComboBox->setCurrentIndex(ASettings::read(ASettings::UserData::PilotSortColumn).toInt());
     ui->acAllowIncompleteComboBox->setCurrentIndex(ASettings::read(ASettings::UserData::AcftAllowIncomplete).toInt());
     {
+        // Block style widgets signals to not trigger style changes during UI setup
         const QSignalBlocker style_blocker(ui->styleComboBox);
         const QSignalBlocker font_blocker1(ui->fontSpinBox);
         const QSignalBlocker font_blocker2(ui->fontComboBox);
@@ -149,13 +150,18 @@ void SettingsWidget::readSettings()
         ui->styleComboBox->setCurrentText(ASettings::read(ASettings::Main::Style).toString());
         ui->fontSpinBox->setValue(ASettings::read(ASettings::Main::FontSize).toUInt());
         ui->fontComboBox->setCurrentFont(QFont(ASettings::read(ASettings::Main::Font).toString()));
-        ui->fontCheckBox->setChecked(ASettings::read(ASettings::Main::UseSystemFont).toBool());
+        bool use_system_font = ASettings::read(ASettings::Main::UseSystemFont).toBool();
+        ui->fontCheckBox->setChecked(use_system_font);
+        if (!use_system_font) {
+            ui->fontComboBox->setEnabled(true);
+            ui->fontSpinBox->setEnabled(true);
+        }
     }
 }
 
 void SettingsWidget::setupValidators()
 {
-    DEB << "Setting up Validators...";
+    // DEB << "Setting up Validators...";
     for(const auto& pair : LINE_EDIT_VALIDATORS){
         auto line_edit = parent()->findChild<QLineEdit*>(pair.first);
         if(line_edit != nullptr){
@@ -335,12 +341,14 @@ void SettingsWidget::on_acAllowIncompleteComboBox_currentIndexChanged(int index)
 void SettingsWidget::on_aboutPushButton_clicked()
 {
     QMessageBox message_box(this);
+    QPixmap icon = QPixmap(Opl::Assets::APP_ICON_TRANSPARENT);
+    message_box.setIconPixmap(icon.scaledToWidth(64, Qt::TransformationMode::SmoothTransformation));
     QString SQLITE_VERSION = aDB->sqliteVersion();
     QString text = QMessageBox::tr(
 
                        "<h3><center>About openPilotLog</center></h3>"
                        "<br>"
-                       "(c) 2020-2021 Felix Turowsky"
+                       "&#169; 2020-2021 Felix Turowsky"
                        "<br>"
                        "<p>This is a collaboratively developed Free and Open Source Application. "
                        "Visit us <a href=\"https://%1/\">here</a> for more information.</p>"

+ 9 - 0
src/oplconstants.h

@@ -170,6 +170,15 @@ static const auto DEFAULT_AIRCRAFT_POSITION = DataPosition(TABLE_AIRCRAFT, 0);
 
 } // namespace opl::db
 
+namespace Assets {
+
+static const auto APP_ICON_FILLED = QLatin1String(":/icons/opl-icons/appicon_round_gradient.svg");
+static const auto APP_ICON_TRANSPARENT = QLatin1String(":/icons/opl-icons/appicon_round_transparent.svg");
+static const auto LOGO = QLatin1String(":/icons/opl-icons/opl_logo.svg");
+static const auto PILOT_ICON = QLatin1String(":/icons/opl-icons/pilot.png");
+
+}
+
 } // namespace opl
 
 #endif // OPLCONSTANTS_H

Some files were not shown because too many files changed in this diff