Преглед изворни кода

Minor Fixes and Improvements

- Updated Database templates eliminating a parsing error
- various adjustments for future-proofing (Qt6)
- fixed an issue in NewFlightDialog where a valid entry in the acftLineEdit would get deleted
- improved completionData updating (still WIP)
- fixed a bug in FirstRunDialog where Night Angle EASA was set to +6 iso -6 degrees
Felix пре 3 година
родитељ
комит
a8b7a224b1

+ 112 - 112
assets/database/templates/airports.json

@@ -3943,7 +3943,7 @@
         "icao": "EDBM",
         "lat": 52.073612,
         "long": 11.626389,
-        "name": "\"\"\"Magdeburg \"\"\"\"City\"\"\"\" Airport\"\"\"",
+        "name": "Magdeburg City Airport",
         "tzolson": "Europe/Berlin",
         "utcoffset": 1
     },
@@ -7585,14 +7585,14 @@
     },
     {
         "airport_id": 633,
-        "alt": "Norway",
-        "country": "16.678100585938",
+        "alt": 85,
+        "country": "Norway",
         "iata": "EVE",
         "icao": "ENEV",
-        "lat": "\"Evenes\"\"\"",
-        "long": 68.491302490234,
-        "name": "\"\"\"Harstad/Narvik Airport\"",
-        "tzolson": "1",
+        "lat": 68.491302490234,
+        "long": 16.678100585938,
+        "name": "Evenes Harstad/Narvik Airport",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 84
     },
     {
@@ -7777,26 +7777,26 @@
     },
     {
         "airport_id": 649,
-        "alt": "Norway",
-        "country": "10.785439",
+        "alt": 173,
+        "country": "Norway",
         "iata": "RYG",
         "icao": "ENRY",
-        "lat": "\"Rygge\"\"\"",
-        "long": 59.378817,
-        "name": "\"\"\"Moss Airport\"",
-        "tzolson": "1",
+        "lat": 59.378817,
+        "long": 10.785439,
+        "name": "Rygge Moss Airport",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 174
     },
     {
         "airport_id": 650,
-        "alt": "Norway",
-        "country": "15.465600013733",
+        "alt": 94,
+        "country": "Norway",
         "iata": "LYR",
         "icao": "ENSB",
-        "lat": "\"Longyear\"\"\"",
-        "long": 78.246101379395,
-        "name": "\"\"\"Svalbard Airport\"",
-        "tzolson": "1",
+        "lat": 78.246101379395,
+        "long": 15.465600013733,
+        "name": "Longyear Svalbard Airport",
+        "tzolson": "Europe/Arctic",
         "utcoffset": 88
     },
     {
@@ -7837,26 +7837,26 @@
     },
     {
         "airport_id": 654,
-        "alt": "Norway",
-        "country": "18.9188995361328",
+        "alt": 32,
+        "country": "Norway",
         "iata": "TOS",
         "icao": "ENTC",
-        "lat": "\"\"\"\"",
-        "long": 69.6832962036133,
-        "name": "\"\"\"Tromsø Airport\"",
-        "tzolson": "1",
+        "lat": 69.6832962036133,
+        "long": 18.9188995361328,
+        "name": "Tromsø Airport",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 31
     },
     {
         "airport_id": 655,
-        "alt": "Norway",
-        "country": "10.258600235",
+        "alt": 285,
+        "country": "Norway",
         "iata": "TRF",
         "icao": "ENTO",
-        "lat": "\"Torp\"\"\"",
-        "long": 59.1866989136,
-        "name": "\"\"\"Sandefjord Airport\"",
-        "tzolson": "1",
+        "lat": 59.1866989136,
+        "long": 10.258600235,
+        "name": "Torp Sandefjord Airport",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 286
     },
     {
@@ -7987,7 +7987,7 @@
         "icao": "EPSC",
         "lat": 53.5847015381,
         "long": 14.9021997452,
-        "name": "\"\"\"Szczecin-Goleniów \"\"\"\"Solidarność\"\"\"\" Airport\"\"\"",
+        "name": "Szczecin-Goleniów Solidarność Airport",
         "tzolson": "Europe/Warsaw",
         "utcoffset": 1
     },
