Mac shortcuts

This commit is contained in:
Yevgen Muntyan 2008-04-27 22:54:32 -05:00
parent edd9563ebc
commit cdf2e202a5
16 changed files with 243 additions and 70 deletions

View File

@ -20,6 +20,7 @@ mooapp_sources = \
mooapp.c \
mooapp.h \
mooapp-private.h \
mooapp-accels.h \
moohtml.h \
moohtml.c \
moolinklabel.h \

View File

@ -0,0 +1,18 @@
#ifndef MOO_APP_ACCELS_H
#define MOO_APP_ACCELS_H
#include <gtk/gtk.h>
#ifndef GDK_WINDOWING_QUARTZ
#define MOO_APP_ACCEL_HELP "F1"
#define MOO_APP_ACCEL_QUIT "<Ctrl>Q"
#else /* GDK_WINDOWING_QUARTZ */
#define MOO_APP_ACCEL_HELP "<Meta>question"
#define MOO_APP_ACCEL_QUIT "<Meta>Q"
#endif /* GDK_WINDOWING_QUARTZ */
#endif /* MOO_APP_ACCELS_H */

View File

@ -18,6 +18,7 @@
#define WANT_MOO_APP_CMD_CHARS
#include "mooapp/mooapp-private.h"
#include "mooapp/smclient/eggsmclient.h"
#include "mooapp/mooapp-accels.h"
#include "mooedit/mooeditprefs.h"
#include "mooedit/mooeditor.h"
#include "mooedit/mooplugin.h"
@ -1263,7 +1264,7 @@ install_common_actions (void)
moo_window_class_new_action (klass, "Help", NULL,
"label", GTK_STOCK_HELP,
"accel", "F1",
"accel", MOO_APP_ACCEL_HELP,
"stock-id", GTK_STOCK_HELP,
"closure-callback", moo_app_help,
NULL);
@ -1280,7 +1281,7 @@ install_common_actions (void)
"label", GTK_STOCK_QUIT,
"tooltip", GTK_STOCK_QUIT,
"stock-id", GTK_STOCK_QUIT,
"accel", "<ctrl>Q",
"accel", MOO_APP_ACCEL_QUIT,
"closure-callback", moo_app_quit,
"closure-proxy-func", moo_app_get_instance,
NULL);

View File

@ -65,6 +65,7 @@ mooedit_sources = \
mooeditaction-factory.c \
mooeditaction-factory.h \
mooeditaction.h \
mooedit-accels.h \
mooedit-bookmarks.c \
mooedit.c \
mooeditconfig.c \
@ -211,7 +212,7 @@ install-data-hook:
echo "*** "; \
fi
uninstall-hook:
echo "Updating mime database" && $(update_mime) && echo "Done."
if echo "Updating mime database" && $(update_mime); then echo "Done."; else echo "Failed."; fi
else MOO_OS_MINGW
install-data-hook:
cp /usr/share/mime/packages/freedesktop.org.xml $(DESTDIR)${mimedir}/packages/ && \

View File

