[ekiga] Pushed the opal account registration consideration in the opal code



commit 10036066d481f9fe14a14912fb82b5356a391d2a
Author: Julien Puydt <jpuydt gnome org>
Date:   Thu Jun 4 18:15:46 2009 +0200

    Pushed the opal account registration consideration in the opal code
    
    They don't belong to the abstract account stack
---
 lib/engine/account/account-core.cpp          |   11 -----
 lib/engine/account/account-core.h            |   12 ------
 lib/engine/account/account.h                 |   18 +++-----
 lib/engine/account/bank-impl.h               |   16 --------
 lib/engine/account/bank.h                    |    7 ---
 lib/engine/components/opal/h323-endpoint.cpp |    8 ++--
 lib/engine/components/opal/h323-endpoint.h   |    2 +-
 lib/engine/components/opal/opal-account.cpp  |   53 ++++++++++++++++++++++---
 lib/engine/components/opal/opal-account.h    |   14 +++++-
 lib/engine/components/opal/sip-endpoint.cpp  |    8 ++--
 lib/engine/components/opal/sip-endpoint.h    |    2 +-
 lib/engine/presence/presence-core.cpp        |   15 -------
 lib/engine/presence/presence-core.h          |    8 +---
 src/gui/accounts.cpp                         |   51 ++----------------------
 src/gui/main.cpp                             |   51 ++++++------------------
 15 files changed, 94 insertions(+), 182 deletions(-)

diff --git a/lib/engine/account/account-core.cpp b/lib/engine/account/account-core.cpp
index 9b6cd21..4ae6741 100644
--- a/lib/engine/account/account-core.cpp
+++ b/lib/engine/account/account-core.cpp
@@ -78,7 +78,6 @@ Ekiga::AccountCore::add_bank (BankPtr bank)
   bank_added.emit (bank);
 
   bank->questions.add_handler (questions.make_slot ());
-  bank->registration_event.connect (sigc::bind<0> (sigc::mem_fun (this, &Ekiga::AccountCore::on_registration_event), bank));
 }
 
 
@@ -101,16 +100,6 @@ Ekiga::AccountCore::add_account_subscriber (AccountSubscriber &subscriber)
 }
 
 
-void
-Ekiga::AccountCore::on_registration_event (BankPtr bank,
-					   AccountPtr account,
-					   Ekiga::Account::RegistrationState state,
-					   const std::string info)
-{
-  registration_event.emit (bank, account, state, info);
-}
-
-
 void Ekiga::AccountCore::on_mwi_event (BankPtr bank,
 				       AccountPtr account,
                                        const std::string & info)
diff --git a/lib/engine/account/account-core.h b/lib/engine/account/account-core.h
index 03e3d2c..c9a1066 100644
--- a/lib/engine/account/account-core.h
+++ b/lib/engine/account/account-core.h
@@ -161,14 +161,6 @@ namespace Ekiga
     ChainOfResponsibility<FormRequest*> questions;
 
 
-    /** This signal is emitted when there is a new registration event
-     * @param: account is the account
-     *         state is the state
-     *         info contains information about the registration status
-     */
-    sigc::signal4<void, BankPtr, AccountPtr, Account::RegistrationState, std::string> registration_event;
-
-
     /** This signal is emitted when there is a new message waiting event
      * @param: account is the account
      *         info contains information about the indication
@@ -191,10 +183,6 @@ namespace Ekiga
     std::set<AccountSubscriber *> account_subscribers;
     typedef std::set<AccountSubscriber *>::iterator subscriber_iterator;
     typedef std::set<AccountSubscriber *>::const_iterator subscriber_const_iterator;
-    void on_registration_event (BankPtr bank,
-				AccountPtr account,
-                                Account::RegistrationState state,
-                                const std::string info);
     void on_mwi_event (BankPtr bank,
 		       AccountPtr account,
                        const std::string & info);
diff --git a/lib/engine/account/account.h b/lib/engine/account/account.h
index 912590d..3094012 100644
--- a/lib/engine/account/account.h
+++ b/lib/engine/account/account.h
@@ -58,9 +58,6 @@ namespace Ekiga
   {
   public:
 
-    typedef enum { Processing, Registered, Unregistered, RegistrationFailed, UnregistrationFailed } RegistrationState;
-
-
     /** The destructor.
      */
     virtual ~Account () { }
