[gnome-commander/GSettings] Adds use_gcmd_block to GSettings (now known as use-gcmd-block)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds use_gcmd_block to GSettings (now known as use-gcmd-block)
- Date: Wed, 6 Jul 2016 20:51:24 +0000 (UTC)
commit d30049a0942b3d5c1e833a7c89c08b692037bee6
Author: Uwe Scholz <uwescholz src gnome org>
Date: Wed Jul 6 22:50:55 2016 +0200
Adds use_gcmd_block to GSettings (now known as use-gcmd-block)
data/org.gnome.gnome-commander.gschema.xml | 6 ++++--
src/gnome-cmd-data.cc | 19 +++++++++++++++----
src/gnome-cmd-data.h | 1 +
3 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index f9a788e..57c84a6 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -532,8 +532,10 @@
</key>
<key name="use-gcmd-block" type="b">
<default l10n="messages">false</default>
- <summary></summary>
- <description></description>
+ <summary>Use gcmd-block for terminal commands</summary>
+ <description>
+ This option defines if a terminal window should stay open after a command finishes inside of it.
+ </description>
</key>
<key name="terminal-cmd" type="s">
<default l10n="messages">'gnome-terminal'</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 7305d78..0e74c7f 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -813,6 +813,11 @@ void on_terminal_exec_cmd_changed()
gnome_cmd_data.options.termexec = terminal_exec_cmd;
}
+void on_use_gcmd_block_changed()
+{
+ gnome_cmd_data.use_gcmd_block = g_settings_get_boolean (gnome_cmd_data.options.gcmd_settings->programs,
GCMD_SETTINGS_USE_GCMD_BLOCK);
+}
+
static void gcmd_settings_class_init (GcmdSettingsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1199,6 +1204,11 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
G_CALLBACK (on_terminal_exec_cmd_changed),
NULL);
+ g_signal_connect (gs->programs,
+ "changed::use-gcmd-block",
+ G_CALLBACK (on_use_gcmd_block_changed),
+ NULL);
+
}
@@ -2856,6 +2866,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//terminal_exec
migrate_data_string_value_into_gsettings(gnome_cmd_data_get_string ("/programs/terminal_exec",
"gnome-terminal -e %s"),
options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_EXEC_CMD);
+ //use_gcmd_block
+ migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE) ?
1 : 0,
+ options.gcmd_settings->programs, GCMD_SETTINGS_USE_GCMD_BLOCK);
g_free(color);
// ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
@@ -3240,8 +3253,7 @@ void GnomeCmdData::load()
options.sendto = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_SENDTO_CMD);
options.termopen = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_TERMINAL_CMD);
options.termexec = g_settings_get_string(options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_EXEC_CMD);
-
- use_gcmd_block = gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE);
+ use_gcmd_block = g_settings_get_boolean(options.gcmd_settings->programs, GCMD_SETTINGS_USE_GCMD_BLOCK);
options.device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
@@ -3771,8 +3783,7 @@ void GnomeCmdData::save()
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_SENDTO_CMD,
options.sendto);
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_TERMINAL_CMD,
options.termopen);
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_TERMINAL_EXEC_CMD,
options.termexec);
-
- gnome_cmd_data_set_bool ("/programs/use_gcmd_block", use_gcmd_block);
+ set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_USE_GCMD_BLOCK,
&(use_gcmd_block));
gnome_cmd_data_set_bool ("/devices/only_icon", options.device_only_icon);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 632f188..9ffc295 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -152,6 +152,7 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_SENDTO_CMD "sendto-cmd"
#define GCMD_SETTINGS_TERMINAL_CMD "terminal-cmd"
#define GCMD_SETTINGS_TERMINAL_EXEC_CMD "terminal-exec-cmd"
+#define GCMD_SETTINGS_USE_GCMD_BLOCK "use-gcmd-block"
#define GCMD_PREF_KEYBINDINGS "org.gnome.gnome-commander.preferences.keybindings"
#define GCMD_SETTINGS_QUICK_SEARCH_SHORTCUT "quick-search"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]