]> spindle.queued.net Git - midori/commitdiff
Introduce a merged NextForward akin to StopReload
authorChristian Dywan <christian@twotoasts.de>
Sun, 19 Aug 2012 13:32:48 +0000 (15:32 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 19 Aug 2012 13:32:48 +0000 (15:32 +0200)
Fixes: https://bugs.launchpad.net/midori/+bug/823736
midori/midori-browser.c
midori/midori-websettings.c

index f35143027e2f2c07c09c717ed5685ac0d1204273..a74d2c2978ad73380a94cdd0979fcad298b92d55 100644 (file)
@@ -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) },
index e1768b3c3a5246d1ab8b661c4da3735bcd43f606..b9dea7f2ae251d733bc9aee95308d34ee6041ca4 100644 (file)
@@ -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,