[gnome-commander/GSettings] Adds sendto to GSettings (now known as sendto-cmd)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds sendto to GSettings (now known as sendto-cmd)
- Date: Tue, 5 Jul 2016 20:40:35 +0000 (UTC)
commit e7e60d9bdc07ef7982590314a5846a532d09ceeb
Author: Uwe Scholz <uwescholz src gnome org>
Date: Tue Jul 5 19:31:55 2016 +0200
Adds sendto to GSettings (now known as sendto-cmd)
data/org.gnome.gnome-commander.gschema.xml | 10 ++++++----
src/gnome-cmd-data.cc | 20 ++++++++++++++++++--
src/gnome-cmd-data.h | 1 +
3 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index ef5d4fc..7f98555 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -555,10 +555,12 @@
<summary></summary>
<description></description>
</key>
- <key name="sendto" type="s">
- <default l10n="messages">'xfce4-terminal -e "mutt -a %s"'</default>
- <summary></summary>
- <description></description>
+ <key name="sendto-cmd" type="s">
+ <default l10n="messages">'nautilus-sendto %s'</default>
+ <summary>Send to command</summary>
+ <description>
+ This string defines the command for sending files to a receiver.
+ </description>
</key>
</schema>
<schema gettext-domain="gnome-commander" id="org.gnome.gnome-commander.preferences.devices"
path="/org/gnome/gnome-commander/preferences/devices/">
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 649d95d..cc938ca 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -789,6 +789,14 @@ void on_differ_cmd_changed()
gnome_cmd_data.options.differ = differ_cmd;
}
+void on_sendto_cmd_changed()
+{
+ gchar *sendto_cmd;
+
+ sendto_cmd = g_settings_get_string (gnome_cmd_data.options.gcmd_settings->programs,
GCMD_SETTINGS_SENDTO_CMD);
+ gnome_cmd_data.options.sendto = sendto_cmd;
+}
+
static void gcmd_settings_class_init (GcmdSettingsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1160,6 +1168,11 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
G_CALLBACK (on_differ_cmd_changed),
NULL);
+ g_signal_connect (gs->programs,
+ "changed::sendto-cmd",
+ G_CALLBACK (on_sendto_cmd_changed),
+ NULL);
+
}
@@ -2808,6 +2821,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//differ
migrate_data_string_value_into_gsettings(gnome_cmd_data_get_string ("/programs/differ", "meld %s"),
options.gcmd_settings->programs,
GCMD_SETTINGS_DIFFER_CMD);
+ //sendto
+ migrate_data_string_value_into_gsettings(gnome_cmd_data_get_string ("/programs/sendto",
"nautilus-sendto %s"),
+ options.gcmd_settings->programs,
GCMD_SETTINGS_SENDTO_CMD);
g_free(color);
// ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
@@ -3189,7 +3205,7 @@ void GnomeCmdData::load()
options.viewer = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_VIEWER_CMD);
options.editor = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_EDITOR_CMD);
options.differ = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_DIFFER_CMD);
- options.sendto = gnome_cmd_data_get_string ("/programs/sendto", "nautilus-sendto %s");
+ options.sendto = g_settings_get_string(options.gcmd_settings->programs, GCMD_SETTINGS_SENDTO_CMD);
options.termopen = gnome_cmd_data_get_string ("/programs/terminal_open", "gnome-terminal");
options.termexec = gnome_cmd_data_get_string ("/programs/terminal_exec", "gnome-terminal -e %s");
@@ -3720,7 +3736,7 @@ void GnomeCmdData::save()
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_VIEWER_CMD,
options.viewer);
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_EDITOR_CMD,
options.editor);
set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_DIFFER_CMD,
options.differ);
- gnome_cmd_data_set_string ("/programs/sendto", options.sendto);
+ set_gsettings_when_changed (options.gcmd_settings->programs, GCMD_SETTINGS_SENDTO_CMD,
options.sendto);
gnome_cmd_data_set_string ("/programs/terminal_open", options.termopen);
gnome_cmd_data_set_string ("/programs/terminal_exec", options.termexec);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index f693132..d8157cb 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -149,6 +149,7 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_VIEWER_CMD "viewer-cmd"
#define GCMD_SETTINGS_EDITOR_CMD "editor-cmd"
#define GCMD_SETTINGS_DIFFER_CMD "differ-cmd"
+#define GCMD_SETTINGS_SENDTO_CMD "sendto-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]