From d652965ce4b7d23d49516ea642a6ad51af8c0c1b Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Sun, 22 Dec 2013 21:37:09 +0100 Subject: [PATCH] Add wizard button in preferences only if it is enabled Changes the version of .ui for older gtk version Fix chat without message storage --- configure.ac | 2 +- gtk/call_statistics.ui | 2 +- gtk/chat.c | 14 ++++++++++---- gtk/keypad.ui | 2 +- gtk/main.c | 2 +- gtk/propertybox.c | 3 +++ 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index a35089e36..d44cda018 100644 --- a/configure.ac +++ b/configure.ac @@ -710,7 +710,7 @@ AC_ARG_ENABLE(msg-storage, AM_CONDITIONAL(BUILD_MSG_STORAGE, test x$enable_msg_storage = xtrue) if test x$enable_msg_storage != xfalse; then - PKG_CHECK_MODULES(SQLITE3,[ sqlite3 >= 3.7.0],[ + PKG_CHECK_MODULES(SQLITE3,[ sqlite3 >= 3.6.0],[ SQLITE3_CFLAGS+="-DMSG_STORAGE_ENABLED" AC_SUBST(SQLITE3_CFLAGS) AC_SUBST(SQLITE3_LIBS) diff --git a/gtk/call_statistics.ui b/gtk/call_statistics.ui index c6f71deb6..a647a8dca 100644 --- a/gtk/call_statistics.ui +++ b/gtk/call_statistics.ui @@ -1,6 +1,6 @@ - + False diff --git a/gtk/chat.c b/gtk/chat.c index bfb6529e8..b44605ae3 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -357,7 +357,7 @@ void linphone_gtk_chat_add_contact(const LinphoneAddress *addr){ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *with){ GtkWidget *chat_view=linphone_gtk_create_widget("main","chatroom_frame"); - GtkWidget *main_window=linphone_gtk_get_main_window (); + 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"); GdkColor color; @@ -375,7 +375,7 @@ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddres colorb.red = 56832; colorb.green = 60928; colorb.blue = 61952; - + with_str=linphone_address_as_string_uri_only(with); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text),GTK_WRAP_WORD_CHAR); gtk_text_view_set_editable(GTK_TEXT_VIEW(text),FALSE); @@ -468,9 +468,10 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room, gboolean send=TRUE; /*GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" );*/ const LinphoneAddress *from= linphone_chat_message_get_from ( msg ); - + w= ( GtkWidget* ) g_object_get_data ( G_OBJECT ( friendlist ),"chatview" ); if ( w!=NULL ) { + /* Chat window opened */ const LinphoneAddress *from_chatview=linphone_gtk_friend_list_get_active_address(); if (linphone_address_weak_equal(from,from_chatview)) { send=TRUE; @@ -480,8 +481,13 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room, } send=FALSE; } - } else { + } else { + /* Chat window closed */ +#ifdef MSG_STORAGE_ENABLED send=FALSE; +#else + send=TRUE; +#endif if ( !linphone_gtk_friend_list_is_contact ( linphone_chat_message_get_from ( msg ) ) ) { linphone_gtk_chat_add_contact ( linphone_chat_message_get_from ( msg ) ); } diff --git a/gtk/keypad.ui b/gtk/keypad.ui index 5dfcfc487..2dd62a0f0 100644 --- a/gtk/keypad.ui +++ b/gtk/keypad.ui @@ -1,6 +1,6 @@ - + False diff --git a/gtk/main.c b/gtk/main.c index a25b42523..135dfe5f4 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1591,7 +1591,7 @@ static void linphone_gtk_init_status_icon(){ const char *title; title=linphone_gtk_get_ui_config("title",_("Linphone - a video internet phone")); icon=gtk_status_icon_new_from_pixbuf(pbuf); -#if GTK_CHECK_VERSION(2,20,0) +#if GTK_CHECK_VERSION(2,20,2) gtk_status_icon_set_name(icon,title); #endif g_signal_connect_swapped(G_OBJECT(icon),"activate",(GCallback)handle_icon_click,NULL); diff --git a/gtk/propertybox.c b/gtk/propertybox.c index 57f3b0c4e..46a750ead 100644 --- a/gtk/propertybox.c +++ b/gtk/propertybox.c @@ -1400,6 +1400,9 @@ void linphone_gtk_show_parameters(void){ if (linphone_address_get_username(contact)) gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"username")),linphone_address_get_username(contact)); } +#ifdef BUILD_WIZARD + gtk_widget_show(linphone_gtk_get_widget(pb,"wizard")); +#endif linphone_address_destroy(contact); linphone_gtk_show_sip_accounts(pb); /* CODECS CONFIG */