@ -0,0 +1,65 @@
#ifndef MOO_EDIT_ACCELS_H
#define MOO_EDIT_ACCELS_H
#include <mooutils/mooaccel.h>
#define MOO_EDIT_ACCEL_NEW MOO_ACCEL_NEW
#define MOO_EDIT_ACCEL_OPEN MOO_ACCEL_OPEN
#define MOO_EDIT_ACCEL_SAVE MOO_ACCEL_SAVE
#define MOO_EDIT_ACCEL_SAVE_AS MOO_ACCEL_SAVE_AS
#define MOO_EDIT_ACCEL_CLOSE MOO_ACCEL_CLOSE
#define MOO_EDIT_ACCEL_UNDO MOO_ACCEL_UNDO
#define MOO_EDIT_ACCEL_REDO MOO_ACCEL_REDO
#define MOO_EDIT_ACCEL_CUT MOO_ACCEL_CUT
#define MOO_EDIT_ACCEL_COPY MOO_ACCEL_COPY
#define MOO_EDIT_ACCEL_PASTE MOO_ACCEL_PASTE
#define MOO_EDIT_ACCEL_SELECT_ALL MOO_ACCEL_SELECT_ALL
#define MOO_EDIT_ACCEL_PAGE_SETUP MOO_ACCEL_PAGE_SETUP
#define MOO_EDIT_ACCEL_PRINT MOO_ACCEL_PRINT
#define MOO_EDIT_ACCEL_FIND MOO_ACCEL_CTRL "F"
#define MOO_EDIT_ACCEL_REPLACE MOO_ACCEL_CTRL "R"
#ifndef GDK_WINDOWING_QUARTZ
#define MOO_EDIT_ACCEL_FIND_NEXT "F3"
#define MOO_EDIT_ACCEL_FIND_PREV "<Shift>F3"
#define MOO_EDIT_ACCEL_FIND_CURRENT "F4"
#define MOO_EDIT_ACCEL_FIND_CURRENT_BACK "<Shift>F4"
#define MOO_EDIT_ACCEL_GOTO_LINE "<Ctrl>G"
#define MOO_EDIT_ACCEL_FIND_IN_FILES "<Ctrl><Alt>F"
#define MOO_EDIT_ACCEL_FOCUS_DOC "<Alt>C"
#define MOO_EDIT_ACCEL_SWITCH_TO_TAB "<Alt>"
#else /* GDK_WINDOWING_QUARTZ */
#define MOO_EDIT_ACCEL_FIND_NEXT "<Meta>G"
#define MOO_EDIT_ACCEL_FIND_PREV "<Meta><Shift>G"
#define MOO_EDIT_ACCEL_FIND_CURRENT "F4" /* XXX */
#define MOO_EDIT_ACCEL_FIND_CURRENT_BACK "<Shift>F4" /* XXX */
#define MOO_EDIT_ACCEL_GOTO_LINE "<Meta>L"
#define MOO_EDIT_ACCEL_FIND_IN_FILES "<Ctrl><Meta>F"
#define MOO_EDIT_ACCEL_FOCUS_DOC "<Meta>J"
#define MOO_EDIT_ACCEL_SWITCH_TO_TAB "<Meta>"
#endif /* GDK_WINDOWING_QUARTZ */
#define MOO_EDIT_ACCEL_BOOKMARK MOO_ACCEL_CTRL "B"
#define MOO_EDIT_ACCEL_NEXT_BOOKMARK "<Alt>Down" /* XXX */
#define MOO_EDIT_ACCEL_PREV_BOOKMARK "<Alt>Up" /* XXX */
/* no such shortcut on Mac */
#define MOO_EDIT_ACCEL_RELOAD "F5"
/* XXX Shift-Command-W is Close File on Mac */
#define MOO_EDIT_ACCEL_CLOSE_ALL MOO_ACCEL_CTRL "<Shift>W"
#define MOO_EDIT_ACCEL_PREV_TAB "<Alt>Left"
#define MOO_EDIT_ACCEL_NEXT_TAB "<Alt>Right"
#define MOO_EDIT_ACCEL_STOP "Escape"
#define MOO_EDIT_ACCEL_COMPLETE "<Ctrl>Space"
#endif /* MOO_EDIT_ACCELS_H */

View File

@ -279,8 +279,6 @@ moo_editor_class_init (MooEditorClass *klass)
moo_window_class_new_action (edit_window_class, RECENT_DIALOG_ACTION_ID, NULL,
"display-name", _("Open Recent Files Dialog"),
"label", Q_("Open Recent|_More..."),
// "stock-id", GTK_STOCK_NEW,
// "accel", "<ctrl>N",
"closure-callback", action_recent_dialog,
NULL);
g_type_class_unref (edit_window_class);

View File

