From 11aa2e57cd475919c92173d80914749257bdfd6c Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Tue, 14 Aug 2007 22:57:59 +0000 Subject: [PATCH] 2007-08-14 [ticho] 2.10.0cvs123 * src/messageview.c * src/gtk/gtkutils.c Changed return receipt account selector to GtkComboBox. Fixed a runtime warning where GTK tried to parse "name 2.10.0cvs120.patchset ( cvs diff -u -r 1.25.2.20 -r 1.25.2.21 tools/Makefile.am; cvs diff -u -r 1.30.2.22 -r 1.30.2.23 tools/README; diff -u /dev/null tools/popfile-link.sh; ) > 2.10.0cvs121.patchset ( cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/prefs_logging.c; ) > 2.10.0cvs122.patchset +( cvs diff -u -r 1.94.2.144 -r 1.94.2.145 src/messageview.c; cvs diff -u -r 1.5.2.64 -r 1.5.2.65 src/gtk/gtkutils.c; ) > 2.10.0cvs123.patchset diff --git a/configure.ac b/configure.ac index dbe291438..cea924143 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=10 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=122 +EXTRA_VERSION=123 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c index 97832977f..9f3237029 100644 --- a/src/gtk/gtkutils.c +++ b/src/gtk/gtkutils.c @@ -36,6 +36,8 @@ #include #include +#include "combobox.h" + #if HAVE_LIBCOMPFACE # include #endif @@ -929,21 +931,22 @@ void label_window_destroy(GtkWidget *window) } GtkWidget *gtkut_account_menu_new(GList *ac_list, - GCallback callback, - gpointer data) + GCallback callback, + gpointer data) { GList *cur_ac; - GtkWidget *menu; + GtkWidget *optmenu; + GtkListStore *menu; + GtkTreeIter iter; + PrefsAccount *account; + gchar *name; g_return_val_if_fail(ac_list != NULL, NULL); - menu = gtk_menu_new(); + optmenu = gtkut_sc_combobox_create(NULL, FALSE); + menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu))); for (cur_ac = ac_list; cur_ac != NULL; cur_ac = cur_ac->next) { - gchar *name; - GtkWidget *menuitem; - PrefsAccount *account; - account = (PrefsAccount *) cur_ac->data; if (account->name) name = g_strdup_printf("%s: %s <%s>", @@ -954,13 +957,15 @@ GtkWidget *gtkut_account_menu_new(GList *ac_list, name = g_strdup_printf("%s: %s", account->account_name, account->address); - MENUITEM_ADD(menu, menuitem, name, account->account_id); + COMBOBOX_ADD_ESCAPED(menu, name, account->account_id); g_free(name); - if (callback != NULL) - g_signal_connect(G_OBJECT(menuitem), "activate", - callback, data); } - return menu; + gtk_combo_box_set_active(GTK_COMBO_BOX(optmenu), 0); + + if( callback != NULL ) + g_signal_connect(G_OBJECT(optmenu), "changed", callback, data); + + return optmenu; } void gtkut_set_widget_bgcolor_rgb(GtkWidget *widget, guint rgbvalue) diff --git a/src/messageview.c b/src/messageview.c index e11fdd6c5..c95c6d9a2 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -66,6 +66,7 @@ #include "uri_opener.h" #include "inc.h" #include "log.h" +#include "combobox.h" static GList *messageview_list = NULL; @@ -587,7 +588,7 @@ static gint disposition_notification_send(MsgInfo *msginfo) if (ok != 0) { AlertValue val; gchar *message; - message = g_strdup_printf( + message = g_markup_printf_escaped( _("The notification address to which the return receipt is\n" "to be sent does not correspond to the return path:\n" "Notification address: %s\n" @@ -1401,26 +1402,22 @@ static void partial_recv_unmark_clicked(NoticeView *noticeview, static void select_account_cb(GtkWidget *w, gpointer data) { - *(gint*)data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), MENU_VAL_ID)); + *(gint*)data = combobox_get_active_data(GTK_COMBO_BOX(w)); } - + static PrefsAccount *select_account_from_list(GList *ac_list) { GtkWidget *optmenu; - GtkWidget *menu; gint account_id; g_return_val_if_fail(ac_list != NULL, NULL); g_return_val_if_fail(ac_list->data != NULL, NULL); - optmenu = gtk_option_menu_new(); - menu = gtkut_account_menu_new(ac_list, - G_CALLBACK(select_account_cb), + optmenu = gtkut_account_menu_new(ac_list, + G_CALLBACK(select_account_cb), &account_id); - if (!menu) + if (!optmenu) return NULL; - gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); account_id = ((PrefsAccount *) ac_list->data)->account_id; if (alertpanel_with_widget( _("Return Receipt Notification"), -- 2.25.1