@@ -74,6 +71,13 @@ namespace Ekiga
     virtual const std::string get_name () const = 0;
 
 
+    /** Returns the status of the Ekiga::Account.
+     * This function is purely virtual and should be implemented by the
+     * Ekiga::Account descendant.
+     * @return The status of the Ekiga::Contact
+     */
+    virtual const std::string get_status () const = 0;
+
     /** Returns the address of record for that Ekiga::Account.
      * @return The address of record.
      */
@@ -140,14 +144,6 @@ namespace Ekiga
     sigc::signal0<void> removed;
 
 
-    /** This signal is emitted when there is a new registration event for
-     *  the Account.
-     * @param: state is the state
-     *         info contains information about the registration status
-     */
-    sigc::signal2<void, RegistrationState, std::string> registration_event;
-
-
     /** This signal is emitted when there is a new message waiting indication
      * @param: mwi is the message waiting indication
      */
diff --git a/lib/engine/account/bank-impl.h b/lib/engine/account/bank-impl.h
index ce47fe2..a0592f5 100644
--- a/lib/engine/account/bank-impl.h
+++ b/lib/engine/account/bank-impl.h
@@ -136,11 +136,6 @@ namespace Ekiga
     void remove_account (gmref_ptr<AccountType> account);
 
     using RefLister<AccountType>::add_connection;
-
-  private:
-    void on_registration_event (Ekiga::Account::RegistrationState,
-				std::string info,
-				gmref_ptr<AccountType> account);
   };
 
 /**
@@ -215,7 +210,6 @@ Ekiga::BankImpl<AccountType>::add_account (gmref_ptr<AccountType> account)
   add_object (account);
 
   account->questions.add_handler (questions.make_slot ());
-  account->registration_event.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::BankImpl<AccountType>::on_registration_event), account));
 }
 
 
@@ -226,14 +220,4 @@ Ekiga::BankImpl<AccountType>::remove_account (gmref_ptr<AccountType> account)
   remove_object (account);
 }
 
-
-template<typename AccountType>
-void
-Ekiga::BankImpl<AccountType>::on_registration_event (Ekiga::Account::RegistrationState state,
-						     std::string info,
-						     gmref_ptr<AccountType> account)
-{
-  registration_event.emit (account, state, info);
-}
-
 #endif
diff --git a/lib/engine/account/bank.h b/lib/engine/account/bank.h
index 11f45c2..9d46a7d 100644
--- a/lib/engine/account/bank.h
+++ b/lib/engine/account/bank.h
@@ -84,13 +84,6 @@ namespace Ekiga
      */
     sigc::signal1<void, AccountPtr> account_updated;
 
-    /** This signal is emitted when there is a new registration event
-     * @param: account is the account
-     *         state is the state
-     *         info contains information about the registration status
-     */
-    sigc::signal3<void, Ekiga::AccountPtr, Account::RegistrationState, std::string> registration_event;
-
     /** This chain allows the BankImpl to present forms to the user
      */
     ChainOfResponsibility<FormRequest*> questions;
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index d9e5699..545bb21 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -333,14 +333,14 @@ Opal::H323::EndPoint::Register (const Opal::Account& account)
       // Signal
       Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &Opal::H323::EndPoint::registration_event_in_main),
                                                account,
-                                               Ekiga::Account::RegistrationFailed,
+                                               Account::RegistrationFailed,
                                                info));
     }
     else {
 
       Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &Opal::H323::EndPoint::registration_event_in_main),
                                                account,
-                                               Ekiga::Account::Registered,
+                                               Account::Registered,
                                                std::string ()));
     }
   }
@@ -453,8 +453,8 @@ Opal::H323::EndPoint::on_transfer (std::string uri)
 
 void
 Opal::H323::EndPoint::registration_event_in_main (Opal::Account& account,
-						  Ekiga::Account::RegistrationState state,
+						  Opal::Account::RegistrationState state,
 						  const std::string msg)
 {
-  account.registration_event.emit (state, msg);
+  account.handle_registration_event (state, msg);
 }