@ -17,6 +17,7 @@
#define MOOEDIT_COMPILATION
#include "moostatusbar-glade.h"
#include "mooedit/mooedit-private.h"
#include "mooedit/mooedit-accels.h"
#include "mooedit/mooeditor-private.h"
#include "mooedit/mooeditfiltersettings.h"
#include "mooedit/moolang.h"
@ -372,7 +373,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_NEW,
"tooltip", _("Create new document"),
"stock-id", GTK_STOCK_NEW,
"accel", "<ctrl>N",
"accel", MOO_EDIT_ACCEL_NEW,
"closure-callback", action_new_doc,
NULL);
@ -381,7 +382,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("_Open..."),
"tooltip", _("Open..."),
"stock-id", GTK_STOCK_OPEN,
"accel", "<ctrl>O",
"accel", MOO_EDIT_ACCEL_OPEN,
"closure-callback", action_open,
NULL);
@ -390,7 +391,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("_Reload"),
"tooltip", _("Reload document"),
"stock-id", GTK_STOCK_REFRESH,
"accel", "F5",
"accel", MOO_EDIT_ACCEL_RELOAD,
"closure-callback", action_reload,
"condition::sensitive", "can-reload",
NULL);
@ -408,7 +409,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_SAVE,
"tooltip", GTK_STOCK_SAVE,
"stock-id", GTK_STOCK_SAVE,
"accel", "<ctrl>S",
"accel", MOO_EDIT_ACCEL_SAVE,
"closure-callback", action_save,
"condition::sensitive", "has-open-document",
NULL);
@ -418,7 +419,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("Save _As..."),
"tooltip", _("Save as..."),
"stock-id", GTK_STOCK_SAVE_AS,
"accel", "<ctrl><shift>S",
"accel", MOO_EDIT_ACCEL_SAVE_AS,
"closure-callback", action_save_as,
"condition::sensitive", "has-open-document",
NULL);
@ -428,7 +429,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_CLOSE,
"tooltip", _("Close document"),
"stock-id", GTK_STOCK_CLOSE,
"accel", "<ctrl>W",
"accel", MOO_EDIT_ACCEL_CLOSE,
"closure-callback", action_close_tab,
"condition::sensitive", "has-open-document",
NULL);
@ -437,7 +438,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Close All"),
"label", _("Close A_ll"),
"tooltip", _("Close all documents"),
"accel", "<shift><ctrl>W",
"accel", MOO_EDIT_ACCEL_CLOSE_ALL,
"closure-callback", action_close_all,
"condition::sensitive", "has-open-document",
NULL);
@ -447,7 +448,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_UNDO,
"tooltip", GTK_STOCK_UNDO,
"stock-id", GTK_STOCK_UNDO,
"accel", "<ctrl>Z",
"accel", MOO_EDIT_ACCEL_UNDO,
"closure-signal", "undo",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "can-undo",
@ -458,7 +459,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_REDO,
"tooltip", GTK_STOCK_REDO,
"stock-id", GTK_STOCK_REDO,
"accel", "<shift><ctrl>Z",
"accel", MOO_EDIT_ACCEL_REDO,
"closure-signal", "redo",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "can-redo",
@ -469,7 +470,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_CUT,
"tooltip", GTK_STOCK_CUT,
"stock-id", GTK_STOCK_CUT,
"accel", "<ctrl>X",
"accel", MOO_EDIT_ACCEL_CUT,
"closure-signal", "cut-clipboard",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-selection",
@ -480,7 +481,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_COPY,
"tooltip", GTK_STOCK_COPY,
"stock-id", GTK_STOCK_COPY,
"accel", "<ctrl>C",
"accel", MOO_EDIT_ACCEL_COPY,
"closure-signal", "copy-clipboard",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-selection",
@ -491,7 +492,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_PASTE,
"tooltip", GTK_STOCK_PASTE,
"stock-id", GTK_STOCK_PASTE,
"accel", "<ctrl>V",
"accel", MOO_EDIT_ACCEL_PASTE,
"closure-signal", "paste-clipboard",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -511,7 +512,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", GTK_STOCK_SELECT_ALL,
"label", GTK_STOCK_SELECT_ALL,
"tooltip", GTK_STOCK_SELECT_ALL,
"accel", "<ctrl>A",
"accel", MOO_EDIT_ACCEL_SELECT_ALL,
"closure-callback", moo_text_view_select_all,
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-text",
@ -522,7 +523,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("_Previous Tab"),
"tooltip", _("Previous tab"),
"stock-id", GTK_STOCK_GO_BACK,
"accel", "<alt>Left",
"accel", MOO_EDIT_ACCEL_PREV_TAB,
"closure-callback", action_previous_tab,
"condition::sensitive", "has-open-document",
NULL);
@ -532,7 +533,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("_Next Tab"),
"tooltip", _("Next tab"),
"stock-id", GTK_STOCK_GO_FORWARD,
"accel", "<alt>Right",
"accel", MOO_EDIT_ACCEL_NEXT_TAB,
"closure-callback", action_next_tab,
"condition::sensitive", "has-open-document",
NULL);
@ -542,7 +543,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_FIND,
"tooltip", GTK_STOCK_FIND,
"stock-id", GTK_STOCK_FIND,
"accel", "<ctrl>F",
"accel", MOO_EDIT_ACCEL_FIND,
"closure-signal", "find-interactive",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -553,7 +554,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("Find _Next"),
"tooltip", _("Find next"),
"stock-id", GTK_STOCK_GO_FORWARD,
"accel", "F3",
"accel", MOO_EDIT_ACCEL_FIND_NEXT,
"closure-signal", "find-next-interactive",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -564,7 +565,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", _("Find _Previous"),
"tooltip", _("Find previous"),
"stock-id", GTK_STOCK_GO_BACK,
"accel", "<shift>F3",
"accel", MOO_EDIT_ACCEL_FIND_PREV,
"closure-signal", "find-prev-interactive",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -575,7 +576,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_FIND_AND_REPLACE,
"tooltip", GTK_STOCK_FIND_AND_REPLACE,
"stock-id", GTK_STOCK_FIND_AND_REPLACE,
"accel", "<ctrl>R",
"accel", MOO_EDIT_ACCEL_REPLACE,
"closure-signal", "replace-interactive",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -585,7 +586,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Find Current Word"),
"label", _("Find Current _Word"),
"stock-id", GTK_STOCK_FIND,
"accel", "F4",
"accel", MOO_EDIT_ACCEL_FIND_CURRENT,
"closure-callback", action_find_now_f,
"condition::sensitive", "has-open-document",
NULL);
@ -594,7 +595,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Find Current Word Backwards"),
"label", _("Find Current Word _Backwards"),
"stock-id", GTK_STOCK_FIND,
"accel", "<shift>F4",
"accel", MOO_EDIT_ACCEL_FIND_CURRENT_BACK,
"closure-callback", action_find_now_b,
"condition::sensitive", "has-open-document",
NULL);
@ -603,7 +604,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Go to Line"),
"label", _("_Go to Line..."),
"tooltip", _("Go to line..."),
"accel", "<ctrl>G",
"accel", MOO_EDIT_ACCEL_GOTO_LINE,
"closure-signal", "goto-line-interactive",
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -628,7 +629,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
moo_window_class_new_action (window_class, "FocusDoc", NULL,
"display-name", _("Focus Document"),
"label", _("_Focus Document"),
"accel", "<alt>C",
"accel", MOO_EDIT_ACCEL_FOCUS_DOC,
"closure-callback", gtk_widget_grab_focus,
"closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-open-document",
@ -639,7 +640,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"label", GTK_STOCK_STOP,
"tooltip", GTK_STOCK_STOP,
"stock-id", GTK_STOCK_STOP,
"accel", "Escape",
"accel", MOO_EDIT_ACCEL_STOP,
"closure-callback", action_abort_jobs,
"condition::sensitive", "has-jobs-running",
"condition::visible", "has-stop-clients",
@ -648,7 +649,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
for (i = 1; i < 10; ++i)
{
char *action_id = g_strdup_printf ("SwitchToTab%u", i);
char *accel = g_strdup_printf ("<Alt>%u", i);
char *accel = g_strdup_printf (MOO_EDIT_ACCEL_SWITCH_TO_TAB "%u", i);
_moo_window_class_new_action_callback (window_class, action_id, NULL,
G_CALLBACK (action_switch_to_tab),
_moo_marshal_VOID__UINT,
@ -681,7 +682,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Toggle Bookmark"),
"label", _("Toggle Bookmark"),
"stock-id", MOO_STOCK_EDIT_BOOKMARK,
"accel", "<ctrl>B",
"accel", MOO_EDIT_ACCEL_BOOKMARK,
"closure-callback", action_toggle_bookmark,
"condition::sensitive", "has-open-document",
NULL);
@ -689,7 +690,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
moo_window_class_new_action (window_class, "NextBookmark", NULL,
"display-name", _("Next Bookmark"),
"label", _("Next Bookmark"),
"accel", "<alt>Down",
"accel", MOO_EDIT_ACCEL_NEXT_BOOKMARK,
"connect-accel", TRUE,
"closure-callback", action_next_bookmark,
"condition::visible", "has-open-document",
@ -698,7 +699,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
moo_window_class_new_action (window_class, "PreviousBookmark", NULL,
"display-name", _("Previous Bookmark"),
"label", _("Previous Bookmark"),
"accel", "<alt>Up",
"accel", MOO_EDIT_ACCEL_PREV_BOOKMARK,
"connect-accel", TRUE,
"closure-callback", action_prev_bookmark,
"condition::visible", "has-open-document",
@ -778,7 +779,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", _("Page Setup"),
"label", _("Page S_etup..."),
"tooltip", _("Page Setup..."),
"accel", "<ctrl><shift>P",
"accel", MOO_EDIT_ACCEL_PAGE_SETUP,
"closure-callback", action_page_setup,
NULL);
@ -795,7 +796,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"display-name", GTK_STOCK_PRINT,
"label", _("Print..."),
"tooltip", _("Print..."),
"accel", "<ctrl>P",
"accel", MOO_EDIT_ACCEL_PRINT,
"stock-id", GTK_STOCK_PRINT,
"closure-callback", action_print,
"condition::sensitive", "has-open-document",

View File

@ -11,6 +11,7 @@
*/
#define MOOEDIT_COMPILATION
#include "mooedit/mooedit-accels.h"
#include "mooedit/mootextview-private.h"
#include "mooedit/mootextview.h"
#include "mooedit/mootextbuffer.h"
@ -648,9 +649,9 @@ static void moo_text_view_class_init (MooTextViewClass *klass)
G_TYPE_BOOLEAN, 0);
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_z, GDK_CONTROL_MASK,
gtk_binding_entry_add_signal (binding_set, GDK_z, MOO_ACCEL_CTRL_MASK,
"undo", 0);
gtk_binding_entry_add_signal (binding_set, GDK_z, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
gtk_binding_entry_add_signal (binding_set, GDK_z, MOO_ACCEL_CTRL_MASK | GDK_SHIFT_MASK,
"redo", 0);
}

View File

@ -127,7 +127,7 @@ cmpl_plugin_init (CmplPlugin *plugin)
"display-name", _("Complete Word"),
"label", _("Complete Word"),
"tooltip", _("Complete Word"),
"accel", "<Ctrl>space",
"accel", MOO_EDIT_ACCEL_COMPLETE,
"closure-callback", completion_callback,
"condition::sensitive", "has-open-document",
NULL);

View File

@ -22,6 +22,7 @@
#include "mooedit/plugins/mooeditplugins.h"
#include "moofileview/moofileentry.h"
#include "mooedit/moocmdview.h"
#include "mooedit/mooedit-accels.h"
#include "mooutils/moostock.h"
#include "mooutils/mooglade.h"
#include "mooutils/moohistorycombo.h"
@ -246,7 +247,7 @@ find_plugin_init (FindPlugin *plugin)
"display-name", _("Find In Files"),
"label", _("Find In Files"),
"tooltip", _("Find in files"),
"accel", "<ctrl><alt>f",
"accel", MOO_EDIT_ACCEL_FIND_IN_FILES,
"stock-id", MOO_STOCK_FIND_IN_FILES,
"closure-callback", find_in_files_cb,
NULL);

View File

@ -17,6 +17,7 @@ moofileview_sources = \
moofilesystem.c \
moofilesystem.h \
moofileview.c \
moofileview-accels.h \
moofileview-aux.h \
moofileview-dialogs.c \
moofileview-dialogs.h \

View File

@ -0,0 +1,51 @@
#ifndef MOO_FILE_VIEW_ACCELS_H
#define MOO_FILE_VIEW_ACCELS_H
#include <mooutils/mooaccel.h>
#define MOO_FILE_VIEW_ACCEL_CUT MOO_ACCEL_CUT
#define MOO_FILE_VIEW_ACCEL_COPY MOO_ACCEL_COPY
#define MOO_FILE_VIEW_ACCEL_PASTE MOO_ACCEL_PASTE
#ifndef GDK_WINDOWING_QUARTZ
#define MOO_FILE_VIEW_ACCEL_GO_UP "<Alt>Up"
#define MOO_FILE_VIEW_ACCEL_GO_BACK "<Alt>Left"
#define MOO_FILE_VIEW_ACCEL_GO_FORWARD "<Alt>Right"
#define MOO_FILE_VIEW_ACCEL_GO_HOME "<Alt>Home"
#define MOO_FILE_VIEW_ACCEL_DELETE "<Alt>Delete"
#define MOO_FILE_VIEW_ACCEL_SHOW_HIDDEN "<Alt><Shift>H"
#define MOO_FILE_VIEW_ACCEL_PROPERTIES "<Alt>Return"
#define MOO_FILE_VIEW_BINDING_GO_UP GDK_Up, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_UP_KP GDK_KP_Up, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_BACK GDK_Left, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_BACK_KP GDK_KP_Left, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_FORWARD GDK_Right, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_FORWARD_KP GDK_KP_Right, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_HOME GDK_Home, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_HOME_KP GDK_KP_Home, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_DELETE GDK_Delete, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_PROPERTIES GDK_Return, GDK_MOD1_MASK
#else /* GDK_WINDOWING_QUARTZ */
#define MOO_FILE_VIEW_ACCEL_GO_UP "<Meta>Up"
#define MOO_FILE_VIEW_ACCEL_GO_BACK "<Meta>["
#define MOO_FILE_VIEW_ACCEL_GO_FORWARD "<Meta>]"
#define MOO_FILE_VIEW_ACCEL_GO_HOME "<Meta><Shift>H"
#define MOO_FILE_VIEW_ACCEL_DELETE "<Meta>Backspace"
#define MOO_FILE_VIEW_ACCEL_SHOW_HIDDEN NULL
#define MOO_FILE_VIEW_ACCEL_PROPERTIES "<Meta>I"
#define MOO_FILE_VIEW_BINDING_GO_UP GDK_Up, GDK_META_MASK
#define MOO_FILE_VIEW_BINDING_GO_UP_KP GDK_KP_Up, GDK_META_MASK
#define MOO_FILE_VIEW_BINDING_GO_BACK GDK_bracketleft, GDK_META_MASK
#define MOO_FILE_VIEW_BINDING_GO_FORWARD GDK_bracketright, GDK_MOD1_MASK
#define MOO_FILE_VIEW_BINDING_GO_HOME GDK_h, GDK_META_MASK | GDK_SHIFT_MASK
#define MOO_FILE_VIEW_BINDING_DELETE GDK_BackSpace, GDK_META_MASK
#define MOO_FILE_VIEW_BINDING_PROPERTIES GDK_i, GDK_META_MASK
#endif /* GDK_WINDOWING_QUARTZ */
#endif /* MOO_FILE_VIEW_ACCELS_H */

