2007-08-03 [colin] 2.10.0cvs87
authorColin Leroy <colin@colino.net>
Fri, 3 Aug 2007 19:45:49 +0000 (19:45 +0000)
committerColin Leroy <colin@colino.net>
Fri, 3 Aug 2007 19:45:49 +0000 (19:45 +0000)
* src/prefs_account.c
* src/gtk/combobox.h
* src/gtk/gtkutils.c
Fix a deprecated widget. Patch by
Andrej

ChangeLog
PATCHSETS
configure.ac
src/gtk/combobox.h
src/gtk/gtkutils.c
src/prefs_account.c

index 1ac5ab19ee541a98076ccdf7979f24542216a685..772a58bbb065697e8e2ec7ae4f636a8bcb2a71e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-03 [colin]     2.10.0cvs87
+
+       * src/prefs_account.c
+       * src/gtk/combobox.h
+       * src/gtk/gtkutils.c
+               Fix a deprecated widget. Patch by
+               Andrej
+
 2007-08-03 [colin]     2.10.0cvs86
 
        * src/compose.c
index eb5f4fb7c5b1c407b88b7dba5045f5299814ba00..5385f415624d86cc607ef25c58ac0e74eadf0763 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.170 -r 1.207.2.171 src/folderview.c;  cvs diff -u -r 1.274.2.204 -r 1.274.2.205 src/mainwindow.c;  cvs diff -u -r 1.39.2.40 -r 1.39.2.41 src/mainwindow.h;  ) > 2.10.0cvs84.patchset
 ( cvs diff -u -r 1.79.2.57 -r 1.79.2.58 src/mh.c;  ) > 2.10.0cvs85.patchset
 ( cvs diff -u -r 1.382.2.397 -r 1.382.2.398 src/compose.c;  cvs diff -u -r 1.50.2.38 -r 1.50.2.39 src/compose.h;  cvs diff -u -r 1.213.2.152 -r 1.213.2.153 src/folder.c;  ) > 2.10.0cvs86.patchset
+( cvs diff -u -r 1.105.2.104 -r 1.105.2.105 src/prefs_account.c;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/gtk/combobox.h;  cvs diff -u -r 1.5.2.63 -r 1.5.2.64 src/gtk/gtkutils.c;  ) > 2.10.0cvs87.patchset
index ea942aa3613c9500dd3b3fc47d703f2ba1ea7f36..b80fcc4eaa940c485953ffe3b3f5011113ad5af2 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=86
+EXTRA_VERSION=87
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index d764a90b3ed038f15507420a81c7c849ec142320..c5c476d2953fa82a89208110ba1db9aca2a0e653 100644 (file)
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkcombobox.h>
 
+enum {
+       COMBOBOX_TEXT,
+       COMBOBOX_DATA,
+       COMBOBOX_SENS
+};
+
+
 #define COMBOBOX_ADD(menu, label, data)                 \
 {                                                               \
        gtk_list_store_append(menu, &iter); \
        gtk_list_store_set(menu, &iter, \
-                       0, (label ? label : ""), \
-                       1, data, \
+                       COMBOBOX_TEXT, (label ? label : ""), \
+                       COMBOBOX_DATA, data, \
+                       COMBOBOX_SENS, TRUE, \
                        -1); \
 }
 
@@ -38,8 +46,9 @@
        gchar *tmp_esc = g_markup_printf_escaped("%s", label);   \
        gtk_list_store_append(menu, &iter);                      \
        gtk_list_store_set(menu, &iter,                          \
-                       0, (tmp_esc ? tmp_esc : ""),             \
-                       1, data,                                 \
+                       COMBOBOX_TEXT, (tmp_esc ? tmp_esc : ""),                 \
+                       COMBOBOX_DATA, data,                             \
+                       COMBOBOX_SENS, TRUE,                             \
                        -1);                                     \
        g_free(tmp_esc);                                         \
 }
index 0e65e0d36b25a776868480b9c85534f0651ffca6..97832977f2539bfeaff66ca0caa7ffb7541e28bd 100644 (file)
@@ -61,6 +61,7 @@
 #include "manage_window.h"
 #include "base64.h"
 #include "manual.h"
+#include "combobox.h"
 
 gboolean gtkut_get_font_size(GtkWidget *widget,
                             gint *width, gint *height)
