aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-04-25 22:07:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-04-25 22:07:44 +0800
commit86fdd3a1cba7c156cfa127322e258f5636b45a99 (patch)
treee49802fd9008a59587fca1cafb1801b8b3bf0db6 /filter
parentc2119e513bc7482fc0150287af8502a5ff67191a (diff)
parent23df769955ea54f756a579c19964df87ae6fd5c8 (diff)
downloadgsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.gz
gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.tar.zst
gsoc2013-evolution-86fdd3a1cba7c156cfa127322e258f5636b45a99.zip
Merge branch 'master' into kill-bonobo
This was a particularly messy merge. Watch out for regressions! Conflicts: ChangeLog NEWS a11y/ChangeLog a11y/widgets/ea-combo-button.c a11y/widgets/ea-combo-button.h a11y/widgets/ea-widgets.c addressbook/ChangeLog addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in addressbook/gui/component/addressbook-component.c addressbook/gui/component/addressbook-component.h addressbook/gui/component/addressbook-config.c addressbook/gui/component/addressbook-migrate.h addressbook/gui/component/addressbook-view.c addressbook/gui/component/addressbook-view.h addressbook/gui/component/addressbook.h addressbook/gui/component/autocompletion-config.c addressbook/gui/component/autocompletion-config.h addressbook/gui/component/component-factory.c addressbook/gui/component/e-book-shell-module-migrate.c addressbook/gui/component/ldap-config.glade addressbook/gui/contact-editor/Makefile.am addressbook/gui/contact-editor/contact-editor.glade addressbook/gui/contact-editor/e-contact-editor-address.c addressbook/gui/contact-editor/e-contact-editor-address.h addressbook/gui/contact-editor/e-contact-editor-im.c addressbook/gui/contact-editor/e-contact-editor-im.h addressbook/gui/contact-editor/e-contact-editor.c addressbook/gui/contact-editor/e-contact-editor.h addressbook/gui/contact-editor/eab-editor.c addressbook/gui/contact-editor/eab-editor.h addressbook/gui/contact-editor/test-editor.c addressbook/gui/contact-list-editor/Makefile.am addressbook/gui/widgets/Makefile.am addressbook/gui/widgets/e-addressbook-model.c addressbook/gui/widgets/e-addressbook-model.h addressbook/gui/widgets/e-addressbook-reflow-adapter.c addressbook/gui/widgets/e-addressbook-view.c addressbook/gui/widgets/e-addressbook-view.h addressbook/gui/widgets/e-minicard-view.c addressbook/gui/widgets/eab-contact-display.c addressbook/gui/widgets/eab-gui-util.c addressbook/gui/widgets/eab-menu.c addressbook/gui/widgets/eab-menu.h addressbook/gui/widgets/eab-popup-control.c addressbook/gui/widgets/eab-popup-control.h addressbook/gui/widgets/eab-popup.c addressbook/gui/widgets/eab-popup.h addressbook/gui/widgets/eab-vcard-control.c addressbook/gui/widgets/eab-vcard-control.h addressbook/gui/widgets/gal-view-minicard.c addressbook/gui/widgets/gal-view-minicard.h addressbook/printing/e-contact-print-style-editor.c addressbook/printing/e-contact-print-style-editor.h addressbook/printing/e-contact-print.glade addressbook/printing/test-contact-print-style-editor.c addressbook/tools/evolution-addressbook-export.c addressbook/util/Makefile.am calendar/ChangeLog calendar/gui/Makefile.am calendar/gui/apps_evolution_calendar.schemas.in calendar/gui/calendar-component.c calendar/gui/calendar-component.h calendar/gui/calendar-config.c calendar/gui/comp-editor-factory.c calendar/gui/comp-editor-factory.h calendar/gui/comp-util.c calendar/gui/comp-util.h calendar/gui/control-factory.c calendar/gui/control-factory.h calendar/gui/dialogs/alarm-dialog.c calendar/gui/dialogs/cal-prefs-dialog.c calendar/gui/dialogs/cal-prefs-dialog.glade calendar/gui/dialogs/cal-prefs-dialog.h calendar/gui/dialogs/comp-editor.c calendar/gui/dialogs/comp-editor.h calendar/gui/dialogs/event-editor.c calendar/gui/dialogs/event-page.c calendar/gui/dialogs/memo-editor.c calendar/gui/dialogs/memo-page.c calendar/gui/dialogs/recurrence-page.c calendar/gui/dialogs/task-details-page.c calendar/gui/dialogs/task-details-page.glade calendar/gui/dialogs/task-editor.c calendar/gui/dialogs/task-page.c calendar/gui/e-cal-component-memo-preview.c calendar/gui/e-cal-component-memo-preview.h calendar/gui/e-cal-component-preview.c calendar/gui/e-cal-component-preview.h calendar/gui/e-cal-event.h calendar/gui/e-cal-model.c calendar/gui/e-cal-popup.c calendar/gui/e-calendar-table.c calendar/gui/e-calendar-view.c calendar/gui/e-day-view.c calendar/gui/e-itip-control.c calendar/gui/e-memo-table.c calendar/gui/e-memos.c calendar/gui/e-memos.h calendar/gui/e-tasks.c calendar/gui/e-tasks.h calendar/gui/e-week-view.c calendar/gui/gnome-cal.c calendar/gui/goto.c calendar/gui/itip-bonobo-control.c calendar/gui/itip-bonobo-control.h calendar/gui/itip-utils.c calendar/gui/itip-utils.h calendar/gui/main.c calendar/gui/memos-component.c calendar/gui/memos-control.c calendar/gui/memos-control.h calendar/gui/migration.c calendar/gui/migration.h calendar/gui/tasks-component.c calendar/gui/tasks-control.c calendar/importers/main.c composer/ChangeLog composer/e-composer-actions.c composer/e-composer-private.c composer/e-msg-composer.c composer/e-msg-composer.h composer/evolution-composer.ui configure.in doc/reference/shell/eshell-overrides.txt e-util/ChangeLog e-util/Makefile.am e-util/e-corba-utils.c e-util/e-corba-utils.h e-util/e-gui-utils.c e-util/e-gui-utils.h e-util/e-logger.c e-util/e-non-intrusive-error-dialog.c e-util/e-non-intrusive-error-dialog.h e-util/e-plugin-ui.c e-util/e-util-labels.c e-util/e-util-labels.h e-util/e-util.c e-util/e-util.h filter/ChangeLog filter/filter-option.c help/C/evolution.xml help/ChangeLog help/Makefile.am help/cs/cs.po help/de/de.po help/es/es.po help/eu/figures/Screenshot-Free-Busy.png help/eu/figures/evo_blink.png help/eu/figures/evo_dialog-info.png help/eu/figures/evo_dialog-warning.png help/eu/figures/evo_email_a.png help/eu/figures/evo_flag_follow_up_a.png help/eu/figures/evo_proxyadd_a.png help/eu/figures/evo_shd_memo_a.png help/eu/figures/exchange-delegation.png help/eu/figures/exchange-identity.png help/eu/figures/exchange-receive-options.png help/eu/figures/exchange-receive.png help/eu/figures/exchg-identity.png help/eu/figures/exchng-identity.png help/eu/figures/exchng-rec-mail.png help/eu/figures/exchng-rec-option.png help/eu/figures/exchng-rec-options.png help/eu/figures/free_busy.png help/eu/figures/full-1.png help/eu/figures/full-2.png help/eu/figures/full-3.png help/eu/figures/full-4.png help/eu/figures/full-5.png help/eu/figures/full-6.png help/eu/figures/full-7.png help/eu/figures/mail-druid-pic.png help/eu/figures/mail-inbox.png help/eu/figures/mail-threaded.png help/eu/figures/mainwindow-pic.png help/eu/figures/minus.png help/eu/figures/plus.png help/eu/figures/proxy-cal.png help/eu/figures/proxy-login.png help/eu/figures/schedule.png help/eu/figures/stock_search.png help/eu/figures/sub-others-folder.png help/eu/figures/sub-pub-fold.png help/eu/figures/vfolder-createrule-fig.png help/quickref/Makefile.am mail/ChangeLog mail/Makefile.am mail/default/Makefile.am mail/e-mail-shell-module-migrate.c mail/e-searching-tokenizer.c mail/em-account-editor.c mail/em-account-prefs.h mail/em-composer-prefs.c mail/em-composer-prefs.h mail/em-composer-utils.c mail/em-filter-folder-element.c mail/em-folder-browser.c mail/em-folder-selection-button.h mail/em-folder-selector.c mail/em-folder-tree-model.c mail/em-folder-tree-model.h mail/em-folder-tree.c mail/em-folder-tree.h mail/em-folder-utils.c mail/em-folder-utils.h mail/em-folder-view.c mail/em-format-html-display.c mail/em-format-html-print.c mail/em-format-html-print.h mail/em-format-html.c mail/em-format-quote.h mail/em-format.c mail/em-format.h mail/em-html-stream.h mail/em-mailer-prefs.c mail/em-mailer-prefs.h mail/em-message-browser.c mail/em-message-browser.h mail/em-migrate.h mail/em-network-prefs.h mail/em-popup.c mail/em-search-context.h mail/em-subscribe-editor.c mail/em-utils.c mail/em-utils.h mail/filtertypes.xml mail/mail-component-factory.c mail/mail-component.c mail/mail-config-factory.c mail/mail-config-factory.h mail/mail-config.c mail/mail-config.glade mail/mail-crypto.c mail/mail-crypto.h mail/mail-dialogs.glade mail/mail-folder-cache.c mail/mail-mt.c mail/mail-send-recv.c mail/mail-send-recv.h mail/mail-session.c mail/mail-session.h mail/mail-types.h mail/mail-vfolder.c mail/message-list.c mail/message-tag-followup.c mail/searchtypes.xml mail/vfoldertypes.xml plugins/attachment-reminder/Makefile.am plugins/audio-inline/org-gnome-audio-inline.eplug.xml plugins/caldav/ChangeLog plugins/caldav/caldav-source.c plugins/calendar-http/ChangeLog plugins/calendar-weather/ChangeLog plugins/calendar-weather/calendar-weather.c plugins/email-custom-header/ChangeLog plugins/email-custom-header/email-custom-header.c plugins/exchange-operations/ChangeLog plugins/google-account-setup/ChangeLog plugins/google-account-setup/Makefile.am plugins/google-account-setup/google-contacts-source.c plugins/google-account-setup/google-source.c plugins/import-ics-attachments/ChangeLog plugins/import-ics-attachments/Makefile.am plugins/import-ics-attachments/icsimporter.c plugins/itip-formatter/ChangeLog plugins/itip-formatter/itip-view.c plugins/mail-account-disable/ChangeLog plugins/mail-account-disable/mail-account-disable.c plugins/mail-notification/ChangeLog plugins/mail-notification/mail-notification.c plugins/mail-to-meeting/ChangeLog plugins/mail-to-task/ChangeLog plugins/mark-all-read/mark-all-read.c plugins/publish-calendar/ChangeLog plugins/publish-calendar/publish-format-fb.c plugins/publish-calendar/publish-format-ical.c plugins/save-attachments/ChangeLog plugins/save-attachments/Makefile.am plugins/save-attachments/save-attachments.c plugins/select-one-source/ChangeLog plugins/select-one-source/Makefile.am plugins/select-one-source/select-one-source.c plugins/startup-wizard/ChangeLog plugins/startup-wizard/startup-wizard.c plugins/webdav-account-setup/ChangeLog plugins/webdav-account-setup/Makefile.am plugins/webdav-account-setup/webdav-contacts-source.c po/ChangeLog po/POTFILES.in po/ar.po po/bg.po po/bn_IN.po po/ca.po po/cs.po po/da.po po/de.po po/el.po po/en_GB.po po/es.po po/et.po po/fr.po po/gl.po po/gu.po po/hi.po po/hu.po po/it.po po/ja.po po/kn.po po/ko.po po/lt.po po/ml.po po/mr.po po/nb.po po/nl.po po/pa.po po/pl.po po/pt.po po/ru.po po/sl.po po/sr.po po/sr@latin.po po/sv.po po/ta.po po/te.po po/th.po po/tr.po po/zh_HK.po po/zh_TW.po shell/ChangeLog shell/Evolution-Component.idl shell/Makefile.am shell/apps_evolution_shell.schemas.in shell/e-component-registry.c shell/e-component-registry.h shell/e-component-view.c shell/e-component-view.h shell/e-corba-config-page.c shell/e-corba-config-page.h shell/e-shell-constants.h shell/e-shell-importer.c shell/e-shell-importer.h shell/e-shell-nm.c shell/e-shell-settings-dialog.c shell/e-shell-settings-dialog.h shell/e-shell-view.c shell/e-shell-view.h shell/e-shell-window-commands.c shell/e-shell-window-commands.h shell/e-shell-window.c shell/e-shell-window.h shell/e-shell.c shell/e-shell.h shell/e-sidebar.c shell/e-sidebar.h shell/e-user-creatable-items-handler.c shell/e-user-creatable-items-handler.h shell/es-menu.c shell/es-menu.h shell/evolution-component.c shell/evolution-component.h shell/evolution-config-control.c shell/evolution-config-control.h shell/evolution-listener.c shell/evolution-listener.h shell/evolution-shell-component-utils.c shell/evolution-shell-component-utils.h shell/importer/evolution-importer-client.c shell/importer/evolution-importer-client.h shell/importer/evolution-importer-listener.c shell/importer/evolution-importer-listener.h shell/importer/evolution-importer.c shell/importer/evolution-importer.h shell/importer/evolution-intelligent-importer.c shell/importer/evolution-intelligent-importer.h shell/importer/import.glade shell/importer/intelligent.c shell/importer/intelligent.h shell/main.c shell/shell.error.xml shell/test/evolution-test-component.c shell/test/evolution-test-component.h smime/ChangeLog smime/lib/Makefile.am ui/Makefile.am ui/evolution-addressbook.xml ui/evolution-calendar.xml widgets/ChangeLog widgets/menus/gal-view-menus.c widgets/menus/gal-view-menus.h widgets/misc/ChangeLog widgets/misc/Makefile.am widgets/misc/e-activity-handler.c widgets/misc/e-activity-handler.h widgets/misc/e-attachment-bar.c widgets/misc/e-attachment-bar.h widgets/misc/e-attachment.c widgets/misc/e-attachment.h widgets/misc/e-calendar-item.c widgets/misc/e-charset-picker.c widgets/misc/e-combo-button.c widgets/misc/e-combo-button.h widgets/misc/e-config-page.c widgets/misc/e-config-page.h widgets/misc/e-dropdown-button.c widgets/misc/e-dropdown-button.h widgets/misc/e-filter-bar.h widgets/misc/e-info-label.c widgets/misc/e-info-label.h widgets/misc/e-multi-config-dialog.c widgets/misc/e-multi-config-dialog.h widgets/misc/e-online-button.c widgets/misc/e-search-bar.c widgets/misc/e-search-bar.h widgets/misc/e-signature-combo-box.c widgets/misc/e-signature-combo-box.h widgets/misc/e-signature-editor.c widgets/misc/e-signature-editor.h widgets/misc/e-task-bar.c widgets/misc/e-task-bar.h widgets/misc/e-task-widget.c widgets/misc/e-task-widget.h widgets/misc/test-dropdown-button.c widgets/misc/test-info-label.c widgets/misc/test-multi-config-dialog.c widgets/table/ChangeLog widgets/table/e-cell-date.c widgets/table/e-table-group-container.c widgets/table/e-table-group-leaf.c widgets/table/e-table-group.c widgets/table/e-table-group.h widgets/table/e-table.c widgets/table/e-table.h
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog10
-rw-r--r--filter/filter-datespec.c49
-rw-r--r--filter/filter-option.c57
-rw-r--r--filter/filter-rule.c80
-rw-r--r--filter/filter.glade171
5 files changed, 124 insertions, 243 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index a30463deb5..656210ddce 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,13 @@
+2009-04-24 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #572348
+
+ * filter.glade:
+ * filter-datespec.c:
+ * filter-rule.c:
+ * filter-option.c:
+ Remove deprecated Gtk+ symbols.
+
2009-01-11 Tor Lillqvist <tml@novell.com>
* filter-option.c (get_dynamic_options): Add cast to avoid
diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c
index 82b0e08197..599681c4d4 100644
--- a/filter/filter-datespec.c
+++ b/filter/filter-datespec.c
@@ -95,7 +95,7 @@ static const timespan timespans[] = {
struct _FilterDatespecPrivate {
GtkWidget *label_button;
- GtkWidget *notebook_type, *option_type, *calendar_specify, *spin_relative, *option_relative, *option_past_future;
+ GtkWidget *notebook_type, *combobox_type, *calendar_specify, *spin_relative, *combobox_relative, *combobox_past_future;
FilterDatespec_type type;
int span;
};
@@ -385,49 +385,39 @@ set_values (FilterDatespec *fds)
case FDST_X_AGO:
p->span = get_best_span(fds->value);
gtk_spin_button_set_value((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds);
- gtk_option_menu_set_history((GtkOptionMenu*)p->option_relative, p->span);
- gtk_option_menu_set_history((GtkOptionMenu*)p->option_past_future, 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 0);
break;
case FDST_X_FUTURE:
p->span = get_best_span(fds->value);
gtk_spin_button_set_value((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds);
- gtk_option_menu_set_history((GtkOptionMenu*)p->option_relative, p->span);
- gtk_option_menu_set_history((GtkOptionMenu*)p->option_past_future, 1);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 1);
break;
}
gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, note_type);
- gtk_option_menu_set_history ((GtkOptionMenu*) p->option_type, note_type);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_type), note_type);
}
static void
-set_option_type (GtkMenu *menu, FilterDatespec *fds)
+set_combobox_type (GtkComboBox *combobox, FilterDatespec *fds)
{
- GtkWidget *w;
-
- /* ugh, no other way to 'get_history' */
- w = gtk_menu_get_active (menu);
- fds->priv->type = g_list_index (GTK_MENU_SHELL (menu)->children, w);
+ fds->priv->type = gtk_combo_box_get_active (combobox);
gtk_notebook_set_current_page ((GtkNotebook*) fds->priv->notebook_type, fds->priv->type);
}
static void
-set_option_relative (GtkMenu *menu, FilterDatespec *fds)
+set_combobox_relative (GtkComboBox *combobox, FilterDatespec *fds)
{
- GtkWidget *w;
-
- w = gtk_menu_get_active (menu);
- fds->priv->span = g_list_index (GTK_MENU_SHELL (menu)->children, w);
+ fds->priv->span = gtk_combo_box_get_active (combobox);
}
static void
-set_option_past_future (GtkMenu *menu, FilterDatespec *fds)
+set_combobox_past_future (GtkComboBox *combobox, FilterDatespec *fds)
{
- GtkWidget *w;
-
- w = gtk_menu_get_active (menu);
- if(g_list_index (GTK_MENU_SHELL (menu)->children, w) == 0)
+ if (gtk_combo_box_get_active (combobox) == 0)
fds->type = fds->priv->type = FDST_X_AGO;
else
fds->type = fds->priv->type = FDST_X_FUTURE;
@@ -457,20 +447,17 @@ button_clicked (GtkButton *button, FilterDatespec *fds)
gtk_dialog_set_has_separator (dialog, FALSE);
p->notebook_type = glade_xml_get_widget (gui, "notebook_type");
- p->option_type = glade_xml_get_widget (gui, "option_type");
+ p->combobox_type = glade_xml_get_widget (gui, "combobox_type");
p->calendar_specify = glade_xml_get_widget (gui, "calendar_specify");
p->spin_relative = glade_xml_get_widget (gui, "spin_relative");
- p->option_relative = glade_xml_get_widget (gui, "option_relative");
- p->option_past_future = glade_xml_get_widget (gui, "option_past_future");
+ p->combobox_relative = glade_xml_get_widget (gui, "combobox_relative");
+ p->combobox_past_future = glade_xml_get_widget (gui, "combobox_past_future");
set_values (fds);
- g_signal_connect (GTK_OPTION_MENU (p->option_type)->menu, "deactivate",
- G_CALLBACK (set_option_type), fds);
- g_signal_connect (GTK_OPTION_MENU (p->option_relative)->menu, "deactivate",
- G_CALLBACK (set_option_relative), fds);
- g_signal_connect (GTK_OPTION_MENU (p->option_past_future)->menu, "deactivate",
- G_CALLBACK (set_option_past_future), fds);
+ g_signal_connect (p->combobox_type, "changed", G_CALLBACK (set_combobox_type), fds);
+ g_signal_connect (p->combobox_relative, "changed", G_CALLBACK (set_combobox_relative), fds);
+ g_signal_connect (p->combobox_past_future, "changed", G_CALLBACK (set_combobox_past_future), fds);
gtk_box_pack_start ((GtkBox *) dialog->vbox, toplevel, TRUE, TRUE, 3);
diff --git a/filter/filter-option.c b/filter/filter-option.c
index 7af511b543..2e76eca1c3 100644
--- a/filter/filter-option.c
+++ b/filter/filter-option.c
@@ -342,11 +342,34 @@ xml_decode (FilterElement *fe, xmlNodePtr node)
}
static void
-option_changed (GtkWidget *widget, FilterElement *fe)
+combobox_changed (GtkWidget *widget, FilterElement *fe)
{
FilterOption *fo = (FilterOption *)fe;
- fo->current = g_object_get_data ((GObject *) widget, "option");
+ fo->current = (struct _filter_option *) g_list_nth (fo->options, gtk_combo_box_get_active (GTK_COMBO_BOX (widget)));
+}
+
+static GSList *
+get_dynamic_options (FilterOption *fo)
+{
+ GModule *module;
+ GSList *(*get_func)(void);
+ GSList *res = NULL;
+
+ if (!fo || !fo->dynamic_func)
+ return res;
+
+ module = g_module_open (NULL, G_MODULE_BIND_LAZY);
+
+ if (g_module_symbol (module, fo->dynamic_func, (gpointer) &get_func)) {
+ res = get_func ();
+ } else {
+ g_warning ("optionlist dynamic fill function '%s' not found", fo->dynamic_func);
+ }
+
+ g_module_close (module);
+
+ return res;
}
static GSList *
@@ -376,10 +399,7 @@ static GtkWidget *
get_widget (FilterElement *fe)
{
FilterOption *fo = (FilterOption *)fe;
- GtkWidget *menu;
- GtkWidget *omenu;
- GtkWidget *item;
- GtkWidget *first = NULL;
+ GtkWidget *combobox;
GList *l;
struct _filter_option *op;
int index = 0, current = 0;
@@ -436,35 +456,20 @@ get_widget (FilterElement *fe)
g_list_free (old_ops);
}
- menu = gtk_menu_new ();
+ combobox = gtk_combo_box_new_text ();
l = fo->options;
while (l) {
op = l->data;
- item = gtk_menu_item_new_with_label (_(op->title));
- g_object_set_data ((GObject *) item, "option", op);
- g_signal_connect (item, "activate", G_CALLBACK (option_changed), fe);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_widget_show (item);
- if (op == fo->current) {
- current = index;
- first = item;
- } else if (!first) {
- first = item;
- }
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(op->title));
l = g_list_next (l);
index++;
}
- omenu = gtk_option_menu_new ();
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
- if (first)
- g_signal_emit_by_name (first, "activate", fe);
-
- gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), current);
+ g_signal_connect (combobox, "changed", G_CALLBACK (combobox_changed), fe);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), current);
- return omenu;
+ return combobox;
}
static void
diff --git a/filter/filter-rule.c b/filter/filter-rule.c
index 9febe8d0ee..7972de13d0 100644
--- a/filter/filter-rule.c
+++ b/filter/filter-rule.c
@@ -605,13 +605,13 @@ build_code (FilterRule *fr, GString *out)
static void
fr_grouping_changed(GtkWidget *w, FilterRule *fr)
{
- fr->grouping = gtk_option_menu_get_history((GtkOptionMenu *)w);
+ fr->grouping = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
}
static void
fr_threading_changed(GtkWidget *w, FilterRule *fr)
{
- fr->threading = gtk_option_menu_get_history((GtkOptionMenu *)w);
+ fr->threading = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
}
struct _part_data {
@@ -622,11 +622,20 @@ 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 (data->f, part); part && i < index; i++, part = rule_context_next_part (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))
return;
@@ -644,17 +653,13 @@ option_activate (GtkMenuItem *item, struct _part_data *data)
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);
}
static GtkWidget *
get_rule_part_widget (RuleContext *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;
@@ -674,26 +679,23 @@ get_rule_part_widget (RuleContext *f, FilterPart *newpart, FilterRule *fr)
data->partwidget = p;
data->container = hbox;
- menu = gtk_menu_new ();
+ combobox = gtk_combo_box_new_text ();
+
/* sigh, this is a little ugly */
while ((part = rule_context_next_part (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;
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);
@@ -836,7 +838,7 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
{
GtkWidget *hbox, *vbox, *parts, *inframe;
GtkWidget *add, *label, *name, *w;
- GtkWidget *omenu, *menu, *item;
+ GtkWidget *combobox;
GtkWidget *scrolledwindow;
GtkObject *hadj, *vadj;
GList *l;
@@ -920,48 +922,40 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
const char *thread_types[] = { N_("If all conditions are met"), N_("If any conditions are met") };
label = gtk_label_new_with_mnemonic (_("_Find items:"));
- menu = gtk_menu_new ();
+ combobox = gtk_combo_box_new_text ();
for (i=0;i<2;i++) {
- item = gtk_menu_item_new_with_label(_(thread_types[i]));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(thread_types[i]));
}
- omenu = gtk_option_menu_new ();
- gtk_label_set_mnemonic_widget ((GtkLabel *)label, omenu);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), fr->grouping);
- gtk_widget_show (omenu);
+ gtk_label_set_mnemonic_widget ((GtkLabel *)label, combobox);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), fr->grouping);
+ gtk_widget_show (combobox);
- gtk_box_pack_end (GTK_BOX (hbox), omenu, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- g_signal_connect(omenu, "changed", G_CALLBACK(fr_grouping_changed), fr);
+ g_signal_connect (combobox, "changed", G_CALLBACK (fr_grouping_changed), fr);
}
if (f->flags & RULE_CONTEXT_THREADING) {
const char *thread_types[] = { N_("None"), N_("All related"), N_("Replies"), N_("Replies and parents"), N_("No reply or parent") };
label = gtk_label_new_with_mnemonic (_("I_nclude threads"));
- menu = gtk_menu_new ();
+ combobox = gtk_combo_box_new_text ();
for (i=0;i<5;i++) {
- item = gtk_menu_item_new_with_label(_(thread_types[i]));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(thread_types[i]));
}
- omenu = gtk_option_menu_new ();
- gtk_label_set_mnemonic_widget ((GtkLabel *)label, omenu);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
- gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), fr->threading);
- gtk_widget_show (omenu);
+ gtk_label_set_mnemonic_widget ((GtkLabel *)label, combobox);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), fr->threading);
+ gtk_widget_show (combobox);
- gtk_box_pack_end (GTK_BOX (hbox), omenu, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- g_signal_connect(omenu, "changed", G_CALLBACK(fr_threading_changed), fr);
+ g_signal_connect (combobox, "changed", G_CALLBACK (fr_threading_changed), fr);
}
gtk_box_pack_start (GTK_BOX (inframe), hbox, FALSE, FALSE, 3);
diff --git a/filter/filter.glade b/filter/filter.glade
index 3b43c26249..3773a234c1 100644
--- a/filter/filter.glade
+++ b/filter/filter.glade
@@ -6,7 +6,7 @@
<widget class="GtkWindow" id="rule-editor">
<property name="visible">True</property>
- <property name="title" translatable="no">window1</property>
+ <property name="title">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@@ -53,23 +53,11 @@
</child>
<child>
- <widget class="GtkOptionMenu" id="filter_source">
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget15">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Incoming</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
+ <widget class="GtkComboBox" id="filter_source_combobox">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Incoming</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -298,7 +286,7 @@
<widget class="GtkWindow" id="filter_datespec_win">
<property name="border_width">6</property>
<property name="visible">True</property>
- <property name="title" translatable="no">window1</property>
+ <property name="title">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@@ -351,40 +339,13 @@
</child>
<child>
- <widget class="GtkOptionMenu" id="option_type">
+ <widget class="GtkComboBox" id="combobox_type">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget19">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">the current time</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">the time you specify</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">a time relative to the current time</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
+ <property name="items" translatable="yes">the current time
+the time you specify
+a time relative to the current time</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -625,72 +586,17 @@ a time relative to when filtering occurs.</property>
</child>
<child>
- <widget class="GtkOptionMenu" id="option_relative">
+ <widget class="GtkComboBox" id="combobox_relative">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget23">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">seconds</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget27">
- <property name="visible">True</property>
- <property name="label" translatable="yes">days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">weeks</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">months</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">years</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
+ <property name="items" translatable="yes">seconds
+minutes
+hours
+days
+weeks
+months
+years</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -700,33 +606,12 @@ a time relative to when filtering occurs.</property>
</child>
<child>
- <widget class="GtkOptionMenu" id="option_past_future">
+ <widget class="GtkComboBox" id="combobox_past_future">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget31">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">ago</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget33">
- <property name="visible">True</property>
- <property name="label" translatable="yes">in the future</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
-
+ <property name="items" translatable="yes">ago
+in the future</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>