All Tabs Reload Patch
- From: Bjoern Gruening <bjoern gruening t-online de>
- To: epiphany-list gnome org
- Subject: All Tabs Reload Patch
- Date: Sat, 01 Oct 2005 01:05:02 +0200
I have missed the "Reload All Tabs" Option in the Epiphany menue, so i
have played with the current CVS Source and create a patch for these
feature.
It is my first patch, so i'am not sure which is the prefered way to
submit a patch. I will append a diff file. I hope thats ok.
One question is still which keybord shortcut you will prefer if you like
these option.
The current is <control>Y. Not the ideal Shortcut, i know :-)
bbb
diff --normal epiphany/src/ephy-window.c epiphany2/src/ephy-window.c
206a207,209
> { "ViewAllReload", GTK_STOCK_REFRESH, N_("_AllReload"), "<control>Y",
> N_("Display the latest content of all open Tabs"),
> G_CALLBACK (window_cmd_view_all_reload) },
376a380
> { "XFKeyRefresh", XF86XK_Refresh, G_CALLBACK (window_cmd_view_all_reload ) },
382a387
> { "XFKeyReload", XF86XK_Reload, G_CALLBACK (window_cmd_view_all_reload ) },
diff --normal epiphany/src/window-commands.c epiphany2/src/window-commands.c
229a230,286
> window_cmd_view_all_reload (GtkAction *action,
> EphyWindow *window)
> {
> EphyEmbed *embed;
> GdkEvent *event;
> GdkEventType type;
> guint state = 0;
> gboolean force = FALSE;
>
> EphyTab *tab;
> GList *tabs = NULL, *l;
> GtkAction *action2;
>
> tabs = ephy_window_get_tabs (window);
> if (g_list_length (tabs) == 0) return;
>
> event = gtk_get_current_event ();
> if (event)
> {
> type = event->type;
>
> if (type == GDK_BUTTON_RELEASE)
> {
> state = event->button.state;
> }
> else if (type == GDK_KEY_RELEASE)
> {
> state = event->key.state;
> }
>
> gdk_event_free (event);
> }
>
> if (state & GDK_SHIFT_MASK)
> {
> force = TRUE;
> }
>
> for (l = tabs; l != NULL; l = l->next)
> {
> tab = (EphyTab *) l->data;
> g_return_val_if_fail (EPHY_IS_TAB (tab), FALSE);
>
> embed = ephy_tab_get_embed (tab);
> g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
>
> if (embed == NULL) return FALSE;
> ephy_embed_reload (embed, force);
> }
>
> // is the following line necessary?
> // gtk_widget_grab_focus (GTK_WIDGET (embed));
>
> g_list_free (tabs);
> }
>
> void
diff --normal epiphany/src/window-commands.h epiphany2/src/window-commands.h
51a52,54
> void window_cmd_view_all_reload (GtkAction *action,
> EphyWindow *window);
>
diff --normal epiphany/src/ephy-window.c epiphany2/src/ephy-window.c
206a207,209
> { "ViewAllReload", GTK_STOCK_REFRESH, N_("_AllReload"), "<control>Y",
> N_("Display the latest content of all open Tabs"),
> G_CALLBACK (window_cmd_view_all_reload) },
376a380
> { "XFKeyRefresh", XF86XK_Refresh, G_CALLBACK (window_cmd_view_all_reload ) },
382a387
> { "XFKeyReload", XF86XK_Reload, G_CALLBACK (window_cmd_view_all_reload ) },
diff --normal epiphany/src/window-commands.c epiphany2/src/window-commands.c
229a230,286
> window_cmd_view_all_reload (GtkAction *action,
> EphyWindow *window)
> {
> EphyEmbed *embed;
> GdkEvent *event;
> GdkEventType type;
> guint state = 0;
> gboolean force = FALSE;
>
> EphyTab *tab;
> GList *tabs = NULL, *l;
> GtkAction *action2;
>
> tabs = ephy_window_get_tabs (window);
> if (g_list_length (tabs) == 0) return;
>
> event = gtk_get_current_event ();
> if (event)
> {
> type = event->type;
>
> if (type == GDK_BUTTON_RELEASE)
> {
> state = event->button.state;
> }
> else if (type == GDK_KEY_RELEASE)
> {
> state = event->key.state;
> }
>
> gdk_event_free (event);
> }
>
> if (state & GDK_SHIFT_MASK)
> {
> force = TRUE;
> }
>
> for (l = tabs; l != NULL; l = l->next)
> {
> tab = (EphyTab *) l->data;
> g_return_val_if_fail (EPHY_IS_TAB (tab), FALSE);
>
> embed = ephy_tab_get_embed (tab);
> g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
>
> if (embed == NULL) return FALSE;
> ephy_embed_reload (embed, force);
> }
>
> // is the following line necessary?
> // gtk_widget_grab_focus (GTK_WIDGET (embed));
>
> g_list_free (tabs);
> }
>
diff --normal epiphany/src/window-commands.h epiphany2/src/window-commands.h
51a52,54
> void window_cmd_view_all_reload (GtkAction *action,
> EphyWindow *window);
>
diff --normal epiphany/data/ui/epiphany-ui.xml epiphany2/data/ui/epiphany-ui.xml
58a59
> <menuitem name="ViewAllReloadMenu" action="ViewAllReload"/>
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]