[gnome-commander/GSettings] Adds save_tabs_on_exit to GSettings (now known as save-tabs-on-exit)



commit 8ad0a01684c4f5ebee9b7bffd16399827b40f868
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Wed Jun 8 21:33:49 2016 +0200

    Adds save_tabs_on_exit to GSettings (now known as save-tabs-on-exit)

 data/org.gnome.gnome-commander.gschema.xml |    6 ++++--
 src/gnome-cmd-data.cc                      |    9 ++++++---
 src/gnome-cmd-data.h                       |    1 +
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 1973064..29e045f 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -289,8 +289,10 @@
     </key>
     <key name="save-tabs-on-exit" type="b">
       <default l10n="messages">true</default>
-      <summary></summary>
-      <description></description>
+      <summary>Save tabs on exit</summary>
+      <description>
+          Defines if the current open tabs are opened again when Gnome Commander is restarted.
+      </description>
     </key>
     <key name="save-dir-history-on-exit" type="b">
       <default l10n="messages">true</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 0a950bb..066a7a6 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1888,9 +1888,12 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
         //main_win_pos_y
         migrate_data_int_value_into_gsettings(gnome_cmd_data_get_int ("/options/main_win_pos_y", 25),
                                                         options.gcmd_settings->general, 
GCMD_SETTINGS_MAIN_WIN_POS_Y);
-        //save-dirs-on-exit
+        //save_dirs_on_exit
         migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/save_dirs_on_exit", TRUE) ? 
1 : 0,
                                                         options.gcmd_settings->general, 
GCMD_SETTINGS_SAVE_DIRS_ON_EXIT);
+        //save_tabs_on_exit
+        migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/save_tabs_on_exit", TRUE) ? 
1 : 0,
+                                                        options.gcmd_settings->general, 
GCMD_SETTINGS_SAVE_TABS_ON_EXIT);
         // ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
         //       à la save_devices_old ("devices.backup");
         //       and move .gnome2/gnome-commander to .gnome2/gnome-commander.backup
@@ -2127,7 +2130,7 @@ void GnomeCmdData::load()
     gnome_cmd_data_get_color ("/colors/ls_colors_white_bg", options.ls_colors_palette.white_bg);
 
     options.save_dirs_on_exit = g_settings_get_boolean (options.gcmd_settings->general, 
GCMD_SETTINGS_SAVE_DIRS_ON_EXIT);
-    options.save_tabs_on_exit = gnome_cmd_data_get_bool ("/options/save_tabs_on_exit", TRUE);
+    options.save_tabs_on_exit = g_settings_get_boolean (options.gcmd_settings->general, 
GCMD_SETTINGS_SAVE_TABS_ON_EXIT);
     options.save_dir_history_on_exit = gnome_cmd_data_get_bool ("/options/save_dir_history_on_exit", TRUE);
 
     options.always_show_tabs = gnome_cmd_data_get_bool ("/options/always_show_tabs", FALSE);
@@ -2659,7 +2662,7 @@ void GnomeCmdData::save()
     }
 
     set_gsettings_when_changed      (options.gcmd_settings->general, GCMD_SETTINGS_SAVE_DIRS_ON_EXIT, 
&(options.save_dirs_on_exit));
-    gnome_cmd_data_set_bool ("/options/save_tabs_on_exit", options.save_tabs_on_exit);
+    set_gsettings_when_changed      (options.gcmd_settings->general, GCMD_SETTINGS_SAVE_TABS_ON_EXIT, 
&(options.save_tabs_on_exit));
     gnome_cmd_data_set_bool ("/options/save_dir_history_on_exit", options.save_dir_history_on_exit);
 
     gnome_cmd_data_set_bool ("/options/always_show_tabs", options.always_show_tabs);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 63fd7db..58982c8 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -84,6 +84,7 @@ GcmdSettings *gcmd_settings_new (void);
 #define GCMD_SETTINGS_MAIN_WIN_POS_X                  "main-win-pos-x"
 #define GCMD_SETTINGS_MAIN_WIN_POS_Y                  "main-win-pos-y"
 #define GCMD_SETTINGS_SAVE_DIRS_ON_EXIT               "save-dirs-on-exit"
+#define GCMD_SETTINGS_SAVE_TABS_ON_EXIT               "save-tabs-on-exit"
 
 #define GCMD_PREF_FILTER                              "org.gnome.gnome-commander.preferences.filter"
 #define GCMD_SETTINGS_FILTER_HIDE_UNKNOWN             "hide-unknown"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]