[gnome-system-tools/users-ui-redesign: 9/12] Hack to update GUI before showing the window



commit 53f8476df14d66fb8e0ecbec957d256e0200aabb
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Fri Aug 7 00:36:33 2009 +0200

    Hack to update GUI before showing the window
    
    The general gst framework updates the data asynchronously. Here we want to avoid this so that the dialog does not change size after being shown. In the long term, find another solution to that.

 src/users/main.c       |    5 +++++
 src/users/users-tool.c |    4 +---
 src/users/users-tool.h |    2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/users/main.c b/src/users/main.c
index 6a7ad9c..2d5f66a 100644
--- a/src/users/main.c
+++ b/src/users/main.c
@@ -33,6 +33,7 @@
 
 #include "table.h"
 #include "callbacks.h"
+#include "users-tool.h"
 
 GstTool *tool;
 
@@ -102,6 +103,10 @@ main (int argc, char *argv[])
 	gst_dialog_connect_signals (tool->main_dialog, signals);
 	main_window_prepare (GST_USERS_TOOL (tool));
 
+	/* Required for the users tool to avoid resizing the window after showing it.
+	 * FIXME: we should find something more elegant to do that. */
+	gst_users_tool_update_gui (tool);
+
 	gtk_widget_show (GTK_WIDGET (tool->main_dialog));
 	gtk_main ();
 	
diff --git a/src/users/users-tool.c b/src/users/users-tool.c
index a24d638..3efa5cb 100644
--- a/src/users/users-tool.c
+++ b/src/users/users-tool.c
@@ -29,8 +29,6 @@
 static void  gst_users_tool_class_init     (GstUsersToolClass *class);
 static void  gst_users_tool_init           (GstUsersTool      *tool);
 static void  gst_users_tool_finalize       (GObject           *object);
-
-static void  gst_users_tool_update_gui     (GstTool *tool);
 static void  gst_users_tool_update_config  (GstTool *tool);
 
 static GObject* gst_users_tool_constructor (GType                  type,
@@ -185,7 +183,7 @@ update_profiles (GstUsersTool *tool)
 	g_list_free (names);
 }
 
-static void
+void
 gst_users_tool_update_gui (GstTool *tool)
 {
 	update_users (GST_USERS_TOOL (tool));
diff --git a/src/users/users-tool.h b/src/users/users-tool.h
index 7248cc0..68046a7 100644
--- a/src/users/users-tool.h
+++ b/src/users/users-tool.h
@@ -62,6 +62,8 @@ GType    gst_users_tool_get_type           (void);
 
 GstTool *gst_users_tool_new                (void);
 
+void     gst_users_tool_update_gui         (GstTool *tool);
+
 
 G_END_DECLS
 



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