CVS: sylpheedclaws/sylpheed-claws/src expldifdlg.c,1.1.4.27,1.1.4.28 prefs_account.c,1.105.2.114,1.105.2.115 prefs_folder_item.c,1.52.2.53,1.52.2.54 prefs_spelling.c,1.5.2.34,1.5.2.35 prefs_themes.c,1.3.2.52,1.3.2.53 wizard.c,1.1.2.63,1.1.2.64
[email protected] Tue, 30 Oct 2007 08:04:21 +0000
| Newsgroups | gmane.mail.sylpheed.claws.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv25349/src
Modified Files:
Tag: gtk2
expldifdlg.c prefs_account.c prefs_folder_item.c
prefs_spelling.c prefs_themes.c wizard.c
Log Message:
2007-10-30 [paul] 3.0.2cvs107
* src/expldifdlg.c
* src/prefs_account.c
* src/prefs_folder_item.c
* src/prefs_spelling.c
* src/prefs_themes.c
* src/wizard.c
* src/gtk/gtkaspell.c
* src/gtk/gtkaspell.h
* src/plugins/spamassassin/spamassassin_gtk.c
replace deprecated gtk_option_menu...
patch by Pawel Pekala
Index: expldifdlg.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/expldifdlg.c,v
retrieving revision 1.1.4.27
retrieving revision 1.1.4.28
diff -u -d -r1.1.4.27 -r1.1.4.28
--- expldifdlg.c 2007/10/11 16:43:12 1.1.4.27
+++ expldifdlg.c 2007/10/30 08:04:14 1.1.4.28
@@ -47,6 +47,7 @@
#include "utils.h"
#include "manage_window.h"
#include "filesel.h"
+#include "combobox.h"
#define PAGE_FILE_INFO 0
#define PAGE_DN 1
@@ -219,7 +220,6 @@
gboolean retVal = FALSE;
gboolean errFlag = FALSE;
gchar *suffix;
- GtkWidget *menu, *menuItem;
gint id;
/* Set suffix */
@@ -227,9 +227,7 @@
g_strchug( suffix ); g_strchomp( suffix );
/* Set RDN format */
- menu = gtk_option_menu_get_menu( GTK_OPTION_MENU( expldif_dlg.optmenuRDN ) );
- menuItem = gtk_menu_get_active( GTK_MENU( menu ) );
- id = GPOINTER_TO_INT( g_object_get_data(G_OBJECT(menuItem), "user_data"));
+ id = combobox_get_active_data(GTK_COMBO_BOX(expldif_dlg.optmenuRDN));
exportldif_set_rdn( _exportCtl_, id );
exportldif_set_suffix( _exportCtl_, suffix );
@@ -426,6 +424,34 @@
expldif_dlg.entryLdif = entryLdif;
}
+static void export_ldif_relative_dn_changed(GtkWidget *widget, gpointer data)
+{
+ gint relativeDN = combobox_get_active_data(GTK_COMBO_BOX(widget));
+ GtkLabel *label = GTK_LABEL(data);
+
+ switch(relativeDN) {
+ case EXPORT_LDIF_ID_UID:
+ gtk_label_set_text(label,
+ _("The address book Unique ID is used to create a DN that is " \
+ "formatted similar to:\n" \
+ " uid=102376,ou=people,dc=claws-mail,dc=org"));
+ break;
+ case EXPORT_LDIF_ID_DNAME:
+ gtk_label_set_text(label,
+ _("The address book Display Name is used to create a DN that " \
+ "is formatted similar to:\n" \
+ " cn=John Doe,ou=people,dc=claws-mail,dc=org"));
+ break;
+ case EXPORT_LDIF_ID_EMAIL:
+ gtk_label_set_text(label,
+ _("The first Email Address belonging to a person is used to " \
+ "create a DN that is formatted similar to:\n" \
+ " [email protected],ou=people,dc=claws-mail,dc=org"));
+ break;
+ }
+
+}
+
/**
* Format notebook distinguished name page.
* \param pageNum Page (tab) number.
@@ -437,10 +463,11 @@
GtkWidget *label;
GtkWidget *entrySuffix;
GtkWidget *optmenuRDN;
+ GtkWidget *labelRDN;
GtkWidget *checkUseDN;
GtkWidget *checkEMail;
- GtkWidget *menu;
- GtkWidget *menuItem;
+ GtkListStore *store;
+ GtkTreeIter iter;
GtkTooltips *toolTip;
gint top;
@@ -456,7 +483,7 @@
GTK_NOTEBOOK( expldif_dlg.notebook ), pageNum ),
label );
- table = gtk_table_new( 5, 2, FALSE );
+ table = gtk_table_new( 6, 2, FALSE );
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
@@ -489,50 +516,13 @@
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
- menu = gtk_menu_new();
- menuItem = gtk_menu_item_new_with_label( _( "Unique ID" ) );
- g_object_set_data( G_OBJECT( menuItem ), "user_data",
- GINT_TO_POINTER( EXPORT_LDIF_ID_UID ) );
- gtk_menu_append( GTK_MENU(menu), menuItem );
- gtk_widget_show( menuItem );
- toolTip = gtk_tooltips_new();
- gtk_tooltips_set_tip(
- GTK_TOOLTIPS(toolTip), menuItem, _(
- "The address book Unique ID is used to create a DN that is " \
- "formatted similar to:\n" \
- " uid=102376,ou=people,dc=claws-mail,dc=org"
- ), NULL );
-
- menuItem = gtk_menu_item_new_with_label( _( "Display Name" ) );
- g_object_set_data( G_OBJECT( menuItem ), "user_data",
- GINT_TO_POINTER( EXPORT_LDIF_ID_DNAME ) );
- gtk_menu_append( GTK_MENU(menu), menuItem );
- gtk_widget_show( menuItem );
- toolTip = gtk_tooltips_new();
- gtk_tooltips_set_tip(
- GTK_TOOLTIPS(toolTip), menuItem, _(
- "The address book Display Name is used to create a DN that " \
- "is formatted similar to:\n" \
- " cn=John Doe,ou=people,dc=claws-mail,dc=org"
- ), NULL );
-
- menuItem = gtk_menu_item_new_with_label( _( "Email Address" ) );
- g_object_set_data( G_OBJECT( menuItem ), "user_data",
- GINT_TO_POINTER( EXPORT_LDIF_ID_EMAIL ) );
- gtk_menu_append( GTK_MENU(menu), menuItem );
- gtk_widget_show( menuItem );
- toolTip = gtk_tooltips_new();
- gtk_tooltips_set_tip(
- GTK_TOOLTIPS(toolTip), menuItem, _(
- "The first Email Address belonging to a person is used to " \
- "create a DN that is formatted similar to:\n" \
- " [email protected],ou=people,dc=claws-mail,dc=org"
- ), NULL );
-
- optmenuRDN = gtk_option_menu_new();
- gtk_option_menu_set_menu( GTK_OPTION_MENU( optmenuRDN ), menu );
+ optmenuRDN = gtkut_sc_combobox_create(NULL, TRUE);
+ store = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenuRDN)));
+
+ COMBOBOX_ADD(store, _("Unique ID"), EXPORT_LDIF_ID_UID);
+ COMBOBOX_ADD(store, _("Display Name"), EXPORT_LDIF_ID_DNAME);
+ COMBOBOX_ADD(store, _("Email Address"), EXPORT_LDIF_ID_EMAIL);
gtk_table_attach(GTK_TABLE(table), optmenuRDN, 1, 2, top, (top + 1),
GTK_FILL, 0, 0, 0);
@@ -549,8 +539,16 @@
"the available RDN options that will be used to " \
"create the DN."
), NULL );
-
- /* Third row */
+
+ /* Third row*/
+ top++;
+ labelRDN = gtk_label_new("");
+ gtk_label_set_line_wrap(GTK_LABEL(labelRDN), TRUE);
+ gtk_label_set_justify(GTK_LABEL(labelRDN), GTK_JUSTIFY_CENTER);
+ gtk_table_attach(GTK_TABLE(table), labelRDN, 0, 2, top, (top + 1),
+ GTK_FILL, 0, 0, 0);
+
+ /* Fourth row */
top++;
checkUseDN = gtk_check_button_new_with_label(
_( "Use DN attribute if present in data" ) );
@@ -568,7 +566,7 @@
"will be used if the DN user attribute is not found."
), NULL );
- /* Fourth row */
+ /* Fifth row */
top++;
checkEMail = gtk_check_button_new_with_label(
_( "Exclude record if no Email Address" ) );
@@ -586,6 +584,11 @@
gtk_widget_show_all(vbox);
+ g_signal_connect(G_OBJECT(optmenuRDN), "changed",
+ G_CALLBACK(export_ldif_relative_dn_changed), labelRDN);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(optmenuRDN), 0);
+
+
expldif_dlg.entrySuffix = entrySuffix;
expldif_dlg.optmenuRDN = optmenuRDN;
expldif_dlg.checkUseDN = checkUseDN;
@@ -754,8 +757,8 @@
ctl->suffix );
}
- gtk_option_menu_set_history(
- GTK_OPTION_MENU( expldif_dlg.optmenuRDN ), ctl->rdnIndex );
+ gtk_combo_box_set_active(
+ GTK_COMBO_BOX( expldif_dlg.optmenuRDN ), ctl->rdnIndex );
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON( expldif_dlg.checkUseDN ), ctl->useDN );
gtk_toggle_button_set_active(
Index: prefs_account.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/prefs_account.c,v
retrieving revision 1.105.2.114
retrieving revision 1.105.2.115
diff -u -d -r1.105.2.114 -r1.105.2.115
--- prefs_account.c 2007/10/18 09:50:54 1.105.2.114
+++ prefs_account.c 2007/10/30 08:04:14 1.105.2.115
@@ -180,9 +180,9 @@
GtkWidget *autoreplyto_entry;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary;
- GtkWidget *optmenu_default_dictionary;
+ GtkWidget *combo_default_dictionary;
GtkWidget *checkbtn_enable_default_alt_dictionary;
- GtkWidget *optmenu_default_alt_dictionary;
+ GtkWidget *combo_default_alt_dictionary;
#endif
} ComposePage;
@@ -548,7 +548,7 @@
prefs_set_data_from_toggle, prefs_set_toggle},
{"default_dictionary", NULL, &tmp_ac_prefs.default_dictionary, P_STRING,
- &compose_page.optmenu_default_dictionary,
+ &compose_page.combo_default_dictionary,
prefs_account_compose_default_dictionary_set_string_from_optmenu,
prefs_account_compose_default_dictionary_set_optmenu_from_string},
@@ -557,7 +557,7 @@
prefs_set_data_from_toggle, prefs_set_toggle},
{"default_alt_dictionary", NULL, &tmp_ac_prefs.default_alt_dictionary, P_STRING,
- &compose_page.optmenu_default_alt_dictionary,
+ &compose_page.combo_default_alt_dictionary,
prefs_account_compose_default_dictionary_set_string_from_optmenu,
prefs_account_compose_default_dictionary_set_optmenu_from_string},
#else
@@ -1802,9 +1802,9 @@
GtkWidget *frame_dict;
GtkWidget *table_dict;
GtkWidget *checkbtn_enable_default_dictionary = NULL;
- GtkWidget *optmenu_default_dictionary = NULL;
+ GtkWidget *combo_default_dictionary = NULL;
GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
- GtkWidget *optmenu_default_alt_dictionary = NULL;
+ GtkWidget *combo_default_alt_dictionary = NULL;
#endif
vbox1 = gtk_vbox_new (FALSE, VSPACING);
@@ -1942,15 +1942,12 @@
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
tmp_ac_prefs.enable_default_dictionary);
- optmenu_default_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table_dict), optmenu_default_dictionary, 1, 2,
+ combo_default_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, TRUE);
+ gtk_table_attach(GTK_TABLE(table_dict), combo_default_dictionary, 1, 2,
0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_dictionary),
- gtkaspell_dictionary_option_menu_new(
- prefs_common.aspell_path));
-
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, optmenu_default_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, combo_default_dictionary);
/* Default dictionary */
checkbtn_enable_default_alt_dictionary = gtk_check_button_new_with_label(_("Default alternate dictionary"));
@@ -1959,15 +1956,12 @@
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
tmp_ac_prefs.enable_default_alt_dictionary);
- optmenu_default_alt_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table_dict), optmenu_default_alt_dictionary, 1, 2,
+ combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, FALSE);
+ gtk_table_attach(GTK_TABLE(table_dict), combo_default_alt_dictionary, 1, 2,
1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_alt_dictionary),
- gtkaspell_dictionary_option_menu_new_with_refresh(
- prefs_common.aspell_path, FALSE));
-
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, optmenu_default_alt_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, combo_default_alt_dictionary);
gtk_widget_show_all(table_dict);
#endif
@@ -1985,22 +1979,19 @@
page->autoreplyto_entry = autoreplyto_entry;
#ifdef USE_ASPELL
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
- page->optmenu_default_dictionary = optmenu_default_dictionary;
+ page->combo_default_dictionary = combo_default_dictionary;
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
- page->optmenu_default_alt_dictionary = optmenu_default_alt_dictionary;
+ page->combo_default_alt_dictionary = combo_default_alt_dictionary;
#endif
#ifdef USE_ASPELL
/* reset gtkaspell menus */
- if (compose_page.optmenu_default_dictionary != NULL) {
- gtk_option_menu_remove_menu(GTK_OPTION_MENU(compose_page.optmenu_default_dictionary));
- gtk_option_menu_set_menu(GTK_OPTION_MENU(compose_page.optmenu_default_dictionary),
- gtkaspell_dictionary_option_menu_new(
- prefs_common.aspell_path));
- gtk_option_menu_remove_menu(GTK_OPTION_MENU(compose_page.optmenu_default_alt_dictionary));
- gtk_option_menu_set_menu(GTK_OPTION_MENU(compose_page.optmenu_default_alt_dictionary),
- gtkaspell_dictionary_option_menu_new_with_refresh(
- prefs_common.aspell_path, FALSE));
+ if (compose_page.combo_default_dictionary != NULL) {
+ gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_dictionary),
+ gtkaspell_dictionary_store_new(prefs_common.aspell_path));
+ gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_alt_dictionary),
+ gtkaspell_dictionary_store_new_with_refresh(
+ prefs_common.aspell_path, FALSE));
}
#endif
@@ -4230,28 +4221,22 @@
static void prefs_account_compose_default_dictionary_set_string_from_optmenu
(PrefParam *pparam)
{
- GtkWidget *menu;
- GtkWidget *menuitem;
+ GtkWidget *combo;
gchar **str;
g_return_if_fail(*pparam->widget != NULL);
-
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- if (menuitem == NULL)
- return;
+ combo = *pparam->widget;
str = (gchar **) pparam->data;
+
g_free(*str);
- *str = gtkaspell_get_dictionary_menu_active_item(menu);
+ *str = gtkaspell_get_dictionary_menu_active_item(GTK_COMBO_BOX(combo));
}
static void prefs_account_compose_default_dictionary_set_optmenu_from_string
(PrefParam *pparam)
{
- GtkWidget *optionmenu;
- GtkWidget *menu;
- GtkWidget *menuitem;
+ GtkWidget *combo;
gchar *dictionary;
g_return_if_fail(*pparam->widget != NULL);
@@ -4260,12 +4245,10 @@
if (dictionary == NULL)
return;
- optionmenu = *pparam->widget;
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optionmenu));
+ combo = *pparam->widget;
if (dictionary)
- gtkaspell_set_dictionary_menu_active_item(optionmenu, dictionary);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(combo),
+ dictionary);
}
#endif
Index: prefs_folder_item.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/prefs_folder_item.c,v
retrieving revision 1.52.2.53
retrieving revision 1.52.2.54
diff -u -d -r1.52.2.53 -r1.52.2.54
--- prefs_folder_item.c 2007/10/15 17:19:35 1.52.2.53
+++ prefs_folder_item.c 2007/10/30 08:04:15 1.52.2.54
@@ -123,8 +123,8 @@
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary;
GtkWidget *checkbtn_enable_default_alt_dictionary;
- GtkWidget *optmenu_default_dictionary;
- GtkWidget *optmenu_default_alt_dictionary;
+ GtkWidget *combo_default_dictionary;
+ GtkWidget *combo_default_alt_dictionary;
#endif
/* apply to sub folders */
@@ -716,15 +716,12 @@
GtkTreeIter iter;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary = NULL;
- GtkWidget *optmenu_default_dictionary = NULL;
+ GtkWidget *combo_default_dictionary = NULL;
GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
- GtkWidget *optmenu_default_alt_dictionary = NULL;
+ GtkWidget *combo_default_alt_dictionary = NULL;
GtkWidget *default_dictionary_rec_checkbtn = NULL;
GtkWidget *default_alt_dictionary_rec_checkbtn = NULL;
gchar *dictionary;
- GtkOptionMenu *optmenu;
- GtkWidget *menu;
- GtkWidget *menuitem;
#endif
GtkWidget *request_return_receipt_rec_checkbtn = NULL;
GtkWidget *save_copy_to_folder_rec_checkbtn = NULL;
@@ -901,25 +898,17 @@
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
item->prefs->enable_default_dictionary);
- optmenu_default_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table), optmenu_default_dictionary, 1, 2,
+ combo_default_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, TRUE);
+ gtk_table_attach(GTK_TABLE(table), combo_default_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_dictionary),
- gtkaspell_dictionary_option_menu_new(
- prefs_common.aspell_path));
-
dictionary = item->prefs->default_dictionary;
-
- optmenu = GTK_OPTION_MENU(optmenu_default_dictionary);
-
- menu = gtk_option_menu_get_menu(optmenu);
if (dictionary)
- gtkaspell_set_dictionary_menu_active_item(optmenu_default_dictionary, dictionary);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ gtkaspell_set_dictionary_menu_active_item(
+ GTK_COMBO_BOX(combo_default_dictionary), dictionary);
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, optmenu_default_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, combo_default_dictionary);
default_dictionary_rec_checkbtn = gtk_check_button_new();
gtk_table_attach(GTK_TABLE(table), default_dictionary_rec_checkbtn, 2, 3,
@@ -934,25 +923,17 @@
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
item->prefs->enable_default_alt_dictionary);
- optmenu_default_alt_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table), optmenu_default_alt_dictionary, 1, 2,
+ combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, FALSE);
+ gtk_table_attach(GTK_TABLE(table), combo_default_alt_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_alt_dictionary),
- gtkaspell_dictionary_option_menu_new_with_refresh(
- prefs_common.aspell_path, FALSE));
-
dictionary = item->prefs->default_alt_dictionary;
-
- optmenu = GTK_OPTION_MENU(optmenu_default_alt_dictionary);
-
- menu = gtk_option_menu_get_menu(optmenu);
if (dictionary)
- gtkaspell_set_dictionary_menu_active_item(optmenu_default_alt_dictionary, dictionary);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ gtkaspell_set_dictionary_menu_active_item(
+ GTK_COMBO_BOX(combo_default_alt_dictionary), dictionary);
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, optmenu_default_alt_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, combo_default_alt_dictionary);
default_alt_dictionary_rec_checkbtn = gtk_check_button_new();
gtk_table_attach(GTK_TABLE(table), default_alt_dictionary_rec_checkbtn, 2, 3,
@@ -976,9 +957,9 @@
page->optmenu_default_account = optmenu_default_account;
#ifdef USE_ASPELL
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
- page->optmenu_default_dictionary = optmenu_default_dictionary;
+ page->combo_default_dictionary = combo_default_dictionary;
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
- page->optmenu_default_alt_dictionary = optmenu_default_alt_dictionary;
+ page->combo_default_alt_dictionary = combo_default_alt_dictionary;
#endif
page->request_return_receipt_rec_checkbtn = request_return_receipt_rec_checkbtn;
@@ -1015,9 +996,7 @@
static void compose_save_folder_prefs(FolderItem *folder, FolderItemComposePage *page)
{
FolderItemPrefs *prefs = folder->prefs;
-#if USE_ASPELL
- GtkWidget *menu;
-#endif
+
gboolean all = FALSE;
if (folder->path == NULL)
@@ -1075,16 +1054,16 @@
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn))) {
prefs->enable_default_dictionary =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_dictionary));
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_default_dictionary));
ASSIGN_STRING(prefs->default_dictionary,
- gtkaspell_get_dictionary_menu_active_item(menu));
+ gtkaspell_get_dictionary_menu_active_item(
+ GTK_COMBO_BOX(page->combo_default_dictionary)));
}
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn))) {
prefs->enable_default_alt_dictionary =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_alt_dictionary));
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_default_alt_dictionary));
ASSIGN_STRING(prefs->default_alt_dictionary,
- gtkaspell_get_dictionary_menu_active_item(menu));
+ gtkaspell_get_dictionary_menu_active_item(
+ GTK_COMBO_BOX(page->combo_default_alt_dictionary)));
}
#endif
Index: prefs_spelling.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/prefs_spelling.c,v
retrieving revision 1.5.2.34
retrieving revision 1.5.2.35
diff -u -d -r1.5.2.34 -r1.5.2.35
--- prefs_spelling.c 2007/07/11 16:33:52 1.5.2.34
+++ prefs_spelling.c 2007/10/30 08:04:16 1.5.2.35
@@ -40,6 +40,7 @@
#include "gtk/prefswindow.h"
#include "gtk/filesel.h"
#include "gtk/colorsel.h"
+#include "gtk/combobox.h"
typedef struct _SpellingPage
{
@@ -60,18 +61,15 @@
GtkWidget *aspell_path_select;
GtkWidget *default_dict_label;
- GtkWidget *default_dict_optmenu;
- GtkWidget *default_dict_optmenu_menu;
+ GtkWidget *default_dict_combo;
GtkWidget *default_alt_dict_label;
- GtkWidget *default_alt_dict_optmenu;
- GtkWidget *default_alt_dict_optmenu_menu;
+ GtkWidget *default_alt_dict_combo;
GtkWidget *both_dict_check;
GtkWidget *sugmode_label;
- GtkWidget *sugmode_optmenu;
- GtkWidget *sugmode_optmenu_menu;
+ GtkWidget *sugmode_combo;
GtkWidget *misspelled_label;
GtkWidget *misspelled_colorbtn;
@@ -85,8 +83,6 @@
{
SpellingPage *spelling = (SpellingPage *) data;
gchar *file_path;
- GtkWidget *new_menu;
- GtkWidget *alt_new_menu;
file_path = filesel_select_file_open(_("Select dictionaries location"),
prefs_common.aspell_path);
@@ -97,20 +93,18 @@
tmp = g_strdup_printf("%s%s", tmp_path, G_DIR_SEPARATOR_S);
g_free(tmp_path);
- new_menu = gtkaspell_dictionary_option_menu_new(tmp);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling->default_dict_optmenu),
- new_menu);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(spelling->default_dict_combo),
+ gtkaspell_dictionary_store_new(tmp));
- alt_new_menu = gtkaspell_dictionary_option_menu_new_with_refresh(tmp, FALSE);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling->default_alt_dict_optmenu),
- alt_new_menu);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(spelling->default_alt_dict_combo),
+ gtkaspell_dictionary_store_new_with_refresh(tmp, FALSE));
gtk_entry_set_text(GTK_ENTRY(spelling->aspell_path_entry), tmp);
/* select first one */
- gtk_option_menu_set_history(GTK_OPTION_MENU(
- spelling->default_dict_optmenu), 0);
- gtk_option_menu_set_history(GTK_OPTION_MENU(
- spelling->default_alt_dict_optmenu), 0);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(
+ spelling->default_dict_combo), 0);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(
+ spelling->default_alt_dict_combo), 0);
g_free(tmp);
@@ -154,16 +148,13 @@
GtkWidget *table;
GtkWidget *default_dict_label;
- GtkWidget *default_dict_optmenu;
- GtkWidget *default_dict_optmenu_menu;
+ GtkWidget *default_dict_combo;
GtkWidget *default_alt_dict_label;
- GtkWidget *default_alt_dict_optmenu;
- GtkWidget *default_alt_dict_optmenu_menu;
+ GtkWidget *default_alt_dict_combo;
GtkWidget *sugmode_label;
- GtkWidget *sugmode_optmenu;
- GtkWidget *sugmode_optmenu_menu;
+ GtkWidget *sugmode_combo;
GtkWidget *both_dict_check;
GtkWidget *misspelled_label;
@@ -238,16 +229,12 @@
gtk_label_set_justify(GTK_LABEL(default_dict_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(default_dict_label), 1, 0.5);
- default_dict_optmenu = gtk_option_menu_new();
- gtk_widget_show(default_dict_optmenu);
- gtk_widget_set_size_request(default_dict_optmenu, 180, -1);
- gtk_table_attach (GTK_TABLE (table), default_dict_optmenu, 1, 2, 0, 1,
+ default_dict_combo = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, TRUE);
+ gtk_widget_set_size_request(default_dict_combo, 180, -1);
+ gtk_table_attach (GTK_TABLE (table), default_dict_combo, 1, 2, 0, 1,
GTK_SHRINK, 0, 0, 0);
- default_dict_optmenu_menu = gtk_menu_new();
- gtk_option_menu_set_menu(GTK_OPTION_MENU(default_dict_optmenu),
- default_dict_optmenu_menu);
-
default_alt_dict_label = gtk_label_new(_("Default alternate dictionary"));
gtk_widget_show(default_alt_dict_label);
gtk_table_attach(GTK_TABLE (table), default_alt_dict_label, 0, 1, 1, 2,
@@ -256,23 +243,18 @@
gtk_label_set_justify(GTK_LABEL(default_alt_dict_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(default_alt_dict_label), 1, 0.5);
- default_alt_dict_optmenu = gtk_option_menu_new();
- gtk_widget_show(default_alt_dict_optmenu);
- gtk_widget_set_size_request(default_alt_dict_optmenu, 180, -1);
- gtk_table_attach (GTK_TABLE (table), default_alt_dict_optmenu, 1, 2, 1, 2,
+ default_alt_dict_combo = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, FALSE);
+ gtk_widget_set_size_request(default_alt_dict_combo, 180, -1);
+ gtk_table_attach (GTK_TABLE (table), default_alt_dict_combo, 1, 2, 1, 2,
GTK_SHRINK, 0, 0, 0);
- default_alt_dict_optmenu_menu = gtk_menu_new();
- gtk_option_menu_set_menu(GTK_OPTION_MENU(default_alt_dict_optmenu),
- default_alt_dict_optmenu_menu);
-
both_dict_check = gtk_check_button_new_with_label(
_("Check with both dictionaries"));
gtk_widget_show(both_dict_check);
gtk_table_attach (GTK_TABLE (table), both_dict_check, 1, 2, 2, 3,
GTK_SHRINK, 0, 0, 0);
-
sugmode_label = gtk_label_new(_("Default suggestion mode"));
gtk_widget_show(sugmode_label);
gtk_table_attach(GTK_TABLE (table), sugmode_label, 0, 1, 3, 4,
@@ -281,16 +263,11 @@
gtk_label_set_justify(GTK_LABEL(sugmode_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1, 0.5);
- sugmode_optmenu = gtk_option_menu_new();
- gtk_widget_show(sugmode_optmenu);
- gtk_widget_set_size_request(sugmode_optmenu, 180, -1);
- gtk_table_attach (GTK_TABLE (table), sugmode_optmenu, 1, 2, 3, 4,
+ sugmode_combo = gtkaspell_sugmode_combo_new(prefs_common.aspell_sugmode);
+ gtk_widget_set_size_request(sugmode_combo, 180, -1);
+ gtk_table_attach (GTK_TABLE (table), sugmode_combo, 1, 2, 3, 4,
GTK_SHRINK, 0, 0, 0);
- sugmode_optmenu_menu = gtk_menu_new();
- gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
- sugmode_optmenu_menu);
-
misspelled_hbox = gtk_hbox_new(FALSE, 10);
gtk_widget_show(misspelled_hbox);
gtk_box_pack_start(GTK_BOX(vbox1), misspelled_hbox, FALSE, FALSE, 0);
@@ -319,7 +296,7 @@
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, misspelled_colorbtn);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, use_alternate_checkbtn);
SET_TOGGLE_SENSITIVITY(use_alternate_checkbtn, default_alt_dict_label);
- SET_TOGGLE_SENSITIVITY(use_alternate_checkbtn, default_alt_dict_optmenu);
+ SET_TOGGLE_SENSITIVITY(use_alternate_checkbtn, default_alt_dict_combo);
SET_TOGGLE_SENSITIVITY(use_alternate_checkbtn, both_dict_check);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable_aspell_checkbtn),
@@ -337,17 +314,12 @@
g_signal_connect(G_OBJECT(aspell_path_select), "clicked",
G_CALLBACK(prefs_spelling_btn_aspell_path_clicked_cb),
prefs_spelling);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(default_dict_optmenu),
- gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path));
- gtkaspell_set_dictionary_menu_active_item(default_dict_optmenu, prefs_common.dictionary);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(default_alt_dict_optmenu),
- gtkaspell_dictionary_option_menu_new_with_refresh(prefs_common.aspell_path, FALSE));
- gtkaspell_set_dictionary_menu_active_item(default_alt_dict_optmenu, prefs_common.alt_dictionary);
+ gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(default_dict_combo),
+ prefs_common.dictionary);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
- gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
- gtkaspell_sugmode_option_menu_set(GTK_OPTION_MENU(sugmode_optmenu),
- prefs_common.aspell_sugmode);
+ gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(default_alt_dict_combo),
+ prefs_common.alt_dictionary);
+
g_signal_connect(G_OBJECT(misspelled_colorbtn), "clicked",
G_CALLBACK(prefs_spelling_colorsel), prefs_spelling);
@@ -367,16 +339,11 @@
prefs_spelling->aspell_path_entry = aspell_path_entry;
prefs_spelling->aspell_path_select = aspell_path_select;
prefs_spelling->default_dict_label = default_dict_label;
- prefs_spelling->default_dict_optmenu = default_dict_optmenu;
- prefs_spelling->default_dict_optmenu_menu
- = default_dict_optmenu_menu;
+ prefs_spelling->default_dict_combo = default_dict_combo;
prefs_spelling->default_alt_dict_label = default_alt_dict_label;
- prefs_spelling->default_alt_dict_optmenu = default_alt_dict_optmenu;
- prefs_spelling->default_alt_dict_optmenu_menu
- = default_alt_dict_optmenu_menu;
+ prefs_spelling->default_alt_dict_combo = default_alt_dict_combo;
prefs_spelling->sugmode_label = sugmode_label;
- prefs_spelling->sugmode_optmenu = sugmode_optmenu;
- prefs_spelling->sugmode_optmenu_menu = sugmode_optmenu_menu;
+ prefs_spelling->sugmode_combo = sugmode_combo;
prefs_spelling->misspelled_label = misspelled_label;
prefs_spelling->misspelled_colorbtn = misspelled_colorbtn;
prefs_spelling->both_dict_check = both_dict_check;
@@ -406,20 +373,15 @@
g_free(prefs_common.dictionary);
prefs_common.dictionary =
gtkaspell_get_dictionary_menu_active_item(
- gtk_option_menu_get_menu(
- GTK_OPTION_MENU(
- spelling->default_dict_optmenu)));
+ GTK_COMBO_BOX(spelling->default_dict_combo));
g_free(prefs_common.alt_dictionary);
prefs_common.alt_dictionary =
gtkaspell_get_dictionary_menu_active_item(
- gtk_option_menu_get_menu(
- GTK_OPTION_MENU(
- spelling->default_alt_dict_optmenu)));
+ GTK_COMBO_BOX(spelling->default_alt_dict_combo));
prefs_common.aspell_sugmode =
- gtkaspell_get_sugmode_from_option_menu(
- GTK_OPTION_MENU(spelling->sugmode_optmenu));
+ combobox_get_active_data(GTK_COMBO_BOX(spelling->sugmode_combo));
prefs_common.misspelled_col = spelling->misspell_col;
}
Index: prefs_themes.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/prefs_themes.c,v
retrieving revision 1.3.2.52
retrieving revision 1.3.2.53
diff -u -d -r1.3.2.52 -r1.3.2.53
--- prefs_themes.c 2007/10/11 16:43:16 1.3.2.52
+++ prefs_themes.c 2007/10/30 08:04:16 1.3.2.53
@@ -141,7 +141,7 @@
static int prefs_themes_cmp_name(gconstpointer a, gconstpointer b);
static void prefs_themes_free_names (ThemesData *tdata);
-static void prefs_themes_set_themes_menu (GtkOptionMenu *opmenu, const ThemesData *tdata);
+static void prefs_themes_set_themes_menu (GtkComboBox *combo, const ThemesData *tdata);
static gchar *prefs_themes_get_theme_stats (const gchar *dirname);
static gboolean prefs_themes_is_system_theme (const gchar *dirname);
@@ -262,43 +262,40 @@
return FALSE;
}
-static void prefs_themes_set_themes_menu(GtkOptionMenu *opmenu, const ThemesData *tdata)
+static void prefs_themes_set_themes_menu(GtkComboBox *combo, const ThemesData *tdata)
{
+ GtkListStore *store;
+ GtkTreeIter iter;
GList *themes = tdata->names;
- GtkWidget *menu;
- GtkWidget *item;
gint i = 0, active = 0;
GList *sorted_list = NULL;
-
- g_return_if_fail(opmenu != NULL);
- gtk_option_menu_remove_menu(opmenu);
+ g_return_if_fail(combo != NULL);
/* sort theme data list by data name */
- menu = gtk_menu_new ();
while (themes != NULL) {
ThemeName *tname = (ThemeName *)(themes->data);
sorted_list = g_list_insert_sorted(sorted_list, (gpointer)(tname),
- (GCompareFunc)prefs_themes_cmp_name);
+ (GCompareFunc)prefs_themes_cmp_name);
themes = g_list_next(themes);
}
+ store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+
/* feed gtk_menu w/ sorted themes names */
themes = sorted_list;
while (themes != NULL) {
ThemeName *tname = (ThemeName *)(themes->data);
gchar *tpath = (gchar *)(tname->item->data);
- item = gtk_menu_item_new_with_label(tname->name);
- gtk_widget_show(item);
- g_signal_connect(G_OBJECT(item), "activate",
- G_CALLBACK(prefs_themes_menu_item_activated_cb),
- tname->item->data);
- gtk_menu_append(GTK_MENU(menu), item);
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set(store, &iter,
+ 0, tname->name,
+ 1, tname->item->data, -1);
- if (tdata->displayed != NULL && tdata->displayed == tpath)
+ if (tdata->displayed != NULL && !strcmp2(tdata->displayed,tpath))
active = i;
++i;
@@ -307,8 +304,12 @@
g_list_free(sorted_list);
- gtk_menu_set_active(GTK_MENU(menu), active);
- gtk_option_menu_set_menu (opmenu, menu);
+ g_signal_connect(G_OBJECT(combo), "changed",
+ G_CALLBACK(prefs_themes_menu_item_activated_cb),
+ NULL);
+
+ gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
+ gtk_combo_box_set_active(combo, active);
}
static int prefs_themes_cmp_name(gconstpointer a_p, gconstpointer b_p)
@@ -410,7 +411,7 @@
debug_print("Finished preferences for themes.\n");
stock_pixmap_themes_list_free(tdata->themes);
- prefs_themes_free_names(tdata);
+ prefs_themes_free_names(tdata);
g_free(tdata->page);
g_free(tdata);
}
@@ -422,7 +423,7 @@
theme_str = tdata->displayed;
- g_free(prefs_common.pixmap_theme_path);
+ g_free(prefs_common.pixmap_theme_path);
prefs_common.pixmap_theme_path = g_strdup(theme_str);
@@ -478,7 +479,7 @@
alertpanel_notice(_("Theme removed successfully"));
/* update interface back to first theme */
prefs_themes_get_themes_and_names(tdata);
- prefs_themes_set_themes_menu(GTK_OPTION_MENU(tdata->page->op_menu), tdata);
+ prefs_themes_set_themes_menu(GTK_COMBO_BOX(tdata->page->op_menu), tdata);
prefs_themes_display_global_stats(tdata);
tdata->displayed = (gchar *)((g_list_first(tdata->themes))->data);
prefs_themes_get_theme_info(tdata);
@@ -560,7 +561,7 @@
if (NULL != insted) {
alertpanel_notice(_("Theme installed successfully"));
tdata->displayed = (gchar *)(insted->data);
- prefs_themes_set_themes_menu(GTK_OPTION_MENU(tdata->page->op_menu), tdata);
+ prefs_themes_set_themes_menu(GTK_COMBO_BOX(tdata->page->op_menu), tdata);
prefs_themes_display_global_stats(tdata);
prefs_themes_get_theme_info(tdata);
}
@@ -581,10 +582,15 @@
static void prefs_themes_menu_item_activated_cb(GtkWidget *widget, gpointer data)
{
ThemesData *tdata = prefs_themes_data;
- gchar *path = (gchar *)data;
+ gchar *path;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
- g_return_if_fail(path != NULL);
+ g_return_if_fail(gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter));
+ model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget));
+ gtk_tree_model_get(model, &iter, 1, &path, -1);
+
tdata->displayed = path;
prefs_themes_get_theme_info(tdata);
}
@@ -805,8 +811,6 @@
GtkWidget *vbox2;
GtkWidget *hbox3;
GtkWidget *menu_themes;
- GtkWidget *menu_themes_menu;
- GtkWidget *glade_menuitem;
GtkWidget *btn_install;
GtkWidget *btn_more;
GtkWidget *label_global_status;
@@ -833,6 +837,7 @@
GtkWidget *hbuttonbox1;
GtkWidget *btn_use;
GtkWidget *btn_remove;
+ GtkCellRenderer *renderer;
vbox1 = gtk_vbox_new (FALSE, VSPACING);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -845,14 +850,9 @@
gtk_box_pack_start (GTK_BOX (vbox2), hbox3, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox3), 5);
- menu_themes = gtk_option_menu_new ();
+ menu_themes = gtk_combo_box_new();
gtk_widget_show (menu_themes);
gtk_box_pack_start (GTK_BOX (hbox3), menu_themes, FALSE, FALSE, 0);
- menu_themes_menu = gtk_menu_new ();
- glade_menuitem = gtk_menu_item_new_with_label ("");
- gtk_widget_show (glade_menuitem);
- gtk_menu_append (GTK_MENU (menu_themes_menu), glade_menuitem);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (menu_themes), menu_themes_menu);
btn_install = gtk_button_new_with_label (_("Install new..."));
gtk_widget_show (btn_install);
@@ -1028,8 +1028,12 @@
prefs_themes->op_menu = menu_themes;
prefs_themes->page.widget = vbox1;
-
- prefs_themes_set_themes_menu(GTK_OPTION_MENU(prefs_themes->op_menu), tdata);
+
+ prefs_themes_set_themes_menu(GTK_COMBO_BOX(menu_themes), tdata);
+ renderer = gtk_cell_renderer_text_new();
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(menu_themes), renderer, TRUE);
+ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(menu_themes), renderer,
+ "text", 0, NULL);
prefs_themes_get_theme_info(tdata);
prefs_themes_display_global_stats(tdata);
Index: wizard.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/Attic/wizard.c,v
retrieving revision 1.1.2.63
retrieving revision 1.1.2.64
diff -u -d -r1.1.2.63 -r1.1.2.64
--- wizard.c 2007/10/18 07:12:49 1.1.2.63
+++ wizard.c 2007/10/30 08:04:16 1.1.2.64
@@ -61,6 +61,7 @@
#include "ssl.h"
#endif
#include "prefs_common.h"
+#include "combobox.h"
#ifdef MAEMO
#include <libgnomevfs/gnome-vfs-volume.h>
@@ -571,18 +572,14 @@
static gboolean mailbox_ok = FALSE;
PrefsAccount *prefs_account = prefs_account_new();
GList *account_list = NULL;
- GtkWidget *menu, *menuitem;
gchar *smtp_server, *recv_server;
gint smtp_port, recv_port;
#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
SSLType smtp_ssl_type, recv_ssl_type;
#endif
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(wizard->recv_type));
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- prefs_account->protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-
+ prefs_account->protocol = combobox_get_active_data(
+ GTK_COMBO_BOX(wizard->recv_type));
if (wizard->create_mailbox && prefs_account->protocol != A_IMAP4 &&
!strlen(gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name)))) {
@@ -909,8 +906,7 @@
WizardWindow *wizard = (WizardWindow *)data;
RecvProtocol protocol;
gchar *text;
- protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(wizard->recv_type), MENU_VAL_ID));
+ protocol = combobox_get_active_data(GTK_COMBO_BOX(wizard->recv_type));
text = get_default_server(wizard, "smtp");
gtk_entry_set_text(GTK_ENTRY(wizard->smtp_server), text);
@@ -1346,12 +1342,10 @@
}
}
-static void wizard_protocol_changed(GtkMenuItem *menuitem, gpointer data)
+static void wizard_protocol_changed(GtkComboBox *combo, gpointer data)
{
WizardWindow *wizard = (WizardWindow *)data;
- RecvProtocol protocol;
- protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+ RecvProtocol protocol = combobox_get_active_data(combo);
wizard_protocol_change(wizard, protocol);
}
@@ -1359,11 +1353,11 @@
static GtkWidget* recv_page (WizardWindow * wizard)
{
GtkWidget *table = gtk_table_new(1,1, FALSE);
- GtkWidget *menu = gtk_menu_new();
- GtkWidget *menuitem;
GtkTooltips *tips = gtk_tooltips_new();
GtkWidget *vbox;
GtkWidget *hbox;
+ GtkListStore *store;
+ GtkTreeIter iter;
gchar *text;
gint index = 0;
@@ -1378,24 +1372,14 @@
hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
- wizard->recv_type = gtk_option_menu_new();
-
- MENUITEM_ADD (menu, menuitem, _("POP3"), A_POP3);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
-
- MENUITEM_ADD (menu, menuitem, _("IMAP"), A_IMAP4);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
+ wizard->recv_type = gtkut_sc_combobox_create(NULL, FALSE);
+ store = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(wizard->recv_type)));
- MENUITEM_ADD (menu, menuitem, _("Local mbox file"), A_LOCAL);
- g_signal_connect(G_OBJECT(menuitem), "activate",
- G_CALLBACK(wizard_protocol_changed),
- wizard);
+ COMBOBOX_ADD(store, _("POP3"), A_POP3);
+ COMBOBOX_ADD(store, _("IMAP"), A_IMAP4);
+ COMBOBOX_ADD(store, _("Local mbox file"), A_LOCAL);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (wizard->recv_type), menu);
switch(tmpl.recvtype) {
case A_POP3:
index = 0;
@@ -1409,7 +1393,10 @@
default:
index = 0;
}
- gtk_option_menu_set_history(GTK_OPTION_MENU (wizard->recv_type), index);
+ gtk_combo_box_set_active(GTK_COMBO_BOX (wizard->recv_type), index);
+ g_signal_connect(G_OBJECT(wizard->recv_type), "changed",
+ G_CALLBACK(wizard_protocol_changed),
+ wizard);
PACK_BOX(hbox, _("<span weight=\"bold\">Server type:</span>"),
wizard->recv_type);
@@ -1511,10 +1498,7 @@
int current_page, num_pages;
gboolean skip_mailbox_page = FALSE;
#ifndef MAEMO
- GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(wizard->recv_type));
- GtkWidget *menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gint protocol = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+ gint protocol = combobox_get_active_data(GTK_COMBO_BOX(wizard->recv_type));
if (protocol == A_IMAP4) {
skip_mailbox_page = TRUE;