From 8a072ffc7c0ddcde472877a51ace0bb14f86fb0a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 24 Apr 2009 11:45:21 +0200 Subject: GN-bug #572348 - Removed deprecated Gtk+ symbols Some still left, because those gone in kill-bonobo branch. --- mail/ChangeLog | 18 ++ mail/em-composer-prefs.c | 67 ++------ mail/em-composer-prefs.h | 7 +- mail/em-filter-editor.c | 44 +++-- mail/em-filter-rule.c | 53 +++--- mail/em-filter-source-element.c | 40 ++--- mail/em-mailer-prefs.c | 56 +++--- mail/em-mailer-prefs.h | 5 +- mail/em-subscribe-editor.c | 77 ++++++--- mail/mail-config.glade | 270 ++++------------------------- mail/mail-dialogs.glade | 371 +++++++++++++++++----------------------- mail/message-tag-followup.c | 24 +-- mail/message-tag-followup.h | 2 +- 13 files changed, 388 insertions(+), 646 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index d1e0e834ef..73fca14281 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,21 @@ +2009-04-24 Milan Crha + + ** Fix for bug #572348 + + * mail-config.glade: + * mail-dialogs.glade: + * em-composer-prefs.h: + * em-composer-prefs.c: + * em-subscribe-editor.c: + * em-filter-editor.c: + * em-filter-rule.c: + * em-filter-source-element.c: + * em-mailer-prefs.h: + * em-mailer-prefs.c: + * message-tag-followup.h: + * message-tag-followup.c: + Remove deprecated Gtk+ symbols. + 2009-04-15 Chenthill Palanisamy * mail/mail-ops.c: Corrected a typo error. diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c index 0b19cc24bf..d9f3718cb0 100644 --- a/mail/em-composer-prefs.c +++ b/mail/em-composer-prefs.c @@ -665,7 +665,7 @@ spell_setup (EMComposerPrefs *prefs) } static gint -attach_style_reply_new_order (gint style_id, +reply_style_new_order (gint style_id, gboolean from_enum_to_option_id) { gint values[] = { @@ -685,41 +685,18 @@ attach_style_reply_new_order (gint style_id, } static void -attach_style_info (GtkWidget *item, - gpointer user_data) -{ - gint *style = user_data; - - g_object_set_data ( - G_OBJECT (item), "style", GINT_TO_POINTER (*style)); - - (*style)++; -} - -static void -attach_style_info_reply (GtkWidget *item, - gpointer user_data) -{ - gint *style = user_data; - - g_object_set_data ( - G_OBJECT (item), "style", GINT_TO_POINTER ( - attach_style_reply_new_order (*style, FALSE))); - - (*style)++; -} - -static void -style_activate (GtkWidget *item, - EMComposerPrefs *prefs) +style_changed (GtkComboBox *combobox, const gchar *key) { GConfClient *client; - const gchar *key; gint style; client = mail_config_get_gconf_client (); - key = g_object_get_data (G_OBJECT (item), "key"); - style = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "style")); + style = gtk_combo_box_get_active (combobox); + g_return_if_fail (style >= 0); + + if (g_str_has_suffix (key, "/reply_style")) + style = reply_style_new_order (style, FALSE); + gconf_client_set_int (client, key, style, NULL); } @@ -979,31 +956,15 @@ em_composer_prefs_construct (EMComposerPrefs *prefs) spell_setup (prefs); /* Forwards and Replies */ - prefs->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle")); + prefs->forward_style = GTK_COMBO_BOX (glade_xml_get_widget (gui, "comboboxForwardStyle")); style = gconf_client_get_int (client, "/apps/evolution/mail/format/forward_style", NULL); - gtk_option_menu_set_history (prefs->forward_style, style); - style = 0; + gtk_combo_box_set_active (prefs->forward_style, style); + g_signal_connect (prefs->forward_style, "changed", G_CALLBACK (style_changed), "/apps/evolution/mail/format/forward_style"); - gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->forward_style)), - attach_style_info, &style); - - if (gtk_option_menu_get_menu (prefs->forward_style)) { - option_menu_connect (prefs, prefs->forward_style, G_CALLBACK (style_activate), - "/apps/evolution/mail/format/forward_style"); - } - - prefs->reply_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuReplyStyle")); + prefs->reply_style = GTK_COMBO_BOX (glade_xml_get_widget (gui, "comboboxReplyStyle")); style = gconf_client_get_int (client, "/apps/evolution/mail/format/reply_style", NULL); - gtk_option_menu_set_history (prefs->reply_style, attach_style_reply_new_order (style, TRUE)); - style = 0; - gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->reply_style)), - attach_style_info_reply, &style); - - - if (gtk_option_menu_get_menu (prefs->reply_style)) { - option_menu_connect (prefs, prefs->reply_style, G_CALLBACK (style_activate), - "/apps/evolution/mail/format/reply_style"); - } + gtk_combo_box_set_active (prefs->reply_style, reply_style_new_order (style, TRUE)); + g_signal_connect (prefs->reply_style, "changed", G_CALLBACK (style_changed), "/apps/evolution/mail/format/reply_style"); /* Signatures */ dialog = (GtkDialog *) gtk_dialog_new (); diff --git a/mail/em-composer-prefs.h b/mail/em-composer-prefs.h index 6fcab979f4..82c6ece51e 100644 --- a/mail/em-composer-prefs.h +++ b/mail/em-composer-prefs.h @@ -66,11 +66,8 @@ struct _EMComposerPrefs { GtkTreeModel *language_model; /* Forwards and Replies */ - GtkOptionMenu *forward_style; - GtkOptionMenu *reply_style; - - /* Keyboard Shortcuts */ - GtkOptionMenu *shortcuts_type; + GtkComboBox *forward_style; + GtkComboBox *reply_style; /* Signatures */ GtkTreeView *sig_list; diff --git a/mail/em-filter-editor.c b/mail/em-filter-editor.c index fb0c2c4ea6..4a92a65c58 100644 --- a/mail/em-filter-editor.c +++ b/mail/em-filter-editor.c @@ -122,11 +122,29 @@ em_filter_editor_new (EMFilterContext *fc, const EMFilterSource *source_names) } static void -select_source (GtkMenuItem *mi, EMFilterEditor *fe) +free_sources (gpointer data) +{ + GSList *sources = data; + + g_slist_foreach (sources, (GFunc)g_free, NULL); + g_slist_free (sources); +} + +static void +select_source (GtkComboBox *combobox, EMFilterEditor *fe) { char *source; + int idx; + GSList *sources; + + g_return_if_fail (GTK_IS_COMBO_BOX (combobox)); - source = g_object_get_data(G_OBJECT(mi), "source"); + idx = gtk_combo_box_get_active (combobox); + sources = g_object_get_data (G_OBJECT (combobox), "sources"); + + g_return_if_fail (idx >= 0 && idx < g_slist_length (sources)); + + source = (char *)g_slist_nth (sources, idx); g_return_if_fail (source); rule_editor_set_source ((RuleEditor *)fe, source); @@ -135,23 +153,23 @@ select_source (GtkMenuItem *mi, EMFilterEditor *fe) void em_filter_editor_construct (EMFilterEditor *fe, EMFilterContext *fc, GladeXML *gui, const EMFilterSource *source_names) { - GtkWidget *menu, *item, *omenu; + GtkWidget *combobox; int i; GtkTreeViewColumn *column; + GSList *sources = NULL; - omenu = glade_xml_get_widget (gui, "filter_source"); - gtk_option_menu_remove_menu (GTK_OPTION_MENU (omenu)); - menu = gtk_menu_new (); + combobox = glade_xml_get_widget (gui, "filter_source_combobox"); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combobox)))); for (i = 0; source_names[i].source; i++) { - item = gtk_menu_item_new_with_label(source_names[i].name); - g_object_set_data_full((GObject *)item, "source", g_strdup(source_names[i].source), g_free); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show (item); - g_signal_connect (item, "activate", G_CALLBACK (select_source), fe); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), source_names[i].name); + sources = g_slist_append (sources, g_strdup(source_names[i].source)); } - gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); - gtk_widget_show (omenu); + + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0); + g_signal_connect (combobox, "changed", G_CALLBACK (select_source), fe); + g_object_set_data_full (G_OBJECT (combobox), "sources", sources, free_sources); + gtk_widget_show (combobox); rule_editor_construct ((RuleEditor *) fe, (RuleContext *) fc, gui, source_names[0].source, _("_Filter Rules")); diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 61156302f8..10f06e38da 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -324,39 +324,44 @@ struct _part_data { }; static void -option_activate(GtkMenuItem *item, struct _part_data *data) +part_combobox_changed (GtkComboBox *combobox, struct _part_data *data) { - FilterPart *part = g_object_get_data((GObject *)item, "part"); + FilterPart *part = NULL; FilterPart *newpart; + int index, i; + + index = gtk_combo_box_get_active (combobox); + for (i = 0, part = rule_context_next_part (RULE_CONTEXT (data->f), part); part && i < index; i++, part = rule_context_next_part (RULE_CONTEXT (data->f), part)) { + /* traverse until reached index */ + } + + g_return_if_fail (part != NULL); + g_return_if_fail (i == index); /* dont update if we haven't changed */ - if (!strcmp(part->title, data->part->title)) + if (!strcmp (part->title, data->part->title)) return; /* here we do a widget shuffle, throw away the old widget/rulepart, and create another */ if (data->partwidget) - gtk_container_remove(GTK_CONTAINER(data->container), data->partwidget); + gtk_container_remove (GTK_CONTAINER (data->container), data->partwidget); - newpart = filter_part_clone(part); - filter_part_copy_values(newpart, data->part); - em_filter_rule_replace_action((EMFilterRule *)data->fr, data->part, newpart); - g_object_unref(data->part); + newpart = filter_part_clone (part); + filter_part_copy_values (newpart, data->part); + em_filter_rule_replace_action ((EMFilterRule *)data->fr, data->part, newpart); + g_object_unref (data->part); data->part = newpart; - data->partwidget = filter_part_get_widget(newpart); + data->partwidget = filter_part_get_widget (newpart); if (data->partwidget) - gtk_box_pack_start(GTK_BOX(data->container), data->partwidget, TRUE, TRUE, 0); - - g_object_set_data((GObject *)data->container, "part", newpart); + gtk_box_pack_start (GTK_BOX (data->container), data->partwidget, TRUE, TRUE, 0); } static GtkWidget * get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr) { FilterPart *part = NULL; - GtkWidget *menu; - GtkWidget *item; - GtkWidget *omenu; + GtkWidget *combobox; GtkWidget *hbox; GtkWidget *p; int index = 0, current = 0; @@ -373,14 +378,9 @@ get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr) data->partwidget = p; data->container = hbox; - menu = gtk_menu_new(); + combobox = gtk_combo_box_new_text (); while ((part = em_filter_context_next_action(f, part))) { - item = gtk_menu_item_new_with_label(_(part->title)); - - g_object_set_data((GObject *)item, "part", part); - g_signal_connect(item, "activate", G_CALLBACK(option_activate), data); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show(item); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(part->title)); if (!strcmp(newpart->title, part->title)) current = index; @@ -388,12 +388,11 @@ get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr) index++; } - omenu = gtk_option_menu_new(); - gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), current); - gtk_widget_show(omenu); + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), current); + g_signal_connect (combobox, "changed", G_CALLBACK (part_combobox_changed), data); + gtk_widget_show (combobox); - gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), combobox, FALSE, FALSE, 0); if (p) gtk_box_pack_start(GTK_BOX(hbox), p, TRUE, TRUE, 0); diff --git a/mail/em-filter-source-element.c b/mail/em-filter-source-element.c index d2b5136751..096f91b2dd 100644 --- a/mail/em-filter-source-element.c +++ b/mail/em-filter-source-element.c @@ -232,21 +232,26 @@ clone(FilterElement *fe) } static void -source_changed(GtkWidget *item, EMFilterSourceElement *fs) +source_changed(GtkComboBox *combobox, EMFilterSourceElement *fs) { - SourceInfo *info = (SourceInfo *)g_object_get_data((GObject *)item, "source"); + SourceInfo *info; + int idx; - g_free(fs->priv->current_url); - fs->priv->current_url = g_strdup(info->url); + idx = gtk_combo_box_get_active (combobox); + g_return_if_fail (idx >= 0 && idx < g_list_length (fs->priv->sources)); + + info = (SourceInfo *) g_list_nth (fs->priv->sources, idx); + g_return_if_fail (info != NULL); + + g_free (fs->priv->current_url); + fs->priv->current_url = g_strdup (info->url); } static GtkWidget * get_widget(FilterElement *fe) { EMFilterSourceElement *fs = (EMFilterSourceElement *)fe; - GtkWidget *menu; - GtkWidget *omenu; - GtkWidget *item; + GtkWidget *combobox; GList *i; SourceInfo *first = NULL; int index, current_index; @@ -254,7 +259,7 @@ get_widget(FilterElement *fe) if (fs->priv->sources == NULL) em_filter_source_element_get_sources(fs); - menu = gtk_menu_new(); + combobox = gtk_combo_box_new_text (); index = 0; current_index = -1; @@ -273,15 +278,9 @@ get_widget(FilterElement *fe) else label = g_strdup_printf("%s <%s>", info->name, info->address); - item = gtk_menu_item_new_with_label(label); + gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), label); g_free(label); - g_object_set_data((GObject *)item, "source", info); - g_signal_connect(item, "activate", G_CALLBACK(source_changed), fs); - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show(item); - if (fs->priv->current_url && !strcmp(info->url, fs->priv->current_url)) current_index = index; @@ -289,13 +288,10 @@ get_widget(FilterElement *fe) } } - omenu = gtk_option_menu_new(); - gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); - if (current_index >= 0) { - gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), current_index); + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), current_index); } else { - gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0); g_free(fs->priv->current_url); if (first) @@ -304,7 +300,9 @@ get_widget(FilterElement *fe) fs->priv->current_url = NULL; } - return omenu; + g_signal_connect (combobox, "changed", G_CALLBACK (source_changed), fs); + + return combobox; } static void diff --git a/mail/em-mailer-prefs.c b/mail/em-mailer-prefs.c index ec5b8c7fb7..e489e16826 100644 --- a/mail/em-mailer-prefs.c +++ b/mail/em-mailer-prefs.c @@ -933,82 +933,74 @@ charset_menu_init (EMMailerPrefs *prefs) } static void -trash_days_activate (GtkWidget *item, EMMailerPrefs *prefs) +trash_days_changed (GtkComboBox *combobox, EMMailerPrefs *prefs) { - int days; + int idx; + + idx = gtk_combo_box_get_active (combobox); + g_return_if_fail (idx >= 0 && idx < G_N_ELEMENTS (empty_trash_frequency)); - days = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "days")); - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", days, NULL); + gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", empty_trash_frequency [idx].days, NULL); } static void emmp_empty_trash_init (EMMailerPrefs *prefs) { int locked, days, hist = 0, i; - GtkWidget *menu, *item; toggle_button_init (prefs, prefs->empty_trash, FALSE, "/apps/evolution/mail/trash/empty_on_exit", G_CALLBACK (toggle_button_toggled)); days = gconf_client_get_int(prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", NULL); - menu = gtk_menu_new(); + + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (prefs->empty_trash_days))); for (i = 0; i < G_N_ELEMENTS (empty_trash_frequency); i++) { if (days >= empty_trash_frequency[i].days) hist = i; - item = gtk_menu_item_new_with_label (_(empty_trash_frequency[i].label)); - g_object_set_data ((GObject *) item, "days", GINT_TO_POINTER (empty_trash_frequency[i].days)); - g_signal_connect (item, "activate", G_CALLBACK (trash_days_activate), prefs); - - gtk_widget_show (item); - gtk_menu_shell_append((GtkMenuShell *)menu, item); + gtk_combo_box_append_text (prefs->empty_trash_days, _(empty_trash_frequency[i].label)); } - gtk_widget_show(menu); - gtk_option_menu_set_menu((GtkOptionMenu *)prefs->empty_trash_days, menu); - gtk_option_menu_set_history((GtkOptionMenu *)prefs->empty_trash_days, hist); + g_signal_connect (prefs->empty_trash_days, "changed", G_CALLBACK (trash_days_changed), prefs); + gtk_combo_box_set_active (prefs->empty_trash_days, hist); locked = !gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", NULL); gtk_widget_set_sensitive ((GtkWidget *) prefs->empty_trash_days, !locked); } static void -junk_days_activate (GtkWidget *item, EMMailerPrefs *prefs) +junk_days_changed (GtkComboBox *combobox, EMMailerPrefs *prefs) { - int days; + int idx; + + idx = gtk_combo_box_get_active (combobox); + g_return_if_fail (idx >= 0 && idx < G_N_ELEMENTS (empty_trash_frequency)); - days = GPOINTER_TO_INT (g_object_get_data ((GObject *) item, "days")); - gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/junk/empty_on_exit_days", days, NULL); + gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/junk/empty_on_exit_days", empty_trash_frequency[idx].days, NULL); } static void emmp_empty_junk_init (EMMailerPrefs *prefs) { int locked, days, hist = 0, i; - GtkWidget *menu, *item; toggle_button_init (prefs, prefs->empty_junk, FALSE, "/apps/evolution/mail/junk/empty_on_exit", G_CALLBACK (toggle_button_toggled)); days = gconf_client_get_int(prefs->gconf, "/apps/evolution/mail/junk/empty_on_exit_days", NULL); - menu = gtk_menu_new(); + + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (prefs->empty_junk_days))); for (i = 0; i < G_N_ELEMENTS (empty_trash_frequency); i++) { if (days >= empty_trash_frequency[i].days) hist = i; - item = gtk_menu_item_new_with_label (_(empty_trash_frequency[i].label)); - g_object_set_data ((GObject *) item, "days", GINT_TO_POINTER (empty_trash_frequency[i].days)); - g_signal_connect (item, "activate", G_CALLBACK (junk_days_activate), prefs); - - gtk_widget_show (item); - gtk_menu_shell_append((GtkMenuShell *)menu, item); + gtk_combo_box_append_text (prefs->empty_junk_days, _(empty_trash_frequency[i].label)); } - gtk_widget_show(menu); - gtk_option_menu_set_menu((GtkOptionMenu *)prefs->empty_junk_days, menu); - gtk_option_menu_set_history((GtkOptionMenu *)prefs->empty_junk_days, hist); + g_signal_connect (prefs->empty_junk_days, "changed", G_CALLBACK (junk_days_changed), prefs); + gtk_combo_box_set_active (prefs->empty_junk_days, hist); locked = !gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/junk/empty_on_exit_days", NULL); gtk_widget_set_sensitive ((GtkWidget *) prefs->empty_junk_days, !locked); @@ -1268,7 +1260,7 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs) /* Deleting Mail */ prefs->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit")); - prefs->empty_trash_days = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuEmptyTrashDays")); + prefs->empty_trash_days = GTK_COMBO_BOX (glade_xml_get_widget (gui, "comboboxEmptyTrashDays")); emmp_empty_trash_init (prefs); prefs->confirm_expunge = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkConfirmExpunge")); @@ -1481,7 +1473,7 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs) G_CALLBACK (toggle_button_toggled)); prefs->empty_junk = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "junk_empty_check")); - prefs->empty_junk_days = GTK_OPTION_MENU (glade_xml_get_widget (gui, "junk_empty_combo")); + prefs->empty_junk_days = GTK_COMBO_BOX (glade_xml_get_widget (gui, "junk_empty_combobox")); emmp_empty_junk_init (prefs); prefs->default_junk_plugin = GTK_COMBO_BOX (glade_xml_get_widget (gui, "default_junk_plugin")); diff --git a/mail/em-mailer-prefs.h b/mail/em-mailer-prefs.h index 6e783ef562..3b52d9f40a 100644 --- a/mail/em-mailer-prefs.h +++ b/mail/em-mailer-prefs.h @@ -34,6 +34,7 @@ extern "C" { struct _ESignature; struct _GtkToggleButton; struct _GtkOptionMenu; +struct _GtkComboBox; struct _GdkPixbuf; struct _GtkWidget; struct _GladeXML; @@ -85,7 +86,7 @@ struct _EMMailerPrefs { /* Deleting Mail */ struct _GtkToggleButton *empty_trash; - struct _GtkOptionMenu *empty_trash_days; + struct _GtkComboBox *empty_trash_days; struct _GtkToggleButton *confirm_expunge; /* HTML Mail tab */ @@ -121,7 +122,7 @@ struct _EMMailerPrefs { /* Junk prefs */ struct _GtkToggleButton *check_incoming; struct _GtkToggleButton *empty_junk; - struct _GtkOptionMenu *empty_junk_days; + struct _GtkComboBox *empty_junk_days; struct _GtkToggleButton *sa_local_tests_only; struct _GtkToggleButton *sa_use_daemon; diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index bca062b096..724b9b4874 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -59,9 +59,8 @@ struct _EMSubscribeEditor { GtkDialog *dialog; GtkWidget *vbox; /* where new stores are added */ - GtkWidget *optionmenu; + GtkWidget *combobox; GtkWidget *none_selected; /* 'please select a xxx' message */ - GtkWidget *none_selected_item; GtkWidget *progress; }; @@ -357,7 +356,7 @@ sub_folderinfo_exec (struct _emse_folderinfo_msg *m) if (m->seq == m->sub->seq) { camel_operation_register(m->base.cancel); - m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:pub_full_name, CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &m->base.ex); + m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:pub_full_name, CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &m->base.ex); camel_operation_unregister(m->base.cancel); } } @@ -729,20 +728,31 @@ sub_editor_got_store(char *uri, CamelStore *store, void *data) } static void -sub_editor_menu_changed(GtkWidget *w, EMSubscribeEditor *se) +sub_editor_combobox_changed (GtkWidget *w, EMSubscribeEditor *se) { int i, n; struct _EMSubscribe *sub; - d(printf("menu changed\n")); + d(printf("combobox changed\n")); i = 1; - n = gtk_option_menu_get_history((GtkOptionMenu *)se->optionmenu); - if (n == 0) - gtk_widget_show(se->none_selected); - else { - gtk_widget_hide(se->none_selected); - gtk_widget_hide(se->none_selected_item); + n = gtk_combo_box_get_active (GTK_COMBO_BOX (se->combobox)); + if (n == 0) { + gtk_widget_show (se->none_selected); + } else { + GtkTreeIter iter; + GtkTreeModel *model; + + gtk_widget_hide (se->none_selected); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (se->combobox)); + if (gtk_tree_model_get_iter_first (model, &iter)) { + /* hide the first item */ + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + 1, FALSE, + -1); + } } se->current = NULL; @@ -815,7 +825,10 @@ GtkDialog *em_subscribe_editor_new(void) EAccountList *accounts; EIterator *iter; GladeXML *xml; - GtkWidget *menu, *w; + GtkWidget *w; + GtkCellRenderer *cell; + GtkListStore *store; + GtkTreeIter gtiter; char *gladefile; se = g_malloc0(sizeof(*se)); @@ -859,12 +872,27 @@ GtkDialog *em_subscribe_editor_new(void) w = glade_xml_get_widget(xml, "refresh_button"); g_signal_connect(w, "clicked", G_CALLBACK(sub_editor_refresh), se); - /* setup stores menu */ - se->optionmenu = glade_xml_get_widget(xml, "store_menu"); - menu = gtk_menu_new(); - se->none_selected_item = w = gtk_menu_item_new_with_label(_("No server has been selected")); - gtk_widget_show(w); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); + /* setup stores combobox */ + se->combobox = glade_xml_get_widget (xml, "store_combobox"); + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); + gtk_combo_box_set_model (GTK_COMBO_BOX (se->combobox), GTK_TREE_MODEL (store)); + g_object_unref (store); + + gtk_cell_layout_clear (GTK_CELL_LAYOUT (se->combobox)); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (se->combobox), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (se->combobox), cell, + "text", 0, + "visible", 1, + NULL); + + gtk_list_store_append (store, >iter); + gtk_list_store_set ( + store, >iter, + 0, _("No server has been selected"), + 1, TRUE, + -1); accounts = mail_config_get_accounts (); for (iter = e_list_get_iterator ((EList *) accounts); @@ -875,9 +903,12 @@ GtkDialog *em_subscribe_editor_new(void) /* setup url table, and store table? */ if (account->enabled && account->source->url) { d(printf("adding account '%s'\n", account->name)); - w = gtk_menu_item_new_with_label(account->name); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); - gtk_widget_show(w); + gtk_list_store_append (store, >iter); + gtk_list_store_set ( + store, >iter, + 0, account->name, + 1, TRUE, + -1); e_dlist_addtail(&se->stores, (EDListNode *)subscribe_new(se, account->source->url)); } else { d(printf("not adding account '%s'\n", account->name)); @@ -885,8 +916,8 @@ GtkDialog *em_subscribe_editor_new(void) } g_object_unref(iter); - gtk_option_menu_set_menu((GtkOptionMenu *)se->optionmenu, menu); - g_signal_connect(se->optionmenu, "changed", G_CALLBACK(sub_editor_menu_changed), se); + gtk_combo_box_set_active (GTK_COMBO_BOX (se->combobox), 0); + g_signal_connect(se->combobox, "changed", G_CALLBACK(sub_editor_combobox_changed), se); if (window_size.width == 0) { /* initialize @window_size with the previous session's size */ diff --git a/mail/mail-config.glade b/mail/mail-config.glade index de881e40e5..f435b95a63 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -550,8 +550,8 @@ For example: "Work" or "Personal" * False - + @@ -633,8 +633,8 @@ For example: "Work" or "Personal" * False - + @@ -836,8 +836,8 @@ For example: "Work" or "Personal" * False - + @@ -890,8 +890,8 @@ For example: "Work" or "Personal" * False - + @@ -2804,7 +2804,7 @@ For example: "Work" or "Personal" True em_account_editor_folder_selector_button_new - Select Sent Folder + Select Sent Folder 0 0 Tue, 14 Dec 2004 17:07:09 GMT @@ -2823,7 +2823,7 @@ For example: "Work" or "Personal" True em_account_editor_folder_selector_button_new - Select Drafts Folder + Select Drafts Folder 0 0 Tue, 14 Dec 2004 17:07:02 GMT @@ -5458,10 +5458,12 @@ For example: "Work" or "Personal" - + True - True - -1 + a +b + False + True 0 @@ -6648,10 +6650,12 @@ For example: "Work" or "Personal" - + True - True - -1 + a +b + False + True 0 @@ -6874,7 +6878,6 @@ For example: "Work" or "Personal" 1 6 7 - 0 fill @@ -7164,7 +7167,6 @@ For example: "Work" or "Personal" 0.5 0 0 - omenuReplyStyle PANGO_ELLIPSIZE_NONE -1 False @@ -7199,48 +7201,14 @@ For example: "Work" or "Personal" 0 - + True - True - 0 - - - - True - - - True - Attachment - True - - - - - - True - Inline (Outlook style) - True - - - - - - True - Quoted - True - - - - - - True - Do not quote - True - - - - - + Attachment +Inline (Outlook style) +Quoted +Do not quote + False + True 0 @@ -7268,40 +7236,13 @@ For example: "Work" or "Personal" 0 - + True - True - 0 - - - - True - - - - True - Attachment - True - - - - - - True - Inline - True - - - - - - True - Quoted - True - - - - + Attachment +Inline +Quoted + False + True 0 @@ -7371,7 +7312,6 @@ For example: "Work" or "Personal" 0.5 0 0 - omenuForwardStyle PANGO_ELLIPSIZE_NONE -1 False @@ -9329,35 +9269,6 @@ for display purposes only. - - True @@ -9429,27 +9340,6 @@ for display purposes only. - - True @@ -9506,34 +9396,6 @@ for display purposes only. - - True @@ -9576,27 +9438,6 @@ for display purposes only. - - True @@ -9780,59 +9621,6 @@ for display purposes only. True - - 0 diff --git a/mail/mail-dialogs.glade b/mail/mail-dialogs.glade index 1ecf410ed5..689082792a 100644 --- a/mail/mail-dialogs.glade +++ b/mail/mail-dialogs.glade @@ -19,6 +19,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -174,7 +175,6 @@ True - 0 @@ -201,6 +201,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -235,31 +236,62 @@ + + + 12 + True + False + 18 + - - 12 + True False - 18 + 6 + + + + True + <span weight="bold">Digital Signature</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + - + True False - 6 + 0 - + True - <span weight="bold">Digital Signature</span> + False - True + False GTK_JUSTIFY_LEFT False False - 0 + 0.5 0.5 - 0 + 12 0 PANGO_ELLIPSIZE_NONE -1 @@ -274,67 +306,29 @@ - + True + 1 + 1 False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + 2 + 6 - + True - 1 - 1 False - 2 - 6 + 0 - - True - False - 0 - - - - - - - 0 - 1 - 0 - 1 - + - 0 - True - True + 0 + 1 + 0 + 1 @@ -345,6 +339,44 @@ + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + <span weight="bold">Encryption</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + 0 False @@ -353,23 +385,23 @@ - + True False - 6 + 0 - + True - <span weight="bold">Encryption</span> + False - True + False GTK_JUSTIFY_LEFT False False - 0 + 0.5 0.5 - 0 + 12 0 PANGO_ELLIPSIZE_NONE -1 @@ -384,67 +416,29 @@ - + True + 1 + 1 False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + 2 + 6 - + True - 1 - 1 False - 2 - 6 + 0 - - True - False - 0 - - - - - - - 0 - 1 - 0 - 1 - + - 0 - True - True + 0 + 1 + 0 + 1 @@ -457,13 +451,24 @@ 0 - False - False + True + True + + 0 + False + False + - + + + 0 + True + True + + @@ -483,6 +488,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -556,7 +562,6 @@ 0.5 0 0 - store_menu PANGO_ELLIPSIZE_NONE -1 False @@ -570,24 +575,10 @@ - + True - True - 0 - - - - - - - True - None Selected - True - - - - - + False + True 0 @@ -661,6 +652,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False True @@ -882,6 +874,7 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -943,13 +936,14 @@ 6 - + True - e_create_image_widget - stock_mail-flag-for-followup - 0 - 0 - Wed, 08 Dec 2004 02:35:27 GMT + 6 + stock_mail-flag-for-followup + 0.5 + 0.5 + 0 + 0 0 @@ -1042,7 +1036,6 @@ Please select a follow up action from the "Flag" menu. 0.5 0 0 - combo-entry PANGO_ELLIPSIZE_NONE -1 False @@ -1105,71 +1098,6 @@ Please select a follow up action from the "Flag" menu. - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - True @@ -1208,6 +1136,25 @@ Please select a follow up action from the "Flag" menu. + + + + True + a +b + False + True + True + + + 1 + 2 + 0 + 1 + fill + + + 0 @@ -1241,6 +1188,7 @@ Please select a follow up action from the "Flag" menu. GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True + False False @@ -1441,7 +1389,6 @@ Please select a follow up action from the "Flag" menu. False True local_rb - 0 diff --git a/mail/message-tag-followup.c b/mail/message-tag-followup.c index a5f2a967db..2ddd372257 100644 --- a/mail/message-tag-followup.c +++ b/mail/message-tag-followup.c @@ -112,7 +112,7 @@ message_tag_followup_class_init (MessageTagFollowUpClass *klass) static void message_tag_followup_init (MessageTagFollowUp *editor) { - editor->combo = NULL; + editor->combo_entry = NULL; editor->target_date = NULL; editor->completed = NULL; editor->clear = NULL; @@ -139,7 +139,7 @@ get_tag_list (MessageTagEditor *editor) time_t date; char *text; - camel_tag_set (&tags, "follow-up", gtk_entry_get_text (GTK_ENTRY (followup->combo->entry))); + camel_tag_set (&tags, "follow-up", gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (followup->combo_entry))))); date = e_date_edit_get_time (followup->target_date); if (date != (time_t) -1) { @@ -170,7 +170,7 @@ set_tag_list (MessageTagEditor *editor, CamelTag *tags) text = camel_tag_get (&tags, "follow-up"); if (text) - gtk_entry_set_text (GTK_ENTRY (followup->combo->entry), text); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (followup->combo_entry))), text); text = camel_tag_get (&tags, "due-by"); if (text && *text) { @@ -195,7 +195,7 @@ clear_clicked (GtkButton *button, gpointer user_data) { MessageTagFollowUp *followup = user_data; - gtk_list_select_item (GTK_LIST (followup->combo->list), DEFAULT_FLAG); + gtk_combo_box_set_active (followup->combo_entry, DEFAULT_FLAG); e_date_edit_set_time (followup->target_date, (time_t) -1); gtk_toggle_button_set_active (followup->completed, FALSE); @@ -268,7 +268,6 @@ construct (MessageTagEditor *editor) GtkCellRenderer *renderer; GtkListStore *model; GtkWidget *widget; - GList *strings; GladeXML *gui; int i; char *gladefile; @@ -294,11 +293,6 @@ construct (MessageTagEditor *editor) gtk_widget_reparent (widget, GTK_DIALOG (editor)->vbox); gtk_box_set_child_packing (GTK_BOX (GTK_DIALOG (editor)->vbox), widget, TRUE, TRUE, 6, GTK_PACK_START); - widget = glade_xml_get_widget (gui, "pixmap"); - gtk_image_set_from_icon_name ( - GTK_IMAGE (widget), "stock_mail-flag-for-followup", - GTK_ICON_SIZE_DIALOG); - followup->message_list = GTK_TREE_VIEW (glade_xml_get_widget (gui, "message_list")); model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); gtk_tree_view_set_model (followup->message_list, (GtkTreeModel *) model); @@ -311,13 +305,11 @@ construct (MessageTagEditor *editor) gtk_tree_view_insert_column_with_attributes (followup->message_list, -1, _("Subject"), renderer, "text", 1, NULL); - followup->combo = GTK_COMBO (glade_xml_get_widget (gui, "combo")); - strings = NULL; + followup->combo_entry = GTK_COMBO_BOX (glade_xml_get_widget (gui, "combo")); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (followup->combo_entry))); for (i = 0; i < num_available_flags; i++) - strings = g_list_append (strings, (char *) _(available_flags[i])); - gtk_combo_set_popdown_strings (followup->combo, strings); - g_list_free (strings); - gtk_list_select_item (GTK_LIST (followup->combo->list), DEFAULT_FLAG); + gtk_combo_box_append_text (followup->combo_entry, (char *) _(available_flags[i])); + gtk_combo_box_set_active (followup->combo_entry, DEFAULT_FLAG); followup->target_date = E_DATE_EDIT (glade_xml_get_widget (gui, "target_date")); /* glade bug, need to show this ourselves */ diff --git a/mail/message-tag-followup.h b/mail/message-tag-followup.h index 80f261fb80..4b18865d89 100644 --- a/mail/message-tag-followup.h +++ b/mail/message-tag-followup.h @@ -47,7 +47,7 @@ struct _MessageTagFollowUp { struct _GtkTreeView *message_list; - struct _GtkCombo *combo; + struct _GtkComboBox *combo_entry; struct _EDateEdit *target_date; struct _GtkToggleButton *completed; -- cgit v1.2.3