[gnome-commander] Added "file.copy_as" to user actions
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-commander] Added "file.copy_as" to user actions
- Date: Thu, 30 Jul 2009 16:15:10 +0000 (UTC)
commit a84358997f43cf38555886fe6f711ce34608637d
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Jul 30 18:09:08 2009 +0200
Added "file.copy_as" to user actions
doc/C/gnome-commander.xml | 9 +++++++--
doc/keys.txt | 2 +-
src/gnome-cmd-file-selector.cc | 26 --------------------------
src/gnome-cmd-user-actions.cc | 20 ++++++++++++++++++++
src/gnome-cmd-user-actions.h | 1 +
5 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 920f0f4..f9a3815 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -4038,8 +4038,8 @@
</row>
<row valign="top">
<entry><keycombo><keycap>SHIFT</keycap><keycap>F5</keycap></keycombo></entry>
- <entry><para>Make a copy a file in the current directory.</para></entry>
- <entry><para></para></entry>
+ <entry><para>Make a copy of the file in the current directory.</para></entry>
+ <entry><para>yes</para></entry>
</row>
<row valign="top">
<entry><keycombo><keycap>SHIFT</keycap><keycap>F6</keycap></keycombo></entry>
@@ -4675,6 +4675,11 @@
<entry><para></para></entry>
</row>
<row valign="top">
+ <entry><para>file.copy_as</para></entry>
+ <entry><para>Copy file with rename</para></entry>
+ <entry><para><keycombo><keycap>SHIFT</keycap><keycap>F5</keycap></keycombo></para></entry>
+ </row>
+ <row valign="top">
<entry><para>file.create_symlink</para></entry>
<entry><para>Create symbolic link</para></entry>
<entry><para><keycombo><keycap>CTRL</keycap><keycap>SHIFT</keycap><keycap>F5</keycap></keycombo></para></entry>
diff --git a/doc/keys.txt b/doc/keys.txt
index f4a342e..561c446 100644
--- a/doc/keys.txt
+++ b/doc/keys.txt
@@ -22,7 +22,7 @@ ALT+F8 Open the history list for the command line
SHIFT+F2 Compare directories
SHIFT+F3 View with internal viewer
SHIFT+F4 Edit a new file
-SHIFT+F5 Make a copy a file in the current directory
+SHIFT+F5 Make a copy of the file in the current directory
SHIFT+F6 Rename a file
SHIFT+F10 Bring up the context menu for the selected files
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 658fd35..4039275 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -39,7 +39,6 @@
#include "history.h"
#include "cap.h"
#include "utils.h"
-#include "gnome-cmd-make-copy-dialog.h"
using namespace std;
@@ -284,22 +283,6 @@ inline void GnomeCmdFileSelector::update_direntry()
}
-void gnome_cmd_file_list_show_make_copy_dialog (GnomeCmdFileSelector *fs)
-{
- g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
-
- GnomeCmdFile *f = fs->file_list()->get_selected_file();
-
- if (GNOME_CMD_IS_FILE (f))
- {
- GtkWidget *dialog = gnome_cmd_make_copy_dialog_new (f, fs->get_directory());
-
- gtk_widget_ref (dialog);
- gtk_widget_show (dialog);
- }
-}
-
-
/******************************************************
* DnD functions
**/
@@ -1727,15 +1710,6 @@ gboolean GnomeCmdFileSelector::key_pressed(GdkEventKey *event)
return TRUE;
}
}
- else if (state_is_shift (event->state))
- {
- switch (event->keyval)
- {
- case GDK_F5:
- gnome_cmd_file_list_show_make_copy_dialog (this);
- return TRUE;
- }
- }
else if (state_is_alt (event->state))
{
switch (event->keyval)
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 6d210e5..f95e28d 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -36,6 +36,7 @@
#include "gnome-cmd-main-win.h"
#include "gnome-cmd-mkdir-dialog.h"
#include "gnome-cmd-options-dialog.h"
+#include "gnome-cmd-make-copy-dialog.h"
#include "gnome-cmd-prepare-copy-dialog.h"
#include "gnome-cmd-prepare-move-dialog.h"
#include "gnome-cmd-python-plugin.h"
@@ -156,6 +157,7 @@ static UserActionData user_actions_data[] = {
{file_chmod, "file.chmod", N_("Change permissions")},
{file_chown, "file.chown", N_("Change owner/group")},
{file_copy, "file.copy", N_("Copy files")},
+ {file_copy_as, "file.copy_as", N_("Copy files with rename")},
{file_create_symlink, "file.create_symlink", N_("Create symbolic link")},
{file_delete, "file.delete", N_("Delete files")},
{file_diff, "file.diff", N_("Compare files (diff)")},
@@ -261,6 +263,9 @@ void GnomeCmdUserActions::init()
if (!registered("file.advrename"))
register_action(GDK_CONTROL_MASK, GDK_M, "file.advrename");
+ if (!registered("file.copy_as"))
+ register_action(GDK_SHIFT_MASK, GDK_F5, "file.copy_as");
+
if (!registered("file.create_symlink"))
register_action(GDK_CONTROL_MASK | GDK_SHIFT_MASK, GDK_F5, "file.create_symlink");
@@ -656,6 +661,21 @@ void file_copy (GtkMenuItem *menuitem, gpointer not_used)
}
+void file_copy_as (GtkMenuItem *menuitem, gpointer not_used)
+{
+ GnomeCmdFileSelector *fs = get_fs (ACTIVE);
+ GnomeCmdFile *f = fs->file_list()->get_selected_file();
+
+ if (GNOME_CMD_IS_FILE (f))
+ {
+ GtkWidget *dialog = gnome_cmd_make_copy_dialog_new (f, fs->get_directory());
+
+ gtk_widget_ref (dialog);
+ gtk_widget_show (dialog);
+ }
+}
+
+
void file_move (GtkMenuItem *menuitem, gpointer not_used)
{
GnomeCmdFileSelector *src_fs = get_fs (ACTIVE);
diff --git a/src/gnome-cmd-user-actions.h b/src/gnome-cmd-user-actions.h
index 56229e8..93bb3fb 100644
--- a/src/gnome-cmd-user-actions.h
+++ b/src/gnome-cmd-user-actions.h
@@ -216,6 +216,7 @@ GNOME_CMD_USER_ACTION(no_action);
/************** File Menu **************/
GNOME_CMD_USER_ACTION(file_copy);
+GNOME_CMD_USER_ACTION(file_copy_as);
GNOME_CMD_USER_ACTION(file_move);
GNOME_CMD_USER_ACTION(file_delete);
GNOME_CMD_USER_ACTION(file_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]