]> sjero.net Git - linphone/commitdiff
fix gtk bugs
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 4 Oct 2010 08:26:59 +0000 (10:26 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 4 Oct 2010 08:26:59 +0000 (10:26 +0200)
gtk/loginframe.c
gtk/main.c

index 62092c6b29dace62c06b7890574339c7db97d809..20a72aa71602c4d37a94ddd22fa818f7df132dec 100644 (file)
@@ -47,8 +47,21 @@ static void do_login(SipSetupContext *ssctx, const char *identity, const char *
 
 static gboolean do_login_noprompt(LinphoneProxyConfig *cfg){
        SipSetupContext *ssctx=linphone_proxy_config_get_sip_setup_context(cfg);
+       LinphoneAddress *addr;
+       const char *username;
+       char *tmp;
        if (ssctx==NULL) return TRUE;/*not ready ?*/
-       do_login(ssctx,linphone_proxy_config_get_identity(cfg),NULL);
+       username=linphone_gtk_get_ui_config ("login_username",NULL);
+       if (username==NULL) {
+               linphone_gtk_set_ui_config_int("automatic_login",0);
+               linphone_gtk_show_login_frame(cfg);
+               return FALSE;
+       }
+       addr=linphone_address_new(linphone_proxy_config_get_identity(cfg));
+       linphone_address_set_username(addr,username);
+       tmp=linphone_address_as_string (addr);
+       do_login(ssctx,tmp,NULL);
+       linphone_address_destroy(addr);
        return FALSE;
 }
 
index bdb983c138985476f56263760e29681b24eef04e..a8b15c3271eea5e577cfba3396626ef83df751df 100644 (file)
@@ -94,7 +94,7 @@ static GOptionEntry linphone_options[]={
            .description = N_("if set automatically answer incoming calls")
        },
 #ifdef WIN32
-       {                               /* zsd addition */
+       {
            .long_name = "workdir",
            .short_name = '\0',
            .arg = G_OPTION_ARG_STRING,
@@ -1234,7 +1234,7 @@ void linphone_gtk_manage_login(void){
 }
 
 
-void linphone_gtk_close(GtkWidget *mw){
+gboolean linphone_gtk_close(GtkWidget *mw){
        /*shutdown calls if any*/
        LinphoneCore *lc=linphone_gtk_get_core();
        if (linphone_core_in_call(lc)){
@@ -1242,6 +1242,7 @@ void linphone_gtk_close(GtkWidget *mw){
        }
        linphone_core_enable_video_preview(lc,FALSE);
        gtk_widget_hide(mw);
+       return TRUE;
 }
 
 static void linphone_gtk_init_main_window(){