From 44065b77ebe1f097d551f03af57eb9a708b3e9e5 Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Wed, 11 Nov 2009 11:22:18 -0500
Subject: [PATCH] [#2406] Update toolbar at startup

---
 sflphone-client-gnome/src/actions.c   | 6 +-----
 sflphone-client-gnome/src/actions.h   | 2 +-
 sflphone-client-gnome/src/dbus/dbus.c | 2 +-
 sflphone-client-gnome/src/main.c      | 3 +++
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c
index 1cad4d868e..d89d4c8989 100644
--- a/sflphone-client-gnome/src/actions.c
+++ b/sflphone-client-gnome/src/actions.c
@@ -248,12 +248,8 @@ sflphone_fill_account_list(gboolean toolbarInitialized)
         a->protocol_state_description = g_hash_table_lookup(details, REGISTRATION_STATE_DESCRIPTION);
     }
 
-	// Reset the current account message number
+	// Set the current account message number
 	current_account_set_message_number (count);
-
-    // Prevent update being called when toolbar is not yet initialized
-    if(toolbarInitialized)
-        update_actions ();
 }
 
 gboolean sflphone_init()
diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h
index 2365243748..41e3ab2ef2 100644
--- a/sflphone-client-gnome/src/actions.h
+++ b/sflphone-client-gnome/src/actions.h
@@ -164,7 +164,7 @@ void sflphone_get_ip2ip_properties (GHashTable **properties);
 /**
  * Initialize the accounts data structure
  */
-void sflphone_fill_account_list(gboolean toolbarInitialized);
+void sflphone_fill_account_list ();
 
 void sflphone_fill_call_list (void);
 
diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c
index ed2e4b140d..4cd91db080 100644
--- a/sflphone-client-gnome/src/dbus/dbus.c
+++ b/sflphone-client-gnome/src/dbus/dbus.c
@@ -320,7 +320,7 @@ accounts_changed_cb (DBusGProxy *proxy UNUSED,
         void * foo  UNUSED )
 {
     DEBUG ("Accounts changed");
-    sflphone_fill_account_list(TRUE);
+    sflphone_fill_account_list ();
     sflphone_fill_ip2ip_profile();
     account_list_config_dialog_fill();
 
diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c
index f7a8cecd8e..2a8b7ca5a9 100644
--- a/sflphone-client-gnome/src/main.c
+++ b/sflphone-client-gnome/src/main.c
@@ -116,6 +116,9 @@ There is NO WARRANTY, to the extent permitted by law.\n\n");
     // Get the active calls and conferences at startup    
     sflphone_fill_call_list ();
     sflphone_fill_conference_list();
+
+	// Update the GUI
+	update_actions ();
         
     /* start the main loop */
     gtk_main();
-- 
GitLab