Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
authorJohn Ellis <johne@verizon.net>
Sat, 28 Oct 2006 18:49:38 +0000 (18:49 +0000)
committerJohn Ellis <johne@verizon.net>
Sat, 28 Oct 2006 18:49:38 +0000 (18:49 +0000)
        * img-view.c: Use correct method to close the window using Escape key,
        fixes bug #1231845. Also added more robust method to update window
        list when a window is closed so this doesn't happen again.
        * slideshow.c: Add sanity checks to exported functions to check for
        NULL SlideShow pointers, to match rest of coding style.

ChangeLog
TODO
src/img-view.c
src/slideshow.c

index 418658b..43f7725 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Oct 28 14:41:10 2006  John Ellis  <johne@verizon.net>
+
+       * img-view.c: Use correct method to close the window using Escape key,
+       fixes bug #1231845. Also added more robust method to update window
+       list when a window is closed so this doesn't happen again.
+       * slideshow.c: Add sanity checks to exported functions to check for
+       NULL SlideShow pointers, to match rest of coding style.
+
 Fri Oct 27 19:45:32 2006  John Ellis  <johne@verizon.net>
 
        * layout.c, ui_menu.c, ui_misc.c: Use g_object_ref_sink when
diff --git a/TODO b/TODO
index ad74d86..7c8e977 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,6 +4,10 @@ TODO key: d = done, w = work in progress, ? = possibly fixed
 Major:
 ----------------------------------------------
 
+ > figure out if crash when expanding a folder in the folder tree view then pessing "*" is a bug
+   GTK+ 2.10.4 (gdb shows it deep inside gtk, near gtk_tree_view_set_hover_selection()). This does not
+   happen on GTK+ 2.6.
+
  > pixbuf-renderer.c:
    > tile dispose order is slightly incorrect, furthest ones from current position should be dropped first
 
@@ -125,6 +129,9 @@ d> allow multiple command line dirs to work as expected
 Wishlist?:
 ----------------------------------------------
 
+ > Explore tabbed view option to main window, where 'view in new window' option results
+   in a new tab instead of window.
+
  > Initiating full screen from the command line should not
    show main window until full screen is exited.
 
index 1c0d13d..54a5391 100644 (file)
@@ -558,7 +558,7 @@ static gint view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpoi
                                        }
                                else
                                        {
-                                       gtk_widget_destroy(vw->window);
+                                       view_window_close(vw);
                                        }
                                break;
                        case GDK_Menu:
@@ -767,17 +767,26 @@ static void view_slideshow_stop(ViewWindow *vw)
        if (vw->ss) slideshow_free(vw->ss);
 }
 
-static void view_window_close(ViewWindow *vw)
+static void view_window_destroy_cb(GtkWidget *widget, gpointer data)
 {
+       ViewWindow *vw = data;
+
        view_window_list = g_list_remove(view_window_list, vw);
 
        view_slideshow_stop(vw);
-       view_fullscreen_toggle(vw, TRUE);
-       gtk_widget_destroy(vw->window);
+       fullscreen_stop(vw->fs);
+
        path_list_free(vw->list);
        g_free(vw);
 }
 
+static void view_window_close(ViewWindow *vw)
+{
+       view_slideshow_stop(vw);
+       view_fullscreen_toggle(vw, TRUE);
+       gtk_widget_destroy(vw->window);
+}
+
 static gint view_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data)
 {
        ViewWindow *vw = data;
@@ -832,6 +841,8 @@ static ViewWindow *real_view_window_new(const gchar *path, GList *list, Collecti
 
        view_image_set_buttons(vw, vw->imd);
 
+       g_signal_connect(G_OBJECT(vw->window), "destroy",
+                        G_CALLBACK(view_window_destroy_cb), vw);
        g_signal_connect(G_OBJECT(vw->window), "delete_event",
                         G_CALLBACK(view_window_delete_cb), vw);
        g_signal_connect(G_OBJECT(vw->window), "key_press_event",
index 6b608a2..ab25ce6 100644 (file)
@@ -25,6 +25,8 @@ static void slideshow_timer_reset(SlideShowData *ss, gint reset);
 
 void slideshow_free(SlideShowData *ss)
 {
+       if (!ss) return;
+
        slideshow_timer_reset(ss, FALSE);
 
        if (ss->stop_func) ss->stop_func(ss, ss->stop_data);
@@ -118,6 +120,8 @@ gint slideshow_should_continue(SlideShowData *ss)
        const gchar *imd_path;
        const gchar *path;
 
+       if (!ss) return FALSE;
+
        imd_path = image_get_path(ss->imd);
 
        if ( ((imd_path == NULL) != (ss->slide_path == NULL)) ||
@@ -284,6 +288,8 @@ static void slideshow_timer_reset(SlideShowData *ss, gint reset)
 
 void slideshow_next(SlideShowData *ss)
 {
+       if (!ss) return;
+
        if (!slideshow_step(ss, TRUE))
                {
                slideshow_free(ss);
@@ -295,6 +301,8 @@ void slideshow_next(SlideShowData *ss)
 
 void slideshow_prev(SlideShowData *ss)
 {
+       if (!ss) return;
+
        if (!slideshow_step(ss, FALSE))
                {
                slideshow_free(ss);