[Xfce4-commits] <midori:master> Uncached reload action, default Ctrl+Shift+R

Christian Dywan noreply at xfce.org
Wed Feb 2 01:58:01 CET 2011


Updating branch refs/heads/master
         to adfedc4197e34131e450fd6df7524fca683483d6 (commit)
       from 6ebcc4e21c164a9e86d9c20ec6717c9e0c864718 (commit)

commit adfedc4197e34131e450fd6df7524fca683483d6
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Feb 2 01:55:32 2011 +0100

    Uncached reload action, default Ctrl+Shift+R

 midori/midori-browser.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index aac57d0..d16dab4 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3130,9 +3130,6 @@ _action_reload_stop_activate (GtkAction*     action,
 {
     gchar* stock_id;
     GtkWidget* view;
-    GdkModifierType state = (GdkModifierType)0;
-    gint x, y;
-    gboolean from_cache;
 
     if (!(view = midori_browser_get_current_tab (browser)))
         return;
@@ -3142,9 +3139,19 @@ _action_reload_stop_activate (GtkAction*     action,
     /* Refresh or stop, depending on the stock id */
     if (!strcmp (stock_id, GTK_STOCK_REFRESH))
     {
-        gdk_window_get_pointer (NULL, &x, &y, &state);
-        from_cache = state & GDK_SHIFT_MASK;
-        midori_view_reload (MIDORI_VIEW (view), !from_cache);
+        GdkModifierType state = (GdkModifierType)0;
+        gint x, y;
+        gboolean from_cache = TRUE;
+
+        if (!strcmp (gtk_action_get_name (action), "ReloadUncached"))
+            from_cache = FALSE;
+        else
+        {
+            gdk_window_get_pointer (NULL, &x, &y, &state);
+            if (state & GDK_SHIFT_MASK)
+                from_cache = FALSE;
+        }
+        midori_view_reload (MIDORI_VIEW (view), from_cache);
     }
     else
         midori_view_stop_loading (MIDORI_VIEW (view));
@@ -4909,6 +4916,9 @@ static const GtkActionEntry entries[] =
     { "Reload", GTK_STOCK_REFRESH,
         NULL, "<Ctrl>r",
         N_("Reload the current page"), G_CALLBACK (_action_reload_stop_activate) },
+    { "ReloadUncached", GTK_STOCK_REFRESH,
+        NULL, "<Ctrl><Shift>r",
+        N_("Reload page without caching"), G_CALLBACK (_action_reload_stop_activate) },
     { "Stop", GTK_STOCK_STOP,
         NULL, "Escape",
         N_("Stop loading the current page"), G_CALLBACK (_action_reload_stop_activate) },
@@ -5307,6 +5317,7 @@ static const gchar* ui_markup =
             "<menuitem action='TrashEmpty'/>"
             "<menuitem action='Preferences'/>"
             "<menuitem action='InspectPage'/>"
+            "<menuitem action='ReloadUncached'/>"
             "</menu>"
         "</menubar>"
         "<toolbar name='toolbar_navigation'>"



More information about the Xfce4-commits mailing list