[glade3] * gladeui/glade-project.c: Show selected widget when selection changes and Cancel any queued selec



commit e268e9b0376c7227f7dfc707cd12df0a7591359a
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu Jan 6 16:54:04 2011 +0900

    	* gladeui/glade-project.c: Show selected widget when selection changes and
    	Cancel any queued selection from glade_project_selection_changed.

 ChangeLog               |    3 +++
 gladeui/glade-project.c |   17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6f867c7..4f033ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
 	Also release all cached pages in ->dispose() (which was leeking) and
 	ensure the class field always gets the same height.
 
+	* gladeui/glade-project.c: Show selected widget when selection changes and
+	Cancel any queued selection from glade_project_selection_changed.
+
 2011-01-05  Tristan Van Berkom <tristanvb openismus com>
 
 	* gladeui/Makefile.am, gladeui/glade-signal-class.[ch], gladeui/glade-widget-adaptor.c,
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 36f0d6f..f6a60d1 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -3286,15 +3286,30 @@ void
 glade_project_selection_changed (GladeProject * project)
 {
   g_return_if_fail (GLADE_IS_PROJECT (project));
+
   g_signal_emit (G_OBJECT (project),
                  glade_project_signals[SELECTION_CHANGED], 0);
+
+  if (g_list_length (project->priv->selection) == 1 && 
+      !GLADE_IS_PLACEHOLDER (project->priv->selection->data))
+    {
+      GladeWidget *gwidget = 
+       glade_widget_get_from_gobject (G_OBJECT (project->priv->selection->data));
+
+      glade_widget_show (gwidget);
+    }
+
+  /* Cancel any idle we have */
+  if (project->priv->selection_changed_id > 0)
+    project->priv->selection_changed_id = 
+      (g_source_remove (project->priv->selection_changed_id), 0);
 }
 
 static gboolean
 selection_change_idle (GladeProject *project)
 {
-  glade_project_selection_changed (project);
   project->priv->selection_changed_id = 0;
+  glade_project_selection_changed (project);
   return FALSE;
 }
 



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