[Xfce4-commits] <midori:master> Introduce a merged NextForward akin to StopReload
Christian Dywan
noreply at xfce.org
Sun Aug 19 15:36:01 CEST 2012
Updating branch refs/heads/master
to 544dc087601a3de0c5fb42ce45112a3360acb18a (commit)
from 2e94548d704f610cbd98de61d456678d8cce576b (commit)
commit 544dc087601a3de0c5fb42ce45112a3360acb18a
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Aug 19 15:32:48 2012 +0200
Introduce a merged NextForward akin to StopReload
Fixes: https://bugs.launchpad.net/midori/+bug/823736
midori/midori-browser.c | 33 +++++++++++++++++++++++++--------
midori/midori-websettings.c | 2 +-
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index f351430..a74d2c2 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -320,16 +320,11 @@ _midori_browser_update_interface (MidoriBrowser* browser,
gboolean loading = midori_view_get_load_status (view) != MIDORI_LOAD_FINISHED;
gboolean can_reload = midori_view_can_reload (view);
GtkAction* action;
- GSList* proxies;
_action_set_sensitive (browser, "Reload", can_reload);
_action_set_sensitive (browser, "Stop", can_reload && loading);
_action_set_sensitive (browser, "Back", midori_view_can_go_back (view));
_action_set_sensitive (browser, "Forward", midori_view_can_go_forward (view));
- proxies = gtk_action_get_proxies (_action_by_name (browser, "Forward"));
- for (; proxies != NULL; proxies = g_slist_next (proxies))
- if (GTK_IS_TOOL_ITEM (proxies->data))
- gtk_widget_set_visible (proxies->data, midori_view_can_go_forward (view));
_action_set_sensitive (browser, "Previous",
midori_view_get_previous_page (view) != NULL);
_action_set_sensitive (browser, "Next",
@@ -373,6 +368,23 @@ _midori_browser_update_interface (MidoriBrowser* browser,
"tooltip", _("Stop loading the current page"), NULL);
}
+ action = _action_by_name (browser, "NextForward");
+ if (midori_view_can_go_forward (view))
+ {
+ g_object_set (action,
+ "stock-id", GTK_STOCK_GO_FORWARD,
+ "tooltip", _("Go forward to the next page"),
+ "sensitive", TRUE, NULL);
+ }
+ else
+ {
+ g_object_set (action,
+ "stock-id", GTK_STOCK_MEDIA_NEXT,
+ "tooltip", _("Go to the next sub-page"),
+ "sensitive", midori_view_get_next_page (view) != NULL, NULL);
+ }
+
+
#if HAVE_HILDON
#if HILDON_CHECK_VERSION (2, 2, 0)
hildon_gtk_window_set_progress_indicator (GTK_WINDOW (browser), loading);
@@ -2999,7 +3011,7 @@ midori_browser_get_toolbar_actions (MidoriBrowser* browser)
static const gchar* actions[] = {
"WindowNew", "TabNew", "Open", "SaveAs", "Print", "Find",
"Fullscreen", "Preferences", "Window", "Bookmarks",
- "ReloadStop", "ZoomIn", "TabClose",
+ "ReloadStop", "ZoomIn", "TabClose", "NextForward",
"ZoomOut", "Separator", "Back", "Forward", "Homepage",
"Panel", "Trash", "Search", "BookmarkAdd", "Previous", "Next", NULL };
@@ -3882,9 +3894,11 @@ _action_navigation_activate (GtkAction* action,
return FALSE;
view = MIDORI_VIEW (tab);
-
name = gtk_action_get_name (action);
+ if (!strcmp (name, "NextForward"))
+ name = midori_view_can_go_forward (view) ? "Forward" : "Next";
+
if (g_str_equal (name, "Back"))
{
if (middle_click)
@@ -5667,7 +5681,7 @@ static const GtkActionEntry entries[] =
NULL, "Escape",
N_("Stop loading the current page"), G_CALLBACK (_action_reload_stop_activate) },
{ "ReloadStop", GTK_STOCK_STOP,
- NULL, "<Ctrl>r",
+ NULL, "",
N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
{ "ZoomIn", GTK_STOCK_ZOOM_IN,
NULL, "<Ctrl>plus",
@@ -5719,6 +5733,9 @@ static const GtkActionEntry entries[] =
NULL, "<Alt><Shift>Right",
/* i18n: Visit the following logical page, ie. in a forum or blog */
N_("Go to the next sub-page"), G_CALLBACK (_action_navigation_activate) },
+ { "NextForward", GTK_STOCK_MEDIA_NEXT,
+ NULL, "",
+ N_("Go to the next sub-page"), G_CALLBACK (_action_navigation_activate) },
{ "Homepage", GTK_STOCK_HOME,
N_("_Homepage"), "<Alt>Home",
N_("Go to your homepage"), G_CALLBACK (_action_navigation_activate) },
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index e1768b3..b9dea7f 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -547,7 +547,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"toolbar-items",
_("Toolbar Items"),
_("The items to show on the toolbar"),
- "TabNew,Back,Forward,Next,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu",
+ "TabNew,Back,NextForward,ReloadStop,BookmarkAdd,Location,Search,Trash,CompactMenu",
flags));
g_object_class_install_property (gobject_class,
More information about the Xfce4-commits
mailing list