Skip to content
Snippets Groups Projects
Commit 78b1ed01 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Slight GTK+ GUI toolbar updates modifications

parent 94b3bbd1
No related branches found
No related tags found
No related merge requests found
...@@ -601,14 +601,12 @@ sflphone_place_call ( call_t * c ) ...@@ -601,14 +601,12 @@ sflphone_place_call ( call_t * c )
if( account_list_get_size() == 0 ) if( account_list_get_size() == 0 )
{ {
notify_no_accounts(); notify_no_accounts();
call_list_remove(current_calls , c->callID); sflphone_fail(c);
update_call_tree_remove(current_calls, c);
} }
else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL ) else if( account_list_get_by_state( ACCOUNT_STATE_REGISTERED ) == NULL )
{ {
notify_no_registered_accounts(); notify_no_registered_accounts();
call_list_remove(current_calls , c->callID); sflphone_fail(c);
update_call_tree_remove(current_calls, c);
} }
else else
{ {
...@@ -651,7 +649,6 @@ sflphone_place_call ( call_t * c ) ...@@ -651,7 +649,6 @@ sflphone_place_call ( call_t * c )
// Update history // Update history
c->history_state = OUTGOING; c->history_state = OUTGOING;
call_list_add(history, c); call_list_add(history, c);
//update_call_tree_add(history, c);
} }
} }
......
...@@ -176,12 +176,11 @@ call_mailbox( GtkWidget* widget , gpointer data ) ...@@ -176,12 +176,11 @@ call_mailbox( GtkWidget* widget , gpointer data )
void void
toolbar_update_buttons () toolbar_update_buttons ()
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , TRUE ); gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE);
g_object_ref(holdButton); g_object_ref(holdButton);
g_object_ref(unholdButton); g_object_ref(unholdButton);
...@@ -206,6 +205,7 @@ toolbar_update_buttons () ...@@ -206,6 +205,7 @@ toolbar_update_buttons ()
{ {
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE);
//gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
g_object_ref(callButton); g_object_ref(callButton);
gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton));
...@@ -218,13 +218,14 @@ toolbar_update_buttons () ...@@ -218,13 +218,14 @@ toolbar_update_buttons ()
g_object_ref(holdButton); g_object_ref(holdButton);
gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton));
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3); gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3);
//gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE);
break; break;
case CALL_STATE_RINGING: case CALL_STATE_RINGING:
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE);
break; break;
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); if( active_calltree != history ) gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE);
g_object_ref(callButton); g_object_ref(callButton);
gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton));
...@@ -259,11 +260,11 @@ toolbar_update_buttons () ...@@ -259,11 +260,11 @@ toolbar_update_buttons ()
if( account_list_get_size() > 0 ) if( account_list_get_size() > 0 )
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE ); gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE );
gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE );
} }
else else
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), FALSE);
} }
} }
} }
...@@ -274,7 +275,6 @@ selected(GtkTreeSelection *sel, void* data) ...@@ -274,7 +275,6 @@ selected(GtkTreeSelection *sel, void* data)
GtkTreeIter iter; GtkTreeIter iter;
GValue val; GValue val;
GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; GtkTreeModel *model = (GtkTreeModel*)active_calltree->store;
printf("Select !\n");
if (! gtk_tree_selection_get_selected (sel, &model, &iter)) if (! gtk_tree_selection_get_selected (sel, &model, &iter))
return; return;
...@@ -362,7 +362,8 @@ create_toolbar () ...@@ -362,7 +362,8 @@ create_toolbar ()
gtk_widget_set_state( GTK_WIDGET(unholdButton), GTK_STATE_INSENSITIVE); gtk_widget_set_state( GTK_WIDGET(unholdButton), GTK_STATE_INSENSITIVE);
g_signal_connect (G_OBJECT (unholdButton), "clicked", g_signal_connect (G_OBJECT (unholdButton), "clicked",
G_CALLBACK (unhold), NULL); G_CALLBACK (unhold), NULL);
gtk_widget_show_all(GTK_WIDGET(unholdButton)); //gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(unholdButton), -1);
//gtk_widget_show_all(GTK_WIDGET(unholdButton));
image = gtk_image_new_from_file( ICONS_DIR "/hold.svg"); image = gtk_image_new_from_file( ICONS_DIR "/hold.svg");
holdButton = gtk_tool_button_new (image, _("On Hold")); holdButton = gtk_tool_button_new (image, _("On Hold"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment