Commit cf68e112 authored by Simon Morlat's avatar Simon Morlat
Browse files

recall logined username

parent 3476aa40
......@@ -99,4 +99,4 @@ void linphone_gtk_enable_mute_button(GtkButton *button, gboolean sensitive);
void linphone_gtk_enable_hold_button(LinphoneCall *call, gboolean sensitive, gboolean holdon);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
void linphone_gtk_set_ui_config(const char *key, const char *value);
......@@ -96,6 +96,11 @@ void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg){
g_free(str);
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
if (linphone_address_get_username(from)[0]=='?'){
const char *username=linphone_gtk_get_ui_config ("login_username",NULL);
if (username)
linphone_address_set_username(from,username);
}
ai=linphone_core_find_auth_info(lc,linphone_proxy_config_get_domain(cfg),linphone_address_get_username(from));
/*display the last entered username, if not '?????'*/
......@@ -152,6 +157,7 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")));
linphone_gtk_set_ui_config_int("automatic_login",autologin);
linphone_gtk_set_ui_config("login_username",username);
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
linphone_address_set_username(from,username);
......
......@@ -192,6 +192,10 @@ void linphone_gtk_set_ui_config_int(const char *key , int val){
lp_config_set_int(cfg,"GtkUi",key,val);
}
void linphone_gtk_set_ui_config(const char *key , const char * val){
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
lp_config_set_string(cfg,"GtkUi",key,val);
}
static void parse_item(const char *item, const char *window_name, GtkWidget *w, gboolean show){
char tmp[64];
......
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