Kaynağa Gözat

Auto stash before checking out "origin/main"

Felix Turo 3 yıl önce
ebeveyn
işleme
bb52ecf969

+ 1 - 1
README.md

@@ -10,7 +10,7 @@ I have used paid solutions for many years, and have seen more and of them move f
 
 ## The state of the project!
 
-openPilotLog is currently in development, so no release is provided yet. If you would like to be informed about upcoming releases, you can [subscribe](https://turowsky.eu/?page_id=112) to our newsletter.
+openPilotLog is currently in development, so no release is provided yet. If you would like to be informed about upcoming releases, you can [subscribe](https://openpilotlog.eu/?page_id=35) to our newsletter.
 
 If you want to learn more about this project, check out the [wiki](https://github.com/fiffty-50/openpilotlog/wiki) or the [blog](https://turowsky.eu/)!
 

BIN
assets/database/logbook.db


BIN
deprecated/oldlogbook.db


+ 0 - 0
DEPRECATED_INOP_openPilotLog.pro → deprecated/openPilotLog.pro


+ 22 - 8
src/gui/dialogues/newflightdialog.cpp

@@ -423,14 +423,28 @@ RowData_T NewFlightDialog::prepareFlightEntryData()
         Opl::Db::FLIGHTS_TDUAL,
         Opl::Db::FLIGHTS_TFI,
     };
-    for (int i = 0; i < 5; i++) {
-        if (i == ui->functionComboBox->currentIndex())
-            new_data.insert(function_times[i], block_minutes);
-        else
-            new_data.insert(function_times[i], QString());
-    }
-    if (ui->functionComboBox->currentIndex() == 4)
-        new_data.insert(Opl::Db::FLIGHTS_PIC, block_minutes); // Log FI time as PIC as well
+
+    // Determine function times, zero out all values except one
+    // Log Instructor Time as PIC time as well
+    const int& function_index = ui->functionComboBox->currentIndex();
+    switch (function_index) {
+    case 4:
+        for (int i = 0; i < 5; i++){
+            if(i == 0 || i == 4)
+                new_data.insert(function_times[i], block_minutes);
+            else
+                new_data.insert(function_times[i], 0);
+        }
+        break;
+    default:
+        for (int i = 0; i < 5; i++){
+            if(i == function_index)
+                new_data.insert(function_times[i], block_minutes);
+            else
+                new_data.insert(function_times[i], 0);
+        }
+        break;
+    }
     // Pilot flying / Pilot monitoring
     new_data.insert(Opl::Db::FLIGHTS_PILOTFLYING, ui->pilotFlyingCheckBox->isChecked());
     // Take-Off and Landing

+ 1 - 27
src/gui/dialogues/newflightdialog.ui

@@ -525,33 +525,7 @@
         </widget>
        </item>
        <item row="3" column="1" colspan="2">
-        <widget class="QComboBox" name="functionComboBox">
-         <item>
-          <property name="text">
-           <string>PIC</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>PICUS</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>SIC</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>DUAL</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>FI</string>
-          </property>
-         </item>
-        </widget>
+        <widget class="QComboBox" name="functionComboBox"/>
        </item>
        <item row="4" column="0">
         <widget class="QLabel" name="approachLabel">