From: Margaux Clerc Date: Thu, 24 Jan 2013 14:05:17 +0000 (+0100) Subject: removed keypad X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=199133a740e39cd91df4ccb560668f31fc41df0e removed keypad --- diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 1caded7c..831c69a8 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -5,6 +5,7 @@ UI_FILES= about.ui \ parameters.ui \ sip_account.ui \ call_logs.ui \ + keypad.ui \ log.ui \ buddylookup.ui \ tunnel_config.ui \ diff --git a/gtk/chat.c b/gtk/chat.c index 257a5575..19bcc342 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -194,12 +194,12 @@ void update_chat_state_message(LinphoneChatMessageState state){ default : result="Message in progress.. "; } - GDateTime *dt=g_date_time_new_now_local(); + /*GDateTime *dt=g_date_time_new_now_local(); char *time=g_date_time_format(dt,"%k:%M"); gchar result2[80]; - sprintf(result2,"%s %s",result,time); + sprintf(result2,"%s %s",result,time);*/ - gtk_text_buffer_insert_with_tags_by_name(b,&iter,result2,-1, + gtk_text_buffer_insert_with_tags_by_name(b,&iter,result,-1, "italic","right","small","font_grey",NULL); list=g_list_remove(list,g_list_nth_data(list,0)); g_object_set_data(G_OBJECT(page),"list",list); @@ -342,8 +342,8 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const GtkWidget *main_window=linphone_gtk_get_main_window(); GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list"); GtkWidget *w; - GDateTime *dt=g_date_time_new_now_local(); - char *time=g_date_time_format(dt,"%k:%M"); + /*GDateTime *dt=g_date_time_new_now_local(); + char *time=g_date_time_format(dt,"%k:%M");*/ w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview"); if(w!=NULL){ @@ -365,9 +365,9 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const #else if(!gtk_window_is_active(GTK_WINDOW(main_window))){ if(!GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"is_notified"))){ - gchar result2[80]; - sprintf(result2,"%s \n %s sent at %s",message,display,time); - linphone_gtk_notify(NULL,result2); + /*gchar result2[80]; + sprintf(result2,"%s \n %s sent at %s",message,display,time);*/ + linphone_gtk_notify(NULL,message); g_object_set_data(G_OBJECT(w),"is_notified",GINT_TO_POINTER(TRUE)); } else { g_object_set_data(G_OBJECT(w),"is_notified",GINT_TO_POINTER(FALSE)); diff --git a/gtk/incall_view.c b/gtk/incall_view.c index 8bf19c19..2b115a56 100644 --- a/gtk/incall_view.c +++ b/gtk/incall_view.c @@ -361,6 +361,13 @@ void linphone_gtk_create_in_call_view(LinphoneCall *call){ g_signal_connect(G_OBJECT(transfer),"clicked",(GCallback)transfer_button_clicked,call); gtk_widget_hide(transfer); + GtkWidget *keypad = linphone_gtk_get_widget(call_view,"keypad"); + //gtk_button_set_image(GTK_BUTTON(keypad),gtk_image_new_from_stock + // (GTK_STOCK_GO_FORWARD,GTK_ICON_SIZE_BUTTON)); + + g_signal_connect_swapped(G_OBJECT(keypad),"clicked",(GCallback)linphone_gtk_create_keypad,call); + gtk_widget_hide(keypad); + GtkWidget *conf = linphone_gtk_get_widget(call_view,"conference_button"); gtk_button_set_image(GTK_BUTTON(conf),gtk_image_new_from_stock (GTK_STOCK_ADD,GTK_ICON_SIZE_BUTTON)); g_signal_connect(G_OBJECT(conf),"clicked",(GCallback)conference_button_clicked,call); @@ -673,6 +680,9 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){ gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel")); gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("In call")); + /** keypad button **/ + //gtk_widget_set_visible(linphone_gtk_get_widget(callview,"keypad"),!in_conf); + gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"conference_button"),!in_conf); gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"transfer_button"),!in_conf); @@ -745,10 +755,15 @@ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_m gtk_widget_hide(linphone_gtk_get_widget(callview,"video_button")); gtk_widget_hide(linphone_gtk_get_widget(callview,"transfer_button")); gtk_widget_hide(linphone_gtk_get_widget(callview,"conference_button")); + gtk_widget_hide(linphone_gtk_get_widget(callview,"keypad")); linphone_gtk_enable_mute_button( GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE); linphone_gtk_enable_hold_button(call,FALSE,TRUE); + GtkWidget *keypad=(GtkWidget *)g_object_get_data(G_OBJECT(callview),"keypad"); + if(keypad!=NULL) + gtk_widget_destroy(keypad); + if (taskid!=0) g_source_remove(taskid); g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call); if (in_conf) diff --git a/gtk/linphone.h b/gtk/linphone.h index 367b18c2..ee584b03 100644 --- a/gtk/linphone.h +++ b/gtk/linphone.h @@ -89,6 +89,7 @@ int linphone_gtk_get_ui_config_int(const char *key, int def); void linphone_gtk_set_ui_config_int(const char *key , int val); void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show); +void linphone_gtk_create_keypad(LinphoneCall *call); void linphone_gtk_open_browser(const char *url); void linphone_gtk_check_for_new_version(void); const char *linphone_gtk_get_lang(const char *config_file); @@ -102,7 +103,6 @@ void linphone_gtk_terminate_call(GtkWidget *button); void update_tab_header(LinphoneCall *call,gboolean pause); void linphone_gtk_show_directory_search(void); - void linphone_gtk_status_icon_set_blinking(gboolean val); void linphone_gtk_notify(LinphoneCall *call, const char *msg); LinphoneChatRoom *linphone_gtk_start_chat(GtkTreeView* t); diff --git a/gtk/main.c b/gtk/main.c index 12e84bc9..bc333645 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -744,7 +744,9 @@ static void linphone_gtk_update_call_buttons(LinphoneCall *call){ linphone_gtk_enable_conference_button(lc,FALSE); } update_video_title(); - if (call) linphone_gtk_update_video_button(call); + if (call) { + linphone_gtk_update_video_button(call); + } } static gboolean linphone_gtk_start_call_do(GtkWidget *uri_bar){ @@ -1444,7 +1446,7 @@ void linphone_gtk_load_identities(void){ static void linphone_gtk_dtmf_pressed(GtkButton *button){ const char *label=(char *)g_object_get_data(G_OBJECT(button),"label"); - GtkWidget *uri_bar=linphone_gtk_get_widget(gtk_widget_get_toplevel(GTK_WIDGET(button)),"uribar"); + GtkWidget *uri_bar=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar"); int pos=-1; gtk_editable_insert_text(GTK_EDITABLE(uri_bar),label,1,&pos); linphone_core_play_dtmf (linphone_gtk_get_core(),label[0],-1); @@ -1458,8 +1460,8 @@ static void linphone_gtk_dtmf_released(GtkButton *button){ } -static void linphone_gtk_connect_digits(void){ - GtkContainer *cont=GTK_CONTAINER(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"dtmf_table")); +static void linphone_gtk_connect_digits(GtkWidget *w){ + GtkContainer *cont=GTK_CONTAINER(linphone_gtk_get_widget(w,"dtmf_table")); GList *children=gtk_container_get_children(cont); GList *elem; for(elem=children;elem!=NULL;elem=elem->next){ @@ -1497,11 +1499,10 @@ static void linphone_gtk_configure_main_window(){ static const char *home; static const char *start_call_icon; static const char *add_call_icon; - //static const char *stop_call_icon; static const char *search_icon; static gboolean update_check_menu; static gboolean buttons_have_borders; - static gboolean show_abcd; + //static gboolean show_abcd; GtkWidget *w=linphone_gtk_get_main_window(); GHashTable *contacts_history; @@ -1513,11 +1514,10 @@ static void linphone_gtk_configure_main_window(){ home=linphone_gtk_get_ui_config("home","http://www.linphone.org"); start_call_icon=linphone_gtk_get_ui_config("start_call_icon","startcall-green.png"); add_call_icon=linphone_gtk_get_ui_config("add_call_icon","addcall-green.png"); - //stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon","stopcall-small.png"); search_icon=linphone_gtk_get_ui_config("directory_search_icon",NULL); update_check_menu=linphone_gtk_get_ui_config_int("update_check_menu",0); buttons_have_borders=linphone_gtk_get_ui_config_int("buttons_border",1); - show_abcd=linphone_gtk_get_ui_config_int("show_abcd",1); + //show_abcd=linphone_gtk_get_ui_config_int("show_abcd",1); config_loaded=TRUE; } linphone_gtk_configure_window(w,"main_window"); @@ -1558,7 +1558,7 @@ static void linphone_gtk_configure_main_window(){ } */ } - { + /*{ GdkPixbuf *pbuf=create_pixbuf("dialer-orange.png"); if (pbuf) { GtkImage *img=GTK_IMAGE(linphone_gtk_get_widget(w,"keypad_tab_icon")); @@ -1570,20 +1570,20 @@ static void linphone_gtk_configure_main_window(){ g_object_unref(G_OBJECT(scaled)); g_object_unref(G_OBJECT(pbuf)); } - } + }*/ if (linphone_gtk_can_manage_accounts()) { gtk_widget_show(linphone_gtk_get_widget(w,"assistant_item")); } if (update_check_menu){ gtk_widget_show(linphone_gtk_get_widget(w,"versioncheck_item")); } - if (!show_abcd){ + /*if (!show_abcd){ gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_A")); gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_B")); gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_C")); gtk_widget_hide(linphone_gtk_get_widget(w,"dtmf_D")); gtk_table_resize(GTK_TABLE(linphone_gtk_get_widget(w,"dtmf_table")),4,3); - } + }*/ } void linphone_gtk_manage_login(void){ @@ -1647,7 +1647,16 @@ void linphone_gtk_init_dtmf_table(GtkWidget *mw){ g_object_set_data(G_OBJECT(linphone_gtk_get_widget(mw,"dtmf_0")),"label","0"); g_object_set_data(G_OBJECT(linphone_gtk_get_widget(mw,"dtmf_#")),"label","#"); g_object_set_data(G_OBJECT(linphone_gtk_get_widget(mw,"dtmf_*")),"label","*"); - +} + + +void linphone_gtk_create_keypad(LinphoneCall *call){ + GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer(call); + GtkWidget *keypad=linphone_gtk_create_window("keypad"); + linphone_gtk_connect_digits(keypad); + linphone_gtk_init_dtmf_table(keypad); + g_object_set_data(G_OBJECT(w),"keypad",(gpointer)keypad); + gtk_widget_show(keypad); } static void linphone_gtk_init_main_window(){ @@ -1659,11 +1668,10 @@ static void linphone_gtk_init_main_window(){ linphone_gtk_load_identities(); linphone_gtk_set_my_presence(linphone_core_get_presence_info(linphone_gtk_get_core())); linphone_gtk_show_friends(); - linphone_gtk_connect_digits(); main_window=linphone_gtk_get_main_window(); linphone_gtk_call_log_update(main_window); - linphone_gtk_init_dtmf_table(main_window); + //linphone_gtk_init_dtmf_table(main_window); linphone_gtk_update_call_buttons (NULL); g_object_set_data(G_OBJECT(main_window),"is_conf",GINT_TO_POINTER(FALSE)); /*prevent the main window from being destroyed by a user click on WM controls, instead we hide it*/ diff --git a/gtk/main.ui b/gtk/main.ui index f82875cb..97e9b470 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -70,13 +70,13 @@ 90 - 10 + 30 True False False - False + True 2 @@ -155,7 +155,7 @@ True False - + True False gtk-ok @@ -273,7 +273,17 @@ True False - + + True + False + label + center + + + True + True + 0 + @@ -282,19 +292,6 @@ 0 - - - True - False - label - center - - - True - True - 1 - - False @@ -354,6 +351,32 @@ False True + 1 + + + + + True + False + + + :: + True + True + True + False + bottom + + + False + False + 0 + + + + + False + False 2 @@ -640,6 +663,26 @@ False gtk-connect + + True + False + gtk-add + + + True + False + gtk-add + + + True + False + gtk-add + + + True + False + gtk-add + True False @@ -1082,290 +1125,35 @@ True True - + + + + + + + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 - + True - False - 0.5 - none + True + never - + + 350 True - False - 0 - 0 - - - True - False - 0 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - 4 - 4 - True - - - D - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 3 - 4 - 3 - 4 - - - - - # - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 2 - 3 - 3 - 4 - - - - - 0 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - 3 - 4 - - - - - * - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 3 - 4 - - - - - C - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 3 - 4 - 2 - 3 - - - - - 9 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 2 - 3 - 2 - 3 - - - - - 8 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - 2 - 3 - - - - - 7 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 2 - 3 - - - - - B - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 3 - 4 - 1 - 2 - - - - - 6 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 2 - 3 - 1 - 2 - - - - - 5 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - 1 - 2 - - - - - 4 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - - - - - A - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 3 - 4 - - - - - 3 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 2 - 3 - - - - - 2 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 - - - - - 1 - 40 - 40 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - - - - + True + False + + - - - True @@ -1373,172 +1161,6 @@ 0 - - - False - 0 - none - - - False - - - True - True - ● - True - False - False - True - True - - - True - True - 0 - - - - - True - True - True - False - none - - - - True - False - - - True - False - gtk-find - - - True - True - 0 - - - - - True - False - Search - - - True - True - 1 - - - - - - - False - True - 1 - - - - - - - True - False - <b>Add contacts from directory</b> - True - - - - - False - False - 5 - 2 - - - - - True - False - - - Add contact - True - True - False - image10 - - - - False - False - 0 - - - - - False - False - 3 - - - - - True - True - 0 - - - - - - - True - False - - - True - False - gtk-missing-image - 1 - - - True - True - 0 - - - - - True - False - Keypad - - - True - True - 1 - - - - - False - - - - - True - False - - - True - False - 2 True @@ -1571,29 +1193,137 @@ False True end - 0 + 1 - + True - True - never + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - 350 + + + + + False + 0 + none + + + False + + + True + True + ● + True + False + False + True + True + + + True + True + 0 + + + + + True + True + True + False + none + + + + True + False + + + True + False + gtk-find + + + True + True + 0 + + + + + True + False + Search + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>Add contacts from directory</b> + True + + + + + False + False + 5 + 2 + + + + True - True - False - - + False + + + Add contact + True + True + False + image16 + + + + False + False + 0 + + + + False + False + 3 + - True - True - 1 + False + False + end + 2 @@ -1654,7 +1384,6 @@ True True - 4 1