@@ -15715,7 +15715,7 @@
         "icao": "LFLX",
         "lat": 46.860278,
         "long": 1.721111,
-        "name": "\"\"\"Châteauroux-Déols \"\"\"\"Marcel Dassault\"\"\"\" Airport\"\"\"",
+        "name": "Châteauroux-Déols Marcel Dassault Airport",
         "tzolson": "Europe/Paris",
         "utcoffset": 1
     },
@@ -17419,7 +17419,7 @@
         "icao": "LGZA",
         "lat": 37.7509,
         "long": 20.8843,
-        "name": "\"\"\"Zakynthos International Airport \"\"\"\"Dionysios Solomos\"\"\"\"\"\"\"",
+        "name": "Zakynthos International Airport Dionysios Solomos",
         "tzolson": "Europe/Athens",
         "utcoffset": 2
     },
@@ -17551,7 +17551,7 @@
         "icao": "LIBF",
         "lat": 41.432899,
         "long": 15.535,
-        "name": "\"\"\"Foggia \"\"\"\"Gino Lisa\"\"\"\" Airport\"\"\"",
+        "name": "Foggia Gino Lisa Airport",
         "tzolson": "Europe/Rome",
         "utcoffset": 1
     },
@@ -17563,7 +17563,7 @@
         "icao": "LIBG",
         "lat": 40.517502,
         "long": 17.4032,
-        "name": "\"\"\"Taranto-Grottaglie \"\"\"\"Marcello Arlotta\"\"\"\" Airport\"\"\"",
+        "name": "Taranto-Grottaglie Marcello Arlotta Airport",
         "tzolson": "Europe/Rome",
         "utcoffset": 1
     },
@@ -32203,7 +32203,7 @@
         "icao": "SVCB",
         "lat": 8.12216091156,
         "long": -63.5369567871,
-        "name": "\"\"\"Aeropuerto \"\"\"\"General Tomas de Heres\"\"\"\". Ciudad Bolivar\"\"\"",
+        "name": "Aeropuerto General Tomas de Heres Ciudad Bolivar",
         "tzolson": "America/Caracas",
         "utcoffset": -4
     },
@@ -36829,15 +36829,15 @@
     },
     {
         "airport_id": 3070,
-        "alt": "Indonesia",
-        "country": "128.089004517",
+        "alt": 33,
+        "country": "Indonesia",
         "iata": "AMQ",
         "icao": "WAPP",
-        "lat": "\"Ambon\"\"\"",
-        "long": -3.7102599144,
-        "name": "\"\"\"Pattimura Airport\"",
-        "tzolson": "9",
-        "utcoffset": 33
+        "lat": -3.7102599144,
+        "long": 128.089004517,
+        "name": "Ambon Pattimura Airport",
+        "tzolson": "Asia/Jayapura",
+        "utcoffset": 9
     },
     {
         "airport_id": 3071,
@@ -37765,15 +37765,15 @@
     },
     {
         "airport_id": 3148,
-        "alt": "Australia",
-        "country": "144.753006",
+        "alt": 14,
+        "country": "Australia",
         "iata": null,
         "icao": "YMPC",
-        "lat": "\"Point Cook Base\"\"\"",
-        "long": -37.932201,
-        "name": "\"\"\"RAAF Williams\"",
-        "tzolson": "10",
-        "utcoffset": 14
+        "lat": -37.932201,
+        "long": 144.753006,
+        "name": "Point Cook Base RAAF Williams",
+        "tzolson": "Australia/Melbourne",
+        "utcoffset": 10
     },
     {
         "airport_id": 3149,
@@ -38929,15 +38929,15 @@
     },
     {
         "airport_id": 3245,
-        "alt": "United States",
-        "country": "-91.9356",
+        "alt": 206,
+        "country": "United States",
         "iata": "PBF",
         "icao": "KPBF",
-        "lat": "\"Grider Field\"\"\"",
-        "long": 34.1731,
-        "name": "\"\"\"Pine Bluff Regional Airport\"",
-        "tzolson": "-6",
-        "utcoffset": 206
+        "lat": 34.1731,
+        "long": -91.9356,
+        "name": "Grider Field Pine Bluff Regional Airport",
+        "tzolson": "America/Chicago",
+        "utcoffset": -6
     },
     {
         "airport_id": 3246,
@@ -40435,7 +40435,7 @@
         "icao": "PAAQ",
         "lat": 61.594898,
         "long": -149.08901,
-        "name": "\"\"\"Warren \"\"\"\"Bud\"\"\"\" Woods Palmer Municipal Airport\"\"\"",
+        "name": "Warren Bud Woods Palmer Municipal Airport",
         "tzolson": "America/Anchorage",
         "utcoffset": -9
     },
