ekiga r7563 - in trunk/lib/engine: . components/call-history



Author: jpuydt
Date: Fri Jan 16 14:04:54 2009
New Revision: 7563
URL: http://svn.gnome.org/viewvc/ekiga?rev=7563&view=rev

Log:
Made the call history use the kickstart scheme

Modified:
   trunk/lib/engine/components/call-history/history-main.cpp
   trunk/lib/engine/components/call-history/history-main.h
   trunk/lib/engine/engine.cpp

Modified: trunk/lib/engine/components/call-history/history-main.cpp
==============================================================================
--- trunk/lib/engine/components/call-history/history-main.cpp	(original)
+++ trunk/lib/engine/components/call-history/history-main.cpp	Fri Jan 16 14:04:54 2009
@@ -40,22 +40,42 @@
 #include "call-core.h"
 #include "history-source.h"
 
-bool
-history_init (Ekiga::ServiceCore &core,
-	      int */*argc*/,
-	      char **/*argv*/[])
+struct HISTORYSpark: public Ekiga::Spark
 {
-  bool result = false;
-  gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
-  gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
-
-  if (contact_core && call_core) {
-
-    gmref_ptr<History::Source> source (new History::Source (core));
-    core.add (source);
-    contact_core->add_source (source);
-    result = true;
+  HISTORYSpark (): result(false)
+  {}
+
+  bool try_initialize_more (Ekiga::ServiceCore& core,
+			    int* /*argc*/,
+			    char** /*argv*/[])
+  {
+    gmref_ptr<Ekiga::Service> service = core.get ("call-history-store");
+    gmref_ptr<Ekiga::ContactCore> contact_core = core.get ("contact-core");
+    gmref_ptr<Ekiga::CallCore> call_core = core.get ("call-core");
+
+    if (contact_core && call_core && !service) {
+
+      gmref_ptr<History::Source> source (new History::Source (core));
+      core.add (source);
+      contact_core->add_source (source);
+      result = true;
+    }
+
+    return result;
   }
 
-  return result;
+  Ekiga::Spark::state get_state () const
+  { return result?FULL:BLANK; }
+
+  const std::string get_name () const
+  { return "HISTORY"; }
+
+  bool result;
+};
+
+void
+history_init (Ekiga::KickStart& kickstart)
+{
+  gmref_ptr<Ekiga::Spark> spark(new HISTORYSpark);
+  kickstart.add_spark (spark);
 }

Modified: trunk/lib/engine/components/call-history/history-main.h
==============================================================================
--- trunk/lib/engine/components/call-history/history-main.h	(original)
+++ trunk/lib/engine/components/call-history/history-main.h	Fri Jan 16 14:04:54 2009
@@ -38,16 +38,14 @@
 #ifndef __HISTORY_MAIN_H__
 #define __HISTORY_MAIN_H__
 
-#include "services.h"
+#include "kickstart.h"
 
 /**
  * @addtogroup contacts
  * @{
  */
 
-bool history_init (Ekiga::ServiceCore &core,
-		   int *argc,
-		   char **argv[]);
+void history_init (Ekiga::KickStart& kickstart);
 
 /**
  * @}

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Fri Jan 16 14:04:54 2009
@@ -248,11 +248,7 @@
   resource_list_init (kickstart);
 #endif
 
-  if (!history_init (*service_core, &argc, &argv)) {
-
-    delete service_core;
-    return;
-  }
+  history_init (kickstart);
 
   /* FIXME: this one should go away -- but if I don't put it here, the GUI
    * doesn't work correctly */



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