[gthumb/ext: 6/15] always use get_parent to get the chooser, added utility function



commit 2d1d39fcdd83325744152d270faa5568f910edbf
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Dec 8 12:01:56 2009 +0100

    always use get_parent to get the chooser, added utility function

 gthumb/eggfileformatchooser.c |   15 +++++++++------
 gthumb/eggfileformatchooser.h |    1 +
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gthumb/eggfileformatchooser.c b/gthumb/eggfileformatchooser.c
index 6cce79e..09f0872 100644
--- a/gthumb/eggfileformatchooser.c
+++ b/gthumb/eggfileformatchooser.c
@@ -720,12 +720,8 @@ egg_file_format_chooser_realize (GtkWidget *widget)
 
   g_return_if_fail (NULL == self->priv->chooser);
 
-  parent = gtk_widget_get_toplevel (widget);
-
-  if (!GTK_IS_FILE_CHOOSER (parent))
-    parent = gtk_widget_get_parent (widget);
-
-  while (parent && !GTK_IS_FILE_CHOOSER (parent))
+  parent = gtk_widget_get_parent (widget);
+  while ((parent != NULL) && !GTK_IS_FILE_CHOOSER (parent))
     parent = gtk_widget_get_parent (parent);
 
   self->priv->chooser = GTK_FILE_CHOOSER (parent);
@@ -1217,4 +1213,11 @@ egg_file_format_chooser_append_extension (EggFileFormatChooser *self,
   return result;
 }
 
+void
+egg_file_format_chooser_emit_size_changed (EggFileFormatChooser *self)
+{
+  if (self->priv->size_changed_event == 0)
+    self->priv->size_changed_event = gdk_threads_add_idle (emit_default_size_changed, self);
+}
+
 /* vim: set sw=2 sta et: */
diff --git a/gthumb/eggfileformatchooser.h b/gthumb/eggfileformatchooser.h
index 7ef0aa3..6c78891 100644
--- a/gthumb/eggfileformatchooser.h
+++ b/gthumb/eggfileformatchooser.h
@@ -76,6 +76,7 @@ gpointer        egg_file_format_chooser_get_format_data    (EggFileFormatChooser
 gchar*          egg_file_format_chooser_append_extension   (EggFileFormatChooser *self,
                                                             const gchar          *filename,
                                                             guint                 format);
+void            egg_file_format_chooser_emit_size_changed  (EggFileFormatChooser *self);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]