ekiga r7024 - in trunk: . src/endpoints src/gui



Author: jschamp
Date: Fri Sep 19 17:07:33 2008
New Revision: 7024
URL: http://svn.gnome.org/viewvc/ekiga?rev=7024&view=rev

Log:
Make hidden main window appear if status icon is lost under runtime.

Modified:
   trunk/ChangeLog
   trunk/src/endpoints/ekiga.cpp
   trunk/src/gui/main.cpp

Modified: trunk/src/endpoints/ekiga.cpp
==============================================================================
--- trunk/src/endpoints/ekiga.cpp	(original)
+++ trunk/src/endpoints/ekiga.cpp	Fri Sep 19 17:07:33 2008
@@ -266,8 +266,8 @@
   gtk_window_set_default_icon_name (GM_ICON_LOGO);
   accounts_window = gm_accounts_window_new (*service_core);
 
-  main_window = gm_main_window_new (*service_core);
   statusicon = statusicon_new (*service_core);
+  main_window = gm_main_window_new (*service_core);
 
   /* GM is started */
   PTRACE (1, "Ekiga version "

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Fri Sep 19 17:07:33 2008
@@ -1577,6 +1577,22 @@
 }
 
 
+static void
+on_status_icon_embedding_change (G_GNUC_UNUSED GObject obj,
+				 G_GNUC_UNUSED GParamSpec param,
+				 G_GNUC_UNUSED gpointer data)
+{
+  GtkWidget *main_window = NULL;
+  GtkStatusIcon *status_icon = NULL;
+
+  status_icon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
+  main_window = GnomeMeeting::Process ()->GetMainWindow ();
+
+  /* force the main window to show if no status icon for the user */
+  if (!gtk_status_icon_is_embedded (GTK_STATUS_ICON (status_icon)))
+    gtk_widget_show (main_window);
+}
+
 static GtkWidget *
 gm_mw_init_uri_toolbar (GtkWidget *main_window)
 {
@@ -4003,6 +4019,8 @@
   
   GtkWidget *status_toolbar = NULL;
 
+  GtkStatusIcon *status_icon = NULL;
+
   PanelSection section = DIALPAD;
 
   sigc::connection conn;
@@ -4259,6 +4277,11 @@
   gm_conf_notifier_add (USER_INTERFACE_KEY "main_window/show_call_panel",
 			show_call_panel_changed_nt, window);
 
+  /* Track status icon embed changes */
+  status_icon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
+  g_signal_connect (G_OBJECT (status_icon), "notify::embedded",
+		    G_CALLBACK (on_status_icon_embedding_change), NULL);
+
   /* Until we are ready, nothing possible  */
   gm_main_window_set_busy (window, true);
 



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