[Xfce4-commits] <ristretto:master> Add 'ctrl+r' shortcut for force-reload.

Stephan Arts noreply at xfce.org
Sat Apr 21 13:16:03 CEST 2012


Updating branch refs/heads/master
         to 0bdc862dcb8dd727fcbd826e2f6e6b5636c6bb00 (commit)
       from 81123eacb58bd57ea9b5cd38715f1e8b6480d3f2 (commit)

commit 0bdc862dcb8dd727fcbd826e2f6e6b5636c6bb00
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Apr 21 13:14:50 2012 +0200

    Add 'ctrl+r' shortcut for force-reload.

 src/main_window.c |   24 ++++++++++++++++++++++++
 src/settings.c    |    2 ++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index 77193be..d10ce01 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -223,6 +223,10 @@ cb_rstto_main_window_save_copy (GtkWidget *widget, RsttoMainWindow *window);
 static void
 cb_rstto_main_window_delete (GtkWidget *widget, RsttoMainWindow *window);
 static void
+cb_rstto_main_window_refresh (
+        GtkWidget *widget,
+        RsttoMainWindow *window );
+static void
 cb_rstto_main_window_dnd_files (GtkWidget *widget, gchar **uris, RsttoMainWindow *window);
 
 static void
@@ -736,6 +740,7 @@ rstto_main_window_init (RsttoMainWindow *window)
     GClosure        *previous_image_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_previous_image, window, NULL);
     GClosure        *quit_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_quit, window, NULL);
     GClosure        *delete_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_delete, window, NULL);
+    GClosure        *refresh_closure = g_cclosure_new ((GCallback)cb_rstto_main_window_refresh, window, NULL);
 
     guint navigationbar_position = 3;
     guint thumbnail_size = 3;
@@ -817,6 +822,7 @@ rstto_main_window_init (RsttoMainWindow *window)
     gtk_accel_group_connect_by_path (accel_group, "<Window>/previous-image", previous_image_closure);
     gtk_accel_group_connect_by_path (accel_group, "<Window>/quit", quit_closure);
     gtk_accel_group_connect_by_path (accel_group, "<Window>/delete", delete_closure);
+    gtk_accel_group_connect_by_path (accel_group, "<Window>/refresh", refresh_closure);
 
     /* Set default accelerators */
 
@@ -3342,6 +3348,24 @@ cb_rstto_main_window_delete (
     }
 }
 
+/**
+ * cb_rstto_main_window_refresh:
+ * @widget:
+ * @window:
+ *
+ *
+ */
+static void
+cb_rstto_main_window_refresh (
+        GtkWidget *widget,
+        RsttoMainWindow *window )
+{
+    RsttoFile *r_file = rstto_image_list_iter_get_file (window->priv->iter);
+
+    /* Trigger a reload of all things using this file */
+    rstto_file_changed (r_file);
+}
+
 static gboolean
 rstto_main_window_is_valid_image (RsttoMainWindow *window,
                                   RsttoFile *file)
diff --git a/src/settings.c b/src/settings.c
index 8c23493..3bb5f78 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -166,6 +166,8 @@ rstto_settings_init (GObject *object)
 
         gtk_accel_map_change_entry ("<Window>/delete", GDK_Delete, GDK_SHIFT_MASK, FALSE);
 
+        gtk_accel_map_change_entry ("<Window>/refresh", GDK_r, GDK_CONTROL_MASK, FALSE);
+
         gtk_accel_map_change_entry ("<Actions>/RsttoWindow/play", GDK_F5, 0, FALSE);
     }
     


More information about the Xfce4-commits mailing list