@@ -40837,15 +40837,15 @@
     },
     {
         "airport_id": 3404,
-        "alt": "United States",
-        "country": "-87.307602",
+        "alt": 589,
+        "country": "United States",
         "iata": "HUF",
         "icao": "KHUF",
-        "lat": "\"Hulman Field\"\"\"",
-        "long": 39.4515,
-        "name": "\"\"\"Terre Haute Regional Airport\"",
-        "tzolson": "-5",
-        "utcoffset": 589
+        "lat": 39.4515,
+        "long": -87.307602,
+        "name": "Hulman Field Terre Haute Regional Airport",
+        "tzolson": "America/Indiana",
+        "utcoffset": -5
     },
     {
         "airport_id": 3405,
@@ -48913,14 +48913,14 @@
     },
     {
         "airport_id": 4077,
-        "alt": "Norway",
-        "country": "6.0741000175476",
+        "alt": 243,
+        "country": "Norway",
         "iata": "HOV",
         "icao": "ENOV",
-        "lat": "\"Hovden\"\"\"",
-        "long": 62.180000305176,
-        "name": "\"\"\"Ørsta-Volda Airport\"",
-        "tzolson": "1",
+        "lat": 62.180000305176,
+        "long": 6.0741000175476,
+        "name": "Hovden Ørsta-Volda Airport",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 243
     },
     {
@@ -48973,14 +48973,14 @@
     },
     {
         "airport_id": 4082,
-        "alt": "Norway",
-        "country": "10.6171998977661",
+        "alt": 56,
+        "country": "Norway",
         "iata": "FBU",
         "icao": "ENFB",
-        "lat": "\"Fornebu Airport\"\"\"",
-        "long": 59.8958015441895,
-        "name": "\"\"\"Oslo\"",
-        "tzolson": "1",
+        "lat": 59.8958015441895,
+        "long": 10.6171998977661,
+        "name": "Fornebu Airport Oslo",
+        "tzolson": "Europe/Oslo",
         "utcoffset": 0
     },
     {
@@ -51445,27 +51445,27 @@
     },
     {
         "airport_id": 4288,
-        "alt": "Norway",
-        "country": "14.301400184631",
+        "alt": 229,
+        "country": "Norway",
         "iata": "MQN",
         "icao": "ENRA",
-        "lat": "\"Røssvoll\"\"\"",
-        "long": 66.363899230957,
-        "name": "\"\"\"Mo i Rana Airport\"",
-        "tzolson": "1",
-        "utcoffset": 229
+        "lat": 66.363899230957,
+        "long": 14.301400184631,
+        "name": "Røssvoll Mo i Rana Airport",
+        "tzolson": "Europe/Oslo",
+        "utcoffset": 1
     },
     {
         "airport_id": 4289,
-        "alt": "Norway",
-        "country": "11.14610004425",
+        "alt": 14,
+        "country": "Norway",
         "iata": "RVK",
         "icao": "ENRM",
-        "lat": "\"Ryum\"\"\"",
-        "long": 64.838302612305,
-        "name": "\"\"\"Rørvik Airport\"",
-        "tzolson": "1",
-        "utcoffset": 14
+        "lat": 64.838302612305,
+        "long": 11.14610004425,
+        "name": "Ryum Rørvik Airport",
+        "tzolson": "Europe/Oslo",
+        "utcoffset": 1
     },
     {
         "airport_id": 4290,
@@ -51529,15 +51529,15 @@
     },
     {
         "airport_id": 4295,
-        "alt": "Norway",
-        "country": "31.044900894165",
+        "alt": 42,
+        "country": "Norway",
         "iata": "VAW",
         "icao": "ENSS",
-        "lat": "\"Svartnes\"\"\"",
-        "long": 70.355400085449,
-        "name": "\"\"\"Vardø Airport\"",
-        "tzolson": "1",
-        "utcoffset": 42
+        "lat": 70.355400085449,
+        "long": 31.044900894165,
+        "name": "Svartnes Vardø Airport",
+        "tzolson": "Europe/Oslo",
+        "utcoffset": 1
     },
     {
         "airport_id": 4296,
@@ -62785,14 +62785,14 @@
     },
     {
         "airport_id": 5233,
-        "alt": "Australia",
-        "country": "144.746002197266",
+        "alt": 14,
+        "country": "Australia",
         "iata": null,
         "icao": "YLVT",
-        "lat": "\"Laverton Base\"\"\"",
-        "long": -37.8636016845703,
-        "name": "\"\"\"RAAF Williams\"",
-        "tzolson": "10",
+        "lat": -37.8636016845703,
+        "long": 144.746002197266,
+        "name": "RAAF Williams Laverton Base",
+        "tzolson": "Australia/Sydney",
         "utcoffset": 18
     },
     {
@@ -91609,15 +91609,15 @@
     },
     {
         "airport_id": 7635,
-        "alt": "South Sudan",
-        "country": "32.500556",
+        "alt": 1290,
+        "country": "South Sudan",
         "iata": "HGI",
         "icao": "HSFA",
-        "lat": "\"Heliport\"\"\"",
-        "long": 10.529167,
-        "name": "\"\"\"Paloich Airport\"",
-        "tzolson": "\\N",
-        "utcoffset": 1290
+        "lat": 10.529167,
+        "long": 32.500556,
+        "name": "Paloich Airport Heliport",
+        "tzolson": "Africa/Mozambique",
+        "utcoffset": 2 
     },
     {
         "airport_id": 7636,

+ 1 - 2
mainwindow.cpp

@@ -30,8 +30,7 @@
 #include "src/functions/adatetime.h"
 void MainWindow::doDebugStuff()
 {
-    NewFlightDialog nf(completionData, this);
-    nf.exec();
+    LOG << AStandardPaths::directory(AStandardPaths::Database).filesystemAbsolutePath();
 }
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)

