[gnome-commander/GSettings] Adds terminal_exec to GSettings (now known as terminal-exec-cmd)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds terminal_exec to GSettings (now known as terminal-exec-cmd)
- Date: Tue, 5 Jul 2016 20:40:51 +0000 (UTC)
commit 5b7bc8352e26efe72bf59472156f119aa5edf26e
Author: Uwe Scholz <uwescholz src gnome org>
Date: Tue Jul 5 21:31:39 2016 +0200
Adds terminal_exec to GSettings (now known as terminal-exec-cmd)
data/org.gnome.gnome-commander.gschema.xml | 10 ++++++----
src/gnome-cmd-data.cc | 26 +++++++++++++++++++++-----
src/gnome-cmd-data.h | 3 ++-
3 files changed, 29 insertions(+), 10 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 30ec3f2..15d3be4 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -547,10 +547,12 @@
This string defines the command for opening a terminal.
</description>
</key>
- <key name="terminal-exec" type="s">
- <default l10n="messages">'xfce4-terminal -e %s'</default>
- <summary></summary>
- <description></description>
+ <key name="terminal-exec-cmd" type="s">
+ <default l10n="messages">'gnome-terminal -e %s'</default>
+ <summary>Command for execution in terminal</summary>
+ <description>
+ This string defines the command for executing another command in a terminal.
+ </description>
</key>
<key name="mailclient" type="s">
<default l10n="messages">'echo %s'</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 7c98b53..0483a55 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -799,10 +799,18 @@ void on_sendto_cmd_changed()
void on_terminal_cmd_changed()
{
- gchar *terminal_open_cmd;
+ gchar *terminal_cmd;
- terminal_open_cmd = g_settings_get_string (gnome_cmd_data.options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_CMD);
- gnome_cmd_data.options.sendto = terminal_open_cmd;
+ terminal_cmd = g_settings_get_string (gnome_cmd_data.options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_CMD);
+ gnome_cmd_data.options.sendto = terminal_cmd;
+}
+
+void on_terminal_exec_cmd_changed()
+{
+ gchar *terminal_exec_cmd;
+
+ terminal_exec_cmd = g_settings_get_string (gnome_cmd_data.options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_CMD);
+ gnome_cmd_data.options.sendto = terminal_exec_cmd;
}
static void gcmd_settings_class_init (GcmdSettingsClass *klass)
@@ -1186,6 +1194,11 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
G_CALLBACK (on_terminal_cmd_changed),
NULL);
+ g_signal_connect (gs->programs,
+ "changed::terminal-exec-cmd",
+ G_CALLBACK (on_terminal_exec_cmd_changed),
+ NULL);
+
}
@@ -2840,6 +2853,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//terminal_open
migrate_data_string_value_into_gsettings(gnome_cmd_data_get_string ("/programs/terminal_open",
"gnome-terminal"),
options.gcmd_settings->programs,
GCMD_SETTINGS_TERMINAL_CMD);
+ //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);
g_free(color);
// ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
@@ -3223,7 +3239,7 @@ void GnomeCmdData::load()
options.differ = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_DIFFER_CMD);
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 = gnome_cmd_data_get_string ("/programs/terminal_exec", "gnome-terminal -e %s");
+ 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);
@@ -3754,7 +3770,7 @@ void GnomeCmdData::save()
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_DIFFER_CMD,
options.differ);
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);
- gnome_cmd_data_set_string ("/programs/terminal_exec", options.termexec);
+ 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);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 9bf380f..632f188 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -150,7 +150,8 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_EDITOR_CMD "editor-cmd"
#define GCMD_SETTINGS_DIFFER_CMD "differ-cmd"
#define GCMD_SETTINGS_SENDTO_CMD "sendto-cmd"
-#define GCMD_SETTINGS_TERMINAL_CMD "terminal-cmd"
+#define GCMD_SETTINGS_TERMINAL_CMD "terminal-cmd"
+#define GCMD_SETTINGS_TERMINAL_EXEC_CMD "terminal-exec-cmd"
#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]