]> sjero.net Git - linphone/commitdiff
add a quit menu for whose who don't have a systray
authorSimon Morlat <simon.morlat@linphone.org>
Tue, 22 Nov 2011 11:25:01 +0000 (12:25 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Tue, 22 Nov 2011 11:25:01 +0000 (12:25 +0100)
coreapi/linphonecall.c
coreapi/linphonecore.c
gtk/main.c
gtk/main.ui

index 205f844151d379839129eef6d7dc4afb4e25e546..84b4b1232950f81068f75b4d51f7053d1a806612 100644 (file)
@@ -1241,7 +1241,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
        LinphoneCore *lc=call->core;
        LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
        char *cname;
-       bool_t use_arc;
+       bool_t use_arc=linphone_core_adaptive_rate_control_enabled(lc);
 #ifdef VIDEO_ENABLED
        const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc,
                                                        SalProtoRtpAvp,SalVideo);
@@ -1527,7 +1527,7 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse
                // mediastreamer queue.
                audio_stream_iterate(call->audiostream);
 
-               if (call->audiostream->evq){
+               if (call->audiostream_app_evq){
                        OrtpEvent *ev;
                        while (NULL != (ev=ortp_ev_queue_get(call->audiostream_app_evq))){
                                OrtpEventType evt=ortp_event_get_type(ev);
index d53026ad92aee72f9f7708e14b197911ced1b73b..f7d9c676caf6d79ec3dceab7e2330dd7a2e0a219 100644 (file)
@@ -747,7 +747,9 @@ static void codecs_config_read(LinphoneCore *lc)
 }
 
 static void video_config_read(LinphoneCore *lc){
+#ifdef VIDEO_ENABLED
        int capture, display, self_view;
+#endif
        const char *str;
        int ndev;
        const char **devices;
@@ -771,13 +773,14 @@ static void video_config_read(LinphoneCore *lc){
        linphone_core_set_preferred_video_size_by_name(lc,
                lp_config_get_string(lc->config,"video","size","cif"));
 
+#ifdef VIDEO_ENABLED
        capture=lp_config_get_int(lc->config,"video","capture",1);
        display=lp_config_get_int(lc->config,"video","display",1);
        self_view=lp_config_get_int(lc->config,"video","self_view",1);
        lc->video_conf.displaytype=lp_config_get_string(lc->config,"video","displaytype",NULL);
        if(lc->video_conf.displaytype)
                ms_message("we are using a specific display:%s\n",lc->video_conf.displaytype);
-#ifdef VIDEO_ENABLED
+
        linphone_core_enable_video(lc,capture,display);
        linphone_core_enable_self_view(lc,self_view);
 #endif
index 8fa9ba99a26652a15d836ff6f91161ae2fb168d9..4c918b18d3c914ece2ca94f0ce72e7528b933739 100644 (file)
@@ -499,7 +499,7 @@ static gboolean linphone_gtk_iterate(LinphoneCore *lc){
        static unsigned long previd=0;
        static unsigned long preview_previd=0;
        static gboolean in_iterate=FALSE;
-       
+
        /*avoid reentrancy*/
        if (in_iterate) return TRUE;
        in_iterate=TRUE;
@@ -1147,6 +1147,8 @@ void linphone_gtk_link_to_website(GtkWidget *item){
 
 #ifndef HAVE_GTK_OSX
 
+static GtkStatusIcon *icon=NULL;
+
 static void icon_popup_menu(GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data){
        GtkWidget *menu=(GtkWidget*)g_object_get_data(G_OBJECT(status_icon),"menu");
        gtk_menu_popup(GTK_MENU(menu),NULL,NULL,gtk_status_icon_position_menu,status_icon,button,activate_time);
@@ -1185,8 +1187,6 @@ static GtkWidget *create_icon_menu(){
        return menu;
 }
 
-static GtkStatusIcon *icon=NULL;
-
 static void handle_icon_click() {
        GtkWidget *mw=linphone_gtk_get_main_window();
        if (!gtk_window_is_active((GtkWindow*)mw)) {
@@ -1255,6 +1255,13 @@ static void linphone_gtk_status_icon_set_blinking(gboolean val){
 #endif
 }
 
+void linphone_gtk_options_activate(GtkWidget *item){
+#ifndef HAVE_GTK_OSX
+       gtk_widget_set_visible(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"quit_item"),
+               icon && !gtk_status_icon_is_embedded(icon));
+#endif
+}
+
 static void init_identity_combo(GtkComboBox *box){
        GtkListStore *store;
        GtkCellRenderer *r1,*r2;
index 0448795f71a1ad7db44c55467d493f80d1a852c2..d64634c8b75524bf40ea24122c8b5372ca58d4a2 100644 (file)
                 <property name="use_action_appearance">False</property>
                 <property name="label" translatable="yes">_Options</property>
                 <property name="use_underline">True</property>
+                <signal name="activate" handler="linphone_gtk_options_activate" swapped="no"/>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu2">
                     <property name="visible">True</property>
                         <signal name="toggled" handler="linphone_gtk_enable_self_view" swapped="no"/>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkSeparatorMenuItem" id="separatormenuitem2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImageMenuItem" id="quit_item">
+                        <property name="label">gtk-quit</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                        <signal name="activate" handler="gtk_main_quit" swapped="no"/>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>