@@ -1384,14 +1385,15 @@ GtkWidget *gtkut_sc_combobox_create(GtkWidget *eventbox, gboolean focus_on_click
        GtkListStore *menu;
        GtkCellRenderer *rend;
 
-       menu = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
+       menu = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN);
 
        combobox = gtk_combo_box_new_with_model(GTK_TREE_MODEL(menu));
 
        rend = gtk_cell_renderer_text_new();
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combobox), rend, TRUE);
        gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combobox), rend,
-                       "markup", 0,
+                       "markup", COMBOBOX_TEXT,
+                       "sensitive", COMBOBOX_SENS,
                        NULL);
 
        if( eventbox != NULL )
index aa9a6126a6be6e63f9a4071790ad35d0d896d493..6a1d92088a2f02108700e8655d3bbade3b870349 100644 (file)
@@ -1578,8 +1578,8 @@ static void send_create_widget_func(PrefsPage * _page,
        GtkWidget *vbox3;
        GtkWidget *smtp_auth_checkbtn;
        GtkWidget *optmenu;
-       GtkWidget *optmenu_menu;
-       GtkWidget *menuitem;
+       GtkListStore *menu;
+       GtkTreeIter iter;
        GtkWidget *vbox4;
        GtkWidget *hbox_spc;
        GtkWidget *label;
@@ -1638,20 +1638,17 @@ static void send_create_widget_func(PrefsPage * _page,
        gtk_widget_show (label);
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
 
-       optmenu = gtk_option_menu_new ();
+       optmenu = gtkut_sc_combobox_create(NULL, FALSE);
+       menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu)));
        gtk_widget_show (optmenu);
        gtk_box_pack_start (GTK_BOX (hbox), optmenu, FALSE, FALSE, 0);
 
-       optmenu_menu = gtk_menu_new ();
-
-       MENUITEM_ADD (optmenu_menu, menuitem, _("Automatic"), 0);
-       MENUITEM_ADD (optmenu_menu, menuitem, "PLAIN", SMTPAUTH_PLAIN);
-       MENUITEM_ADD (optmenu_menu, menuitem, "LOGIN", SMTPAUTH_LOGIN);
-       MENUITEM_ADD (optmenu_menu, menuitem, "CRAM-MD5", SMTPAUTH_CRAM_MD5);
-       MENUITEM_ADD (optmenu_menu, menuitem, "DIGEST-MD5", SMTPAUTH_DIGEST_MD5);
-       gtk_widget_set_sensitive (menuitem, FALSE);
-
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
+       COMBOBOX_ADD (menu, _("Automatic"), 0);
+       COMBOBOX_ADD (menu, "PLAIN", SMTPAUTH_PLAIN);
+       COMBOBOX_ADD (menu, "LOGIN", SMTPAUTH_LOGIN);
+       COMBOBOX_ADD (menu, "CRAM-MD5", SMTPAUTH_CRAM_MD5);
+       COMBOBOX_ADD (menu, "DIGEST-MD5", SMTPAUTH_DIGEST_MD5);
+       gtk_list_store_set(menu, &iter, COMBOBOX_SENS, FALSE, -1);
 
        PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2);
 
@@ -3544,43 +3541,16 @@ static void prefs_account_imap_auth_type_set_optmenu(PrefParam *pparam)
 
 static void prefs_account_smtp_auth_type_set_data_from_optmenu(PrefParam *pparam)
 {
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       *((RecvProtocol *)pparam->data) = GPOINTER_TO_INT
-               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+       *((RecvProtocol *)pparam->data) =
+               combobox_get_active_data(GTK_COMBO_BOX(*pparam->widget));
 }
 
 static void prefs_account_smtp_auth_type_set_optmenu(PrefParam *pparam)
 {
        SMTPAuthType type = *((SMTPAuthType *)pparam->data);
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       switch (type) {
-       case SMTPAUTH_PLAIN:
-               gtk_option_menu_set_history(optmenu, 1);
-               break;
-       case SMTPAUTH_LOGIN:
-               gtk_option_menu_set_history(optmenu, 2);
-               break;
-       case SMTPAUTH_CRAM_MD5:
-               gtk_option_menu_set_history(optmenu, 3);
-               break;
-       case SMTPAUTH_DIGEST_MD5:
-               gtk_option_menu_set_history(optmenu, 4);
-               break;
-       case 0:
-       default:
-               gtk_option_menu_set_history(optmenu, 0);
-       }
+       GtkComboBox *optmenu = GTK_COMBO_BOX(*pparam->widget);
 
-       menu = gtk_option_menu_get_menu(optmenu);
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+       combobox_select_by_data(optmenu, type);
 }
 
 static void prefs_account_set_string_from_optmenu(PrefParam *pparam)