+ 1 - 1
src/classes/ahash.cpp

@@ -25,7 +25,7 @@ AHash::AHash(QFileInfo &file_info)
         QCryptographicHash hash(QCryptographicHash::Md5);
         if (hash.addData(&f)) {
             checksum = hash.result();
-            DEB << "File: " << f;
+            DEB << "File: " << f.fileName();
             DEB << "Hash: " << hash.result().toHex();
         } else {
             checksum = QByteArray();

+ 2 - 2
src/database/adatabase.cpp

@@ -783,7 +783,7 @@ bool ADatabase::createBackup(const QString& dest_file)
     LOG << "Backing up current database to: " << dest_file;
     ADatabase::disconnect();
     QFile db_file(databaseFile.absoluteFilePath());
-    DEB << "File to Overwrite:" << db_file;
+    //DEB << "File to Overwrite:" << db_file;
 
     if (!db_file.copy(dest_file)) {
         LOG << "Unable to backup old database:" << db_file.errorString();
@@ -862,7 +862,7 @@ bool ADatabase::restoreBackup(const QString& backup_file)
 
     if (!backup.copy(default_loc))
     {
-        LOG << backup.errorString() << "Could not copy" << backup << "to" << databaseFile;
+        LOG << backup.errorString() << "Could not copy" << backup.fileName() << "to" << databaseFile;
         // try to restore previously used db
         current_db.rename(default_loc);
         return false;

+ 1 - 1
src/database/adatabasesetup.cpp

@@ -330,7 +330,7 @@ bool ADataBaseSetup::backupOldData()
     QString backup_name = database_file.baseName() + QLatin1String("_bak_")
             + date_string + QLatin1String(".db");
     QFile file(database_file.absoluteFilePath());
-    DEB << "File:" << file;
+    DEB << "File:" << file.fileName();
     if (!file.rename(backup_dir.absoluteFilePath(backup_name))) {
         LOG << "Unable to backup old database.\n";
         return false;

+ 4 - 4
src/functions/acalc.h

@@ -102,8 +102,8 @@ QT_DEPRECATED
 inline int QTimeToMinutes(QTime time)
 {
     QString timestring = time.toString("hh:mm");
-    int minutes = (timestring.leftRef(2).toInt()) * 60;
-    minutes += timestring.rightRef(2).toInt();
+    int minutes = (timestring.left(2).toInt()) * 60;
+    minutes += timestring.right(2).toInt();
     return minutes;
 }
 
@@ -115,8 +115,8 @@ inline int QTimeToMinutes(QTime time)
 QT_DEPRECATED
 inline int stringToMinutes(QString timestring)
 {
-    int minutes = (timestring.leftRef(2).toInt()) * 60;
-    minutes += timestring.rightRef(2).toInt();
+    int minutes = (timestring.left(2).toInt()) * 60;
+    minutes += timestring.right(2).toInt();
     timestring = QString::number(minutes);
     return minutes;
 }

+ 3 - 3
src/functions/adate.cpp

@@ -37,7 +37,7 @@ void ADate::padCentury(QString &io_user_input, Opl::Date::ADateFormat format)
 {
     switch (format) {
     case Opl::Date::ADateFormat::ISODate: {
-        int year = io_user_input.leftRef(2).toInt();
+        int year = io_user_input.left(2).toInt();
         if (year > 50)
             io_user_input.prepend(QStringLiteral("19"));
         else
@@ -45,7 +45,7 @@ void ADate::padCentury(QString &io_user_input, Opl::Date::ADateFormat format)
         break;
     }
     case Opl::Date::ADateFormat::DE: {
-        int year = io_user_input.rightRef(2).toInt();
+        int year = io_user_input.right(2).toInt();
         if (year > 50)
             io_user_input.insert(6, QStringLiteral("19"));
         else
@@ -53,7 +53,7 @@ void ADate::padCentury(QString &io_user_input, Opl::Date::ADateFormat format)
         break;
     }
     case Opl::Date::ADateFormat::EN: {
-        int year = io_user_input.rightRef(2).toInt();
+        int year = io_user_input.right(2).toInt();
         if (year > 50)
             io_user_input.insert(6, QStringLiteral("19"));
         else

+ 1 - 2
src/gui/dialogues/firstrundialog.cpp

@@ -254,7 +254,6 @@ bool FirstRunDialog::downloadTemplates(QString branch_name)
 
 bool FirstRunDialog::verifyTemplates()
 {
-    QDir template_dir(AStandardPaths::directory(AStandardPaths::Templates));
     const auto table_names = aDB->getTemplateTableNames();
     for (const auto &table_name : table_names) {
         const QString path = AStandardPaths::asChildOfDir(AStandardPaths::Templates, table_name);
@@ -287,7 +286,7 @@ void FirstRunDialog::writeSettings()
     }
     switch (ui->nightRulesComboBox->currentIndex()) {
     case 0:
-        ASettings::write(ASettings::FlightLogging::NightAngle, 6);
+        ASettings::write(ASettings::FlightLogging::NightAngle, -6);
         break;
     case 1:
         ASettings::write(ASettings::FlightLogging::NightAngle, 0);

+ 4 - 3
src/gui/dialogues/newflightdialog.cpp

@@ -173,7 +173,7 @@ void NewFlightDialog::readSettings()
 {
     ASettings settings;
     ui->functionComboBox->setCurrentText(ASettings::read(ASettings::FlightLogging::Function).toString());
-    ui->approachComboBox->setCurrentText(ASettings::read(ASettings::FlightLogging::Approach).toString());
+    ui->approachComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::Approach).toInt());
     ui->pilotFlyingCheckBox->setChecked(ASettings::read(ASettings::FlightLogging::PilotFlying).toBool());
     ui->ifrCheckBox->setChecked(ASettings::read(ASettings::FlightLogging::LogIFR).toBool());
     ui->flightNumberLineEdit->setText(ASettings::read(ASettings::FlightLogging::FlightNumberPrefix).toString());
@@ -605,10 +605,11 @@ void NewFlightDialog::on_acftLineEdit_editingFinished()
         return;
     }
 
-    // Mark as bad input and prompt for adding new tail
-    onBadInputReceived(line_edit);
     if (!(line_edit->text() == QString()))
         addNewTail(*line_edit);
+    // Mark as bad input and prompt for adding new tail
+    onBadInputReceived(line_edit);
+
 }
 
 void NewFlightDialog::on_doftLineEdit_editingFinished()

+ 1 - 62
src/gui/widgets/logbookwidget.cpp

@@ -133,47 +133,6 @@ void LogbookWidget::flightsTableView_selectionChanged()
         on_actionEdit_Flight_triggered();
 }
 
-/*!
- * \brief LogbookWidget::on_newFlightButton_clicked opens a NewFlightDialog
- */
-//void LogbookWidget::on_newFlightButton_clicked()
-//{
-//    auto old_state = aDB->getUserDataState();
-//
-//    NewFlightDialog nf(completionData, this);
-//    nf.exec();
-//
-//    auto new_state = aDB->getUserDataState();
-//    if (old_state != new_state)
-//        completionData.update();
-//
-//    displayModel->select();
-//}
-
-/*!
- * \brief LogbookWidget::on_editFlightButton_clicked opens a NewFlightDialog and
- * pre-fills the data from the selected flight.
- */
-//void LogbookWidget::on_editFlightButton_clicked()
-//{
-//    if(selectedFlights.length() == 1){
-//        auto old_state = aDB->getUserDataState();
-//
-//        auto ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
-//        ef->exec();
-//
-//        auto new_state = aDB->getUserDataState();
-//        if (old_state != new_state)
-//            completionData.update();
-//        displayModel->select();
-//    } else if (selectedFlights.isEmpty()) {
-//        WARN(tr("<br>No flight selected.<br>"));
-//    } else {
-//        WARN(tr("<br>More than one flight selected."
-//                               "<br><br>Editing multiple entries is not yet supported."));
-//    }
-//}
-
 /*!
  * \brief If a row is selected, query information
  * about the affected row(s) and ask the user to confirm deletion.
@@ -255,33 +214,13 @@ void LogbookWidget::on_tableView_customContextMenuRequested(const QPoint &pos)
 
 void LogbookWidget::on_actionEdit_Flight_triggered()
 {
+    completionData.update();
     if(selectedFlights.length() == 1){
-        auto old_state = aDB->getUserDataState();
-
-        //auto ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
-        //ef->exec();
-
-        //!
-        //! \brief new_state
-        //auto* ef = new NewFlightDialog(completionData, selectedFlights.first(), this);
-        //ui->stackedWidget->addWidget(ef);
-        //ui->stackedWidget->setCurrentWidget(ef);
-        //ef->setWindowFlag(Qt::Widget);
-        //ef->setAttribute(Qt::WA_DeleteOnClose);
-        //ef->exec();
-        //ui->stackedWidget->setCurrentWidget(logbookWidget);
-        //!
-        //! \brief new_state
         NewFlightDialog nff(completionData,selectedFlights.first(), this);
         ui->stackedWidget->addWidget(&nff);
         ui->stackedWidget->setCurrentWidget(&nff);
         nff.setWindowFlag(Qt::Widget);
-        //nff.setAttribute(Qt::WA_DeleteOnClose);
         nff.exec();
-
-        auto new_state = aDB->getUserDataState();
-        if (old_state != new_state)
-            completionData.update();
         displayModel->select();
     } else if (selectedFlights.isEmpty()) {
         WARN(tr("<br>No flight selected.<br>"));

+ 7 - 6
src/gui/widgets/settingswidget.cpp

@@ -236,7 +236,7 @@ void SettingsWidget::updatePersonalDetails()
         QString name;
         name.append(ui->lastnameLineEdit->text());
         name.append(QLatin1String(", "));
-        name.append(ui->firstnameLineEdit->text().leftRef(1));
+        name.append(ui->firstnameLineEdit->text().left(1));
         name.append(QLatin1Char('.'));
         user_data.insert(Opl::Db::PILOTS_ALIAS, name);
     }
@@ -306,18 +306,18 @@ void SettingsWidget::on_aliasComboBox_currentIndexChanged(int index)
     updatePersonalDetails();
 }
 
-void SettingsWidget::on_functionComboBox_currentIndexChanged(const QString &arg1)
+void SettingsWidget::on_functionComboBox_currentIndexChanged(int arg1)
 {
     ASettings::write(ASettings::FlightLogging::Function, arg1);
 }
 
-void SettingsWidget::on_rulesComboBox_currentIndexChanged(const QString &arg1)
+void SettingsWidget::on_rulesComboBox_currentIndexChanged(int arg1)
 {
     ASettings::write(ASettings::FlightLogging::Rules, arg1);
     ASettings::write(ASettings::FlightLogging::LogIFR, ui->rulesComboBox->currentIndex());
 }
 
-void SettingsWidget::on_approachComboBox_currentIndexChanged(const QString &arg1)
+void SettingsWidget::on_approachComboBox_currentIndexChanged(int arg1)
 {
     ASettings::write(ASettings::FlightLogging::Approach, arg1);
 }
@@ -697,12 +697,13 @@ void SettingsWidget::on_dateFormatComboBox_currentIndexChanged(int index)
     }
 }
 
-void SettingsWidget::on_languageComboBox_activated(const QString &arg1)
+void SettingsWidget::on_languageComboBox_activated(int arg1)
 {
-    if (arg1 != Opl::L10N_NAMES[Opl::Translations::English]) {
+    if (arg1 != 0) {
         INFO(tr("Translations are not yet available. If you are interested in making openPilotLog available in your native "
              "language, visit us <a href=\"https://%1/\">here</a> for more information."
              ).arg(QStringLiteral("github.com/fiffty-50/openpilotlog/wiki/Translations")));
         ui->languageComboBox->setCurrentIndex(0);
     }
 }
+

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

@@ -62,9 +62,9 @@ private slots:
     void on_emailLineEdit_editingFinished();
     void on_phoneLineEdit_editingFinished();
     void on_aliasComboBox_currentIndexChanged(int index);
-    void on_functionComboBox_currentIndexChanged(const QString &arg1);
-    void on_rulesComboBox_currentIndexChanged(const QString &arg1);
-    void on_approachComboBox_currentIndexChanged(const QString &arg1);
+    void on_functionComboBox_currentIndexChanged(int arg1);
+    void on_rulesComboBox_currentIndexChanged(int arg1);
+    void on_approachComboBox_currentIndexChanged(int arg1);
     void on_nightComboBox_currentIndexChanged(int index);
     void on_pilotSortComboBox_currentIndexChanged(int index);
     void on_logbookViewComboBox_currentIndexChanged(int index);
@@ -111,7 +111,7 @@ private slots:
 
     void on_dateFormatComboBox_currentIndexChanged(int index);
 
-    void on_languageComboBox_activated(const QString &arg1);
+    void on_languageComboBox_activated(int arg1);
 
 private:
     Ui::SettingsWidget *ui;

+ 1 - 1
src/gui/widgets/settingswidget.ui

@@ -17,7 +17,7 @@
    <item row="0" column="0">
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>1</number>
+      <number>3</number>
      </property>
      <widget class="QWidget" name="personalTab">
       <attribute name="title">