diff --git a/linphone/gtk-glade/main.c b/linphone/gtk-glade/main.c index 763e503a7..e1f73fef9 100644 --- a/linphone/gtk-glade/main.c +++ b/linphone/gtk-glade/main.c @@ -611,9 +611,6 @@ void linphone_gtk_terminate_call(GtkWidget *button){ void linphone_gtk_decline_call(GtkWidget *button){ linphone_core_terminate_call(linphone_gtk_get_core(),NULL); - /* zsd note: there was a big here in 3.0.0 which caused an abort if - * someone clicked "decline"... the following line of code looks - * like a fix for that. */ gtk_widget_destroy(gtk_widget_get_toplevel(button)); } @@ -987,12 +984,14 @@ static void linphone_gtk_configure_main_window(){ static const char *home; static const char *start_call_icon; static const char *stop_call_icon; + static gboolean update_check_menu; GtkWidget *w=linphone_gtk_get_main_window(); if (!config_loaded){ title=linphone_gtk_get_ui_config("title","Linphone"); home=linphone_gtk_get_ui_config("home","http://www.linphone.org"); start_call_icon=linphone_gtk_get_ui_config("start_call_icon","green.png"); stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon","red.png"); + update_check_menu=linphone_gtk_get_ui_config_int("update_check_menu",0); config_loaded=TRUE; } linphone_gtk_configure_window(w,"main_window"); @@ -1021,6 +1020,9 @@ static void linphone_gtk_configure_main_window(){ } if (!linphone_gtk_can_manage_accounts()) gtk_widget_hide(linphone_gtk_get_widget(w,"run_assistant")); + if (update_check_menu){ + gtk_widget_show(linphone_gtk_get_widget(w,"checkversion")); + } } void linphone_gtk_manage_login(void){ diff --git a/linphone/gtk-glade/main.glade b/linphone/gtk-glade/main.glade index 4b7b4d54f..e5b3a0abf 100644 --- a/linphone/gtk-glade/main.glade +++ b/linphone/gtk-glade/main.glade @@ -191,6 +191,13 @@ + + + Check for updates + True + + + diff --git a/linphone/gtk-glade/update.c b/linphone/gtk-glade/update.c index 85ef8d708..6fac1b8ff 100755 --- a/linphone/gtk-glade/update.c +++ b/linphone/gtk-glade/update.c @@ -87,6 +87,11 @@ static gboolean popup_new_version(const char *download_site){ return FALSE; } +static gboolean popup_version_ok(){ + linphone_gtk_display_something(GTK_MESSAGE_INFO,_("You are running the lastest version.")); + return FALSE; +} + static int copytilldot(char *n, const char *v){ int ret=0; while(*v!='\0' && *v!='.' && *v!='-' && *v!='\n' && *v!='\r' && *v!='\t'){ @@ -124,6 +129,12 @@ static void *check_for_new_version(void *d){ g_idle_add((GSourceFunc)popup_new_version,(gpointer)download_site); gdk_threads_leave(); } + }else{ + if (linphone_gtk_get_ui_config_int("update_check_menu",0)){ + gdk_threads_enter(); + g_idle_add((GSourceFunc)popup_version_ok,NULL); + gdk_threads_leave(); + } } } return NULL; @@ -139,3 +150,8 @@ void linphone_gtk_check_for_new_version(void){ if (version_url==NULL) return ; ortp_thread_create(&thread,NULL,check_for_new_version,(void*)version_url); } + +/*called when the user clicks on the "Check for updates" menu item */ +void linphone_gtk_check_for_updates(void){ + linphone_gtk_check_for_new_version(); +}