mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 20:48:07 +00:00
add update check button (optional)
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@720 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
fbc81e885d
commit
480acde2fc
3 changed files with 28 additions and 3 deletions
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -191,6 +191,13 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="versioncheck">
|
||||
<property name="label" translatable="yes">Check for updates</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="linphone_gtk_check_for_updates"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue