diff options
author | David Bordoley <bordoley@msu.edu> | 2003-04-14 22:21:32 +0800 |
---|---|---|
committer | Dave Bordoley <Bordoley@src.gnome.org> | 2003-04-14 22:21:32 +0800 |
commit | 33021c190b07950973747e1891f0a58af675fe2b (patch) | |
tree | 9966a58fd144bb3a9180b412c7f474eef25b3d12 | |
parent | 9b184b29ecf975bdd48166599349e8e9a314d2e3 (diff) | |
download | gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar.gz gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar.bz2 gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar.lz gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar.xz gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.tar.zst gsoc2013-epiphany-33021c190b07950973747e1891f0a58af675fe2b.zip |
Add a help menu and associated "Contents" and "About" menu entries. Add a
2003-04-14 David Bordoley <bordoley@msu.edu>
* data/ui/epiphany-bookmark-editor-ui.xml.in:
* src/bookmarks/ephy-bookmarks-editor.c: (cmd_help_contents),
(ephy_bookmarks_editor_update_menu), (ephy_bookmarks_editor_dispose),
(ephy_bookmarks_editor_node_selected_cb), (keyword_node_selected_cb),
(build_search_box):
Add a help menu and associated "Contents" and "About" menu entries.
Add a focus_monitor to the search entry. Only pass an editor
to update_menu. Update the sensitivity and label of
"Open in New Window/Tab(s)" based on focus and selection. Translators,
if this causes problems with mneumonics, please give suggestions for
other letters to use.
* src/window-commands.c: (window_cmd_help_about):
* src/window-commands.h:
Take a GtkWidget instead of an EphyWindow as the
callback data so that the about function can be used
in the bme.
* src/ephy-window.c: (setup_window):
Setup short toolbar labels for "Bookmark Page...",
"Save As...", "Print...", and "Open..." so that these
items don't have elipses on the toolbar.
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | data/ui/epiphany-bookmark-editor-ui.xml.in | 5 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 54 | ||||
-rw-r--r-- | src/ephy-window.c | 11 | ||||
-rw-r--r-- | src/window-commands.c | 2 | ||||
-rw-r--r-- | src/window-commands.h | 2 |
6 files changed, 92 insertions, 10 deletions
@@ -1,3 +1,31 @@ +2003-04-14 David Bordoley <bordoley@msu.edu> + + * data/ui/epiphany-bookmark-editor-ui.xml.in: + * src/bookmarks/ephy-bookmarks-editor.c: (cmd_help_contents), + (ephy_bookmarks_editor_update_menu), (ephy_bookmarks_editor_dispose), + (ephy_bookmarks_editor_node_selected_cb), (keyword_node_selected_cb), + (build_search_box): + + Add a help menu and associated "Contents" and "About" menu entries. + Add a focus_monitor to the search entry. Only pass an editor + to update_menu. Update the sensitivity and label of + "Open in New Window/Tab(s)" based on focus and selection. Translators, + if this causes problems with mneumonics, please give suggestions for + other letters to use. + + * src/window-commands.c: (window_cmd_help_about): + * src/window-commands.h: + + Take a GtkWidget instead of an EphyWindow as the + callback data so that the about function can be used + in the bme. + + * src/ephy-window.c: (setup_window): + + Setup short toolbar labels for "Bookmark Page...", + "Save As...", "Print...", and "Open..." so that these + items don't have elipses on the toolbar. + 2003-04-14 Frank Belew <frb@ximian.com> * lib/widgets/ephy-notebook.c (update_tabs_visibility): diff --git a/data/ui/epiphany-bookmark-editor-ui.xml.in b/data/ui/epiphany-bookmark-editor-ui.xml.in index 64232c111..668385f61 100644 --- a/data/ui/epiphany-bookmark-editor-ui.xml.in +++ b/data/ui/epiphany-bookmark-editor-ui.xml.in @@ -21,6 +21,11 @@ <menuitem name="EditSelectAll" verb="SelectAll"/> </submenu> +<submenu name="HelpMenu" verb="Help"> + <menuitem name="HelpContents" verb="HelpContents"/> + <menuitem name="HelpAbout" verb="HelpAbout"/> +</submenu> + </menu> <popups> diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 7307570d6..05a226005 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -26,6 +26,7 @@ #include <gdk/gdkkeysyms.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-program.h> +#include <libgnomeui/gnome-stock-icons.h> #include <string.h> #include "ephy-bookmarks-editor.h" @@ -42,6 +43,7 @@ #include "egg-menu-merge.h" #include "popup-commands.h" #include "ephy-state.h" +#include "window-commands.h" static GtkTargetEntry topic_drag_dest_types [] = { @@ -100,6 +102,8 @@ static void cmd_paste (EggAction *action, EphyBookmarksEditor *editor); static void cmd_select_all (EggAction *action, EphyBookmarksEditor *editor); +static void cmd_help_contents (EggAction *action, + EphyBookmarksEditor *editor); struct EphyBookmarksEditorPrivate { @@ -126,6 +130,7 @@ static EggActionGroupEntry ephy_bookmark_popup_entries [] = { /* Toplevel */ { "File", N_("_File"), NULL, NULL, NULL, NULL, NULL }, { "Edit", N_("_Edit"), NULL, NULL, NULL, NULL, NULL }, + { "Help", N_("_Help"), NULL, NULL, NULL, NULL, NULL }, { "FakeToplevel", (""), NULL, NULL, NULL, NULL, NULL }, { "NewTopic", N_("_New Topic"), GTK_STOCK_NEW, "<control>N", @@ -160,6 +165,13 @@ static EggActionGroupEntry ephy_bookmark_popup_entries [] = { { "Close", N_("_Close"), GTK_STOCK_CLOSE, "<control>W", NULL, G_CALLBACK (cmd_close), NULL }, + + { "HelpContents", N_("_Contents"), GTK_STOCK_HELP, "F1", + NULL, G_CALLBACK (cmd_help_contents), NULL }, + + { "HelpAbout", N_("_About"), GNOME_STOCK_ABOUT, NULL, + NULL, G_CALLBACK (window_cmd_help_about), NULL }, + }; static guint ephy_bookmark_popup_n_entries = G_N_ELEMENTS (ephy_bookmark_popup_entries); @@ -347,6 +359,12 @@ cmd_select_all (EggAction *action, } } +static void +cmd_help_contents (EggAction *action, + EphyBookmarksEditor *editor) +{ + /*FIXME: Implement help.*/ +} GType ephy_bookmarks_editor_get_type (void) @@ -469,10 +487,11 @@ ephy_bookmarks_editor_node_activated_cb (GtkWidget *view, } static void -ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor, - EphyNodeView *view) +ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor) { - gboolean rename, delete, properties; + gboolean open_in_window, open_in_tab, + rename, delete, properties; + const gchar *open_in_window_label, *open_in_tab_label; gboolean bmk_focus, key_focus; gboolean key_selection, bmk_selection; gboolean key_normal = FALSE; @@ -503,6 +522,19 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor, g_list_free (selected); } + if (bmk_multiple_selection) + { + open_in_window_label = N_("_Open in New Windows"); + open_in_tab_label = N_("Open in New _Tabs"); + } + else + { + open_in_window_label = _("_Open in New Window"); + open_in_tab_label = _("Open in New _Tab"); + } + + open_in_window = (bmk_focus && bmk_selection); + open_in_tab = (bmk_focus && bmk_selection); rename = (bmk_focus && bmk_selection && !bmk_multiple_selection) || (key_selection && key_focus && key_normal); delete = (bmk_focus && bmk_selection) || @@ -510,6 +542,12 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor, properties = (bmk_focus && bmk_selection && !bmk_multiple_selection); action_group = editor->priv->action_group; + action = egg_action_group_get_action (action_group, "OpenInWindow"); + g_object_set (action, "sensitive", open_in_window, NULL); + g_object_set (action, "label", open_in_window_label, NULL); + action = egg_action_group_get_action (action_group, "OpenInTab"); + g_object_set (action, "sensitive", open_in_tab, NULL); + g_object_set (action, "label", open_in_tab_label, NULL); action = egg_action_group_get_action (action_group, "Rename"); g_object_set (action, "sensitive", rename, NULL); action = egg_action_group_get_action (action_group, "Delete"); @@ -523,7 +561,7 @@ view_focus_cb (EphyNodeView *view, GdkEventFocus *event, EphyBookmarksEditor *editor) { - ephy_bookmarks_editor_update_menu (editor, view); + ephy_bookmarks_editor_update_menu (editor); return FALSE; } @@ -568,6 +606,7 @@ ephy_bookmarks_editor_dispose (GObject *object) { remove_focus_monitor (editor, editor->priv->key_view); remove_focus_monitor (editor, editor->priv->bm_view); + remove_focus_monitor (editor, editor->priv->search_entry); selection = ephy_node_view_get_selection (EPHY_NODE_VIEW (editor->priv->key_view)); if (selection == NULL || selection->data == NULL) @@ -600,7 +639,7 @@ ephy_bookmarks_editor_node_selected_cb (EphyNodeView *view, EphyNode *node, EphyBookmarksEditor *editor) { - ephy_bookmarks_editor_update_menu (editor, view); + ephy_bookmarks_editor_update_menu (editor); } static void @@ -651,7 +690,7 @@ keyword_node_selected_cb (EphyNodeView *view, bookmarks_filter (editor, node); } - ephy_bookmarks_editor_update_menu (editor, view); + ephy_bookmarks_editor_update_menu (editor); } static void @@ -706,10 +745,11 @@ build_search_box (EphyBookmarksEditor *editor) entry = gtk_entry_new (); editor->priv->search_entry = entry; gtk_widget_show (entry); + add_focus_monitor (editor, entry); g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (search_entry_changed_cb), editor); - + label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); str = g_strconcat ("<b>", _("_Search:"), "</b>", NULL); diff --git a/src/ephy-window.c b/src/ephy-window.c index 457c4bd8b..07b456910 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -408,6 +408,7 @@ static void setup_window (EphyWindow *window) { EggActionGroup *action_group; + EggAction *action; EggMenuMerge *merge; int i; @@ -439,7 +440,15 @@ setup_window (EphyWindow *window) ephy_menu_n_entries); egg_menu_merge_insert_action_group (merge, action_group, 0); window->priv->action_group = action_group; - + action = egg_action_group_get_action (action_group, "FileOpen"); + g_object_set (action, "short_label", N_("Open"), NULL); + action = egg_action_group_get_action (action_group, "FileSaveAs"); + g_object_set (action, "short_label", N_("Save As"), NULL); + action = egg_action_group_get_action (action_group, "FilePrint"); + g_object_set (action, "short_label", N_("Print"), NULL); + action = egg_action_group_get_action (action_group, "FileBookmarkPage"); + g_object_set (action, "short_label", N_("Bookmark"), NULL); + action_group = egg_action_group_new ("PopupsActions"); egg_action_group_add_actions (action_group, ephy_popups_entries, ephy_popups_n_entries); diff --git a/src/window-commands.c b/src/window-commands.c index 4cd9c9b87..c0aee9d6b 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -661,7 +661,7 @@ window_cmd_help_contents (EggAction *action, void window_cmd_help_about (EggAction *action, - EphyWindow *window) + GtkWidget *window) { static GtkWidget *about = NULL; GdkPixbuf *icon; diff --git a/src/window-commands.h b/src/window-commands.h index 960ed9ee9..37740a2a9 100644 --- a/src/window-commands.h +++ b/src/window-commands.h @@ -135,7 +135,7 @@ void window_cmd_help_contents (EggAction *action, EphyWindow *window); void window_cmd_help_about (EggAction *action, - EphyWindow *window); + GtkWidget *window); void window_cmd_tabs_next (EggAction *action, EphyWindow *window); |