Use more stock labels

master
Yevgen Muntyan 2006-12-08 03:24:03 -06:00
parent 656c9a026a
commit 53b4993d86
4 changed files with 42 additions and 47 deletions

View File

@ -98,10 +98,9 @@ static MooAppInfo *moo_app_info_new (void);
static MooAppInfo *moo_app_info_copy (const MooAppInfo *info); static MooAppInfo *moo_app_info_copy (const MooAppInfo *info);
static void moo_app_info_free (MooAppInfo *info); static void moo_app_info_free (MooAppInfo *info);
static void install_actions (MooApp *app, static void install_actions (GType type);
GType type); static void install_editor_actions (void);
static void install_editor_actions (MooApp *app); static void install_terminal_actions(void);
static void install_terminal_actions(MooApp *app);
static void moo_app_set_property (GObject *object, static void moo_app_set_property (GObject *object,
guint prop_id, guint prop_id,
@ -423,8 +422,8 @@ moo_app_constructor (GType type,
signal (SIGINT, sigint_handler); signal (SIGINT, sigint_handler);
#endif #endif
install_editor_actions (app); install_editor_actions ();
install_terminal_actions (app); install_terminal_actions ();
return object; return object;
} }
@ -1158,16 +1157,12 @@ moo_app_set_description (MooApp *app,
static void static void
install_actions (MooApp *app, install_actions (GType type)
GType type)
{ {
MooWindowClass *klass = g_type_class_ref (type); MooWindowClass *klass = g_type_class_ref (type);
char *_about;
g_return_if_fail (klass != NULL); g_return_if_fail (klass != NULL);
_about = g_strdup_printf (Q_("Menu item label|_About %s"), app->priv->info->full_name);
moo_window_class_new_action (klass, "Preferences", NULL, moo_window_class_new_action (klass, "Preferences", NULL,
"display-name", GTK_STOCK_PREFERENCES, "display-name", GTK_STOCK_PREFERENCES,
"label", GTK_STOCK_PREFERENCES, "label", GTK_STOCK_PREFERENCES,
@ -1178,19 +1173,18 @@ install_actions (MooApp *app,
moo_window_class_new_action (klass, "About", NULL, moo_window_class_new_action (klass, "About", NULL,
"display-name", GTK_STOCK_ABOUT, "display-name", GTK_STOCK_ABOUT,
"label", _about, "label", GTK_STOCK_ABOUT,
"no-accel", TRUE, "no-accel", TRUE,
"stock-id", GTK_STOCK_ABOUT, "stock-id", GTK_STOCK_ABOUT,
"closure-callback", moo_app_about_dialog, "closure-callback", moo_app_about_dialog,
NULL); NULL);
g_type_class_unref (klass); g_type_class_unref (klass);
g_free (_about);
} }
static void static void
install_editor_actions (MooApp *app) install_editor_actions (void)
{ {
#ifdef MOO_BUILD_EDIT #ifdef MOO_BUILD_EDIT
MooWindowClass *klass = g_type_class_ref (MOO_TYPE_EDIT_WINDOW); MooWindowClass *klass = g_type_class_ref (MOO_TYPE_EDIT_WINDOW);
@ -1207,7 +1201,7 @@ install_editor_actions (MooApp *app)
"closure-proxy-func", moo_app_get_instance, "closure-proxy-func", moo_app_get_instance,
NULL); NULL);
install_actions (app, MOO_TYPE_EDIT_WINDOW); install_actions (MOO_TYPE_EDIT_WINDOW);
g_type_class_unref (klass); g_type_class_unref (klass);
#endif /* MOO_BUILD_EDIT */ #endif /* MOO_BUILD_EDIT */
@ -1232,13 +1226,13 @@ open_in_editor (MooTermWindow *terminal)
static void static void
install_terminal_actions (MooApp *app) install_terminal_actions (void)
{ {
MooWindowClass *klass = g_type_class_ref (MOO_TYPE_TERM_WINDOW); MooWindowClass *klass = g_type_class_ref (MOO_TYPE_TERM_WINDOW);
g_return_if_fail (klass != NULL); g_return_if_fail (klass != NULL);
install_actions (app, MOO_TYPE_TERM_WINDOW); install_actions (MOO_TYPE_TERM_WINDOW);
moo_window_class_new_action (klass, "NewEditor", NULL, moo_window_class_new_action (klass, "NewEditor", NULL,
"display-name", "New Editor", "display-name", "New Editor",
@ -1263,7 +1257,7 @@ install_terminal_actions (MooApp *app)
} }
#else /* !(defined(MOO_BUILD_TERM) && defined(MOO_BUILD_EDIT)) */ #else /* !(defined(MOO_BUILD_TERM) && defined(MOO_BUILD_EDIT)) */
static void static void
install_terminal_actions (G_GNUC_UNUSED MooApp *app) install_terminal_actions (void)
{ {
} }
#endif /* !(defined(MOO_BUILD_TERM) && defined(MOO_BUILD_EDIT)) */ #endif /* !(defined(MOO_BUILD_TERM) && defined(MOO_BUILD_EDIT)) */

View File

@ -566,47 +566,47 @@ void
_moo_edit_class_init_actions (MooEditClass *klass) _moo_edit_class_init_actions (MooEditClass *klass)
{ {
moo_edit_class_new_action (klass, "Undo", moo_edit_class_new_action (klass, "Undo",
"display-name", "Undo", "display-name", GTK_STOCK_UNDO,
"label", "_Undo", "label", GTK_STOCK_UNDO,
"tooltip", "Undo", "tooltip", GTK_STOCK_UNDO,
"stock-id", GTK_STOCK_UNDO, "stock-id", GTK_STOCK_UNDO,
"closure-signal", "undo", "closure-signal", "undo",
"condition::sensitive", "can-undo", "condition::sensitive", "can-undo",
NULL); NULL);
moo_edit_class_new_action (klass, "Redo", moo_edit_class_new_action (klass, "Redo",
"display-name", "Redo", "display-name", GTK_STOCK_REDO,
"label", "_Redo", "label", GTK_STOCK_REDO,
"tooltip", "Redo", "tooltip", GTK_STOCK_REDO,
"stock-id", GTK_STOCK_REDO, "stock-id", GTK_STOCK_REDO,
"closure-signal", "redo", "closure-signal", "redo",
"condition::sensitive", "can-redo", "condition::sensitive", "can-redo",
NULL); NULL);
moo_edit_class_new_action (klass, "Cut", moo_edit_class_new_action (klass, "Cut",
"display-name", "Cut", "display-name", GTK_STOCK_CUT,
"stock-id", GTK_STOCK_CUT, "stock-id", GTK_STOCK_CUT,
"closure-signal", "cut-clipboard", "closure-signal", "cut-clipboard",
"condition::sensitive", "has-selection", "condition::sensitive", "has-selection",
NULL); NULL);
moo_edit_class_new_action (klass, "Copy", moo_edit_class_new_action (klass, "Copy",
"display-name", "Copy", "display-name", GTK_STOCK_COPY,
"stock-id", GTK_STOCK_COPY, "stock-id", GTK_STOCK_COPY,
"closure-signal", "copy-clipboard", "closure-signal", "copy-clipboard",
"condition::sensitive", "has-selection", "condition::sensitive", "has-selection",
NULL); NULL);
moo_edit_class_new_action (klass, "Paste", moo_edit_class_new_action (klass, "Paste",
"display-name", "Paste", "display-name", GTK_STOCK_PASTE,
"stock-id", GTK_STOCK_PASTE, "stock-id", GTK_STOCK_PASTE,
"closure-signal", "paste-clipboard", "closure-signal", "paste-clipboard",
NULL); NULL);
moo_edit_class_new_action (klass, "SelectAll", moo_edit_class_new_action (klass, "SelectAll",
"display-name", "Select All", "display-name", GTK_STOCK_SELECT_ALL,
"label", "Select _All", "label", GTK_STOCK_SELECT_ALL,
"tooltip", "Select all", "tooltip", GTK_STOCK_SELECT_ALL,
"stock-id", GTK_STOCK_SELECT_ALL, "stock-id", GTK_STOCK_SELECT_ALL,
"closure-callback", moo_text_view_select_all, "closure-callback", moo_text_view_select_all,
"condition::sensitive", "has-text", "condition::sensitive", "has-text",

View File

@ -1076,8 +1076,8 @@ init_actions (MooFileView *fileview)
NULL); NULL);
action = moo_action_group_add_action (group, "GoBack", action = moo_action_group_add_action (group, "GoBack",
"label", _("Go Back"), "label", GTK_STOCK_GO_BACK,
"tooltip", _("Go Back"), "tooltip", GTK_STOCK_GO_BACK,
"stock-id", GTK_STOCK_GO_BACK, "stock-id", GTK_STOCK_GO_BACK,
"accel", "<alt>Left", "accel", "<alt>Left",
"force-accel-label", TRUE, "force-accel-label", TRUE,
@ -1087,8 +1087,8 @@ init_actions (MooFileView *fileview)
moo_bind_bool_property (action, "sensitive", fileview, "can-go-back", FALSE); moo_bind_bool_property (action, "sensitive", fileview, "can-go-back", FALSE);
action = moo_action_group_add_action (group, "GoForward", action = moo_action_group_add_action (group, "GoForward",
"label", _("Go Forward"), "label", GTK_STOCK_GO_FORWARD,
"tooltip", _("Go Forward"), "tooltip", GTK_STOCK_GO_FORWARD,
"stock-id", GTK_STOCK_GO_FORWARD, "stock-id", GTK_STOCK_GO_FORWARD,
"accel", "<alt>Right", "accel", "<alt>Right",
"force-accel-label", TRUE, "force-accel-label", TRUE,
@ -1098,8 +1098,8 @@ init_actions (MooFileView *fileview)
moo_bind_bool_property (action, "sensitive", fileview, "can-go-forward", FALSE); moo_bind_bool_property (action, "sensitive", fileview, "can-go-forward", FALSE);
moo_action_group_add_action (group, "GoHome", moo_action_group_add_action (group, "GoHome",
"label", _("Home Folder"), "label", GTK_STOCK_HOME,
"tooltip", _("Home Folder"), "tooltip", GTK_STOCK_HOME,
"stock-id", GTK_STOCK_HOME, "stock-id", GTK_STOCK_HOME,
"accel", "<alt>Home", "accel", "<alt>Home",
"force-accel-label", TRUE, "force-accel-label", TRUE,
@ -1150,8 +1150,8 @@ init_actions (MooFileView *fileview)
_moo_sync_toggle_action (action, fileview, "sort-case-sensitive", FALSE); _moo_sync_toggle_action (action, fileview, "sort-case-sensitive", FALSE);
action = moo_action_group_add_action (group, "Properties", action = moo_action_group_add_action (group, "Properties",
"label", _("Properties"), "label", GTK_STOCK_PROPERTIES,
"tooltip", _("Properties"), "tooltip", GTK_STOCK_PROPERTIES,
"stock-id", GTK_STOCK_PROPERTIES, "stock-id", GTK_STOCK_PROPERTIES,
"accel", "<alt>Return", "accel", "<alt>Return",
"force-accel-label", TRUE, "force-accel-label", TRUE,
@ -1186,8 +1186,8 @@ init_actions (MooFileView *fileview)
NULL); NULL);
action = moo_action_group_add_action (group, "Cut", action = moo_action_group_add_action (group, "Cut",
"label", _("Cut"), "label", GTK_STOCK_CUT,
"tooltip", _("Cut"), "tooltip", GTK_STOCK_CUT,
"stock-id", GTK_STOCK_CUT, "stock-id", GTK_STOCK_CUT,
"accel", "<control>X", "accel", "<control>X",
"force-accel-label", TRUE, "force-accel-label", TRUE,
@ -1197,8 +1197,8 @@ init_actions (MooFileView *fileview)
moo_bind_bool_property (action, "sensitive", fileview, "has-selection", FALSE); moo_bind_bool_property (action, "sensitive", fileview, "has-selection", FALSE);
action = moo_action_group_add_action (group, "Copy", action = moo_action_group_add_action (group, "Copy",
"label", _("Copy"), "label", GTK_STOCK_COPY,
"tooltip", _("Copy"), "tooltip", GTK_STOCK_COPY,
"stock-id", GTK_STOCK_COPY, "stock-id", GTK_STOCK_COPY,
"force-accel-label", TRUE, "force-accel-label", TRUE,
"accel", "<control>C", "accel", "<control>C",
@ -1208,8 +1208,8 @@ init_actions (MooFileView *fileview)
moo_bind_bool_property (action, "sensitive", fileview, "has-selection", FALSE); moo_bind_bool_property (action, "sensitive", fileview, "has-selection", FALSE);
action = moo_action_group_add_action (group, "Paste", action = moo_action_group_add_action (group, "Paste",
"label", _("Paste"), "label", GTK_STOCK_PASTE,
"tooltip", _("Paste"), "tooltip", GTK_STOCK_PASTE,
"stock-id", GTK_STOCK_PASTE, "stock-id", GTK_STOCK_PASTE,
"accel", "<control>V", "accel", "<control>V",
"force-accel-label", TRUE, "force-accel-label", TRUE,

View File

@ -20,6 +20,7 @@
#include "mooutils/mooutils-fs.h" #include "mooutils/mooutils-fs.h"
#include "mooutils/moostock.h" #include "mooutils/moostock.h"
#include "mooutils/mooprefs.h" #include "mooutils/mooprefs.h"
#include "mooutils/moocompat.h"
static void moo_term_window_class_init (MooTermWindowClass *klass); static void moo_term_window_class_init (MooTermWindowClass *klass);
@ -72,9 +73,9 @@ static void moo_term_window_class_init (MooTermWindowClass *klass)
NULL); NULL);
moo_window_class_new_action (window_class, "SelectAll", NULL, moo_window_class_new_action (window_class, "SelectAll", NULL,
"display-name", "Select All", "display-name", GTK_STOCK_SELECT_ALL,
"label", "Select _All", "label", GTK_STOCK_SELECT_ALL,
"tooltip", "Select all", "tooltip", GTK_STOCK_SELECT_ALL,
"accel", "<alt>A", "accel", "<alt>A",
"closure-callback", moo_term_select_all, "closure-callback", moo_term_select_all,
"closure-proxy-func", moo_term_window_get_term, "closure-proxy-func", moo_term_window_get_term,