From 1bd418922dfb1c52cff2373d3ed346451374742a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 6 Aug 2015 21:35:58 +0200 Subject: [PATCH] Move glade description of the in-call view and the conference view into independent files --- gtk/CMakeLists.txt | 3 + gtk/Makefile.am | 5 +- gtk/chat.c | 2 +- gtk/conf_callee_view.ui | 89 ++++++ gtk/conf_view.ui | 91 ++++++ gtk/conference.c | 6 +- gtk/in_call_view.ui | 431 +++++++++++++++++++++++++++++ gtk/incall_view.c | 2 +- gtk/linphone.h | 1 - gtk/main.c | 34 +-- gtk/main.ui | 596 ---------------------------------------- 11 files changed, 625 insertions(+), 635 deletions(-) create mode 100644 gtk/conf_callee_view.ui create mode 100644 gtk/conf_view.ui create mode 100644 gtk/in_call_view.ui diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 7f54cff59..fb496386d 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -40,6 +40,9 @@ set(UI_FILES tunnel_config.ui waiting.ui chat_view.ui + in_call_view.ui + conf_view.ui + conf_callee_view.ui ) set(PIXMAPS stock_people.png) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 1103168aa..156e63aee 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -16,7 +16,10 @@ UI_FILES= about.ui \ config-uri.ui \ provisioning-fetch.ui \ audio_assistant.ui \ - chat_view.ui + chat_view.ui \ + in_call_view.ui \ + conf_view.ui \ + conf_callee_view.ui PIXMAPS= \ stock_people.png diff --git a/gtk/chat.c b/gtk/chat.c index 4b447e446..4a88b810a 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -481,7 +481,7 @@ static gboolean copy_uri_into_clipboard_handler(GtkMenuItem *menuitem, gpointer } GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *with){ - GtkWidget *chat_view=linphone_gtk_create_widget_2("chat_view","chatroom_frame"); + GtkWidget *chat_view=linphone_gtk_create_widget("chat_view","chatroom_frame"); GtkWidget *main_window=linphone_gtk_get_main_window(); GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch"); GtkWidget *text=linphone_gtk_get_widget(chat_view,"textview"); diff --git a/gtk/conf_callee_view.ui b/gtk/conf_callee_view.ui new file mode 100644 index 000000000..4de3ca08c --- /dev/null +++ b/gtk/conf_callee_view.ui @@ -0,0 +1,89 @@ + + + + + + False + + + True + False + 0 + none + + + True + False + 12 + + + True + False + 12 + + + True + False + + + True + False + + + True + True + + + False + False + 0 + + + + + False + True + 0 + + + + + True + False + <b>Callee name</b> + True + right + end + + + True + True + 1 + + + + + 90 + 30 + True + False + + + False + True + 2 + + + + + + + + + + + + + + + diff --git a/gtk/conf_view.ui b/gtk/conf_view.ui new file mode 100644 index 000000000..194a94d1e --- /dev/null +++ b/gtk/conf_view.ui @@ -0,0 +1,91 @@ + + + + + + False + + + True + False + 0 + none + + + True + False + + + True + False + + + End conference + True + True + True + + + False + False + end + 0 + + + + + True + True + end + 0 + + + + + True + False + + + gtk-media-record + True + True + True + True + + + + False + False + 0 + + + + + True + False + True + char + + + True + True + 1 + + + + + False + False + end + 1 + + + + + + + + + + + diff --git a/gtk/conference.c b/gtk/conference.c index 1bfee3afc..c0b292b51 100644 --- a/gtk/conference.c +++ b/gtk/conference.c @@ -81,7 +81,7 @@ static GtkWidget *find_conferencee_from_call(LinphoneCall *call){ static GtkWidget * create_conference_panel(void){ GtkWidget *mw=linphone_gtk_get_main_window(); - GtkWidget *conf_frame=linphone_gtk_create_widget("main","conf_frame"); + GtkWidget *conf_frame=linphone_gtk_create_widget("conf_view","conf_frame"); GtkWidget *conf_box=linphone_gtk_get_widget(conf_frame,"conf_box"); GtkWidget *button_conf=linphone_gtk_get_widget(conf_frame,"terminate_conf"); GtkWidget *image=create_pixmap("stopcall-small.png"); @@ -94,7 +94,7 @@ static GtkWidget * create_conference_panel(void){ g_object_set_data(G_OBJECT(mw),"conf_frame",(gpointer)conf_frame); box=gtk_vbox_new(FALSE,0); - participant=linphone_gtk_create_widget("main","callee_frame"); + participant=linphone_gtk_create_widget("conf_callee_view","callee_frame"); gtk_widget_show(participant); gtk_box_set_homogeneous(GTK_BOX(box),TRUE); init_local_participant(participant); @@ -126,7 +126,7 @@ void linphone_gtk_set_in_conference(LinphoneCall *call){ const LinphoneAddress *addr=linphone_call_get_remote_address(call); gchar *markup; - participant=linphone_gtk_create_widget("main","callee_frame"); + participant=linphone_gtk_create_widget("conf_callee_view","callee_frame"); gtk_widget_show(participant); if (linphone_address_get_display_name(addr)!=NULL){ markup=g_strdup_printf("%s",linphone_address_get_display_name(addr)); diff --git a/gtk/in_call_view.ui b/gtk/in_call_view.ui new file mode 100644 index 000000000..4fd1c0045 --- /dev/null +++ b/gtk/in_call_view.ui @@ -0,0 +1,431 @@ + + + + + + False + + + False + cursor + 0.5 + none + + + True + False + 12 + 12 + + + True + False + + + True + False + center + + + True + True + 0 + + + + + True + False + + + + + + False + False + 1 + + + + + False + + + True + False + gtk-dialog-authentication + 1 + + + False + False + 0 + + + + + True + False + gtk-apply + + + False + False + 1 + + + + + True + False + + + True + True + 2 + 2 + + + + + Set verified + True + True + True + + + + False + False + 3 + + + + + False + True + 2 + + + + + True + False + + + True + False + + + True + True + True + True + none + False + vertical + linphone-micro-enabled + + + False + False + 5 + 0 + + + + + True + False + + + False + False + 5 + 1 + + + + + True + False + 10 + 0 + + + + + True + False + + + True + True + True + True + Click here to set the speakers volume + none + False + vertical + linphone-speaker-enabled + + + False + False + 5 + 0 + + + + + True + False + + + False + False + 5 + 1 + + + + + True + False + 10 + 1 + + + + + False + False + 5 + 3 + + + + + False + spread + + + Answer + True + True + True + + + + False + False + 0 + + + + + Decline + True + True + True + + + + False + False + 1 + + + + + False + False + 4 + + + + + False + + + gtk-media-record + True + True + True + Record this call to an audio file + True + + + + False + False + 0 + + + + + True + False + True + char + + + True + True + 1 + + + + + False + False + 5 + + + + + True + False + 2 + 3 + True + + + Video + True + True + True + + + + + Pause + True + True + True + + + + 1 + 2 + + + + + Mute + True + True + True + + + + 2 + 3 + + + + + Transfer + True + True + True + + + 1 + 2 + + + + + Hang up + True + True + True + + + + 1 + 2 + 1 + 2 + + + + + Conference + True + True + True + + + 2 + 3 + 1 + 2 + + + + + False + False + 7 + 6 + + + + + + + + + True + False + True + + + True + False + In call + True + center + + + True + True + 0 + + + + + True + False + Duration + center + + + True + True + 1 + + + + + 90 + 10 + True + False + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + Call quality rating + + + False + False + 2 + + + + + + + + diff --git a/gtk/incall_view.c b/gtk/incall_view.c index db056fdc8..ed9e17d14 100644 --- a/gtk/incall_view.c +++ b/gtk/incall_view.c @@ -361,7 +361,7 @@ void linphone_gtk_enable_video_button(LinphoneCall *call, gboolean sensitive, gb } void linphone_gtk_create_in_call_view(LinphoneCall *call){ - GtkWidget *call_view=linphone_gtk_create_widget("main","in_call_frame"); + GtkWidget *call_view=linphone_gtk_create_widget("in_call_view","in_call_frame"); GtkWidget *main_window=linphone_gtk_get_main_window (); GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch"); static int call_index=1; diff --git a/gtk/linphone.h b/gtk/linphone.h index 0193a8510..77636ca3a 100644 --- a/gtk/linphone.h +++ b/gtk/linphone.h @@ -99,7 +99,6 @@ LINPHONE_PUBLIC void linphone_gtk_destroy_window(GtkWidget *window); LINPHONE_PUBLIC GtkWidget *linphone_gtk_create_window(const char *window_name, GtkWidget *parent); LINPHONE_PUBLIC GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name); LINPHONE_PUBLIC GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name); -LINPHONE_PUBLIC GtkWidget *linphone_gtk_create_widget_2(const char *filename, const char *widget_name); const char *linphone_gtk_message_storage_get_db_file(const char *filename); LINPHONE_PUBLIC void linphone_gtk_show_assistant(GtkWidget* parent); diff --git a/gtk/main.c b/gtk/main.c index 18d01d95b..822f0f5f1 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -410,38 +410,7 @@ GtkWidget *linphone_gtk_create_window(const char *window_name, GtkWidget *parent return w; } -GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name){ - char path[2048]; - GtkWidget *w; - GtkBuilder* builder = gtk_builder_new (); - GError *error=NULL; - gchar *object_ids[2]; - object_ids[0]=g_strdup(widget_name); - object_ids[1]=NULL; - - if (get_ui_file(filename,path,sizeof(path))==-1) return NULL; - - gtk_builder_set_translation_domain(builder,GETTEXT_PACKAGE); - - if (!gtk_builder_add_objects_from_file(builder,path,object_ids,&error)){ - g_error("Couldn't load %s from builder file %s: %s", widget_name,path,error->message); - g_error_free (error); - g_free(object_ids[0]); - return NULL; - } - g_free(object_ids[0]); - w=GTK_WIDGET(gtk_builder_get_object (builder,widget_name)); - if (w==NULL){ - g_error("Could not retrieve '%s' window from xml file",widget_name); - return NULL; - } - g_object_set_data(G_OBJECT(w),"builder",builder); - g_signal_connect_swapped(G_OBJECT(w),"destroy",(GCallback)g_object_unref,builder); - gtk_builder_connect_signals(builder,w); - return w; -} - -GtkWidget *linphone_gtk_create_widget_2(const char *filename, const char *widget_name) { +GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name) { char path[2048]; GtkWidget *w = NULL; GtkBuilder *builder = gtk_builder_new(); @@ -467,6 +436,7 @@ GtkWidget *linphone_gtk_create_widget_2(const char *filename, const char *widget w = GTK_WIDGET(obj); g_object_set_data_full(obj, "builder", builder, g_object_unref); gtk_widget_unparent(w); + gtk_builder_connect_signals(builder, w); end: diff --git a/gtk/main.ui b/gtk/main.ui index 3f9d7fbe5..698fe2bf8 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -13,602 +13,6 @@ False gtk-connect - - False - - - True - False - 0 - none - - - True - False - 12 - - - True - False - 12 - - - True - False - - - True - False - - - True - True - - - False - False - 0 - - - - - False - True - 0 - - - - - True - False - <b>Callee name</b> - True - right - end - - - True - True - 1 - - - - - 90 - 30 - True - False - - - False - True - 2 - - - - - - - - - - - - - - - - False - - - True - False - 0 - none - - - True - False - - - True - False - - - End conference - True - True - True - - - False - False - end - 0 - - - - - True - True - end - 0 - - - - - True - False - - - gtk-media-record - True - True - True - True - - - - False - False - 0 - - - - - True - False - True - char - - - True - True - 1 - - - - - False - False - end - 1 - - - - - - - - - - - - False - - - False - cursor - 0.5 - none - - - True - False - 12 - 12 - - - True - False - - - True - False - center - - - True - True - 0 - - - - - True - False - - - - - - False - False - 1 - - - - - False - - - True - False - gtk-dialog-authentication - 1 - - - False - False - 0 - - - - - True - False - gtk-apply - - - False - False - 1 - - - - - True - False - - - True - True - 2 - 2 - - - - - Set verified - True - True - True - - - - False - False - 3 - - - - - False - True - 2 - - - - - True - False - - - True - False - - - True - True - True - True - none - False - vertical - linphone-micro-enabled - - - False - False - 5 - 0 - - - - - True - False - - - False - False - 5 - 1 - - - - - True - False - 10 - 0 - - - - - True - False - - - True - True - True - True - Click here to set the speakers volume - none - False - vertical - linphone-speaker-enabled - - - False - False - 5 - 0 - - - - - True - False - - - False - False - 5 - 1 - - - - - True - False - 10 - 1 - - - - - False - False - 5 - 3 - - - - - False - spread - - - Answer - True - True - True - - - - False - False - 0 - - - - - Decline - True - True - True - - - - False - False - 1 - - - - - False - False - 4 - - - - - False - - - gtk-media-record - True - True - True - Record this call to an audio file - True - - - - False - False - 0 - - - - - True - False - True - char - - - True - True - 1 - - - - - False - False - 5 - - - - - True - False - 2 - 3 - True - - - Video - True - True - True - - - - - Pause - True - True - True - - - - 1 - 2 - - - - - Mute - True - True - True - - - - 2 - 3 - - - - - Transfer - True - True - True - - - 1 - 2 - - - - - Hang up - True - True - True - - - - 1 - 2 - 1 - 2 - - - - - Conference - True - True - True - - - 2 - 3 - 1 - 2 - - - - - False - False - 7 - 6 - - - - - - - - - True - False - True - - - True - False - In call - True - center - - - True - True - 0 - - - - - True - False - Duration - center - - - True - True - 1 - - - - - 90 - 10 - True - False - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK - Call quality rating - - - False - False - 2 - - - - - - - True False