diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-04-25 22:07:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-04-25 22:07:44 +0800 |
commit | 86fdd3a1cba7c156cfa127322e258f5636b45a99 (patch) | |
tree | e49802fd9008a59587fca1cafb1801b8b3bf0db6 /calendar/gui/dialogs | |
parent | c2119e513bc7482fc0150287af8502a5ff67191a (diff) | |
parent | 23df769955ea54f756a579c19964df87ae6fd5c8 (diff) | |
download | gsoc2013-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 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/Makefile.am | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 157 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.glade | 182 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 62 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.glade | 184 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.h | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 32 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 6 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 143 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.glade | 108 | ||||
-rw-r--r-- | calendar/gui/dialogs/meeting-page.glade | 407 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 34 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.glade | 59 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 326 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.glade | 141 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 44 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 42 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.glade | 33 |
18 files changed, 710 insertions, 1254 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index 6dd8a4cd77..c6d61101a8 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -89,7 +89,6 @@ glade_DATA = \ cal-prefs-dialog.glade \ e-delegate-dialog.glade \ event-page.glade \ - meeting-page.glade \ memo-page.glade \ recurrence-page.glade \ schedule-page.glade \ diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index 2f1393d70f..3881c85106 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -60,18 +60,18 @@ typedef struct { /* Toplevel */ GtkWidget *toplevel; - GtkWidget *action; + GtkWidget *action_combo; GtkWidget *interval_value; - GtkWidget *value_units; - GtkWidget *relative; - GtkWidget *time; + GtkWidget *value_units_combo; + GtkWidget *relative_combo; + GtkWidget *time_combo; /* Alarm repeat widgets */ GtkWidget *repeat_toggle; GtkWidget *repeat_group; GtkWidget *repeat_quantity; GtkWidget *repeat_value; - GtkWidget *repeat_unit; + GtkWidget *repeat_unit_combo; GtkWidget *option_notebook; @@ -118,7 +118,7 @@ enum { DAYS }; -/* Option menu maps */ +/* Combo box maps */ static const int action_map[] = { E_CAL_COMPONENT_ALARM_DISPLAY, E_CAL_COMPONENT_ALARM_AUDIO, @@ -167,18 +167,18 @@ static const int duration_units_map[] = { }; static void populate_widgets_from_alarm (Dialog *dialog); -static void action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data); +static void action_changed_cb (GtkWidget *action_combo, gpointer data); /* Fills the widgets with default values */ static void clear_widgets (Dialog *dialog) { /* Sane defaults */ - e_dialog_option_menu_set (dialog->action, E_CAL_COMPONENT_ALARM_DISPLAY, action_map); + e_dialog_combo_box_set (dialog->action_combo, E_CAL_COMPONENT_ALARM_DISPLAY, action_map); e_dialog_spin_set (dialog->interval_value, 15); - e_dialog_option_menu_set (dialog->value_units, MINUTES, value_map); - e_dialog_option_menu_set (dialog->relative, BEFORE, relative_map); - e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map); + e_dialog_combo_box_set (dialog->value_units_combo, MINUTES, value_map); + e_dialog_combo_box_set (dialog->relative_combo, BEFORE, relative_map); + e_dialog_combo_box_set (dialog->time_combo, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map); gtk_widget_set_sensitive (dialog->repeat_group, FALSE); gtk_widget_set_sensitive (dialog->dalarm_group, FALSE); @@ -192,8 +192,9 @@ clear_widgets (Dialog *dialog) static void alarm_to_dialog (Dialog *dialog) { - GtkWidget *menu; - GList *l; + GtkTreeModel *model; + GtkTreeIter iter; + gboolean valid; gboolean repeat; ECalComponentAlarmAction action; char *email; @@ -203,12 +204,15 @@ alarm_to_dialog (Dialog *dialog) clear_widgets (dialog); /* Alarm types */ - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action)); - for (i = 0, l = GTK_MENU_SHELL (menu)->children; action_map[i] != -1; i++, l = l->next) { - if (e_cal_get_static_capability (dialog->ecal, action_map_cap[i])) - gtk_widget_set_sensitive (l->data, FALSE); - else - gtk_widget_set_sensitive (l->data, TRUE); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->action_combo)); + valid = gtk_tree_model_get_iter_first (model, &iter); + for (i = 0; valid && action_map[i] != -1; i++) { + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + 1, !e_cal_get_static_capability (dialog->ecal, action_map_cap[i]), + -1); + + valid = gtk_tree_model_iter_next (model, &iter); } /* Set a default address if possible */ @@ -220,6 +224,9 @@ alarm_to_dialog (Dialog *dialog) a = g_new0 (ECalComponentAttendee, 1); a->value = email; + a->cutype = ICAL_CUTYPE_INDIVIDUAL; + a->status = ICAL_PARTSTAT_NEEDSACTION; + a->role = ICAL_ROLE_REQPARTICIPANT; attendee_list.data = a; attendee_list.next = NULL; e_cal_component_alarm_set_attendee_list (dialog->alarm, &attendee_list); @@ -252,17 +259,17 @@ alarm_to_repeat_widgets (Dialog *dialog, ECalComponentAlarm *alarm) return; if ( repeat.duration.minutes ) { - e_dialog_option_menu_set (dialog->repeat_unit, DUR_MINUTES, duration_units_map); + e_dialog_combo_box_set (dialog->repeat_unit_combo, DUR_MINUTES, duration_units_map); e_dialog_spin_set (dialog->repeat_value, repeat.duration.minutes); } if ( repeat.duration.hours ) { - e_dialog_option_menu_set (dialog->repeat_unit, DUR_HOURS, duration_units_map); + e_dialog_combo_box_set (dialog->repeat_unit_combo, DUR_HOURS, duration_units_map); e_dialog_spin_set (dialog->repeat_value, repeat.duration.hours); } if ( repeat.duration.days ) { - e_dialog_option_menu_set (dialog->repeat_unit, DUR_DAYS, duration_units_map); + e_dialog_combo_box_set (dialog->repeat_unit_combo, DUR_DAYS, duration_units_map); e_dialog_spin_set (dialog->repeat_value, repeat.duration.days); } } @@ -282,7 +289,7 @@ repeat_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) repeat.repetitions = e_dialog_spin_get_int (dialog->repeat_quantity); memset (&repeat.duration, 0, sizeof (repeat.duration)); - switch (e_dialog_option_menu_get (dialog->repeat_unit, duration_units_map)) { + switch (e_dialog_combo_box_get (dialog->repeat_unit_combo, duration_units_map)) { case DUR_MINUTES: repeat.duration.minutes = e_dialog_spin_get_int (dialog->repeat_value); break; @@ -429,6 +436,9 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) a = g_new0 (ECalComponentAttendee, 1); a->value = e_destination_get_email (dest); a->cn = e_destination_get_name (dest); + a->cutype = ICAL_CUTYPE_INDIVIDUAL; + a->status = ICAL_PARTSTAT_NEEDSACTION; + a->role = ICAL_ROLE_REQPARTICIPANT; attendee_list = g_slist_append (attendee_list, a); } @@ -603,11 +613,11 @@ populate_widgets_from_alarm (Dialog *dialog) /* Alarm Types */ switch ( trigger->type ) { case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START: - e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map); + e_dialog_combo_box_set (dialog->time_combo, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map); break; case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: - e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END, time_map); + e_dialog_combo_box_set (dialog->time_combo, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END, time_map); break; default: g_warning ("%s: Unexpected alarm type (%d)", G_STRLOC, trigger->type); @@ -615,25 +625,25 @@ populate_widgets_from_alarm (Dialog *dialog) switch ( trigger->u.rel_duration.is_neg ){ case 1: - e_dialog_option_menu_set (dialog->relative, BEFORE, relative_map); + e_dialog_combo_box_set (dialog->relative_combo, BEFORE, relative_map); break; case 0: - e_dialog_option_menu_set (dialog->relative, AFTER, relative_map); + e_dialog_combo_box_set (dialog->relative_combo, AFTER, relative_map); break; } if ( trigger->u.rel_duration.days ) { - e_dialog_option_menu_set (dialog->value_units, DAYS, value_map); + e_dialog_combo_box_set (dialog->value_units_combo, DAYS, value_map); e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.days); } else if ( trigger->u.rel_duration.hours ) { - e_dialog_option_menu_set (dialog->value_units, HOURS, value_map); + e_dialog_combo_box_set (dialog->value_units_combo, HOURS, value_map); e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.hours); } else if ( trigger->u.rel_duration.minutes ) { - e_dialog_option_menu_set (dialog->value_units, MINUTES, value_map); + e_dialog_combo_box_set (dialog->value_units_combo, MINUTES, value_map); e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.minutes); } else { - e_dialog_option_menu_set (dialog->value_units, MINUTES, value_map); + e_dialog_combo_box_set (dialog->value_units_combo, MINUTES, value_map); e_dialog_spin_set (dialog->interval_value, 0); } @@ -641,8 +651,8 @@ populate_widgets_from_alarm (Dialog *dialog) alarm_to_repeat_widgets (dialog, dialog->alarm); /* Alarm options */ - e_dialog_option_menu_set (dialog->action, *action, action_map); - action_selection_done_cb (GTK_MENU_SHELL (gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action))), dialog); + e_dialog_combo_box_set (dialog->action_combo, *action, action_map); + action_changed_cb (dialog->action_combo, dialog); switch (*action) { case E_CAL_COMPONENT_ALARM_AUDIO: @@ -674,13 +684,13 @@ dialog_to_alarm (Dialog *dialog) /* Fill out the alarm */ memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger)); - trigger.type = e_dialog_option_menu_get (dialog->time, time_map); - if (e_dialog_option_menu_get (dialog->relative, relative_map) == BEFORE) + trigger.type = e_dialog_combo_box_get (dialog->time_combo, time_map); + if (e_dialog_combo_box_get (dialog->relative_combo, relative_map) == BEFORE) trigger.u.rel_duration.is_neg = 1; else trigger.u.rel_duration.is_neg = 0; - switch (e_dialog_option_menu_get (dialog->value_units, value_map)) { + switch (e_dialog_combo_box_get (dialog->value_units_combo, value_map)) { case MINUTES: trigger.u.rel_duration.minutes = e_dialog_spin_get_int (dialog->interval_value); @@ -701,7 +711,7 @@ dialog_to_alarm (Dialog *dialog) } e_cal_component_alarm_set_trigger (dialog->alarm, trigger); - action = e_dialog_option_menu_get (dialog->action, action_map); + action = e_dialog_combo_box_get (dialog->action_combo, action_map); e_cal_component_alarm_set_action (dialog->alarm, action); /* Repeat stuff */ @@ -747,17 +757,17 @@ get_widgets (Dialog *dialog) if (!dialog->toplevel) return FALSE; - dialog->action = GW ("action"); + dialog->action_combo = GW ("action-combobox"); dialog->interval_value = GW ("interval-value"); - dialog->value_units = GW ("value-units"); - dialog->relative = GW ("relative"); - dialog->time = GW ("time"); + dialog->value_units_combo = GW ("value-units-combobox"); + dialog->relative_combo = GW ("relative-combobox"); + dialog->time_combo = GW ("time-combobox"); dialog->repeat_toggle = GW ("repeat-toggle"); dialog->repeat_group = GW ("repeat-group"); dialog->repeat_quantity = GW ("repeat-quantity"); dialog->repeat_value = GW ("repeat-value"); - dialog->repeat_unit = GW ("repeat-unit"); + dialog->repeat_unit_combo = GW ("repeat-unit-combobox"); dialog->option_notebook = GW ("option-notebook"); @@ -781,16 +791,57 @@ get_widgets (Dialog *dialog) #undef GW - return (dialog->action + if (dialog->action_combo) { + const char *actions[] = { + N_("Pop up an alert"), + N_("Play a sound"), + N_("Run a program"), + N_("Send an email") + }; + + GtkComboBox *combo = (GtkComboBox*)dialog->action_combo; + GtkCellRenderer *cell; + GtkListStore *store; + gint i; + + g_return_val_if_fail (combo != NULL, FALSE); + g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), FALSE); + + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); + gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); + g_object_unref (store); + + gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo)); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, + "text", 0, + "sensitive", 1, + NULL); + + for (i = 0; i < G_N_ELEMENTS (actions); i++) { + GtkTreeIter iter; + + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + 0, _(actions[i]), + 1, TRUE, + -1); + } + } + + return (dialog->action_combo && dialog->interval_value - && dialog->value_units - && dialog->relative - && dialog->time + && dialog->value_units_combo + && dialog->relative_combo + && dialog->time_combo && dialog->repeat_toggle && dialog->repeat_group && dialog->repeat_quantity && dialog->repeat_value - && dialog->repeat_unit + && dialog->repeat_unit_combo && dialog->option_notebook && dialog->dalarm_group && dialog->dalarm_message @@ -817,7 +868,7 @@ show_options (Dialog *dialog) char *email; e_cal_component_alarm_set_action (dialog->alarm, - e_dialog_option_menu_get (dialog->action, action_map)); + e_dialog_combo_box_get (dialog->action_combo, action_map)); repeat = !e_cal_get_static_capability (dialog->ecal, CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT); @@ -1046,14 +1097,14 @@ malarm_description_changed_cb (GtkWidget *widget, gpointer data) } static void -action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) +action_changed_cb (GtkWidget *action_combo, gpointer data) { Dialog *dialog = data; char *dir; ECalComponentAlarmAction action; int page = 0, i; - action = e_dialog_option_menu_get (dialog->action, action_map); + action = e_dialog_combo_box_get (dialog->action_combo, action_map); for (i = 0; action_map[i] != -1 ; i++) { if (action == action_map[i]) { page = i; @@ -1096,12 +1147,10 @@ action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) static void init_widgets (Dialog *dialog) { - GtkWidget *menu; GtkTextBuffer *text_buffer; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action)); - g_signal_connect (menu, "selection_done", - G_CALLBACK (action_selection_done_cb), + g_signal_connect (dialog->action_combo, "changed", + G_CALLBACK (action_changed_cb), dialog); g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled", diff --git a/calendar/gui/dialogs/alarm-dialog.glade b/calendar/gui/dialogs/alarm-dialog.glade index 5a5d4ef291..91b23c5e6d 100644 --- a/calendar/gui/dialogs/alarm-dialog.glade +++ b/calendar/gui/dialogs/alarm-dialog.glade @@ -137,48 +137,10 @@ <property name="spacing">6</property> <child> - <widget class="GtkOptionMenu" id="action"> + <widget class="GtkComboBox" id="action-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Pop up an alert</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget3"> - <property name="visible">True</property> - <property name="label" translatable="yes">Play a sound</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget4"> - <property name="visible">True</property> - <property name="label" translatable="yes">Run a program</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="send_an_email1"> - <property name="visible">True</property> - <property name="label" translatable="yes">Send an email</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -207,40 +169,13 @@ </child> <child> - <widget class="GtkOptionMenu" id="value-units"> + <widget class="GtkComboBox" id="value-units-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget5"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget6"> - <property name="visible">True</property> - <property name="label" translatable="yes">minute(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget7"> - <property name="visible">True</property> - <property name="label" translatable="yes">hour(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget8"> - <property name="visible">True</property> - <property name="label" translatable="yes">day(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">minute(s) +hour(s) +day(s)</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -250,32 +185,12 @@ </child> <child> - <widget class="GtkOptionMenu" id="relative"> + <widget class="GtkComboBox" id="relative-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget9"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget10"> - <property name="visible">True</property> - <property name="label" translatable="yes">before</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget11"> - <property name="visible">True</property> - <property name="label" translatable="yes">after</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">before +after</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -285,32 +200,12 @@ </child> <child> - <widget class="GtkOptionMenu" id="time"> + <widget class="GtkComboBox" id="time-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget12"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget13"> - <property name="visible">True</property> - <property name="label" translatable="yes">start of appointment</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget14"> - <property name="visible">True</property> - <property name="label" translatable="yes">end of appointment</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">start of appointment +end of appointment</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -485,40 +380,13 @@ </child> <child> - <widget class="GtkOptionMenu" id="repeat-unit"> + <widget class="GtkComboBox" id="repeat-unit-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget2"> - <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="convertwidget3"> - <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="convertwidget4"> - <property name="visible">True</property> - <property name="label" translatable="yes">days</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">minutes +hours +days</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 21ace5aea4..70058bcd89 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -119,15 +119,8 @@ static void timezone_changed (GtkWidget *widget, CalendarPrefsDialog *prefs) { icaltimezone *zone; - icalcomponent *icalcomp, *dl_comp; zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (prefs->timezone)); - icalcomp = icaltimezone_get_component (zone); - - if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) - gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, FALSE); - else - gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, TRUE); calendar_config_set_timezone (icaltimezone_get_location (zone)); } @@ -228,14 +221,6 @@ day_second_zone_clicked (GtkWidget *widget, CalendarPrefsDialog *prefs) } static void -daylight_saving_changed (GtkWidget *widget, CalendarPrefsDialog *prefs) -{ - gboolean set = gtk_toggle_button_get_active ((GtkToggleButton *) prefs->daylight_saving); - calendar_config_set_daylight_saving (set); - timezone_changed (widget, prefs); -} - -static void start_of_day_changed (GtkWidget *widget, CalendarPrefsDialog *prefs) { int start_hour, start_minute, end_hour, end_minute; @@ -495,6 +480,30 @@ template_url_changed (GtkEntry *entry, CalendarPrefsDialog *prefs) } static void +update_system_tz_widgets (CalendarPrefsDialog *prefs) +{ + icaltimezone *zone; + + zone = e_cal_util_get_system_timezone (); + if (zone) { + char *tmp = g_strdup_printf ("(%s)", icaltimezone_get_display_name (zone)); + gtk_label_set_text (GTK_LABEL (prefs->system_tz_label), tmp); + g_free (tmp); + } else { + gtk_label_set_text (GTK_LABEL (prefs->system_tz_label), "(UTC)"); + } + + gtk_widget_set_sensitive (prefs->timezone, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check))); +} + +static void +use_system_tz_changed (GtkWidget *check, CalendarPrefsDialog *prefs) +{ + calendar_config_set_use_system_timezone (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))); + update_system_tz_widgets (prefs); +} + +static void setup_changes (CalendarPrefsDialog *prefs) { int i; @@ -502,9 +511,9 @@ setup_changes (CalendarPrefsDialog *prefs) for (i = 0; i < 7; i ++) g_signal_connect (G_OBJECT (prefs->working_days[i]), "toggled", G_CALLBACK (working_days_changed), prefs); + g_signal_connect (G_OBJECT (prefs->use_system_tz_check), "toggled", G_CALLBACK (use_system_tz_changed), prefs); g_signal_connect (G_OBJECT (prefs->timezone), "changed", G_CALLBACK (timezone_changed), prefs); g_signal_connect (G_OBJECT (prefs->day_second_zone), "clicked", G_CALLBACK (day_second_zone_clicked), prefs); - g_signal_connect (G_OBJECT (prefs->daylight_saving), "toggled", G_CALLBACK (daylight_saving_changed), prefs); g_signal_connect (G_OBJECT (prefs->start_of_day), "changed", G_CALLBACK (start_of_day_changed), prefs); g_signal_connect (G_OBJECT (prefs->end_of_day), "changed", G_CALLBACK (end_of_day_changed), prefs); @@ -632,25 +641,23 @@ show_config (CalendarPrefsDialog *prefs) gint mask, day, week_start_day, time_divisions; icaltimezone *zone; gboolean sensitive, set = FALSE; - icalcomponent *icalcomp, *dl_comp; char *location; CalUnits units; int interval; + /* Use system timezone */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check), calendar_config_get_use_system_timezone ()); + gtk_widget_set_sensitive (prefs->system_tz_label, FALSE); + update_system_tz_widgets (prefs); + /* Timezone. */ - location = calendar_config_get_timezone (); + location = calendar_config_get_timezone_stored (); zone = icaltimezone_get_builtin_timezone (location); e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (prefs->timezone), zone); g_free (location); - icalcomp = icaltimezone_get_component (zone); - if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) - gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, FALSE); - else - gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, TRUE); - - set = calendar_config_get_daylight_saving (); - gtk_toggle_button_set_active ((GtkToggleButton *) prefs->daylight_saving, set); + /* Day's second zone */ + update_day_second_zone_caption (prefs); /* Day's second zone */ update_day_second_zone_caption (prefs); @@ -788,9 +795,10 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs) e_config_add_items ((EConfig *) ec, l, NULL, NULL, eccp_free, prefs); /* General tab */ + prefs->use_system_tz_check = glade_xml_get_widget (gui, "use-system-tz-check"); + prefs->system_tz_label = glade_xml_get_widget (gui, "system-tz-label"); prefs->timezone = glade_xml_get_widget (gui, "timezone"); prefs->day_second_zone = glade_xml_get_widget (gui, "day_second_zone"); - prefs->daylight_saving = glade_xml_get_widget (gui, "daylight_cb"); for (i = 0; i < 7; i++) prefs->working_days[i] = glade_xml_get_widget (gui, working_day_names[i]); prefs->week_start_day = glade_xml_get_widget (gui, "week_start_day"); diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade index f3509e4f8f..867abdbb22 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.glade +++ b/calendar/gui/dialogs/cal-prefs-dialog.glade @@ -96,37 +96,103 @@ <child> <widget class="GtkTable" id="time"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">6</property> <property name="column_spacing">6</property> <child> - <widget class="Custom" id="timezone"> + <widget class="GtkLabel" id="label63"> <property name="visible">True</property> - <property name="creation_function">make_timezone_entry</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property> - <accessibility> - <atkrelation target="timezone_label" type="labelled-by"/> - </accessibility> + <property name="label" translatable="yes">Se_cond zone:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">day_second_zone</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox25"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkButton" id="day_second_zone"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">None</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label64"> + <property name="visible">True</property> + <property name="label" translatable="yes">(Shown in a Day View)</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">6</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkLabel" id="timezone_label"> + <widget class="GtkLabel" id="label11"> <property name="visible">True</property> - <property name="label" translatable="yes">Time _zone:</property> - <property name="use_underline">True</property> + <property name="label" translatable="yes">Time format:</property> + <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> @@ -135,7 +201,6 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">timezone</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -144,8 +209,8 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -221,34 +286,28 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkLabel" id="label11"> + <widget class="GtkCheckButton" id="daylight_cb"> <property name="visible">True</property> - <property name="label" translatable="yes">Time format:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Adjust for daylight sa_ving time</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> </widget> <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> <property name="top_attach">2</property> <property name="bottom_attach">3</property> <property name="x_options">fill</property> @@ -257,9 +316,29 @@ </child> <child> - <widget class="GtkLabel" id="label63"> + <widget class="Custom" id="timezone"> <property name="visible">True</property> - <property name="label" translatable="yes">Se_cond zone:</property> + <property name="creation_function">make_timezone_entry</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property> + <accessibility> + <atkrelation target="timezone_label" type="labelled-by"/> + </accessibility> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="timezone_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">Time _zone:</property> <property name="use_underline">True</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -269,7 +348,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">day_second_zone</property> + <property name="mnemonic_widget">timezone</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -278,39 +357,42 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkHBox" id="hbox25"> + <widget class="GtkHBox" id="hbox26"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkButton" id="day_second_zone"> + <widget class="GtkCheckButton" id="use-system-tz-check"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">None</property> + <property name="label" translatable="yes">Use s_ystem time zone</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> </widget> <packing> <property name="padding">0</property> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> </packing> </child> <child> - <widget class="GtkLabel" id="label64"> + <widget class="GtkLabel" id="system-tz-label"> <property name="visible">True</property> - <property name="label" translatable="yes">(Shown in a Day View)</property> + <property name="label">(system/tz)</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -318,7 +400,7 @@ <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> - <property name="xpad">6</property> + <property name="xpad">5</property> <property name="ypad">0</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> @@ -335,10 +417,9 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> <property name="x_options">fill</property> - <property name="y_options">fill</property> </packing> </child> </widget> @@ -1268,6 +1349,7 @@ Days</property> <property name="fill">False</property> </packing> </child> + <child> <widget class="GtkCheckButton" id="dview_show_week_no"> <property name="visible">True</property> diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h index 895a263986..0ef1e4a667 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.h +++ b/calendar/gui/dialogs/cal-prefs-dialog.h @@ -42,9 +42,10 @@ struct _CalendarPrefsDialog { GConfClient *gconf; /* General tab */ + GtkWidget *use_system_tz_check; + GtkWidget *system_tz_label; GtkWidget *timezone; GtkWidget *day_second_zone; - GtkWidget *daylight_saving; GtkWidget *working_days[7]; GtkWidget *week_start_day; GtkWidget *start_of_day; diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 65e5e71183..9405663a9b 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -102,6 +102,11 @@ struct _CompEditorPrivate { gchar *summary; + /* Manages menus and toolbars */ + GtkUIManager *manager; + + gchar *summary; + guint32 attachment_bar_visible : 1; /* TODO use this flags for setting all the boolean variables @@ -162,6 +167,7 @@ static const gchar *ui = "</ui>"; static void comp_editor_show_help (CompEditor *editor); +static void setup_widgets (CompEditor *editor); static void real_edit_comp (CompEditor *editor, ECalComponent *comp); static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms); @@ -460,7 +466,7 @@ save_comp (CompEditor *editor) } /* If we are not the organizer, we don't update the sequence number */ - if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone)) + if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone, priv->client)) e_cal_component_commit_sequence (clone); else e_cal_component_abort_sequence (clone); @@ -485,6 +491,11 @@ save_comp (CompEditor *editor) if (result) g_signal_emit_by_name (editor, "object_created"); } else { + + if (e_cal_component_has_recurrences (priv->comp) && priv->mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (priv->comp, priv->client); + + if (priv->mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (priv->comp, NULL); e_cal_component_set_rrule_list (priv->comp, NULL); @@ -595,7 +606,7 @@ save_comp_with_send (CompEditor *editor) return FALSE; if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org, &strip_alarms))) { - if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp))) { + if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp, priv->client))) { if (e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_JOURNAL) return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_PUBLISH, strip_alarms); else @@ -1948,9 +1959,9 @@ comp_editor_set_flags (CompEditor *editor, g_object_notify (G_OBJECT (editor), "flags"); } - -CompEditorFlags -comp_editor_get_flags (CompEditor *editor) +GtkActionGroup * +comp_editor_get_action_group (CompEditor *editor, + const gchar *group_name) { g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); @@ -2300,6 +2311,7 @@ fill_widgets (CompEditor *editor) EAttachmentView *view; CompEditorPrivate *priv; GList *l; + GtkAction *action; view = E_ATTACHMENT_VIEW (editor->priv->attachment_view); store = e_attachment_view_get_store (view); @@ -2321,6 +2333,9 @@ fill_widgets (CompEditor *editor) g_slist_free (attachment_list); } + action = comp_editor_get_action (editor, "classify-public"); + g_signal_handlers_block_by_func (action, G_CALLBACK (classification_changed_cb), editor); + for (l = priv->pages; l != NULL; l = l->next) comp_editor_page_fill_widgets (l->data, priv->comp); } @@ -2343,7 +2358,7 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp) priv->comp = e_cal_component_clone (comp); priv->existing_org = e_cal_component_has_organizer (comp); - priv->user_org = (itip_organizer_is_user (comp, priv->client) || itip_sentby_is_user (comp)); + priv->user_org = (itip_organizer_is_user (comp, priv->client) || itip_sentby_is_user (comp, priv->client)); priv->warned = FALSE; update_window_border (editor, NULL); @@ -2369,10 +2384,11 @@ set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComp prop; prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { const char *attendee = icalproperty_get_attendee (prop); - const char *delfrom; + const char *delfrom = NULL; param = icalproperty_get_first_parameter(prop, ICAL_DELEGATEDFROM_PARAMETER); - delfrom = icalparameter_get_delegatedfrom (param); + if (param) + delfrom = icalparameter_get_delegatedfrom (param); if (!(g_str_equal (itip_strip_mailto (attendee), address) || ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), address)))) { diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index e2ca71c5cb..812575ef4c 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -112,7 +112,7 @@ create_schedule_page (CompEditor *editor) priv = EVENT_EDITOR_GET_PRIVATE (editor); priv->sched_window = gtk_dialog_new_with_buttons ( - _("Free/Busy"), GTK_WINDOW (editor), GTK_DIALOG_MODAL, + _("Free/Busy"), GTK_WINDOW (editor), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); g_signal_connect ( @@ -167,7 +167,7 @@ action_free_busy_cb (GtkAction *action, if (editor->priv->sched_window == NULL) create_schedule_page (COMP_EDITOR (editor)); else - gtk_widget_show (editor->priv->sched_window); + gtk_window_present (GTK_WINDOW (editor->priv->sched_window)); } static void @@ -619,7 +619,7 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) } e_cal_component_free_attendee_list (attendees); - comp_editor_set_needs_send (editor, priv->meeting_shown && (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp))); + comp_editor_set_needs_send (editor, priv->meeting_shown && (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client))); priv->updating = FALSE; } diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 1f09663c53..b0fcdc4632 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -98,7 +98,7 @@ struct _EventPagePrivate { GtkWidget *start_time; GtkWidget *end_time; - GtkWidget *end_time_selector; + GtkWidget *end_time_combo; GtkWidget *time_hour; GtkWidget *hour_selector; GtkWidget *minute_selector; @@ -115,7 +115,7 @@ struct _EventPagePrivate { gboolean show_time_as_busy; GtkWidget *alarm_dialog; - GtkWidget *alarm_time; + GtkWidget *alarm_time_combo; GtkWidget *alarm_warning; GtkWidget *alarm_box; @@ -174,7 +174,7 @@ static void set_attendees (ECalComponent *comp, const GPtrArray *attendees); static void hour_sel_changed ( GtkSpinButton *widget, EventPage *epage); static void minute_sel_changed ( GtkSpinButton *widget, EventPage *epage); static void hour_minute_changed ( EventPage *epage); -static void update_end_time_selector( EventPage *epage); +static void update_end_time_combo ( EventPage *epage); static void event_page_select_organizer (EventPage *epage, const char *backend_address); static void set_subscriber_info_string (EventPage *epage, const char *backend_address); @@ -354,8 +354,8 @@ set_all_day (EventPage *epage, gboolean all_day) /* TODO implement for in end time selector */ if (all_day) - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); - gtk_widget_set_sensitive (priv->end_time_selector, !all_day); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1); + gtk_widget_set_sensitive (priv->end_time_combo, !all_day); e_date_edit_set_show_time (E_DATE_EDIT (priv->start_time), !all_day); e_date_edit_set_show_time (E_DATE_EDIT (priv->end_time), !all_day); @@ -450,7 +450,7 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD priv->sync_timezones = TRUE; - update_end_time_selector (epage); + update_end_time_combo (epage); } /* Fills the widgets with default values */ @@ -488,7 +488,7 @@ clear_widgets (EventPage *epage) set_busy_time_menu (epage, TRUE); /* Alarm */ - e_dialog_option_menu_set (priv->alarm_time, ALARM_NONE, alarm_map); + e_dialog_combo_box_set (priv->alarm_time_combo, ALARM_NONE, alarm_map); /* Categories */ e_dialog_editable_set (priv->categories, NULL); @@ -728,9 +728,9 @@ sensitize_widgets (EventPage *epage) sensitize = !read_only && sens; - alarm = e_dialog_option_menu_get (priv->alarm_time, alarm_map) != ALARM_NONE; + alarm = e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map) != ALARM_NONE; custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) || - e_dialog_option_menu_get (priv->alarm_time, alarm_map) == ALARM_CUSTOM ? TRUE:FALSE; + e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map) == ALARM_CUSTOM ? TRUE:FALSE; if (alarm && !priv->alarm_icon) { priv->alarm_icon = create_image_event_box ("stock_bell", _("This event has alarms")); @@ -740,7 +740,7 @@ sensitize_widgets (EventPage *epage) /* The list of organizers is set to be non-editable. Otherwise any * change in the displayed list causes an 'Account not found' error. */ - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->organizer))), FALSE); gtk_editable_set_editable (GTK_EDITABLE (priv->summary), !read_only); gtk_editable_set_editable (GTK_EDITABLE (priv->location), sensitize); @@ -750,16 +750,16 @@ sensitize_widgets (EventPage *epage) gtk_widget_set_sensitive (priv->end_time, sensitize); gtk_widget_set_sensitive (priv->end_timezone, sensitize); gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->description), !read_only); - gtk_widget_set_sensitive (priv->alarm_time, !read_only); + gtk_widget_set_sensitive (priv->alarm_time_combo, !read_only); gtk_widget_set_sensitive (priv->categories_btn, !read_only); /*TODO implement the for portion of the end time selector */ if (flags & COMP_EDITOR_NEW_ITEM) { if (priv->all_day_event) - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1); else - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 0); } else - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1); gtk_widget_set_sensitive (priv->hour_selector, sensitize); gtk_widget_set_sensitive (priv->minute_selector, sensitize); @@ -856,7 +856,7 @@ get_current_account (EventPage *epage) priv = epage->priv; - str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry)); + str = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer)))); if (!str) return NULL; @@ -960,9 +960,8 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (organizer.value != NULL) { const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; - GList *list = NULL; - if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) { + if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) { if (e_cal_get_static_capability ( client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) @@ -986,13 +985,15 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) string = g_strdup (strip); if (!priv->user_org) { - list = g_list_append (list, string); - gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), list); - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->organizer), string); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->organizer), 0); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->organizer))), FALSE); + } else { + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer))), string); } g_free (string); - g_list_free (list); priv->existing = TRUE; } } else { @@ -1039,7 +1040,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) e_cal_component_free_datetime (&start_date); e_cal_component_free_datetime (&end_date); - update_end_time_selector (epage); + update_end_time_combo (epage); /* Classification */ e_cal_component_get_classification (comp, &cl); comp_editor_set_classification (editor, cl); @@ -1064,7 +1065,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) enable_busy_time_menu (epage, TRUE); /* Alarms */ - g_signal_handlers_block_matched (priv->alarm_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); + g_signal_handlers_block_matched (priv->alarm_time_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_block_matched (priv->alarm_list_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); if (e_cal_component_has_alarms (comp)) { @@ -1073,9 +1074,9 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) alarms = e_cal_component_get_alarm_uids (comp); if (!is_custom_alarm_uid_list (comp, alarms, priv->old_summary, priv->alarm_units, priv->alarm_interval, &alarm_type)) - e_dialog_option_menu_set (priv->alarm_time, alarm_type, alarm_map); + e_dialog_combo_box_set (priv->alarm_time_combo, alarm_type, alarm_map); else - e_dialog_option_menu_set (priv->alarm_time, ALARM_CUSTOM, alarm_map); + e_dialog_combo_box_set (priv->alarm_time_combo, ALARM_CUSTOM, alarm_map); for (list = alarms; list != NULL; list = list->next) { ECalComponentAlarm *ca; @@ -1087,9 +1088,9 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) cal_obj_uid_list_free (alarms); } else { - e_dialog_option_menu_set (priv->alarm_time, ALARM_NONE, alarm_map); + e_dialog_combo_box_set (priv->alarm_time_combo, ALARM_NONE, alarm_map); } - g_signal_handlers_unblock_matched (priv->alarm_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); + g_signal_handlers_unblock_matched (priv->alarm_time_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_unblock_matched (priv->alarm_list_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); /* Categories */ @@ -1281,8 +1282,8 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) /* Alarm */ e_cal_component_remove_all_alarms (comp); - if (e_dialog_option_menu_get (priv->alarm_time, alarm_map) != ALARM_NONE) { - if (e_dialog_option_menu_get (priv->alarm_time, alarm_map) == ALARM_CUSTOM) { + if (e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map) != ALARM_NONE) { + if (e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map) == ALARM_CUSTOM) { GtkTreeModel *model; GtkTreeIter iter; gboolean valid_iter; @@ -1349,7 +1350,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; trigger.u.rel_duration.is_neg = 1; - alarm_type = e_dialog_option_menu_get (priv->alarm_time, alarm_map); + alarm_type = e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map); switch (alarm_type) { case ALARM_15_MINUTES: trigger.u.rel_duration.minutes = 15; @@ -1512,10 +1513,10 @@ event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) static void -time_sel_changed (GtkOptionMenu *widget, EventPage *epage) +time_sel_changed (GtkComboBox *combo, EventPage *epage) { EventPagePrivate *priv; - int selection = gtk_option_menu_get_history (widget); + int selection = gtk_combo_box_get_active (combo); priv = epage->priv; @@ -1528,12 +1529,12 @@ time_sel_changed (GtkOptionMenu *widget, EventPage *epage) gtk_widget_show (priv->time_hour); gtk_widget_hide (priv->end_time); - update_end_time_selector ( epage); + update_end_time_combo ( epage); } } static -void update_end_time_selector (EventPage *epage) +void update_end_time_combo (EventPage *epage) { EventPagePrivate *priv; struct icaltimetype start_tt = icaltime_null_time(); @@ -2019,11 +2020,11 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) g_return_if_fail (date_set); /* TODO implement the for portion in end time selector */ - gtk_widget_set_sensitive (priv->end_time_selector, !all_day); + gtk_widget_set_sensitive (priv->end_time_combo, !all_day); if (all_day) - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1); else - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 0); action = comp_editor_get_action (editor, "view-time-zone"); gtk_action_set_sensitive (action, !all_day); @@ -2176,7 +2177,7 @@ get_widgets (EventPage *epage) page->accel_group = g_object_ref (accel_groups->data); priv->alarm_dialog = GW ("alarm-dialog"); priv->alarm_box = GW ("custom_box"); - priv->alarm_time = GW ("alarm-time"); + priv->alarm_time_combo = GW ("alarm-time-combobox"); priv->timezone_label = GW ("timezone-label"); priv->start_timezone = GW ("start-timezone"); @@ -2199,7 +2200,10 @@ get_widgets (EventPage *epage) priv->categories = GW ("categories"); priv->categories_btn = GW ("categories-button"); + priv->organizer = GW ("organizer"); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); + priv->summary = GW ("summary"); priv->summary_label = GW ("summary-label"); priv->location = GW ("location"); @@ -2236,7 +2240,7 @@ get_widgets (EventPage *epage) priv->time_hour = GW ("time-hour"); priv->hour_selector = GW ("hour_selector"); priv->minute_selector = GW ("minute_selector"); - priv->end_time_selector = GW ("end-time-selector"); + priv->end_time_combo = GW ("end-time-combobox"); priv->end_time = GW ("end-time"); gtk_widget_show_all (priv->time_hour); @@ -2634,7 +2638,7 @@ alarm_changed_cb (GtkWidget *widget, { EventPagePrivate *priv = epage->priv; - if (e_dialog_option_menu_get (priv->alarm_time, alarm_map) != ALARM_NONE) { + if (e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map) != ALARM_NONE) { ECalComponentAlarm *ca; ECalComponentAlarmTrigger trigger; icalcomponent *icalcomp; @@ -2649,7 +2653,7 @@ alarm_changed_cb (GtkWidget *widget, trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; trigger.u.rel_duration.is_neg = 1; - alarm_type = e_dialog_option_menu_get (priv->alarm_time, alarm_map); + alarm_type = e_dialog_combo_box_get (priv->alarm_time_combo, alarm_map); switch (alarm_type) { case ALARM_15_MINUTES: e_alarm_list_clear (priv->alarm_list_store); @@ -2773,9 +2777,8 @@ init_widgets (EventPage *epage) CompEditor *editor; GtkTextBuffer *text_buffer; icaltimezone *zone; - char *menu_label = NULL; + char *combo_label = NULL; GtkTreeSelection *selection; - GtkWidget *cus_item, *menu; ECal *client; editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage)); @@ -2881,11 +2884,11 @@ init_widgets (EventPage *epage) } /* End time selector */ - gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->end_time_combo), 1); gtk_widget_hide (priv->time_hour); gtk_widget_show (priv->end_time); - g_signal_connect (priv->end_time_selector, "changed", G_CALLBACK (time_sel_changed), epage); - update_end_time_selector ( epage); + g_signal_connect (priv->end_time_combo, "changed", G_CALLBACK (time_sel_changed), epage); + update_end_time_combo ( epage); /* Hour and Minute selector */ gtk_spin_button_set_range( (GtkSpinButton*) priv->hour_selector, 0, G_MAXINT); @@ -2896,50 +2899,40 @@ init_widgets (EventPage *epage) priv->alarm_units = calendar_config_get_default_reminder_units (); priv->alarm_interval = calendar_config_get_default_reminder_interval (); - menu_label = ""; + combo_label = NULL; switch (priv->alarm_units) { case CAL_DAYS: if (priv->alarm_interval != 1) { - menu_label = g_strdup_printf (ngettext("%d day before appointment", "%d days before appointment", priv->alarm_interval), priv->alarm_interval); + combo_label = g_strdup_printf (ngettext("%d day before appointment", "%d days before appointment", priv->alarm_interval), priv->alarm_interval); } break; case CAL_HOURS: if (priv->alarm_interval != 1) { - menu_label = g_strdup_printf (ngettext("%d hour before appointment", "%d hours before appointment", priv->alarm_interval), priv->alarm_interval); + combo_label = g_strdup_printf (ngettext("%d hour before appointment", "%d hours before appointment", priv->alarm_interval), priv->alarm_interval); } break; case CAL_MINUTES: if (priv->alarm_interval != 15) { - menu_label = g_strdup_printf (ngettext("%d minute before appointment", "%d minutes before appointment", priv->alarm_interval), priv->alarm_interval); + combo_label = g_strdup_printf (ngettext("%d minute before appointment", "%d minutes before appointment", priv->alarm_interval), priv->alarm_interval); } break; } - cus_item = gtk_menu_item_new_with_label (menu_label); - if(menu_label[0] != '\0') { - gtk_widget_show (cus_item); + if (combo_label) { + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->alarm_time_combo), combo_label); + g_free (combo_label); } - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); - - cus_item = gtk_menu_item_new_with_label (_("Customize")); - gtk_widget_show (cus_item); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); - - cus_item = gtk_menu_item_new_with_label (_("None")); - gtk_widget_show (cus_item); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); - gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), cus_item); + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->alarm_time_combo), _("Customize")); + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->alarm_time_combo), _("None")); g_signal_connect_swapped ( - priv->alarm_time, "changed", + priv->alarm_time_combo, "changed", G_CALLBACK (comp_editor_page_changed), epage); g_signal_connect ( - priv->alarm_time, "changed", + priv->alarm_time_combo, "changed", G_CALLBACK (alarm_changed_cb), epage); /* Belongs to priv->description */ @@ -3024,9 +3017,8 @@ event_page_select_organizer (EventPage *epage, const char *backend_address) if (default_address) { if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), default_address); - /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ - gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->organizer)->button), !subscribed_cal); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer))), default_address); + gtk_widget_set_sensitive (priv->organizer, !subscribed_cal); } } else g_warning ("No potential organizers!"); @@ -3092,9 +3084,14 @@ event_page_construct (EventPage *epage, EMeetingStore *model) g_object_unref(it); - if (priv->address_strings) - gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings); - else + if (priv->address_strings) { + GList *l; + + for (l = priv->address_strings; l; l = l->next) + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->organizer), l->data); + + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->organizer), 0); + } else g_warning ("No potential organizers!"); if (!init_widgets (epage)) { diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade index c7d00dda94..7a57f6b716 100644 --- a/calendar/gui/dialogs/event-page.glade +++ b/calendar/gui/dialogs/event-page.glade @@ -198,7 +198,6 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">organizer-entry</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -392,34 +391,12 @@ <property name="spacing">0</property> <child> - <widget class="GtkOptionMenu" id="end-time-selector"> - <property name="height_request">24</property> + <widget class="GtkComboBox" id="end-time-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child> - <widget class="GtkMenu" id="menu2"> - - <child> - <widget class="GtkMenuItem" id="for1"> - <property name="visible">True</property> - <property name="label" translatable="yes">for</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_for1_activate" last_modification_time="Tue, 18 Oct 2005 03:44:20 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="until1"> - <property name="visible">True</property> - <property name="label" translatable="yes">until</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_until1_activate" last_modification_time="Tue, 18 Oct 2005 03:44:20 GMT"/> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">for +until</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">12</property> @@ -756,34 +733,13 @@ <property name="spacing">0</property> <child> - <widget class="GtkCombo" id="organizer"> + <widget class="GtkComboBoxEntry" id="organizer"> <property name="visible">True</property> - <property name="value_in_list">False</property> - <property name="allow_empty">True</property> - <property name="case_sensitive">False</property> - <property name="enable_arrow_keys">True</property> - <property name="enable_arrows_always">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="organizer-entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child internal-child="list"> - <widget class="GtkList" id="combo-list1"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - </widget> - </child> + <property name="items" translatable="yes">a +b</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -1090,7 +1046,6 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">alarm-time</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -1104,42 +1059,13 @@ </child> <child> - <widget class="GtkOptionMenu" id="alarm-time"> + <widget class="GtkComboBox" id="alarm-time-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child> - <widget class="GtkMenu" id="menu1"> - - <child> - <widget class="GtkMenuItem" id="15_minutes_before_appointment1"> - <property name="visible">True</property> - <property name="label" translatable="yes">15 minutes before appointment</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_15_minutes_before_appointment1_activate" last_modification_time="Mon, 10 Oct 2005 02:55:55 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="1_hour_before_appointment1"> - <property name="visible">True</property> - <property name="label" translatable="yes">1 hour before appointment</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_1_hour_before_appointment1_activate" last_modification_time="Mon, 10 Oct 2005 02:55:55 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="1day_before_appointment1"> - <property name="visible">True</property> - <property name="label" translatable="yes">1 day before appointment</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_1day_before_appointment1_activate" last_modification_time="Mon, 10 Oct 2005 02:55:55 GMT"/> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">15 minutes before appointment +1 hour before appointment +1 day before appointment</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">4</property> diff --git a/calendar/gui/dialogs/meeting-page.glade b/calendar/gui/dialogs/meeting-page.glade deleted file mode 100644 index c332d081ca..0000000000 --- a/calendar/gui/dialogs/meeting-page.glade +++ /dev/null @@ -1,407 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="meeting-toplevel"> - <property name="title" translatable="no">window1</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - - <child> - <widget class="GtkVBox" id="meeting-page"> - <property name="border_width">12</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="organizer-table"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="label10"> - <property name="visible">True</property> - <property name="label" translatable="yes">Or_ganizer:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">organizer-entry</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCombo" id="organizer"> - <property name="visible">True</property> - <property name="value_in_list">True</property> - <property name="allow_empty">False</property> - <property name="case_sensitive">False</property> - <property name="enable_arrow_keys">True</property> - <property name="enable_arrows_always">False</property> - <accessibility> - <atkproperty name="AtkObject::accessible_name" translatable="yes">Organizer</atkproperty> - </accessibility> - - <child internal-child="entry"> - <widget class="GtkEntry" id="organizer-entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child internal-child="list"> - <widget class="GtkList" id="convertwidget1"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - - <child> - <widget class="GtkListItem" id="convertwidget2"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="convertwidget3"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="existing-organizer-table"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="org-label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Organizer:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">organizer-entry</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="existing-organizer"> - <property name="visible">True</property> - <property name="label" translatable="yes">None</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="existing-organizer-button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">C_hange Organizer</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="attendees-label"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Att_endees</b></property> - <property name="use_underline">True</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="list-box"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkVButtonBox" id="vbuttonbox1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkButton" id="add-attendee"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-add</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="remove-attendee"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-remove</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="invite"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">gtk-jump-to</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Co_ntacts...</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 362a8b0e9a..4f8c37c0a3 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -255,22 +255,21 @@ memo_page_fill_widgets (CompEditorPage *page, if (organizer.value != NULL) { const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; - GList *list = NULL; if ( organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); - if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), string); + if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) { + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->org_combo))), string); } else { - list = g_list_append (list, string); - gtk_combo_set_popdown_strings (GTK_COMBO (priv->org_combo), list); - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), FALSE); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->org_combo)))); + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->org_combo), string); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->org_combo), 0); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->org_combo))), FALSE); } g_free (string); - g_list_free (list); } } @@ -344,7 +343,7 @@ sensitize_widgets (MemoPage *mpage) /* The list of organizers is set to be non-editable. Otherwise any * change in the displayed list causes an 'Account not found' error. */ - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->org_combo))), FALSE); gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->memo_content), sensitize); gtk_widget_set_sensitive (priv->start_date, sensitize); @@ -515,7 +514,7 @@ get_current_account (MemoPage *page) EIterator *it; const char *str; - str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry)); + str = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->org_combo)))); if (!str) return NULL; @@ -778,6 +777,7 @@ get_widgets (MemoPage *mpage) priv->org_label = GW ("org-label"); priv->org_combo = GW ("org-combo"); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->org_combo)))); priv->to_button = GW ("to-button"); priv->to_hbox = GW ("to-hbox"); @@ -1062,9 +1062,8 @@ memo_page_select_organizer (MemoPage *mpage, const char *backend_address) if (default_address) { if (flags & COMP_EDITOR_NEW_ITEM) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), default_address); - /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ - gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->org_combo)->button), !subscribed_cal); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->org_combo))), default_address); + gtk_widget_set_sensitive (priv->org_combo, !subscribed_cal); } } else g_warning ("No potential organizers!"); @@ -1132,9 +1131,14 @@ memo_page_construct (MemoPage *mpage) g_object_unref(it); - if (priv->address_strings) - gtk_combo_set_popdown_strings (GTK_COMBO (priv->org_combo), priv->address_strings); - else + if (priv->address_strings) { + GList *l; + + for (l = priv->address_strings; l; l = l->next) + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->org_combo), l->data); + + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->org_combo), 0); + } else g_warning ("No potential organizers!"); gtk_widget_show (priv->org_label); diff --git a/calendar/gui/dialogs/memo-page.glade b/calendar/gui/dialogs/memo-page.glade index 6b65a053d5..8728c9366e 100644 --- a/calendar/gui/dialogs/memo-page.glade +++ b/calendar/gui/dialogs/memo-page.glade @@ -169,6 +169,7 @@ <property name="yalign">0</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="mnemonic_widget">memo_content</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -285,7 +286,6 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">combo-entry1</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -428,44 +428,6 @@ </child> <child> - <widget class="GtkCombo" id="org-combo"> - <property name="value_in_list">False</property> - <property name="allow_empty">True</property> - <property name="case_sensitive">False</property> - <property name="enable_arrow_keys">True</property> - <property name="enable_arrows_always">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="combo-entry1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child internal-child="list"> - <widget class="GtkList" id="combo-list1"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options"></property> - </packing> - </child> - - <child> <widget class="GtkHBox" id="to-hbox"> <property name="homogeneous">False</property> <property name="spacing">0</property> @@ -485,6 +447,25 @@ <property name="y_options">fill</property> </packing> </child> + + <child> + <widget class="GtkComboBoxEntry" id="org-combo"> + <property name="visible">True</property> + <property name="items" translatable="yes">a +b</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 15171d52ed..c85a0ae0f2 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -145,9 +145,9 @@ struct _RecurrencePagePrivate { GtkWidget *params; GtkWidget *interval_value; - GtkWidget *interval_unit; + GtkWidget *interval_unit_combo; GtkWidget *special; - GtkWidget *ending_menu; + GtkWidget *ending_combo; GtkWidget *ending_special; GtkWidget *custom_warning_bin; @@ -159,10 +159,10 @@ struct _RecurrencePagePrivate { /* For monthly recurrences, created by hand */ int month_index; - GtkWidget *month_day_menu; + GtkWidget *month_day_combo; enum month_day_options month_day; - GtkWidget *month_num_menu; + GtkWidget *month_num_combo; enum month_num_options month_num; /* For ending date, created by hand */ @@ -343,11 +343,11 @@ recurrence_page_finalize (GObject *object) preview_date_range_changed_cb, NULL); g_signal_handlers_disconnect_matched ( - priv->interval_unit, G_SIGNAL_MATCH_DATA, + priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); g_signal_handlers_disconnect_matched ( - priv->ending_menu, G_SIGNAL_MATCH_DATA, + priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); /* Chain up to parent's finalize() method. */ @@ -410,7 +410,6 @@ clear_widgets (RecurrencePage *rpage) { RecurrencePagePrivate *priv; GtkAdjustment *adj; - GtkWidget *menu; priv = rpage->priv; @@ -431,22 +430,20 @@ clear_widgets (RecurrencePage *rpage) e_dialog_spin_set (priv->interval_value, 1); g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->interval_unit, + g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->interval_unit_combo, ICAL_DAILY_RECURRENCE, freq_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); priv->ending_date_tt = icaltime_today (); priv->ending_count = 1; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->ending_menu, + g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->ending_combo, ENDING_FOR, ending_types_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); make_ending_special (rpage); /* Exceptions list */ e_date_time_list_clear (priv->exception_list_store); @@ -668,7 +665,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) /* Frequency, interval, week start */ - r.freq = e_dialog_option_menu_get (priv->interval_unit, freq_map); + r.freq = e_dialog_combo_box_get (priv->interval_unit_combo, freq_map); r.interval = e_dialog_spin_get_int (priv->interval_value); r.week_start = ICAL_SUNDAY_WEEKDAY + calendar_config_get_week_start_day (); @@ -721,14 +718,14 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) enum month_day_options month_day; g_return_if_fail (GTK_BIN (priv->special)->child != NULL); - g_return_if_fail (priv->month_day_menu != NULL); - g_return_if_fail (GTK_IS_OPTION_MENU (priv->month_day_menu)); - g_return_if_fail (priv->month_num_menu != NULL); - g_return_if_fail (GTK_IS_OPTION_MENU (priv->month_num_menu)); + g_return_if_fail (priv->month_day_combo != NULL); + g_return_if_fail (GTK_IS_COMBO_BOX (priv->month_day_combo)); + g_return_if_fail (priv->month_num_combo != NULL); + g_return_if_fail (GTK_IS_COMBO_BOX (priv->month_num_combo)); - month_num = e_dialog_option_menu_get (priv->month_num_menu, + month_num = e_dialog_combo_box_get (priv->month_num_combo, month_num_options_map ); - month_day = e_dialog_option_menu_get (priv->month_day_menu, + month_day = e_dialog_combo_box_get (priv->month_day_combo, month_day_options_map); if (month_num == MONTH_NUM_LAST) @@ -799,8 +796,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) /* Ending date */ - ending_type = e_dialog_option_menu_get (priv->ending_menu, - ending_types_map); + ending_type = e_dialog_combo_box_get (priv->ending_combo, ending_types_map); switch (ending_type) { case ENDING_FOR: @@ -903,8 +899,8 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp) e_cal_component_set_exdate_list (comp, list); e_cal_component_free_exdate_list (list); - if (GTK_WIDGET_VISIBLE (priv->ending_menu) && GTK_WIDGET_IS_SENSITIVE (priv->ending_menu) && - e_dialog_option_menu_get (priv->ending_menu, ending_types_map) == ENDING_UNTIL) { + if (GTK_WIDGET_VISIBLE (priv->ending_combo) && GTK_WIDGET_IS_SENSITIVE (priv->ending_combo) && + e_dialog_combo_box_get (priv->ending_combo, ending_types_map) == ENDING_UNTIL) { /* check whether the "until" date is in the future */ struct icaltimetype tt; gboolean ok = TRUE; @@ -978,44 +974,37 @@ make_weekly_special (RecurrencePage *rpage) G_CALLBACK (comp_editor_page_changed), rpage); } - +/* Creates the subtree for the monthly recurrence number */ static void -month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) -{ - GtkWidget *item; - int month_index; - - item = gtk_menu_get_active (GTK_MENU (menu_shell)); - item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))); - - month_index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "data")); - g_object_set_data (G_OBJECT (data), "data", GINT_TO_POINTER (month_index)); -} - -/* Creates the option menu for the monthly recurrence number */ -static GtkWidget * -make_recur_month_num_submenu (const char *title, int start, int end) +make_recur_month_num_subtree (GtkTreeStore *store, GtkTreeIter *par, const char *title, int start, int end) { - GtkWidget *submenu, *item; + GtkTreeIter iter, parent; int i; - submenu = gtk_menu_new (); + gtk_tree_store_append (store, &parent, par); + gtk_tree_store_set (store, &parent, 0, _(title), 1, -1, -1); + for (i = start; i < end; i++) { - item = gtk_menu_item_new_with_label (_(e_cal_recur_nth[i])); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); - g_object_set_data (G_OBJECT (item), "data", GINT_TO_POINTER (i + 1)); - gtk_widget_show (item); + gtk_tree_store_append (store, &iter, &parent); + gtk_tree_store_set (store, &iter, 0, _(e_cal_recur_nth[i]), 1, i + 1, -1); } +} +static void +only_leaf_sensitive (GtkCellLayout *cell_layout, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + gboolean sensitive; - item = gtk_menu_item_new_with_label (_(title)); - gtk_widget_show (item); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu); + sensitive = !gtk_tree_model_iter_has_child (tree_model, iter); - return item; + g_object_set (cell, "sensitive", sensitive, NULL); } static GtkWidget * -make_recur_month_num_menu (int month_index) +make_recur_month_num_combo (int month_index) { static const char *options[] = { /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [first] [Monday] [forever]' @@ -1046,67 +1035,65 @@ make_recur_month_num_menu (int month_index) N_("last") }; - GtkWidget *menu, *submenu, *item, *submenu_item; - GtkWidget *omenu; int i; + GtkTreeStore *store; + GtkTreeIter iter; + GtkWidget *combo; + GtkCellRenderer *cell; - menu = gtk_menu_new (); + store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT); /* Relation */ for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) { - item = gtk_menu_item_new_with_label (_(options[i])); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show (item); + gtk_tree_store_append (store, &iter, NULL); + gtk_tree_store_set (store, &iter, 0, _(options [i]), 1, month_num_options_map [i], -1); } /* Current date */ - item = gtk_menu_item_new_with_label (_(e_cal_recur_nth[month_index - 1])); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show (item); - - /* Other Submenu */ - submenu = gtk_menu_new (); + gtk_tree_store_append (store, &iter, NULL); + gtk_tree_store_set (store, &iter, 0, _(e_cal_recur_nth[month_index - 1]), 1, MONTH_NUM_DAY, -1); + gtk_tree_store_append (store, &iter, NULL); /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [Other date] [11th to 20th] [17th] [forever]' * (dropdown menu options are in [square brackets]). */ - submenu_item = gtk_menu_item_new_with_label (_("Other Date")); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item); - gtk_widget_show (submenu_item); + gtk_tree_store_set (store, &iter, 0, _("Other Date"), 1, MONTH_NUM_OTHER, -1); /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [1st to 10th] [7th] [forever]' (dropdown menu options are in [square brackets]). */ - item = make_recur_month_num_submenu (_("1st to 10th"), 0, 10); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); + make_recur_month_num_subtree (store, &iter, _("1st to 10th"), 0, 10); + /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [11th to 20th] [17th] [forever]' (dropdown menu options are in [square brackets]). */ - item = make_recur_month_num_submenu (_("11th to 20th"), 10, 20); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); + make_recur_month_num_subtree (store, &iter, _("11th to 20th"), 10, 20); + /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [21th to 31th] [27th] [forever]' (dropdown menu options are in [square brackets]). */ - item = make_recur_month_num_submenu (_("21st to 31st"), 20, 31); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); + make_recur_month_num_subtree (store, &iter, _("21st to 31st"), 20, 31); + + combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); + g_object_unref (store); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), submenu); - g_object_set_data (G_OBJECT (submenu_item), "data", GINT_TO_POINTER (month_index)); - g_signal_connect((submenu), "selection_done", - G_CALLBACK (month_num_submenu_selection_done_cb), - submenu_item); + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "text", 0, NULL); - omenu = gtk_option_menu_new (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); + gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), + cell, + only_leaf_sensitive, + NULL, NULL); - return omenu; + return combo; } -/* Creates the option menu for the monthly recurrence days */ +/* Creates the combo box for the monthly recurrence days */ static GtkWidget * -make_recur_month_menu (void) +make_recur_month_combobox (void) { static const char *options[] = { /* For Translator : 'day' is part of the sentence of the form 'appointment recurs/Every [x] month(s) on the [first] [day] [forever]' @@ -1122,76 +1109,80 @@ make_recur_month_menu (void) N_("Sunday") }; - GtkWidget *menu; - GtkWidget *omenu; + GtkWidget *combo; int i; - menu = gtk_menu_new (); + combo = gtk_combo_box_new_text (); for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) { - GtkWidget *item; - - item = gtk_menu_item_new_with_label (_(options[i])); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show (item); + gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i])); } - omenu = gtk_option_menu_new (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); - - return omenu; + return combo; } static void -month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, - RecurrencePage *rpage) +month_num_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) { + GtkTreeIter iter; RecurrencePagePrivate *priv; enum month_num_options month_num; enum month_day_options month_day; priv = rpage->priv; - month_num = e_dialog_option_menu_get (priv->month_num_menu, - month_num_options_map); - month_day = e_dialog_option_menu_get (priv->month_day_menu, + month_day = e_dialog_combo_box_get (priv->month_day_combo, month_day_options_map); - if (month_num == MONTH_NUM_OTHER) { - GtkWidget *label, *item; + if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->month_num_combo), &iter)) { + gint value; + GtkTreeIter parent; + GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->month_num_combo)); + + gtk_tree_model_get (model, &iter, 1, &value, -1); - item = gtk_menu_get_active (GTK_MENU (menu_shell)); - priv->month_index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "data")); + if (value == -1) { + return; + } + + if (gtk_tree_model_iter_parent (model, &parent, &iter)) { + /* it's a leaf, thus the day number */ + month_num = MONTH_NUM_DAY; + priv->month_index = value; - month_num = MONTH_NUM_DAY; - e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map); + g_return_if_fail (gtk_tree_model_iter_nth_child (model, &iter, NULL, month_num)); - label = GTK_BIN (priv->month_num_menu)->child; - gtk_label_set_text (GTK_LABEL (label), _(e_cal_recur_nth[priv->month_index - 1])); + gtk_tree_store_set (GTK_TREE_STORE (model), &iter, 0, _(e_cal_recur_nth[priv->month_index - 1]), -1); + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->month_num_combo), &iter); + } else { + /* top level node */ + month_num = value; - e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map); - e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map); + if (month_num == MONTH_NUM_OTHER) + month_num = MONTH_NUM_DAY; + } + } else { + month_num = 0; } if (month_num == MONTH_NUM_DAY && month_day != MONTH_DAY_NTH) - e_dialog_option_menu_set (priv->month_day_menu, + e_dialog_combo_box_set (priv->month_day_combo, MONTH_DAY_NTH, month_day_options_map); else if (month_num != MONTH_NUM_DAY && month_num != MONTH_NUM_LAST && month_day == MONTH_DAY_NTH) - e_dialog_option_menu_set (priv->month_day_menu, + e_dialog_combo_box_set (priv->month_day_combo, MONTH_DAY_MON, month_num_options_map); comp_editor_page_changed (COMP_EDITOR_PAGE (rpage)); } -/* Callback used when the monthly day selection menu changes. We need +/* Callback used when the monthly day selection changes. We need * to change the valid range of the day index spin button; e.g. days * are 1-31 while a Sunday is the 1st through 5th. */ static void -month_day_menu_selection_done_cb (GtkMenuShell *menu_shell, - RecurrencePage *rpage) +month_day_combo_changed_cb (GtkComboBox *combo, RecurrencePage *rpage) { RecurrencePagePrivate *priv; enum month_num_options month_num; @@ -1199,16 +1190,16 @@ month_day_menu_selection_done_cb (GtkMenuShell *menu_shell, priv = rpage->priv; - month_num = e_dialog_option_menu_get (priv->month_num_menu, + month_num = e_dialog_combo_box_get (priv->month_num_combo, month_num_options_map); - month_day = e_dialog_option_menu_get (priv->month_day_menu, + month_day = e_dialog_combo_box_get (priv->month_day_combo, month_day_options_map); if (month_day == MONTH_DAY_NTH && month_num != MONTH_NUM_LAST && month_num != MONTH_NUM_DAY) - e_dialog_option_menu_set (priv->month_num_menu, + e_dialog_combo_box_set (priv->month_num_combo, MONTH_NUM_DAY, month_num_options_map); else if (month_day != MONTH_DAY_NTH && month_num == MONTH_NUM_DAY) - e_dialog_option_menu_set (priv->month_num_menu, + e_dialog_combo_box_set (priv->month_num_combo, MONTH_NUM_FIRST, month_num_options_map); @@ -1223,12 +1214,11 @@ make_monthly_special (RecurrencePage *rpage) GtkWidget *hbox; GtkWidget *label; GtkAdjustment *adj; - GtkWidget *menu; priv = rpage->priv; g_return_if_fail (GTK_BIN (priv->special)->child == NULL); - g_return_if_fail (priv->month_day_menu == NULL); + g_return_if_fail (priv->month_day_combo == NULL); /* Create the widgets */ @@ -1243,21 +1233,21 @@ make_monthly_special (RecurrencePage *rpage) adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 31, 1, 10, 10)); - priv->month_num_menu = make_recur_month_num_menu (priv->month_index); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_num_menu, + priv->month_num_combo = make_recur_month_num_combo (priv->month_index); + gtk_box_pack_start (GTK_BOX (hbox), priv->month_num_combo, FALSE, FALSE, 6); - priv->month_day_menu = make_recur_month_menu (); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_day_menu, + priv->month_day_combo = make_recur_month_combobox (); + gtk_box_pack_start (GTK_BOX (hbox), priv->month_day_combo, FALSE, FALSE, 6); gtk_widget_show_all (hbox); /* Set the options */ - e_dialog_option_menu_set (priv->month_num_menu, + e_dialog_combo_box_set (priv->month_num_combo, priv->month_num, month_num_options_map); - e_dialog_option_menu_set (priv->month_day_menu, + e_dialog_combo_box_set (priv->month_day_combo, priv->month_day, month_day_options_map); @@ -1265,14 +1255,8 @@ make_monthly_special (RecurrencePage *rpage) adj, "value-changed", G_CALLBACK (comp_editor_page_changed), rpage); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_num_menu)); - g_signal_connect((menu), "selection_done", - G_CALLBACK (month_num_menu_selection_done_cb), - rpage); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_day_menu)); - g_signal_connect((menu), "selection_done", - G_CALLBACK (month_day_menu_selection_done_cb), - rpage); + g_signal_connect (priv->month_num_combo, "changed", G_CALLBACK (month_num_combo_changed_cb), rpage); + g_signal_connect (priv->month_day_combo, "changed", G_CALLBACK (month_day_combo_changed_cb), rpage); } /* Changes the recurrence-special widget to match the interval units. @@ -1290,18 +1274,18 @@ make_recurrence_special (RecurrencePage *rpage) priv = rpage->priv; - if (priv->month_num_menu != NULL) { - gtk_widget_destroy (priv->month_num_menu); - priv->month_num_menu = NULL; + if (priv->month_num_combo != NULL) { + gtk_widget_destroy (priv->month_num_combo); + priv->month_num_combo = NULL; } if (GTK_BIN (priv->special)->child != NULL) { gtk_widget_destroy (GTK_BIN (priv->special)->child); priv->weekday_picker = NULL; - priv->month_day_menu = NULL; + priv->month_day_combo = NULL; } - frequency = e_dialog_option_menu_get (priv->interval_unit, freq_map); + frequency = e_dialog_combo_box_get (priv->interval_unit_combo, freq_map); switch (frequency) { case ICAL_DAILY_RECURRENCE: @@ -1449,8 +1433,7 @@ make_ending_special (RecurrencePage *rpage) priv->ending_count_spin = NULL; } - ending_type = e_dialog_option_menu_get (priv->ending_menu, - ending_types_map); + ending_type = e_dialog_combo_box_get (priv->ending_combo, ending_types_map); switch (ending_type) { case ENDING_FOR: @@ -1480,20 +1463,18 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) { RecurrencePagePrivate *priv = rpage->priv; CompEditor *editor; - GtkWidget *menu; ECal *client; editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (rpage)); client = comp_editor_get_client (editor); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); if (r->count == 0) { if (r->until.year == 0) { /* Forever */ - e_dialog_option_menu_set (priv->ending_menu, + e_dialog_combo_box_set (priv->ending_combo, ENDING_FOREVER, ending_types_map); } else { @@ -1526,7 +1507,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) } priv->ending_date_tt = r->until; - e_dialog_option_menu_set (priv->ending_menu, + e_dialog_combo_box_set (priv->ending_combo, ENDING_UNTIL, ending_types_map); } @@ -1534,12 +1515,12 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) /* Count of occurrences */ priv->ending_count = r->count; - e_dialog_option_menu_set (priv->ending_menu, + e_dialog_combo_box_set (priv->ending_combo, ENDING_FOR, ending_types_map); } - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); make_ending_special (rpage); } @@ -1564,7 +1545,6 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) int n_by_second, n_by_minute, n_by_hour; int n_by_day, n_by_month_day, n_by_year_day; int n_by_week_no, n_by_month, n_by_set_pos; - GtkWidget *menu; GtkAdjustment *adj; rpage = RECURRENCE_PAGE (page); @@ -1673,12 +1653,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) || n_by_set_pos != 0) goto custom; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->interval_unit, + g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->interval_unit_combo, ICAL_DAILY_RECURRENCE, freq_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; case ICAL_WEEKLY_RECURRENCE: { @@ -1740,12 +1719,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) priv->weekday_day_mask = day_mask; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->interval_unit, + g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->interval_unit_combo, ICAL_WEEKLY_RECURRENCE, freq_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; } @@ -1840,12 +1818,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } else goto custom; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->interval_unit, + g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->interval_unit_combo, ICAL_MONTHLY_RECURRENCE, freq_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; case ICAL_YEARLY_RECURRENCE: @@ -1857,12 +1834,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) || n_by_set_pos != 0) goto custom; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->interval_unit, + g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + e_dialog_combo_box_set (priv->interval_unit_combo, ICAL_YEARLY_RECURRENCE, freq_map); - g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; default: @@ -2019,9 +1995,9 @@ get_widgets (RecurrencePage *rpage) priv->params = GW ("params"); priv->interval_value = GW ("interval-value"); - priv->interval_unit = GW ("interval-unit"); + priv->interval_unit_combo = GW ("interval-unit-combobox"); priv->special = GW ("special"); - priv->ending_menu = GW ("ending-menu"); + priv->ending_combo = GW ("ending-combobox"); priv->ending_special = GW ("ending-special"); priv->custom_warning_bin = GW ("custom-warning-bin"); @@ -2037,9 +2013,9 @@ get_widgets (RecurrencePage *rpage) return (priv->recurs && priv->params && priv->interval_value - && priv->interval_unit + && priv->interval_unit_combo && priv->special - && priv->ending_menu + && priv->ending_combo && priv->ending_special && priv->custom_warning_bin && priv->exception_list @@ -2296,19 +2272,19 @@ init_widgets (RecurrencePage *rpage) /* Recurrence units */ g_signal_connect_swapped ( - priv->interval_unit, "changed", + priv->interval_unit_combo, "changed", G_CALLBACK (comp_editor_page_changed), rpage); g_signal_connect_swapped ( - priv->interval_unit, "changed", + priv->interval_unit_combo, "changed", G_CALLBACK (make_recurrence_special), rpage); /* Recurrence ending */ g_signal_connect_swapped ( - priv->ending_menu, "changed", + priv->ending_combo, "changed", G_CALLBACK (comp_editor_page_changed), rpage); g_signal_connect_swapped ( - priv->ending_menu, "changed", + priv->ending_combo, "changed", G_CALLBACK (make_ending_special), rpage); /* Exception buttons */ diff --git a/calendar/gui/dialogs/recurrence-page.glade b/calendar/gui/dialogs/recurrence-page.glade index 14d6c2fa04..5cec3f8494 100644 --- a/calendar/gui/dialogs/recurrence-page.glade +++ b/calendar/gui/dialogs/recurrence-page.glade @@ -4,7 +4,7 @@ <glade-interface> <widget class="GtkWindow" id="recurrence-toplevel"> - <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> @@ -15,6 +15,8 @@ <property name="skip_pager_hint">False</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <child> <widget class="GtkVBox" id="recurrence-page"> @@ -36,6 +38,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -63,6 +69,10 @@ <property name="yalign">0.5</property> <property name="xpad">12</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -81,8 +91,7 @@ <widget class="GtkCheckButton" id="recurs"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">This appointment rec_urs</property> + <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">This appointment rec_urs</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> @@ -112,8 +121,7 @@ <child> <widget class="GtkLabel" id="label68"> <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">Every</property> + <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">Every</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> @@ -123,6 +131,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -151,52 +163,15 @@ </child> <child> - <widget class="GtkOptionMenu" id="interval-unit"> + <widget class="GtkComboBox" id="interval-unit-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget2"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">day(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget3"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][week(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">week(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget4"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][month(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">month(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget5"> - <property name="visible" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][year(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">True</property> - <property name="label" translatable="yes">year(s)</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes" comments="TRANSLATORS: Entire string is for example: + 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (combobox options are in [square brackets])">day(s) +week(s) +month(s) +year(s)</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -229,43 +204,14 @@ </child> <child> - <widget class="GtkOptionMenu" id="ending-menu"> + <widget class="GtkComboBox" id="ending-combobox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="history">0</property> - - <child internal-child="menu"> - <widget class="GtkMenu" id="convertwidget6"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="convertwidget7"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (dropdown menu options are in [square brackets])">for</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget8"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][until][2006/01/01]' (dropdown menu options are in [square brackets])">until</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget9"> - <property name="visible">True</property> - <property name="label" translatable="yes" comments="TRANSLATORS: Entire string is for example: - 'This appointment recurs/Every[x][day(s)][forever]' (dropdown menu options are in [square brackets])">forever</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes" comments="TRANSLATORS: Entire string is for example: + 'This appointment recurs/Every[x][day(s)][for][1]occurrences' (combobox options are in [square brackets])">for +until +forever</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> @@ -361,6 +307,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -388,6 +338,10 @@ <property name="yalign">0.5</property> <property name="xpad">12</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -418,6 +372,9 @@ <property name="rules_hint">False</property> <property name="reorderable">False</property> <property name="enable_search">True</property> + <property name="fixed_height_mode">False</property> + <property name="hover_selection">False</property> + <property name="hover_expand">False</property> </widget> </child> </widget> @@ -502,6 +459,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -562,6 +523,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -589,6 +554,10 @@ <property name="yalign">0.5</property> <property name="xpad">12</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 8212864a31..82fb75564a 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -52,8 +52,8 @@ struct _TaskDetailsPagePrivate { /* Widgets from the Glade file */ GtkWidget *main; - GtkWidget *status; - GtkWidget *priority; + GtkWidget *status_combo; + GtkWidget *priority_combo; GtkWidget *percent_complete; GtkWidget *date_completed_label; @@ -165,7 +165,7 @@ task_details_page_focus_main_widget (CompEditorPage *page) tdpage = TASK_DETAILS_PAGE (page); priv = tdpage->priv; - gtk_widget_grab_focus (priv->status); + gtk_widget_grab_focus (priv->status_combo); } @@ -241,8 +241,8 @@ sensitize_widgets (TaskDetailsPage *tdpage) if (!e_cal_is_read_only (client, &read_only, NULL)) read_only = TRUE; - gtk_widget_set_sensitive (priv->status, !read_only); - gtk_widget_set_sensitive (priv->priority, !read_only); + gtk_widget_set_sensitive (priv->status_combo, !read_only); + gtk_widget_set_sensitive (priv->priority_combo, !read_only); gtk_widget_set_sensitive (priv->percent_complete, !read_only); gtk_widget_set_sensitive (priv->completed_date, !read_only); gtk_widget_set_sensitive (priv->url_label, !read_only); @@ -290,7 +290,7 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } else status = ICAL_STATUS_NONE; } - e_dialog_option_menu_set (priv->status, status, status_map); + e_dialog_combo_box_set (priv->status_combo, status, status_map); if (percent) e_cal_component_free_percent (percent); @@ -325,7 +325,7 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } else { priority = PRIORITY_UNDEFINED; } - e_dialog_option_menu_set (priv->priority, priority, priority_map); + e_dialog_combo_box_set (priv->priority_combo, priority, priority_map); /* URL */ e_cal_component_get_url (comp, &url); @@ -358,11 +358,11 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) e_cal_component_set_percent (comp, &percent); /* Status. */ - status = e_dialog_option_menu_get (priv->status, status_map); + status = e_dialog_combo_box_get (priv->status_combo, status_map); e_cal_component_set_status (comp, status); /* Priority. */ - priority = e_dialog_option_menu_get (priv->priority, priority_map); + priority = e_dialog_combo_box_get (priv->priority_combo, priority_map); priority_value = priority_index_to_value (priority); e_cal_component_set_priority (comp, &priority_value); @@ -465,8 +465,8 @@ get_widgets (TaskDetailsPage *tdpage) g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); - priv->status = GW ("status"); - priv->priority = GW ("priority"); + priv->status_combo = GW ("status-combobox"); + priv->priority_combo = GW ("priority-combobox"); priv->percent_complete = GW ("percent-complete"); priv->date_completed_label = GW ("date_completed_label"); @@ -483,8 +483,8 @@ get_widgets (TaskDetailsPage *tdpage) #undef GW - return (priv->status - && priv->priority + return (priv->status_combo + && priv->priority_combo && priv->percent_complete && priv->date_completed_label && priv->completed_date @@ -541,19 +541,19 @@ date_changed_cb (EDateEdit *dedit, &completed_tt.hour, &completed_tt.minute); - status = e_dialog_option_menu_get (priv->status, status_map); + status = e_dialog_combo_box_get (priv->status_combo, status_map); if (!date_set) { completed_tt = icaltime_null_time (); if (status == ICAL_STATUS_COMPLETED) { - e_dialog_option_menu_set (priv->status, + e_dialog_combo_box_set (priv->status_combo, ICAL_STATUS_NONE, status_map); e_dialog_spin_set (priv->percent_complete, 0); } } else { if (status != ICAL_STATUS_COMPLETED) { - e_dialog_option_menu_set (priv->status, + e_dialog_combo_box_set (priv->status_combo, ICAL_STATUS_COMPLETED, status_map); } @@ -568,7 +568,7 @@ date_changed_cb (EDateEdit *dedit, } static void -status_changed (GtkMenu *menu, TaskDetailsPage *tdpage) +status_changed (GtkWidget *combo, TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; icalproperty_status status; @@ -584,7 +584,7 @@ status_changed (GtkMenu *menu, TaskDetailsPage *tdpage) comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE); - status = e_dialog_option_menu_get (priv->status, status_map); + status = e_dialog_combo_box_get (priv->status_combo, status_map); if (status == ICAL_STATUS_NONE) { e_dialog_spin_set (priv->percent_complete, 0); e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime); @@ -641,7 +641,7 @@ percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage) status = ICAL_STATUS_INPROCESS; } - e_dialog_option_menu_set (priv->status, status, status_map); + e_dialog_combo_box_set (priv->status_combo, status, status_map); e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime); complete_date_changed (tdpage, ctime, complete); @@ -671,8 +671,8 @@ init_widgets (TaskDetailsPage *tdpage) /* Connect signals. The Status, Percent Complete & Date Completed properties are closely related so whenever one changes we may need to update the other 2. */ - g_signal_connect((GTK_OPTION_MENU (priv->status)->menu), - "deactivate", + g_signal_connect (GTK_COMBO_BOX (priv->status_combo), + "changed", G_CALLBACK (status_changed), tdpage); g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment), @@ -681,7 +681,7 @@ init_widgets (TaskDetailsPage *tdpage) /* Priority */ g_signal_connect_swapped ( - GTK_OPTION_MENU (priv->priority)->menu, "deactivate", + GTK_COMBO_BOX (priv->priority_combo), "changed", G_CALLBACK (comp_editor_page_changed), tdpage); /* Completed Date */ diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 88b753b9db..486b86ea34 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -332,7 +332,7 @@ sensitize_widgets (TaskPage *tpage) /* The list of organizers is set to be non-editable. Otherwise any * change in the displayed list causes an 'Account not found' error. */ - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->organizer))), FALSE); gtk_editable_set_editable (GTK_EDITABLE (priv->summary), !read_only); gtk_widget_set_sensitive (priv->due_date, !read_only); @@ -371,7 +371,7 @@ sensitize_widgets (TaskPage *tpage) gtk_widget_show (priv->attendee_box); gtk_widget_show (priv->organizer); gtk_label_set_text_with_mnemonic (GTK_LABEL (priv->org_cal_label), _("Organi_zer:")); - gtk_label_set_mnemonic_widget (GTK_LABEL (priv->org_cal_label), GTK_COMBO (priv->organizer)->entry); + gtk_label_set_mnemonic_widget (GTK_LABEL (priv->org_cal_label), priv->organizer); } } void @@ -418,7 +418,7 @@ get_current_account (TaskPage *page) priv = page->priv; - str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry)); + str = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer)))); if (!str) return NULL; @@ -614,9 +614,8 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (organizer.value != NULL) { const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; - GList *list = NULL; - if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) { + if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) { if (e_cal_get_static_capability ( client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) @@ -640,13 +639,15 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) string = g_strdup (strip); if (!priv->user_org) { - list = g_list_append (list, string); - gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), list); - gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->organizer), string); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->organizer), 0); + gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (priv->organizer))), FALSE); + } else { + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer))), string); } g_free (string); - g_list_free (list); priv->existing = TRUE; } } else { @@ -1420,7 +1421,10 @@ get_widgets (TaskPage *tpage) priv->description = GW ("description"); priv->categories_btn = GW ("categories-button"); priv->categories = GW ("categories"); + priv->organizer = GW ("organizer"); + gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); + priv->invite = GW ("invite"); priv->add = GW ("add-attendee"); priv->edit = GW ("edit-attendee"); @@ -1569,8 +1573,8 @@ categories_clicked_cb (GtkWidget *button, { GtkEntry *entry; - entry = GTK_ENTRY (tpage->priv->categories); - e_categories_config_open_dialog_for_entry (entry); + entry = priv->categories; + e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry)); } static gboolean @@ -1985,9 +1989,8 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address) if (default_address) { if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) { - gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), default_address); - /* FIXME: Use accessor functions to access private members of a GtkCombo widget */ - gtk_widget_set_sensitive (GTK_WIDGET (GTK_COMBO (priv->organizer)->button), !subscribed_cal); + gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer))), default_address); + gtk_widget_set_sensitive (priv->organizer, !subscribed_cal); } } else g_warning ("No potential organizers!"); @@ -2054,9 +2057,14 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) g_object_unref(it); - if (priv->address_strings) - gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings); - else + if (priv->address_strings) { + GList *l; + + for (l = priv->address_strings; l; l = l->next) + gtk_combo_box_append_text (GTK_COMBO_BOX (priv->organizer), l->data); + + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->organizer), 0); + } else g_warning ("No potential organizers!"); if (!init_widgets (tpage)) { diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade index d106381f8f..72beb68f21 100644 --- a/calendar/gui/dialogs/task-page.glade +++ b/calendar/gui/dialogs/task-page.glade @@ -600,34 +600,13 @@ <property name="spacing">6</property> <child> - <widget class="GtkCombo" id="organizer"> + <widget class="GtkComboBoxEntry" id="organizer"> <property name="visible">True</property> - <property name="value_in_list">False</property> - <property name="allow_empty">True</property> - <property name="case_sensitive">False</property> - <property name="enable_arrow_keys">True</property> - <property name="enable_arrows_always">False</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="organiser-entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child internal-child="list"> - <widget class="GtkList" id="combo-list1"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - </widget> - </child> + <property name="items" translatable="yes">a +b</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> </widget> <packing> <property name="padding">0</property> |