[gnome-commander/GSettings] Adds conbuttons_visibility option to GSettings (now known as show-devbuttons)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds conbuttons_visibility option to GSettings (now known as show-devbuttons)
- Date: Thu, 2 Jun 2016 22:00:27 +0000 (UTC)
commit c5f5ae3285aa1b3c9939b71f4a94a6eb81ef870b
Author: Uwe Scholz <uwescholz src gnome org>
Date: Fri Jun 3 00:00:08 2016 +0200
Adds conbuttons_visibility option to GSettings (now known as show-devbuttons)
data/org.gnome.gnome-commander.gschema.xml | 6 +++---
src/gnome-cmd-data.cc | 7 +++++--
src/gnome-cmd-data.h | 1 +
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 420ba7f..110fe07 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -189,10 +189,10 @@
<summary></summary>
<description></description>
</key>
- <key name="conbuttons-visibility" type="b">
+ <key name="show-devbuttons" type="b">
<default>true</default>
- <summary></summary>
- <description></description>
+ <summary>Show device buttons</summary>
+ <description>Defines if device buttons are shown.</description>
</key>
<key name="con-list-visibility" type="b">
<default>true</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index a50a5f4..b41076f 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1768,6 +1768,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//list_orientation
migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/list_orientation", FALSE) ?
1 : 0,
options.gcmd_settings->general,
GCMD_SETTINGS_HORIZONTAL_ORIENTATION);
+ //conbuttons_visibility
+ migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/conbuttons_visibility",
FALSE) ? 1 : 0,
+ options.gcmd_settings->general,
GCMD_SETTINGS_SHOW_DEVBUTTONS);
// 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
@@ -1955,7 +1958,7 @@ void GnomeCmdData::load()
priv->main_win_pos[1] = gnome_cmd_data_get_int ("/options/main_win_pos_y", -1);
toolbar_visibility = gnome_cmd_data_get_bool ("/programs/toolbar_visibility", TRUE);
- conbuttons_visibility = gnome_cmd_data_get_bool ("/options/conbuttons_visibility", TRUE);
+ conbuttons_visibility = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SHOW_DEVBUTTONS);
concombo_visibility = gnome_cmd_data_get_bool ("/options/con_list_visibility", TRUE);
cmdline_visibility = gnome_cmd_data_get_bool ("/options/cmdline_visibility", TRUE);
buttonbar_visibility = gnome_cmd_data_get_bool ("/programs/buttonbar_visibility", TRUE);
@@ -2491,7 +2494,7 @@ void GnomeCmdData::save()
gnome_cmd_data_set_bool ("/programs/skip_mounting", options.skip_mounting);
gnome_cmd_data_set_bool ("/programs/toolbar_visibility", toolbar_visibility);
- gnome_cmd_data_set_bool ("/options/conbuttons_visibility", conbuttons_visibility);
+ set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_SHOW_DEVBUTTONS,
&(conbuttons_visibility));
gnome_cmd_data_set_bool ("/options/con_list_visibility", concombo_visibility);
gnome_cmd_data_set_bool ("/options/cmdline_visibility", cmdline_visibility);
gnome_cmd_data_set_bool ("/programs/buttonbar_visibility", buttonbar_visibility);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index ab35318..55fd26b 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -74,6 +74,7 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_MIME_ICON_DIR "mime-icon-dir"
#define GCMD_SETTINGS_CMDLINE_HISTORY_LENGTH "cmdline-history-length"
#define GCMD_SETTINGS_HORIZONTAL_ORIENTATION "horizontal-orientation"
+#define GCMD_SETTINGS_SHOW_DEVBUTTONS "show-devbuttons"
#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]