diff --git a/lib/engine/components/opal/h323-endpoint.h b/lib/engine/components/opal/h323-endpoint.h
index a745bf9..266c052 100644
--- a/lib/engine/components/opal/h323-endpoint.h
+++ b/lib/engine/components/opal/h323-endpoint.h
@@ -125,7 +125,7 @@ namespace Opal {
       void on_transfer (std::string uri);
 
       void registration_event_in_main (Opal::Account& account,
-				       Ekiga::Account::RegistrationState state,
+				       Account::RegistrationState state,
 				       const std::string msg);
 
       CallManager & manager;
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 9b62123..346da99 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -50,6 +50,8 @@
 #include "form-request-simple.h"
 #include "toolbox.h"
 
+#include "presence-core.h"
+#include "personal-details.h"
 
 Opal::Account::Account (Ekiga::ServiceCore & _core,
                         const std::string & account)
@@ -121,8 +123,6 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
     type = Account::SIP;
   else
     type = Account::H323;
-
-  registration_event.connect (sigc::mem_fun (this, &Opal::Account::on_registration_event));
 }
 
 
@@ -152,8 +152,6 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
 
   if (enabled)
     enable ();
-
-  registration_event.connect (sigc::mem_fun (this, &Opal::Account::on_registration_event));
 }
 
 
@@ -188,6 +186,12 @@ const std::string Opal::Account::get_name () const
   return name;
 }
 
+const std::string
+Opal::Account::get_status () const
+{
+  return status;
+}
+
 const std::string Opal::Account::get_aor () const
 {
   std::stringstream str;
@@ -442,11 +446,46 @@ Opal::Account::on_consult (const std::string url)
 }
 
 void
-Opal::Account::on_registration_event (Ekiga::Account::RegistrationState state,
-				      std::string /*info*/)
+Opal::Account::handle_registration_event (RegistrationState state,
+					  std::string info)
 {
   active = false;
 
-  if (state == Ekiga::Account::Registered)
+  switch (state) {
+  case Registered:
+    status = _("Registered");
     active = true;
+    {
+      gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
+      gmref_ptr<Ekiga::PersonalDetails> personal_details = core.get ("personal-details");
+      if (presence_core && personal_details) {
+
+	presence_core->publish (personal_details);
+      }
+    } 
+    break;
+
+  case Unregistered:
+    status = _("Unregistered");
+    break;
+
+  case UnregistrationFailed:
+    status = _("Could not unregister");
+    if (!info.empty ())
+      status = status + " (" + info + ")";
+    break;
+
+  case RegistrationFailed:
+    status = _("Could not register");
+    if (!info.empty ())
+      status = status + " (" + info + ")";
+    break;
+
+  case Processing:
+    status = _("Processing...");
+  default:
+    break;
+  }
+
+  updated.emit ();
 }
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 2cf551d..0439483 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -57,6 +57,8 @@ public:
 
     typedef enum { SIP, Ekiga, DiamondCard, H323 } Type;
 
+    typedef enum { Processing, Registered, Unregistered, RegistrationFailed, UnregistrationFailed } RegistrationState;
+
     Account (Ekiga::ServiceCore & core, 
              const std::string & account);
 
@@ -74,6 +76,8 @@ public:
 
     const std::string get_name () const;
 
+    const std::string get_status () const;
+
     const std::string get_aor () const;
 
     /** Returns the protocol name of the Opal::Account.
@@ -133,14 +137,17 @@ public:
     const std::string as_string () const;
 
     sigc::signal0<void> trigger_saving;
+
+    /* This method is public to be called by an opal endpoint, which will push
+     * this Opal::Account's new registration state
+     */
+    void handle_registration_event (RegistrationState state,
+				    std::string info);
  
 private:
     void on_edit_form_submitted (bool submitted,
 				 Ekiga::Form &result);
     void on_consult (const std::string url);
-    
-    // Triggered for our own event
-    void on_registration_event (Ekiga::Account::RegistrationState state, std::string info);
 
     bool dead;
     bool active;
@@ -148,6 +155,7 @@ private:
     unsigned timeout;
     std::string aid;
     std::string name;
