Commit 668d125b authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

main.c: redo properly button management in linphone_gtk_update_call_buttons()

parent 6d3d8a8f
......@@ -89,3 +89,4 @@ tester/record_for_lc_*.wav
tester/record-call_with_file_player.wav
tester/ZIDCache*.xml
tester/stereo-record.wav
......@@ -447,28 +447,28 @@ GtkWidget *linphone_gtk_create_widget_2(const char *filename, const char *widget
GtkBuilder *builder = gtk_builder_new();
GError *error = NULL;
GObject *obj;
if(get_ui_file(filename, path, sizeof(path)) == -1) goto end;
gtk_builder_set_translation_domain(builder, GETTEXT_PACKAGE);
if(gtk_builder_add_from_file(builder, path, &error) == 0) {
g_error("Couldn't load builder file: %s", error->message);
g_error_free(error);
goto end;
}
obj = gtk_builder_get_object(builder, widget_name);
if(obj == NULL) {
g_error("'%s' widget not found", widget_name);
goto end;
}
w = GTK_WIDGET(obj);
g_object_set_data_full(obj, "builder", builder, g_object_unref);
gtk_widget_unparent(w);
end:
return w;
}
......@@ -870,22 +870,12 @@ static void linphone_gtk_update_call_buttons(LinphoneCall *call){
GtkWidget *mw=linphone_gtk_get_main_window();
const MSList *calls=linphone_core_get_calls(lc);
GtkWidget *button;
bool_t start_active=TRUE;
//bool_t stop_active=FALSE;
bool_t add_call=FALSE;
bool_t add_call=(calls!=NULL);
int call_list_size=ms_list_size(calls);
GtkWidget *conf_frame;
if (calls==NULL){
start_active=TRUE;
//stop_active=FALSE;
}else{
//stop_active=TRUE;
start_active=TRUE;
add_call=TRUE;
}
button=linphone_gtk_get_widget(mw,"start_call");
gtk_widget_set_sensitive(button,start_active);
gtk_widget_set_sensitive(button,TRUE);
gtk_widget_set_visible(button,!add_call);
button=linphone_gtk_get_widget(mw,"add_call");
......@@ -893,10 +883,10 @@ static void linphone_gtk_update_call_buttons(LinphoneCall *call){
if (linphone_core_sound_resources_locked(lc) || (call && linphone_call_get_state(call)==LinphoneCallIncomingReceived)) {
gtk_widget_set_sensitive(button,FALSE);
} else {
gtk_widget_set_sensitive(button,start_active);
gtk_widget_set_sensitive(button,TRUE);
}
gtk_widget_set_visible(button,add_call);
//gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),stop_active);
conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
if(conf_frame==NULL){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment