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

Stephan Arts stephan at xfce.org
Sun Jun 1 00:14:04 CEST 2008


Author: stephan
Date: 2008-05-31 22:14:04 +0000 (Sat, 31 May 2008)
New Revision: 4869

Modified:
   ristretto/trunk/src/main_window.c
   ristretto/trunk/src/navigator.c
   ristretto/trunk/src/navigator.h
Log:
Add dialog to notify a user of changes and that he might want to save them


Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c	2008-05-31 21:11:15 UTC (rev 4868)
+++ ristretto/trunk/src/main_window.c	2008-05-31 22:14:04 UTC (rev 4869)
@@ -915,8 +915,24 @@
 rstto_main_window_dispose(GObject *object)
 {
     RsttoMainWindow *window = RSTTO_MAIN_WINDOW(object);
-    if (window->priv->navigator)
+    RsttoNavigator  *navigator = window->priv->navigator;
+
+    if (navigator)
     {
+        GList *iter, *modified_files = NULL;
+        
+        for (iter = navigator->file_list; iter != NULL; iter = iter->next)
+        {
+            if (rstto_navigator_entry_get_modified((RsttoNavigatorEntry *)iter->data))
+                modified_files = g_list_append (modified_files, iter->data);
+        }
+
+        if (modified_files)
+        {
+            GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_CLOSE, "This dialog should notify that changes where made to one or more images and that you might want to save them. It won't let you do this yet though."); 
+            gtk_dialog_run (GTK_DIALOG(dialog));
+        }
+
         g_object_unref(window->priv->navigator);
         window->priv->navigator = NULL;
     }

Modified: ristretto/trunk/src/navigator.c
===================================================================
--- ristretto/trunk/src/navigator.c	2008-05-31 21:11:15 UTC (rev 4868)
+++ ristretto/trunk/src/navigator.c	2008-05-31 22:14:04 UTC (rev 4869)
@@ -109,6 +109,8 @@
     gboolean             v_flipped;
     gint                 x_offset;
     gint                 y_offset;
+
+    gboolean             modified;
 };
 
 
@@ -910,7 +912,6 @@
             {
                 GtkIconTheme *theme = gtk_icon_theme_get_default();
                 entry->thumb = gtk_icon_theme_load_icon (theme, thunar_vfs_mime_info_lookup_icon_name (info->mime_info, theme), size, 0, NULL);
-                
             }
         }
         else
@@ -972,6 +973,7 @@
         entry->src_pixbuf = gdk_pixbuf_rotate_simple(pixbuf, (360+(rotation-entry->rotation))%360);
     }
     entry->rotation = rotation;
+    entry->modified = TRUE;
     g_signal_emit(G_OBJECT(entry->navigator), rstto_navigator_signals[RSTTO_NAVIGATOR_SIGNAL_ENTRY_MODIFIED], 0, entry, NULL);
 }
 
@@ -1030,6 +1032,12 @@
 }
 
 gboolean
+rstto_navigator_entry_get_modified (RsttoNavigatorEntry *entry)
+{
+    return entry->modified;
+}
+
+gboolean
 rstto_navigator_entry_load_image (RsttoNavigatorEntry *entry, gboolean empty_cache)
 {
     g_return_val_if_fail(entry != NULL, FALSE);

Modified: ristretto/trunk/src/navigator.h
===================================================================
--- ristretto/trunk/src/navigator.h	2008-05-31 21:11:15 UTC (rev 4868)
+++ ristretto/trunk/src/navigator.h	2008-05-31 22:14:04 UTC (rev 4869)
@@ -168,6 +168,9 @@
 gboolean
 rstto_navigator_open_folder(RsttoNavigator *navigator, const gchar *path, gboolean clear, GError **error);
 
+gboolean
+rstto_navigator_entry_get_modified (RsttoNavigatorEntry *entry);
+
 G_END_DECLS
 
 #endif /* __RISTRETTO_NAVIGATOR_H__ */




More information about the Goodies-commits mailing list