rdefeo 1 rok temu
rodzic
commit
5baf7c1bef
3 zmienionych plików z 9 dodań i 20 usunięć
  1. 0 10
      quac.c
  2. 4 10
      quac_settings.c
  3. 5 0
      quac_settings.h

+ 0 - 10
quac.c

@@ -55,16 +55,6 @@ App* app_alloc() {
     app->depth = 0;
     app->selected_item = -1;
 
-    // Default settings
-    // TODO: Store settings in apps_data/quac/.quac.conf as a Flipper Format File!
-    // Create Settings Scene, save settings _on_exit
-    // Always use settings in _on_enter of other scenes
-
-    app->settings.rfid_duration = 3000;
-    app->settings.layout = QUAC_APP_LANDSCAPE;
-    // app->settings.layout = QUAC_APP_PORTRAIT;
-    app->settings.show_icons = true;
-
     app->items_view = item_get_items_view_from_path(app, NULL);
 
     return app;

+ 4 - 10
quac_settings.c

@@ -8,17 +8,11 @@
 #define QUAC_SETTINGS_FILE_TYPE "Quac Settings File"
 #define QUAC_SETTINGS_FILE_VERSION 1
 
-// Quac Settings Defaults
-#define QUAC_SETTINGS_DEFAULT_RFID_DURATION 2500
-#define QUAC_SETTINGS_DEFAULT_LAYOUT QUAC_APP_LANDSCAPE // QUAC_APP_PORTRAIT
-#define QUAC_SETTINGS_DEFAULT_SHOW_ICONS true
-#define QUAC_SETTINGS_DEFAULT_SHOW_HEADERS true
-
 void quac_set_default_settings(App* app) {
-    app->settings.rfid_duration = QUAC_SETTINGS_DEFAULT_RFID_DURATION;
-    app->settings.layout = QUAC_SETTINGS_DEFAULT_LAYOUT;
-    app->settings.show_icons = QUAC_SETTINGS_DEFAULT_SHOW_ICONS;
-    app->settings.show_headers = QUAC_SETTINGS_DEFAULT_SHOW_HEADERS;
+    app->settings.rfid_duration = 2500;
+    app->settings.layout = QUAC_APP_LANDSCAPE;
+    app->settings.show_icons = true;
+    app->settings.show_headers = true;
 }
 
 void quac_load_settings(App* app) {

+ 5 - 0
quac_settings.h

@@ -2,8 +2,13 @@
 
 #include "quac.h"
 
+/** Set the default Settings for Quac */
 void quac_set_default_settings(App* app);
 
+/** Load the Settings from the .quac.conf file. If not found,
+ * then load the defaults.
+*/
 void quac_load_settings(App* app);
 
+/** Save the current settings to the .quac.conf file */
 void quac_save_settings(App* app);