Commit 5bf3b811 authored by Simon Morlat's avatar Simon Morlat
Browse files

gui simplification that workaround a bug in macos x

parent 6209a0b3
......@@ -756,15 +756,17 @@ void linphone_gtk_answer_clicked(GtkWidget *button){
}
}
void linphone_gtk_set_audio_video(){
linphone_core_enable_video(linphone_gtk_get_core(),TRUE,TRUE);
void linphone_gtk_enable_video(GtkWidget *w){
gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
GtkWidget *selfview_item=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"selfview_item");
linphone_core_enable_video(linphone_gtk_get_core(),val,val);
gtk_widget_set_sensitive(selfview_item,val);
if (val){
linphone_core_enable_video_preview(linphone_gtk_get_core(),
linphone_gtk_get_ui_config_int("videoselfview",VIDEOSELFVIEW_DEFAULT));
}
void linphone_gtk_set_audio_only(){
linphone_core_enable_video(linphone_gtk_get_core(),FALSE,FALSE);
}else{
linphone_core_enable_video_preview(linphone_gtk_get_core(),FALSE);
}
}
void linphone_gtk_enable_self_view(GtkWidget *w){
......@@ -1133,13 +1135,14 @@ static void linphone_gtk_connect_digits(void){
}
static void linphone_gtk_check_menu_items(void){
bool_t audio_only=!linphone_core_video_enabled(linphone_gtk_get_core());
bool_t video_enabled=linphone_core_video_enabled(linphone_gtk_get_core());
bool_t selfview=linphone_gtk_get_ui_config_int("videoselfview",VIDEOSELFVIEW_DEFAULT);
GtkWidget *selfview_item=linphone_gtk_get_widget(
linphone_gtk_get_main_window(),"selfview_item");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(linphone_gtk_get_widget(
linphone_gtk_get_main_window(),
audio_only ? "audio_only_item" : "video_item")), TRUE);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(linphone_gtk_get_widget(
linphone_gtk_get_main_window(),"selfview_item")),selfview);
linphone_gtk_get_main_window(),"enable_video_item")), video_enabled);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(selfview_item),selfview);
gtk_widget_set_sensitive(selfview_item,video_enabled);
}
static gboolean linphone_gtk_can_manage_accounts(){
......
......@@ -135,28 +135,11 @@
<object class="GtkMenu" id="menu2">
<property name="visible">True</property>
<child>
<object class="GtkRadioMenuItem" id="audio_only_item">
<object class="GtkCheckMenuItem" id="enable_video_item">
<property name="visible">True</property>
<property name="label" translatable="yes">Audio only</property>
<property name="label" translatable="yes">Enable video</property>
<property name="use_underline">True</property>
<property name="draw_as_radio">True</property>
<signal name="toggled" handler="linphone_gtk_set_audio_only"/>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="video_item">
<property name="visible">True</property>
<property name="label" translatable="yes">Audio &amp; video</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_as_radio">True</property>
<property name="group">audio_only_item</property>
<signal name="toggled" handler="linphone_gtk_set_audio_video"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem5">
<property name="visible">True</property>
<signal name="toggled" handler="linphone_gtk_enable_video"/>
</object>
</child>
<child>
......
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