View File

@ -17,6 +17,7 @@
#endif
#define MOO_FILE_VIEW_COMPILATION
#include "moofileview/moofileview-accels.h"
#include "moofileview/moofileview-dialogs.h"
#include "moofileview/moobookmarkmgr.h"
#include "moofileview/moofilesystem.h"
@ -806,37 +807,39 @@ moo_file_view_class_init (MooFileViewClass *klass)
"delete-to-cursor", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Return, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_PROPERTIES,
"properties-dialog", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Delete, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_DELETE,
"delete-selected", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Up, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_UP,
"go-up", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Up, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_UP_KP,
"go-up", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Left, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_BACK,
"go-back", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Left, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_FORWARD,
"go-forward", 0);
gtk_binding_entry_add_signal (binding_set,
MOO_FILE_VIEW_BINDING_GO_HOME,
"go-home", 0);
#ifdef MOO_FILE_VIEW_BINDING_GO_BACK_KP
gtk_binding_entry_add_signal (binding_set,
MOO_FILE_VIEW_BINDING_GO_BACK_KP,
"go-back", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Right, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_FORWARD_KP,
"go-forward", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Right, GDK_MOD1_MASK,
"go-forward", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Home, GDK_MOD1_MASK,
"go-home", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Home, GDK_MOD1_MASK,
MOO_FILE_VIEW_BINDING_GO_HOME_KP,
"go-home", 0);
#endif
gtk_binding_entry_add_signal (binding_set,
GDK_f, GDK_MOD1_MASK | GDK_SHIFT_MASK,
@ -852,19 +855,19 @@ moo_file_view_class_init (MooFileViewClass *klass)
"toggle-show-bookmarks", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_c, GDK_CONTROL_MASK,
GDK_c, MOO_ACCEL_CTRL_MASK,
"copy-clipboard", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Insert, GDK_CONTROL_MASK,
"copy-clipboard", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_x, GDK_CONTROL_MASK,
GDK_x, MOO_ACCEL_CTRL_MASK,
"cut-clipboard", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Delete, GDK_SHIFT_MASK,
"cut-clipboard", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_v, GDK_CONTROL_MASK,
GDK_v, MOO_ACCEL_CTRL_MASK,
"paste-clipboard", 0);
gtk_binding_entry_add_signal (binding_set,
GDK_Insert, GDK_SHIFT_MASK,
@ -1118,7 +1121,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_GO_UP,
"tooltip", _("Go to parent folder"),
"stock-id", GTK_STOCK_GO_UP,
"accel", "<alt>Up",
"accel", MOO_FILE_VIEW_ACCEL_GO_UP,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-signal", "go-up",
@ -1128,7 +1131,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_GO_BACK,
"tooltip", GTK_STOCK_GO_BACK,
"stock-id", GTK_STOCK_GO_BACK,
"accel", "<alt>Left",
"accel", MOO_FILE_VIEW_ACCEL_GO_BACK,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-signal", "go-back",
@ -1139,7 +1142,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_GO_FORWARD,
"tooltip", GTK_STOCK_GO_FORWARD,
"stock-id", GTK_STOCK_GO_FORWARD,
"accel", "<alt>Right",
"accel", MOO_FILE_VIEW_ACCEL_GO_FORWARD,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-signal", "go-forward",
@ -1150,7 +1153,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_HOME,
"tooltip", GTK_STOCK_HOME,
"stock-id", GTK_STOCK_HOME,
"accel", "<alt>Home",
"accel", MOO_FILE_VIEW_ACCEL_GO_HOME,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-signal", "go-home",
@ -1168,7 +1171,7 @@ init_actions (MooFileView *fileview)
"label", _("Delete..."),
"tooltip", _("Delete..."),
"stock-id", GTK_STOCK_DELETE,
"accel", "<alt>Delete",
"accel", MOO_FILE_VIEW_ACCEL_DELETE,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-callback", file_view_delete_selected,
@ -1179,7 +1182,7 @@ init_actions (MooFileView *fileview)
"action-type::", MOO_TYPE_TOGGLE_ACTION,
"label", _("Show Hidden Files"),
"tooltip", _("Show Hidden Files"),
"accel", "<alt><shift>H",
"accel", MOO_FILE_VIEW_ACCEL_SHOW_HIDDEN,
"force-accel-label", TRUE,
NULL);
_moo_sync_toggle_action (action, fileview, "show-hidden-files", FALSE);
@ -1202,7 +1205,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_PROPERTIES,
"tooltip", GTK_STOCK_PROPERTIES,
"stock-id", GTK_STOCK_PROPERTIES,
"accel", "<alt>Return",
"accel", MOO_FILE_VIEW_ACCEL_PROPERTIES,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-callback", file_view_properties_dialog,
@ -1238,7 +1241,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_CUT,
"tooltip", GTK_STOCK_CUT,
"stock-id", GTK_STOCK_CUT,
"accel", "<control>X",
"accel", MOO_FILE_VIEW_ACCEL_CUT,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-callback", file_view_cut_clipboard,
@ -1250,7 +1253,7 @@ init_actions (MooFileView *fileview)
"tooltip", GTK_STOCK_COPY,
"stock-id", GTK_STOCK_COPY,
"force-accel-label", TRUE,
"accel", "<control>C",
"accel", MOO_FILE_VIEW_ACCEL_COPY,
"closure-object", fileview,
"closure-callback", file_view_copy_clipboard,
NULL);
@ -1260,7 +1263,7 @@ init_actions (MooFileView *fileview)
"label", GTK_STOCK_PASTE,
"tooltip", GTK_STOCK_PASTE,
"stock-id", GTK_STOCK_PASTE,
"accel", "<control>V",
"accel", MOO_FILE_VIEW_ACCEL_PASTE,
"force-accel-label", TRUE,
"closure-object", fileview,
"closure-callback", file_view_paste_clipboard,

View File

@ -13,6 +13,7 @@
#define MOO_FILE_VIEW_COMPILATION
#include "mooiconview.h"
#include "marshals.h"
#include "mooutils/mooaccel.h"
#include "mooutils/mooutils-gobject.h"
#include "mooutils/mooutils-misc.h"
#include <gdk/gdkkeysyms.h>
@ -408,7 +409,7 @@ _moo_icon_view_class_init (MooIconViewClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, "activate-item-at-cursor", 0);
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, "activate-item-at-cursor", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, "activate-item-at-cursor", 0);
gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, "select-all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_a, MOO_ACCEL_CTRL_MASK, "select-all", 0);
add_move_binding (binding_set, GDK_Up, 0,
GTK_MOVEMENT_DISPLAY_LINES, -1);

View File

@ -13,7 +13,7 @@
#ifndef MOO_ACCEL_H
#define MOO_ACCEL_H
#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
@ -30,6 +30,35 @@ void _moo_modify_accel (const char *accel_path,
char *_moo_get_accel_label (const char *accel);
#ifndef GDK_WINDOWING_QUARTZ
#define MOO_ACCEL_CTRL "<Ctrl>"
#define MOO_ACCEL_CTRL_MASK GDK_CONTROL_MASK
#else /* GDK_WINDOWING_QUARTZ */
#define MOO_ACCEL_CTRL "<Meta>"
#define MOO_ACCEL_CTRL_MASK GDK_META_MASK
#endif /* GDK_WINDOWING_QUARTZ */
#define MOO_ACCEL_NEW MOO_ACCEL_CTRL "N"
#define MOO_ACCEL_OPEN MOO_ACCEL_CTRL "O"
#define MOO_ACCEL_SAVE MOO_ACCEL_CTRL "S"
#define MOO_ACCEL_SAVE_AS MOO_ACCEL_CTRL "<Shift>S"
#define MOO_ACCEL_CLOSE MOO_ACCEL_CTRL "W"
#define MOO_ACCEL_UNDO MOO_ACCEL_CTRL "Z"
#define MOO_ACCEL_REDO MOO_ACCEL_CTRL "<Shift>Z"
#define MOO_ACCEL_CUT MOO_ACCEL_CTRL "X"
#define MOO_ACCEL_COPY MOO_ACCEL_CTRL "C"
#define MOO_ACCEL_PASTE MOO_ACCEL_CTRL "V"
#define MOO_ACCEL_SELECT_ALL MOO_ACCEL_CTRL "A"
#define MOO_ACCEL_PAGE_SETUP MOO_ACCEL_CTRL "<Shift>P"
#define MOO_ACCEL_PRINT MOO_ACCEL_CTRL "P"
G_END_DECLS
#endif /* MOO_ACCEL_H */

View File

@ -11,6 +11,7 @@
*/
#include "marshals.h"
#include "mooutils/mooaccel.h"
#include "mooutils/mooentry.h"
#include "mooutils/mooundo.h"
#include "mooutils/mooutils-gobject.h"
@ -250,10 +251,10 @@ moo_entry_class_init (MooEntryClass *klass)
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_z,
GDK_CONTROL_MASK,
MOO_ACCEL_CTRL_MASK,
"undo", 0);
gtk_binding_entry_add_signal (binding_set, GDK_z,
GDK_CONTROL_MASK | GDK_SHIFT_MASK,
MOO_ACCEL_CTRL_MASK | GDK_SHIFT_MASK,
"redo", 0);
gtk_binding_entry_add_signal (binding_set, GDK_u,
GDK_CONTROL_MASK,