+    std::string status;
     std::string protocol_name;
     std::string host;
     std::string username;
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 2a746d4..282a4d9 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -680,7 +680,7 @@ Opal::Sip::EndPoint::OnRegistered (const PString & _aor,
   Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this,
 							  &Opal::Sip::EndPoint::registration_event_in_main),
 					   strm.str (),
-					   was_registering ? Ekiga::Account::Registered : Ekiga::Account::Unregistered,
+					   was_registering ? Account::Registered : Account::Unregistered,
 					   std::string ()));
 }
 
@@ -925,7 +925,7 @@ Opal::Sip::EndPoint::OnRegistrationFailed (const PString & _aor,
     Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this,
 							    &Opal::Sip::EndPoint::registration_event_in_main),
 					     strm.str (),
-					     wasRegistering ? Ekiga::Account::RegistrationFailed : Ekiga::Account::UnregistrationFailed,
+					     wasRegistering ?Account::RegistrationFailed : Account::UnregistrationFailed,
 					     info));
   }
 }
@@ -1228,14 +1228,14 @@ void Opal::Sip::EndPoint::on_transfer (std::string uri)
 
 void
 Opal::Sip::EndPoint::registration_event_in_main (const std::string aor,
-						 Ekiga::Account::RegistrationState state,
+						 Opal::Account::RegistrationState state,
 						 const std::string msg)
 {
   AccountPtr account = bank->find_account (aor);
 
   if (account) {
 
-    account->registration_event.emit (state, msg);
+    account->handle_registration_event (state, msg);
   }
 }
 
diff --git a/lib/engine/components/opal/sip-endpoint.h b/lib/engine/components/opal/sip-endpoint.h
index 5a4d061..951c6c3 100644
--- a/lib/engine/components/opal/sip-endpoint.h
+++ b/lib/engine/components/opal/sip-endpoint.h
@@ -196,7 +196,7 @@ namespace Opal {
       void on_transfer (std::string uri);
 
       void registration_event_in_main (const std::string aor,
-				       Ekiga::Account::RegistrationState state,
+				       Account::RegistrationState state,
 				       const std::string msg);
 
       void presence_status_in_main (std::string uri,
diff --git a/lib/engine/presence/presence-core.cpp b/lib/engine/presence/presence-core.cpp
index 2c2e301..80826a4 100644
--- a/lib/engine/presence/presence-core.cpp
+++ b/lib/engine/presence/presence-core.cpp
@@ -35,20 +35,16 @@
  *
  */
 
-#include "account-core.h"
 #include "presence-core.h"
 #include "personal-details.h"
 
 
 Ekiga::PresenceCore::PresenceCore (Ekiga::ServiceCore& core)
 {
-  gmref_ptr<Ekiga::AccountCore> account_core = core.get ("account-core");
   gmref_ptr<Ekiga::PersonalDetails> details = core.get ("personal-details");
 
   if (details)
     conns.push_back (details->updated.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::PresenceCore::publish), details)));
-  if (account_core)
-    conns.push_back (account_core->registration_event.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::PresenceCore::on_registration_event), details)));
 }
 
 Ekiga::PresenceCore::~PresenceCore ()
@@ -259,14 +255,3 @@ Ekiga::PresenceCore::add_supported_uri (sigc::slot1<bool,std::string> tester)
 {
   uri_testers.insert (tester);
 }
-
-void
-Ekiga::PresenceCore::on_registration_event (Ekiga::BankPtr /*bank*/,
-					    Ekiga::AccountPtr /*account*/,
-					    Ekiga::Account::RegistrationState state,
-					    std::string /*info*/,
-					    gmref_ptr<Ekiga::PersonalDetails> details)
-{
-  if (state == Ekiga::Account::Registered)
-    publish (details);
-}
diff --git a/lib/engine/presence/presence-core.h b/lib/engine/presence/presence-core.h
index f481ad6..084416a 100644
--- a/lib/engine/presence/presence-core.h
+++ b/lib/engine/presence/presence-core.h
@@ -282,16 +282,12 @@ namespace Ekiga
 
     void add_presence_publisher (gmref_ptr<PresencePublisher> publisher);
 
+    void publish (gmref_ptr<PersonalDetails> details);
+
   private:
 
     std::list<gmref_ptr<PresencePublisher> > presence_publishers;
