[Goodies-commits] r3182 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Sat Sep 8 12:58:42 CEST 2007


Author: stephan
Date: 2007-09-08 10:58:41 +0000 (Sat, 08 Sep 2007)
New Revision: 3182

Modified:
   ristretto/trunk/src/main.c
   ristretto/trunk/src/navigator.c
   ristretto/trunk/src/navigator.h
Log:
Add option to configure slideshow timeout
(only in config-file for now)



Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c	2007-09-08 10:43:49 UTC (rev 3181)
+++ ristretto/trunk/src/main.c	2007-09-08 10:58:41 UTC (rev 3182)
@@ -136,6 +136,7 @@
     gboolean show_toolbar = xfce_rc_read_bool_entry(xfce_rc, "ShowToolBar", TRUE);
     gint window_width = xfce_rc_read_int_entry(xfce_rc, "LastWindowWidth", 400);
     gint window_height = xfce_rc_read_int_entry(xfce_rc, "LastWindowHeight", 300);
+    gint slideshow_timeout = xfce_rc_read_int_entry(xfce_rc, "SlideShowTimeout", 5000);
 
     GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     GtkAccelGroup *accel_group = gtk_accel_group_new();
@@ -147,6 +148,7 @@
     g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
 
     RsttoNavigator *navigator = rstto_navigator_new();
+    rstto_navigator_set_timeout(navigator, slideshow_timeout);
     thumbnail_viewer = rstto_thumbnail_viewer_new(navigator);
     viewer = rstto_picture_viewer_new(navigator);
 

Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c	2007-09-08 10:43:49 UTC (rev 3181)
+++ ristretto/trunk/src/navigator.c	2007-09-08 10:58:41 UTC (rev 3182)
@@ -97,6 +97,7 @@
     navigator->file_iter = NULL;
     navigator->compare_func = (GCompareFunc)rstto_navigator_entry_name_compare_func;
     navigator->old_position = -1;
+    navigator->timeout = 5000;
 }
 
 static void
@@ -276,7 +277,7 @@
     {
         navigator->running = running;
         if(!navigator->id)
-            navigator->id = g_timeout_add(5000, (GSourceFunc)cb_rstto_navigator_running, navigator);
+            navigator->id = g_timeout_add(navigator->timeout, (GSourceFunc)cb_rstto_navigator_running, navigator);
     }
     else
     {
@@ -384,6 +385,12 @@
 }
 
 void
+rstto_navigator_set_timeout (RsttoNavigator *navigator, gint timeout)
+{
+    navigator->timeout = timeout;
+}
+
+void
 rstto_navigator_flip_entry(RsttoNavigator *navigator, RsttoNavigatorEntry *entry, gboolean horizontal)
 {
     if (horizontal)
@@ -530,3 +537,4 @@
 {
     entry->fit_to_screen = fts;
 }
+

Modified: ristretto/trunk/src/navigator.h
===================================================================
--- ristretto/trunk/src/navigator.h	2007-09-08 10:43:49 UTC (rev 3181)
+++ ristretto/trunk/src/navigator.h	2007-09-08 10:58:41 UTC (rev 3182)
@@ -52,6 +52,7 @@
     GList              *file_iter;
     gint                old_position;
     gboolean            running;
+    gint                timeout;
     gint                id;
     GCompareFunc        compare_func;
 };
@@ -74,7 +75,10 @@
 
 void       rstto_navigator_set_running (RsttoNavigator *navigator,
                                         gboolean running);
+void
+rstto_navigator_set_timeout (RsttoNavigator *nav, gint);
 
+
 RsttoNavigatorEntry *
 rstto_navigator_get_file (RsttoNavigator *navigator);
 gint




More information about the Goodies-commits mailing list