[gnome-commander] Edit files user action accepts more than one argument
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Edit files user action accepts more than one argument
- Date: Sat, 31 Jan 2015 23:24:24 +0000 (UTC)
commit 00e18f6828326d5aa331c2f91f4ed5f80fc55995
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sat Jan 31 23:57:38 2015 +0100
Edit files user action accepts more than one argument
NEWS | 1 +
doc/C/releases.xml | 3 +++
src/gnome-cmd-user-actions.cc | 30 +++++++++++++++++++++++++++---
3 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 94a1398..b5711dd 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ New features:
* Always reopen the tab which was previously closed in the options dialog
* Samba support is now optionally available via configure option
* Configurable command for sending files to a preferred application
+* Button 'Edit files' accepts more than one selected file at the same time
* Code cleanup
* New or updated translations:
...
diff --git a/doc/C/releases.xml b/doc/C/releases.xml
index 54fa7e3..b0a77a0 100644
--- a/doc/C/releases.xml
+++ b/doc/C/releases.xml
@@ -47,6 +47,9 @@
<para>Configurable command for sending files to a preferred application</para>
</listitem>
<listitem>
+ <para>Button 'Edit files' accepts more than one selected file at the same
time</para>
+ </listitem>
+ <listitem>
<para>Code cleanup</para>
</listitem>
<listitem>
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index d19c17d..9342bb0 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -767,7 +767,6 @@ void file_external_view (GtkMenuItem *menuitem, gpointer not_used)
gnome_cmd_file_list_view (get_fl (ACTIVE), FALSE);
}
-
void file_edit (GtkMenuItem *menuitem, gpointer not_used)
{
GdkModifierType mask;
@@ -777,10 +776,35 @@ void file_edit (GtkMenuItem *menuitem, gpointer not_used)
if (mask & GDK_SHIFT_MASK)
gnome_cmd_file_selector_show_new_textfile_dialog (get_fs (ACTIVE));
else
- gnome_cmd_file_list_edit (get_fl (ACTIVE));
+ {
+ gchar *command;
+
+ command = g_strdup (gnome_cmd_data.options.editor);
+ g_return_if_fail (command != NULL);
+ g_return_if_fail (command[0] != '\0');
+ DEBUG ('g', "Invoking 'Edit file': %s\n", command);
+
+ GnomeCmdDir *dir = NULL;
+ string dir_path;
+ string cmd;
+
+ cmd.reserve(2000);
+ parse_command(&cmd, command);
+ DEBUG ('g', "Edit file: %s\n", cmd.c_str());
+
+ gint argc;
+ gchar **argv;
+ GError *error = NULL;
+
+ g_shell_parse_argv (cmd.c_str(), &argc, &argv, NULL);
+ if (!g_spawn_async (gnome_cmd_dir_is_local (dir) ? dir_path.c_str() : NULL, argv, NULL,
G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error))
+ gnome_cmd_error_message (_("Unable to execute command."), error);
+
+ g_strfreev (argv);
+ g_free (command);
+ }
}
-
void file_edit_new_doc (GtkMenuItem *menuitem, gpointer not_used)
{
gnome_cmd_file_selector_show_new_textfile_dialog (get_fs (ACTIVE));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]