[ekiga] Removed the engine_get_service_core api, and dealt with the change



commit 401bef75ef888348851c403a85b4d10a29298fa3
Author: Julien Puydt <jpuydt gnome org>
Date:   Sun Sep 26 14:14:37 2010 +0200

    Removed the engine_get_service_core api, and dealt with the change
    
    That meant changing a little how the preferences and assistant windows are
    initialized.

 lib/engine/engine.cpp   |    7 -------
 lib/engine/engine.h     |    2 --
 src/ekiga.cpp           |   30 ++++++++----------------------
 src/ekiga.h             |    6 ++----
 src/gui/callbacks.cpp   |    4 ++--
 src/gui/preferences.cpp |    2 +-
 6 files changed, 13 insertions(+), 38 deletions(-)
---
diff --git a/lib/engine/engine.cpp b/lib/engine/engine.cpp
index f474bf4..7ba1ea1 100644
--- a/lib/engine/engine.cpp
+++ b/lib/engine/engine.cpp
@@ -244,13 +244,6 @@ engine_init (Ekiga::ServiceCorePtr service_core,
 #endif
 }
 
-
-Ekiga::ServiceCore *
-engine_get_service_core ()
-{
-  return service_core_ptr.get ();
-}
-
 void
 engine_stop ()
 {
diff --git a/lib/engine/engine.h b/lib/engine/engine.h
index ac31d90..bf9d2ac 100644
--- a/lib/engine/engine.h
+++ b/lib/engine/engine.h
@@ -49,8 +49,6 @@ void engine_init (Ekiga::ServiceCorePtr service_core,
 		  int argc,
 		  char *argv[]);
 
-Ekiga::ServiceCore* engine_get_service_core ();
-
 void engine_stop ();
 
 /**
diff --git a/src/ekiga.cpp b/src/ekiga.cpp
index 4238144..15535b9 100644
--- a/src/ekiga.cpp
+++ b/src/ekiga.cpp
@@ -115,15 +115,6 @@ GnomeMeeting::Exit ()
 }
 
 
-Ekiga::ServiceCore *
-GnomeMeeting::GetServiceCore ()
-{
-  PWaitAndSignal m(ep_var_mutex);
-  
-  return engine_get_service_core (); 
-}
-
-
 GnomeMeeting *
 GnomeMeeting::Process ()
 {
@@ -139,26 +130,15 @@ GnomeMeeting::GetMainWindow ()
 
 
 GtkWidget *
-GnomeMeeting::GetPrefsWindow (bool create)
+GnomeMeeting::GetPrefsWindow ()
 {
-  if (!prefs_window && create) {
-    prefs_window = gm_prefs_window_new (GetServiceCore ());
-    // FIXME should be moved in ekiga_assistant_new
-    gtk_window_set_transient_for (GTK_WINDOW (prefs_window), GTK_WINDOW (main_window));
-  }
   return prefs_window;
 }
 
 
 GtkWidget *
-GnomeMeeting::GetAssistantWindow (bool create)
+GnomeMeeting::GetAssistantWindow ()
 {
-  if (!assistant_window && create) {
-    assistant_window = ekiga_assistant_new (GetServiceCore ());
-    // FIXME should be moved in ekiga_assistant_new
-    gtk_window_set_transient_for (GTK_WINDOW (assistant_window), GTK_WINDOW (main_window));
-  }
-
   return assistant_window;
 }
 
@@ -189,11 +169,17 @@ void GnomeMeeting::BuildGUI (Ekiga::ServiceCorePtr services)
   /* Build the GUI */
   gtk_window_set_default_icon_name (GM_ICON_LOGO);
   accounts_window = gm_accounts_window_new (*services);
+  prefs_window = gm_prefs_window_new (services.get ());
+  assistant_window = ekiga_assistant_new (services.get ());
 
   statusicon = statusicon_new (*services);
   main_window = gm_main_window_new (*services);
   // FIXME should be moved inside the gm_accounts_window_new code
   gtk_window_set_transient_for (GTK_WINDOW (accounts_window), GTK_WINDOW (main_window));
+  // FIXME should be moved in ekiga_assistant_new
+  gtk_window_set_transient_for (GTK_WINDOW (prefs_window), GTK_WINDOW (main_window));
+  // FIXME should be moved in ekiga_assistant_new
+  gtk_window_set_transient_for (GTK_WINDOW (assistant_window), GTK_WINDOW (main_window));
 
   /* GM is started */
   PTRACE (1, "Ekiga version "
diff --git a/src/ekiga.h b/src/ekiga.h
index a735df2..051279f 100644
--- a/src/ekiga.h
+++ b/src/ekiga.h
@@ -96,14 +96,14 @@ class GnomeMeeting : public PProcess
    * BEHAVIOR     :  Returns a pointer to the preferences window GMObject.
    * PRE          :  /
    */
-  GtkWidget *GetPrefsWindow (bool create = true);
+  GtkWidget* GetPrefsWindow ();
  
   
   /* DESCRIPTION  :  /
    * BEHAVIOR     :  Returns a pointer to the assistant window.
    * PRE          :  /
    */
-  GtkWidget *GetAssistantWindow (bool create = true);
+  GtkWidget* GetAssistantWindow ();
   
   
   /* DESCRIPTION  :  /
@@ -137,8 +137,6 @@ class GnomeMeeting : public PProcess
   void BuildGUI (Ekiga::ServiceCorePtr services);
 
  private:
-
-  Ekiga::ServiceCore *GetServiceCore (); // FIXME: should disappear in the future
   
   PMutex ep_var_mutex;
   PMutex dev_access_mutex;
diff --git a/src/gui/callbacks.cpp b/src/gui/callbacks.cpp
index dbfa525..773d271 100644
--- a/src/gui/callbacks.cpp
+++ b/src/gui/callbacks.cpp
@@ -237,8 +237,8 @@ quit_callback (G_GNUC_UNUSED GtkWidget *widget,
   GtkWidget *accounts_window = NULL;
 
   main_window = GnomeMeeting::Process ()->GetMainWindow ();
-  assistant_window = GnomeMeeting::Process ()->GetAssistantWindow (false);
-  prefs_window = GnomeMeeting::Process ()->GetPrefsWindow (false);
+  assistant_window = GnomeMeeting::Process ()->GetAssistantWindow ();
+  prefs_window = GnomeMeeting::Process ()->GetPrefsWindow ();
   accounts_window = GnomeMeeting::Process ()->GetAccountsWindow ();
   
   gtk_widget_hide (main_window);
diff --git a/src/gui/preferences.cpp b/src/gui/preferences.cpp
index 6a6926b..e18c1a9 100644
--- a/src/gui/preferences.cpp
+++ b/src/gui/preferences.cpp
@@ -1093,7 +1093,7 @@ sound_events_list_changed_nt (G_GNUC_UNUSED gpointer id,
   if (gm_conf_entry_get_type (entry) == GM_CONF_STRING
       || gm_conf_entry_get_type (entry) == GM_CONF_BOOL) {
    
-    prefs_window = GnomeMeeting::Process ()->GetPrefsWindow (false);
+    prefs_window = GnomeMeeting::Process ()->GetPrefsWindow ();
     if (prefs_window) {
       gm_prefs_window_sound_events_list_build (prefs_window);
     }



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