From f8f1621ae9b6626c588fd73794c3685597268b5e Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandresavard@msavard.(none)>
Date: Tue, 21 Jun 2011 17:57:29 -0400
Subject: [PATCH] #6233: Fix toolbar updates

---
 sflphone-client-gnome/src/actions.c                  |  4 ++--
 .../src/config/accountlistconfigdialog.c             |  4 ++--
 sflphone-client-gnome/src/contacts/calltree.c        |  4 ----
 sflphone-client-gnome/src/uimanager.c                | 12 ++++++++++--
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c
index 9a7047ff41..d0ea932cdf 100644
--- a/sflphone-client-gnome/src/actions.c
+++ b/sflphone-client-gnome/src/actions.c
@@ -737,7 +737,7 @@ sflphone_new_call()
 
     c->_history_state = OUTGOING;
 
-    calllist_add_call (current_calls,c);
+    calllist_add_call (current_calls, c);
     calltree_add_call (current_calls, c, NULL);
     update_actions();
 
@@ -934,7 +934,7 @@ static int _place_registered_call (callable_obj_t * c)
         return -1;
     }
 
-    if (g_strcasecmp (g_hash_table_lookup (current->properties, "Status"),"REGISTERED") ==0) {
+    if (g_strcasecmp (g_hash_table_lookup (current->properties, "Status"), "REGISTERED") ==0) {
         /* The call is made with the current account */
         // free memory for previous account id and get a new one
         g_free (c->_accountID);
diff --git a/sflphone-client-gnome/src/config/accountlistconfigdialog.c b/sflphone-client-gnome/src/config/accountlistconfigdialog.c
index 5df3718fb3..be0c935579 100644
--- a/sflphone-client-gnome/src/config/accountlistconfigdialog.c
+++ b/sflphone-client-gnome/src/config/accountlistconfigdialog.c
@@ -105,8 +105,8 @@ void account_list_config_dialog_fill()
 {
 
     if (accountListDialog == NULL) {
-        ERROR("Config: Error: Dialog is not opened");
-        return;
+        DEBUG("Config: No account dialog, returning");
+	return;
     }
 
     GtkTreeIter iter;
diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c
index bc38ed0f30..bc71bbe69a 100644
--- a/sflphone-client-gnome/src/contacts/calltree.c
+++ b/sflphone-client-gnome/src/contacts/calltree.c
@@ -291,10 +291,6 @@ row_activated (GtkTreeView       *tree_view UNUSED,
 	    calltree_display(current_calls); 
 	}
     }
-
-    calltab_unselect_all(current_calls);
-    calltab_unselect_all(history);
-    calltab_unselect_all(contacts);
 }
 
 static void 
diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index 832e72726e..2c9c3314bc 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -220,6 +220,7 @@ update_actions()
 
         switch (selectedCall->_state) {
             case CALL_STATE_INCOMING:
+		DEBUG("UIManager: Call State Incoming");
                 // Make the button toolbar clickable
                 gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE);
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
@@ -232,6 +233,7 @@ update_actions()
                                     1);
                 break;
             case CALL_STATE_HOLD:
+		DEBUG("UIManager: Call State Hold");
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE);
                 gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE);
@@ -248,12 +250,14 @@ update_actions()
 
                 break;
             case CALL_STATE_RINGING:
+		DEBUG("UIManager: Call State Ringing");
                 gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE);
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget),
                                     1);
                 break;
             case CALL_STATE_DIALING:
+		DEBUG("UIManager: Call State Dialing");
                 gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE);
 
                 if (active_calltree == current_calls)
@@ -319,6 +323,7 @@ update_actions()
                 break;
             case CALL_STATE_BUSY:
             case CALL_STATE_FAILURE:
+		DEBUG("UIManager: Call State Busy/Failure"); 
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1);
                 break;
@@ -334,7 +339,7 @@ update_actions()
                 gtk_widget_set_sensitive (GTK_WIDGET (transferToolbar), TRUE);
                 break;
             default:
-                WARN ("Should not happen in update_actions()!");
+                ERROR ("UIMAnager: Error: Unknown state in action update!");
                 break;
         }
     } else if (selectedConf) {
@@ -349,6 +354,7 @@ update_actions()
 
             case CONFERENCE_STATE_ACTIVE_ATACHED:
             case CONFERENCE_STATE_ACTIVE_DETACHED:
+		DEBUG("UIManager: Conference State Active");
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE);
                 gtk_action_set_sensitive (GTK_ACTION (recordAction), TRUE);
@@ -362,6 +368,7 @@ update_actions()
                 break;
             case CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD:
             case CONFERENCE_STATE_ACTIVE_DETACHED_RECORD:
+		DEBUG("UIManager: Conference State Record");
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE);
                 gtk_action_set_sensitive (GTK_ACTION (recordAction), TRUE);
@@ -375,6 +382,7 @@ update_actions()
                 break;
             case CONFERENCE_STATE_HOLD:
             case CONFERENCE_STATE_HOLD_RECORD:
+		DEBUG("UIManager: Conference State Hold");
                 gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE);
                 gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE);
                 gtk_action_set_sensitive (GTK_ACTION (recordAction), TRUE);
@@ -387,7 +395,7 @@ update_actions()
                 }
                 break;
             default:
-                WARN ("Should not happen in update_action()!");
+                WARN ("UIManager: Error: Should not happen in action update!");
                 break;
         }
     }
-- 
GitLab