[gnome-commander/GSettings] Adds allow_multiple_instances to GSettings
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds allow_multiple_instances to GSettings
- Date: Sat, 2 Jul 2016 21:52:34 +0000 (UTC)
commit 8149070f0ec53d63a9304651296de9cd997ff36a
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sat Jul 2 23:51:47 2016 +0200
Adds allow_multiple_instances to GSettings
data/org.gnome.gnome-commander.gschema.xml | 12 +++++++-----
src/gnome-cmd-data.cc | 20 ++++++++++++++++++--
src/gnome-cmd-data.h | 1 +
3 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 9f6776b..dcfe26d 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -359,6 +359,13 @@
This option defines if directories will be marked when all items in a file pane should be marked.
</description>
</key>
+ <key name="allow-multiple-instances" type="b">
+ <default l10n="messages">false</default>
+ <summary>Allow multiple instances</summary>
+ <description>
+ This option defines if multiple instances are allowed.
+ </description>
+ </key>
</schema>
<schema gettext-domain="gnome-commander" id="org.gnome.gnome-commander.preferences.quick-connect"
path="/org/gnome/gnome-commander/preferences/quick-connect/">
<key name="uri" type="s">
@@ -516,11 +523,6 @@
<summary></summary>
<description></description>
</key>
- <key name="allow-multiple-instances" type="b">
- <default l10n="messages">false</default>
- <summary></summary>
- <description></description>
- </key>
<key name="quick-search-exact-match-begin" type="b">
<default l10n="messages">true</default>
<summary></summary>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 5a0ef23..796f020 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -689,6 +689,14 @@ void on_always_download_changed()
gnome_cmd_data.options.honor_expect_uris = always_download;
}
+void on_multiple_instances_changed()
+{
+ gboolean allow_multiple_instances;
+
+ allow_multiple_instances = g_settings_get_boolean (gnome_cmd_data.options.gcmd_settings->general,
GCMD_SETTINGS_MULTIPLE_INSTANCES);
+ gnome_cmd_data.options.allow_multiple_instances = allow_multiple_instances;
+}
+
static void gcmd_settings_class_init (GcmdSettingsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1014,6 +1022,11 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
"changed::dont-download",
G_CALLBACK (on_always_download_changed),
NULL);
+
+ g_signal_connect (gs->general,
+ "changed::allow-multiple-instances",
+ G_CALLBACK (on_multiple_instances_changed),
+ NULL);
}
@@ -2633,6 +2646,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//honor_expect_uris
migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/programs/honor_expect_uris", FALSE)
? 1 : 0,
options.gcmd_settings->programs, GCMD_SETTINGS_DONT_DOWNLOAD);
+ //allow_multiple_instances
+ migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/programs/allow_multiple_instances",
FALSE) ? 1 : 0,
+ options.gcmd_settings->general,
GCMD_SETTINGS_MULTIPLE_INSTANCES);
g_free(color);
// ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
@@ -2996,7 +3012,7 @@ void GnomeCmdData::load()
buttonbar_visibility = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SHOW_BUTTONBAR);
options.honor_expect_uris = g_settings_get_boolean (options.gcmd_settings->programs,
GCMD_SETTINGS_DONT_DOWNLOAD);
- options.allow_multiple_instances = gnome_cmd_data_get_bool ("/programs/allow_multiple_instances", FALSE);
+ options.allow_multiple_instances = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_MULTIPLE_INSTANCES);
options.use_internal_viewer = gnome_cmd_data_get_bool ("/programs/use_internal_viewer", TRUE);
options.alt_quick_search = gnome_cmd_data_get_bool ("/programs/alt_quick_search", FALSE);
options.quick_search_exact_match_begin = gnome_cmd_data_get_bool
("/programs/quick_search_exact_match_begin", TRUE);
@@ -3522,9 +3538,9 @@ void GnomeCmdData::save()
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_CMDLINE_HISTORY_LENGTH,
&(cmdline_history_length));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_HORIZONTAL_ORIENTATION,
&(horizontal_orientation));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_GUI_UPDATE_RATE,
&(gui_update_rate));
+ set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_MULTIPLE_INSTANCES,
&(options.allow_multiple_instances));
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_DONT_DOWNLOAD,
&(options.honor_expect_uris));
- gnome_cmd_data_set_bool ("/programs/allow_multiple_instances", options.allow_multiple_instances);
gnome_cmd_data_set_bool ("/programs/use_internal_viewer", options.use_internal_viewer);
gnome_cmd_data_set_bool ("/programs/alt_quick_search", options.alt_quick_search);
gnome_cmd_data_set_bool ("/programs/quick_search_exact_match_begin",
options.quick_search_exact_match_begin);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index b3b18b8..a604fb4 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -91,6 +91,7 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_MAIN_WIN_STATE "main-win-state"
#define GCMD_SETTINGS_SELECT_DIRS "select-dirs"
#define GCMD_SETTINGS_CASE_SENSITIVE "case-sensitive"
+#define GCMD_SETTINGS_MULTIPLE_INSTANCES "allow-multiple-instances"
#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]