-    void publish (gmref_ptr<PersonalDetails> details);
     void on_personal_details_updated (PersonalDetails &details);
-    void on_registration_event (Ekiga::BankPtr bank,
-				Ekiga::AccountPtr account,
-				Ekiga::Account::RegistrationState state,
-                                std::string info,
-                                gmref_ptr<Ekiga::PersonalDetails> details);
 
     /*** API to control which uri are supported by runtime ***/
   public:
diff --git a/src/gui/accounts.cpp b/src/gui/accounts.cpp
index 0838ceb..7cc775c 100644
--- a/src/gui/accounts.cpp
+++ b/src/gui/accounts.cpp
@@ -122,7 +122,7 @@ enum {
   COLUMN_ACCOUNT_ENABLED,
   COLUMN_ACCOUNT_ACCOUNT_NAME,
   COLUMN_ACCOUNT_VOICEMAILS,
-  COLUMN_ACCOUNT_ERROR_MESSAGE,
+  COLUMN_ACCOUNT_STATUS,
   COLUMN_ACCOUNT_STATE,
   COLUMN_ACCOUNT_NUMBER
 };
@@ -184,7 +184,7 @@ gm_accounts_window_update_account_state (GtkWidget *accounts_window,
       if (account == _account.get ()) {
 
         gtk_tree_model_get (GTK_TREE_MODEL (model), &iter,
-                            COLUMN_ACCOUNT_ERROR_MESSAGE, &error,
+                            COLUMN_ACCOUNT_STATUS, &error,
                             COLUMN_ACCOUNT_VOICEMAILS, &mwi,
                             -1);
 
@@ -193,7 +193,7 @@ gm_accounts_window_update_account_state (GtkWidget *accounts_window,
 	if (status) {
 
 	  gtk_list_store_set (GTK_LIST_STORE (model), &iter,
-			      COLUMN_ACCOUNT_ERROR_MESSAGE, status, -1);
+			      COLUMN_ACCOUNT_STATUS, status, -1);
           status_modified = (error == NULL) || strcmp (status, error);
         }
 	if (voicemails) {
@@ -215,47 +215,6 @@ gm_accounts_window_update_account_state (GtkWidget *accounts_window,
 
 
 /* Engine callbacks */
-static void
-on_registration_event (Ekiga::BankPtr /*bank*/,
-		       Ekiga::AccountPtr account,
-                       Ekiga::Account::RegistrationState state,
-                       std::string info,
-                       gpointer window)
-{
-  bool is_processing = false;
-  std::string status;
-
-  switch (state) {
-  case Ekiga::Account::Registered:
-    status = _("Registered");
-    break;
-
-  case Ekiga::Account::Unregistered:
-    status = _("Unregistered");
-    break;
-
-  case Ekiga::Account::UnregistrationFailed:
-    status = _("Could not unregister");
-    if (!info.empty ())
-      status = status + " (" + info + ")";
-    break;
-
-  case Ekiga::Account::RegistrationFailed:
-    status = _("Could not register");
-    if (!info.empty ())
-      status = status + " (" + info + ")";
-    break;
-
-  case Ekiga::Account::Processing:
-    status = _("Processing...");
-    is_processing = true;
-  default:
-    break;
-  }
-
-  gm_accounts_window_update_account_state (GTK_WIDGET (window), is_processing, account, status.c_str (), NULL);
-}
-
 
 static void
 on_mwi_event (Ekiga::AccountPtr account,
@@ -439,7 +398,7 @@ account_toggled_cb (G_GNUC_UNUSED GtkCellRendererToggle *cell,
 
     gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                         COLUMN_ACCOUNT_ENABLED, fixed^1,
-                        COLUMN_ACCOUNT_ERROR_MESSAGE, "",
+                        COLUMN_ACCOUNT_STATUS, "",
                         -1);
   }
 
@@ -504,6 +463,7 @@ gm_accounts_window_update_account (GtkWidget *accounts_window,
                             COLUMN_ACCOUNT_WEIGHT, PANGO_WEIGHT_NORMAL,
                             COLUMN_ACCOUNT_ENABLED, account->is_enabled (),
                             COLUMN_ACCOUNT_ACCOUNT_NAME, account->get_name ().c_str (),
+			    COLUMN_ACCOUNT_STATUS, account->get_status ().c_str (),
                             -1);
         break;
       }
@@ -780,7 +740,6 @@ gm_accounts_window_new (Ekiga::ServiceCore &core)
   account_core->account_updated.connect (sigc::bind (sigc::ptr_fun (on_account_updated), window));
   account_core->account_removed.connect (sigc::bind (sigc::ptr_fun (on_account_removed), window));
   account_core->questions.add_handler (sigc::bind (sigc::ptr_fun (on_handle_questions), (gpointer) window));
-  account_core->registration_event.connect (sigc::bind (sigc::ptr_fun (on_registration_event), (gpointer) window));
   bank->mwi_event.connect (sigc::bind (sigc::ptr_fun (on_mwi_event), (gpointer) window));
 
   account_core->visit_banks (sigc::bind_return (sigc::bind (sigc::ptr_fun (on_bank_added), window), true));
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index b0a6c10..722ce12 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -510,51 +510,26 @@ static void ekiga_main_window_add_device_dialog_show (EkigaMainWindow *main_wind
  * Engine Callbacks 
  */
 static void
-on_registration_event (Ekiga::BankPtr /*bank*/,
-		       Ekiga::AccountPtr account,
-		       Ekiga::Account::RegistrationState state,
-		       std::string /*info*/,
-		       gpointer self)
+on_account_updated (Ekiga::BankPtr /*bank*/,
+		    Ekiga::AccountPtr account,
+		    gpointer self)
 {
-  EkigaMainWindow *mw = NULL;
-
-  gchar *msg = NULL;
-  std::string aor = account->get_aor ();
-
   g_return_if_fail (EKIGA_IS_MAIN_WINDOW (self));
-  mw = EKIGA_MAIN_WINDOW (self);
 
-  switch (state) {
-  case Ekiga::Account::Registered:
-    /* Translators: Is displayed once an account "%s" is registered. */
-    msg = g_strdup_printf (_("Registered %s"), aor.c_str ()); 
-    if (std::find (mw->priv->accounts.begin (), mw->priv->accounts.end (), account->get_host ()) == mw->priv->accounts.end ())
-      mw->priv->accounts.push_back (account->get_host ());
-    break;
+  if (account->get_status () != "") {
 
-  case Ekiga::Account::Unregistered:
-    /* Translators: Is displayed once an account "%s" is unregistered. */
-    msg = g_strdup_printf (_("Unregistered %s"), aor.c_str ());
-    mw->priv->accounts.remove (account->get_host ());
-    break;
+    EkigaMainWindow *mw = NULL;
+    gchar *msg = NULL;
 
-  case Ekiga::Account::UnregistrationFailed:
-    msg = g_strdup_printf (_("Could not unregister %s"), aor.c_str ());
-    break;
+    mw = EKIGA_MAIN_WINDOW (self);
+    msg = g_strdup_printf ("%s: %s",
+			   account->get_name ().c_str (),
+			   account->get_status ().c_str ());
 
-  case Ekiga::Account::RegistrationFailed:
-    msg = g_strdup_printf (_("Could not register %s"), aor.c_str ());
-    break;
-
-  case Ekiga::Account::Processing:
-  default:
-    break;
-  }
-
-  if (msg)
     ekiga_main_window_flash_message (mw, "%s", msg);
 
-  g_free (msg);
+    g_free (msg);
+  }
 }
 
 
@@ -4059,7 +4034,7 @@ ekiga_main_window_connect_engine_signals (EkigaMainWindow *mw)
   gmref_ptr<Ekiga::AccountCore> account_core = mw->priv->core->get ("account-core");
 
   /* Engine Signals callbacks */
-  conn = account_core->registration_event.connect (sigc::bind (sigc::ptr_fun (on_registration_event), (gpointer) mw));
+  conn = account_core->account_updated.connect (sigc::bind (sigc::ptr_fun (on_account_updated), (gpointer) mw));
   mw->priv->connections.push_back (conn);
 
   conn = call_core->setup_call.connect (sigc::bind (sigc::ptr_fun (on_setup_call_cb), (gpointer) mw));



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