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 | |
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')
49 files changed, 1363 insertions, 1786 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 7afa854426..38a3b49e9f 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -389,6 +389,8 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource d (printf("%s:%d (alarm_notify_add_calendar) %s - Calendar Open Async... %p\n", __FILE__, __LINE__, str_uri, client)); g_hash_table_insert (priv->uri_client_hash[source_type], g_strdup (str_uri), client); g_signal_connect (G_OBJECT (client), "cal_opened", G_CALLBACK (cal_opened_cb), an); + /* to resolve floating DATE-TIME properly */ + e_cal_set_default_timezone (client, config_data_get_timezone (), NULL); e_cal_open_async (client, FALSE); } g_free (str_uri); diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index bb7508fbcd..531cc115cd 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -55,7 +55,9 @@ #include "e-util/e-popup.h" #include "e-util/e-error.h" - +#if !GTK_CHECK_VERSION(2,16,0) +#define gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip +#endif #define d(x) @@ -1530,10 +1532,10 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, char *tip; tip = g_strdup_printf (_("You have %d alarms"), g_list_length (tray_icons_list)); - gtk_status_icon_set_tooltip (tray_icon, tip); + gtk_status_icon_set_tooltip_text (tray_icon, tip); } else { - gtk_status_icon_set_tooltip (tray_icon, str); + gtk_status_icon_set_tooltip_text (tray_icon, str); } g_free (start_str); diff --git a/calendar/gui/apps_evolution_calendar.schemas.in b/calendar/gui/apps_evolution_calendar.schemas.in index 7f370d1a19..98e31ac775 100644 --- a/calendar/gui/apps_evolution_calendar.schemas.in +++ b/calendar/gui/apps_evolution_calendar.schemas.in @@ -16,6 +16,18 @@ </schema> <schema> + <key>/schemas/apps/evolution/calendar/display/use_system_timezone</key> + <applyto>/apps/evolution/calendar/display/use_system_timezone</applyto> + <owner>evolution-calendar</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Use system timezone</short> + <long>Check this to use system timezone in Evolution.</long> + </locale> + </schema> + + <schema> <key>/schemas/apps/evolution/calendar/display/day_second_zone</key> <applyto>/apps/evolution/calendar/display/day_second_zone</applyto> <owner>evolution-calendar</owner> @@ -53,18 +65,6 @@ </schema> <schema> - <key>/schemas/apps/evolution/calendar/display/use_daylight_saving</key> - <applyto>/apps/evolution/calendar/display/use_daylight_saving</applyto> - <owner>evolution-calendar</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>daylight savings time</short> - <long>Whether to use daylight savings time while displaying events.</long> - </locale> - </schema> - - <schema> <key>/schemas/apps/evolution/calendar/display/use_24hour_format</key> <applyto>/apps/evolution/calendar/display/use_24hour_format</applyto> <owner>evolution-calendar</owner> diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index f7f91080f8..b84268c65c 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -352,88 +352,6 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme } static void -<<<<<<< .working -======= -impl_upgradeFromVersion (PortableServer_Servant servant, - CORBA_short major, - CORBA_short minor, - CORBA_short revision, - CORBA_Environment *ev) -{ - GError *err = NULL; - CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant)); - - if (!migrate_calendars (calendar_component, major, minor, revision, &err)) { - GNOME_Evolution_Component_UpgradeFailed *failedex; - - failedex = GNOME_Evolution_Component_UpgradeFailed__alloc(); - failedex->what = CORBA_string_dup(_("Failed upgrading calendars.")); - failedex->why = CORBA_string_dup(err->message); - CORBA_exception_set(ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UpgradeFailed, failedex); - } - - if (err) - g_error_free(err); -} - -static gboolean -selector_tree_data_dropped (ESourceSelector *selector, - GtkSelectionData *data, - ESource *destination, - GdkDragAction action, - guint info, - CalendarComponent *component) -{ - gboolean success = FALSE; - ECal *client; - - client = auth_new_cal_from_source (destination, E_CAL_SOURCE_TYPE_EVENT); - - if (!client || !e_cal_open (client, TRUE, NULL)) { - if (client) - g_object_unref (client); - - return FALSE; - } - - if (data->data) { - icalcomponent *icalcomp = NULL; - char *comp_str; /* do not free this! */ - - /* data->data is "source_uid\ncomponent_string" */ - comp_str = strchr ((char *)data->data, '\n'); - if (comp_str) { - comp_str [0] = 0; - comp_str++; - - icalcomp = icalparser_parse_string (comp_str); - - if (icalcomp) { - success = cal_comp_process_source_list_drop (client, icalcomp, action, (char *)data->data, component->priv->source_list); - icalcomponent_free (icalcomp); - } - } - } - - return success; -} - -static void -control_activate_cb (BonoboControl *control, gboolean activate, gpointer data) -{ - CalendarComponentView *component_view = data; - - if (activate) { - BonoboUIComponent *uic; - uic = bonobo_control_get_ui_component (component_view->view_control); - - e_user_creatable_items_handler_activate (component_view->creatable_items_handler, uic); - } -} - - -static void ->>>>>>> .merge-right.r37199 config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { CalendarComponent *calendar_component = data; @@ -556,9 +474,6 @@ create_component_view (CalendarComponent *calendar_component) component_view->memo_source_list = g_object_ref (priv->memo_source_list); /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (calendar_component->priv->source_list); - -<<<<<<< .working -======= g_signal_connect ( component_view->source_selector, "data-dropped", G_CALLBACK (selector_tree_data_dropped), calendar_component); @@ -566,9 +481,69 @@ create_component_view (CalendarComponent *calendar_component) gtk_drag_dest_set(component_view->source_selector, GTK_DEST_DEFAULT_ALL, drag_types, num_drag_types, GDK_ACTION_COPY | GDK_ACTION_MOVE); ->>>>>>> .merge-right.r37199 gtk_widget_show (component_view->source_selector); + selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_container_add (GTK_CONTAINER (selector_scrolled_window), component_view->source_selector); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window), + GTK_SHADOW_IN); + gtk_widget_show (selector_scrolled_window); + + component_view->info_label = (EInfoLabel *)e_info_label_new("x-office-calendar"); + e_info_label_set_info (component_view->info_label, _("Calendars"), ""); + gtk_widget_show (GTK_WIDGET (component_view->info_label)); + + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX (vbox), GTK_WIDGET (component_view->info_label), FALSE, TRUE, 0); + gtk_box_pack_start(GTK_BOX (vbox), selector_scrolled_window, TRUE, TRUE, 0); + gtk_widget_show (vbox); + + gtk_paned_pack1 (GTK_PANED (vpane), vbox, FALSE, FALSE); + + component_view->sidebar_control = bonobo_control_new (vpane); + + /* Create main view */ + component_view->view_control = control_factory_new_control (); + if (!component_view->view_control) { + /* FIXME free memory */ + + return NULL; + } + + component_view->calendar = (GnomeCalendar *) bonobo_control_get_widget (component_view->view_control); + + gtk_paned_pack2 (GTK_PANED (vpane), gnome_calendar_get_tag (component_view->calendar), FALSE, FALSE); + + /* This signal is thrown if backends die - we update the selector */ + g_signal_connect (component_view->calendar, "source_added", + G_CALLBACK (source_added_cb), component_view); + g_signal_connect (component_view->calendar, "source_removed", + G_CALLBACK (source_removed_cb), component_view); + + /* Create status bar */ + statusbar_widget = e_task_bar_new (); + component_view->activity_handler = e_activity_handler_new (); + e_activity_handler_attach_task_bar (component_view->activity_handler, E_TASK_BAR (statusbar_widget)); + e_activity_handler_attach_task_bar (priv->activity_handler, E_TASK_BAR (statusbar_widget)); + + gtk_widget_show (statusbar_widget); + + component_view->statusbar_control = bonobo_control_new (statusbar_widget); + + gnome_calendar_set_activity_handler (component_view->calendar, component_view->activity_handler); + + /* connect after setting the initial selections, or we'll get unwanted calls + to calendar_control_sensitize_calendar_commands */ + g_signal_connect (component_view->source_selector, "selection_changed", + G_CALLBACK (source_selection_changed_cb), component_view); + g_signal_connect (component_view->source_selector, "primary_selection_changed", + G_CALLBACK (primary_source_selection_changed_cb), component_view); + g_signal_connect (component_view->source_selector, "popup_event", + G_CALLBACK (popup_event_cb), component_view); + +>>>>>>> 23df769955ea54f756a579c19964df87ae6fd5c8:calendar/gui/calendar-component.c /* Set up the "new" item handler */ g_signal_connect (component_view->view_control, "activate", G_CALLBACK (control_activate_cb), component_view); @@ -674,6 +649,11 @@ impl_dispose (GObject *object) priv->activity_handler = NULL; } + if (priv->activity_handler != NULL) { + g_object_unref (priv->activity_handler); + priv->activity_handler = NULL; + } + if (priv->create_ecal) { g_object_unref (priv->create_ecal); priv->create_ecal = NULL; diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h index 05feb18d00..691b4f0281 100644 --- a/calendar/gui/calendar-config-keys.h +++ b/calendar/gui/calendar-config-keys.h @@ -28,8 +28,8 @@ G_BEGIN_DECLS #define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar" /* Display settings */ +#define CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/use_system_timezone" #define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone" -#define CALENDAR_CONFIG_DAYLIGHT_SAVING CALENDAR_CONFIG_PREFIX "/display/use_daylight_saving" #define CALENDAR_CONFIG_SELECTED_CALENDARS CALENDAR_CONFIG_PREFIX "/display/selected_calendars" #define CALENDAR_CONFIG_PRIMARY_CALENDAR CALENDAR_CONFIG_PREFIX "/display/primary_calendar" #define CALENDAR_CONFIG_24HOUR CALENDAR_CONFIG_PREFIX "/display/use_24hour_format" diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 2459885b8d..9d15944569 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -39,13 +39,8 @@ #include "calendar-config-keys.h" #include "calendar-config.h" - - static GConfClient *config = NULL; -/* Store the zones here, this is not destroyed as the ical timezones */ -static GHashTable *custom_zones = NULL; - static void do_cleanup (void) { @@ -185,6 +180,35 @@ calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, g return id; } +gboolean +calendar_config_get_use_system_timezone (void) +{ + calendar_config_init (); + + return gconf_client_get_bool (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, NULL); +} + +void +calendar_config_set_use_system_timezone (gboolean use) +{ + calendar_config_init (); + + if (calendar_config_get_use_system_timezone () != use) { + gconf_client_set_bool (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, use, NULL); + gconf_client_notify (config, CALENDAR_CONFIG_TIMEZONE); + + /* FIXME: notify CALENDAR_CONFIG_TIMEZONE change on system timezone change + itself too, when using system timezone. How to receive such change? */ + } +} + +guint +calendar_config_add_notification_use_system_timezone (GConfClientNotifyFunc func, gpointer data) +{ + calendar_config_init (); + + return gconf_client_notify_add (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, func, data, NULL, NULL); +} /* The current timezone, e.g. "Europe/London". It may be NULL, in which case you should assume UTC (though Evolution will show the timezone-setting @@ -192,30 +216,18 @@ calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, g gchar * calendar_config_get_timezone (void) { - calendar_config_init (); + if (calendar_config_get_use_system_timezone ()) + return e_cal_util_get_system_timezone_location (); - return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL); + return calendar_config_get_timezone_stored (); } -static void -set_standard_offsets (icalcomponent *zone_comp, int offset) +gchar * +calendar_config_get_timezone_stored (void) { - icalcomponent *dl_comp, *s_comp; - icalproperty *offset_from, *offset_to; - - /* Set the offset of the standard component to all the daylight components also */ - for (dl_comp = icalcomponent_get_first_component (zone_comp, ICAL_XDAYLIGHT_COMPONENT); dl_comp != NULL; - dl_comp = icalcomponent_get_next_component (zone_comp, ICAL_XDAYLIGHT_COMPONENT)) { - offset_to = icalcomponent_get_first_property (dl_comp, ICAL_TZOFFSETTO_PROPERTY); - icalproperty_set_tzoffsetto (offset_to, offset); - } + calendar_config_init (); - /* Set the tzto offset of the standard component to tzfrom */ - for (s_comp = icalcomponent_get_first_component (zone_comp, ICAL_XSTANDARD_COMPONENT); s_comp != NULL; - s_comp = icalcomponent_get_next_component (zone_comp, ICAL_XSTANDARD_COMPONENT)) { - offset_from = icalcomponent_get_first_property (s_comp, ICAL_TZOFFSETFROM_PROPERTY); - icalproperty_set_tzoffsetfrom (offset_from, offset); - } + return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL); } icaltimezone * @@ -228,72 +240,13 @@ calendar_config_get_icaltimezone (void) location = calendar_config_get_timezone (); if (location) { - icalcomponent *icalcomp, *dl_comp; - zone = icaltimezone_get_builtin_timezone (location); - icalcomp = icaltimezone_get_component (zone); - - - if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) { - g_free (location); - return zone; - } - - if (!calendar_config_get_daylight_saving () && zone) { - icalcomponent *zone_comp, *s_comp; - icalproperty *tz_prop, *offset_to; - icaltimezone *st_zone = NULL; - int offset; - const char *tzid; - char *n_tzid; - - tzid = icaltimezone_get_tzid (zone); - n_tzid = g_strconcat (tzid, "-(Standard)", NULL); - - if (!custom_zones) { - custom_zones = g_hash_table_new (g_str_hash, g_str_equal); - } else if ((st_zone = g_hash_table_lookup (custom_zones, n_tzid))) { - g_free (n_tzid); - g_free (location); - return st_zone; - } - - zone_comp = icalcomponent_new_clone (icalcomp); - s_comp = icalcomponent_get_first_component (zone_comp, ICAL_XSTANDARD_COMPONENT); - - if (!s_comp) { - g_free (n_tzid); - icalcomponent_free (zone_comp); - g_free (location); - return zone; - } - - offset_to = icalcomponent_get_first_property (s_comp, ICAL_TZOFFSETTO_PROPERTY); - offset = icalproperty_get_tzoffsetto (offset_to); - - set_standard_offsets (zone_comp, offset); - - tz_prop = icalcomponent_get_first_property (zone_comp, ICAL_TZID_PROPERTY); - if (tz_prop) { - icalcomponent_remove_property (zone_comp, tz_prop); - } - - tz_prop = icalproperty_new_tzid (n_tzid); - icalcomponent_add_property (zone_comp, tz_prop); - - st_zone = icaltimezone_new (); - icaltimezone_set_component (st_zone, zone_comp); - - zone = st_zone; - g_hash_table_insert (custom_zones, n_tzid, zone); - } g_free (location); } return zone; } - /* Sets the timezone. If set to NULL it defaults to UTC. FIXME: Should check it is being set to a valid timezone. */ void @@ -319,35 +272,6 @@ calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer return id; } -gboolean -calendar_config_get_daylight_saving (void) -{ - calendar_config_init (); - - return gconf_client_get_bool (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, NULL); - -} - -void -calendar_config_set_daylight_saving (gboolean daylight_saving) -{ - calendar_config_init (); - - gconf_client_set_bool (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, daylight_saving, NULL); -} - -guint -calendar_config_add_notification_daylight_saving (GConfClientNotifyFunc func, gpointer data) -{ - guint id; - - calendar_config_init (); - - id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, func, data, NULL, NULL); - - return id; -} - /* Whether we use 24-hour format or 12-hour format (AM/PM). */ gboolean calendar_config_get_24_hour_format (void) diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index f5fe75bf15..224d528078 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -73,8 +73,14 @@ char *calendar_config_get_primary_calendar (void); void calendar_config_set_primary_calendar (const char *primary_uid); guint calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, gpointer data); +/* Use system timezone; if TRUE, then influences also the current timezone functions. */ +gboolean calendar_config_get_use_system_timezone (void); +void calendar_config_set_use_system_timezone (gboolean use); +guint calendar_config_add_notification_use_system_timezone (GConfClientNotifyFunc func, gpointer data); + /* The current timezone, e.g. "Europe/London". */ gchar* calendar_config_get_timezone (void); +gchar* calendar_config_get_timezone_stored (void); icaltimezone *calendar_config_get_icaltimezone (void); void calendar_config_set_timezone (const gchar *timezone); guint calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data); @@ -259,9 +265,16 @@ gboolean calendar_config_locale_supports_12_hour_format(void); void calendar_config_set_dir_path (const char *); char * calendar_config_get_dir_path (void); -gboolean calendar_config_get_daylight_saving (void); -void calendar_config_set_daylight_saving (gboolean daylight_saving); -guint calendar_config_add_notification_daylight_saving (GConfClientNotifyFunc func, gpointer data); +GSList *calendar_config_get_day_second_zones (void); +void calendar_config_free_day_second_zones (GSList *zones); +void calendar_config_set_day_second_zone (const char *location); +char * calendar_config_get_day_second_zone (void); +void calendar_config_select_day_second_zone (void); +guint calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gpointer data); + +/* Birthdays & Anniversaries reminder settings */ +gboolean calendar_config_get_ba_reminder (int *interval, CalUnits *units); +void calendar_config_set_ba_reminder (gboolean *enabled, int *interval, CalUnits *units); GSList *calendar_config_get_day_second_zones (void); void calendar_config_free_day_second_zones (GSList *zones); diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 9a58a8cf6b..57704da0f2 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -796,3 +796,62 @@ cal_comp_process_source_list_drop (ECal *destination, icalcomponent *comp, GdkDr return success; } + +void +comp_util_sanitize_recurrence_master (ECalComponent *comp, ECal *client) +{ + ECalComponent *master = NULL; + icalcomponent *icalcomp = NULL; + ECalComponentRange rid; + ECalComponentDateTime sdt; + const char *uid; + + /* Get the master component */ + e_cal_component_get_uid (comp, &uid); + if (!e_cal_get_object (client, uid, NULL, &icalcomp, NULL)) { + g_warning ("Unable to get the master component \n"); + return; + } + + master = e_cal_component_new (); + e_cal_component_set_icalcomponent (master, icalcomp); + + /* Compare recur id and start date */ + e_cal_component_get_recurid (comp, &rid); + e_cal_component_get_dtstart (comp, &sdt); + + if (icaltime_compare_date_only (*rid.datetime.value, *sdt.value) == 0) + { + ECalComponentDateTime msdt, medt, edt; + int *sequence; + + e_cal_component_get_dtstart (master, &msdt); + e_cal_component_get_dtend (master, &medt); + + e_cal_component_get_dtend (comp, &edt); + + sdt.value->year = msdt.value->year; + sdt.value->month = msdt.value->month; + sdt.value->day = msdt.value->day; + + edt.value->year = medt.value->year; + edt.value->month = medt.value->month; + edt.value->day = medt.value->day; + + e_cal_component_set_dtstart (comp, &sdt); + e_cal_component_set_dtend (comp, &edt); + + e_cal_component_get_sequence (master, &sequence); + e_cal_component_set_sequence (comp, sequence); + + e_cal_component_free_datetime (&msdt); + e_cal_component_free_datetime (&medt); + e_cal_component_free_datetime (&edt); + } + + e_cal_component_free_datetime (&sdt); + e_cal_component_free_range (&rid); + e_cal_component_set_recurid (comp, NULL); + + g_object_unref (master); +} diff --git a/calendar/gui/comp-util.h b/calendar/gui/comp-util.h index 3225557a5e..b93384f40a 100644 --- a/calendar/gui/comp-util.h +++ b/calendar/gui/comp-util.h @@ -58,5 +58,6 @@ void cal_comp_set_dtstart_with_oldzone (ECal *client, ECalComponent *comp, const void cal_comp_set_dtend_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate); gboolean cal_comp_process_source_list_drop (ECal *destination, icalcomponent *comp, GdkDragAction action, const char *source_uid, ESourceList *source_list); +void comp_util_sanitize_recurrence_master (ECalComponent *comp, ECal *client); #endif 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> diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index d75f06c41e..9264d449f1 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -8,11 +8,19 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. +<<<<<<< HEAD:calendar/gui/e-cal-component-preview.c * * You should have received a copy of the GNU Lesser General Public * License along with the program; if not, see <http://www.gnu.org/licenses/> * * +======= + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + * +>>>>>>> 23df769955ea54f756a579c19964df87ae6fd5c8:calendar/gui/e-cal-component-preview.c * Authors: * Federico Mena Quintero <federico@ximian.com> * Damon Chaplin <damon@ximian.com> diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 7ead19cc06..13d9d26c35 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -469,6 +469,7 @@ ecm_value_at (ETableModel *etm, int col, int row) comp_data = g_ptr_array_index (priv->objects, row); g_return_val_if_fail (comp_data != NULL, NULL); + g_return_val_if_fail (comp_data->icalcomp != NULL, NULL); switch (col) { case E_CAL_MODEL_FIELD_CATEGORIES : diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 5839991060..0292f16c71 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -155,20 +155,23 @@ is_delegated (icalcomponent *icalcomp, char *user_email) if (prop) { param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDTO_PARAMETER); - delto = icalparameter_get_delegatedto (param); + if (param) + delto = icalparameter_get_delegatedto (param); } else return FALSE; prop = get_attendee_prop (icalcomp, itip_strip_mailto (delto)); if (prop) { - const char *delfrom; - icalparameter_partstat status; + const char *delfrom = NULL; + icalparameter_partstat status = ICAL_PARTSTAT_NONE; param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER); - delfrom = icalparameter_get_delegatedfrom (param); + if (param) + delfrom = icalparameter_get_delegatedfrom (param); param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - status = icalparameter_get_partstat (param); + if (param) + status = icalparameter_get_partstat (param); if ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), user_email) && status != ICAL_PARTSTAT_DECLINED) return TRUE; @@ -182,7 +185,7 @@ needs_to_accept (icalcomponent *icalcomp, char *user_email) { icalproperty *prop; icalparameter *param; - icalparameter_partstat status; + icalparameter_partstat status = ICAL_PARTSTAT_NONE; prop = get_attendee_prop (icalcomp, user_email); @@ -190,7 +193,8 @@ needs_to_accept (icalcomponent *icalcomp, char *user_email) if (!prop) return TRUE; param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - status = icalparameter_get_partstat (param); + if (param) + status = icalparameter_get_partstat (param); if (status == ICAL_PARTSTAT_ACCEPTED || status == ICAL_PARTSTAT_TENTATIVE) return FALSE; diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index 4f9bced553..a3dba94841 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -119,6 +119,8 @@ void e_calendar_table_process_completed_tasks GList *clients_list, gboolean config_changed); +gboolean ec_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, GtkWidget *etable_wgt, ECalModel *model); + G_END_DECLS #endif /* _E_CALENDAR_TABLE_H_ */ diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 938593a9a6..ddd08556fa 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -31,10 +31,10 @@ #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> #include <libedataserver/e-time-utils.h> +#include <e-util/e-util.h> #include <e-util/e-error.h> #include <e-util/e-dialog-utils.h> #include <e-util/e-icon-factory.h> -#include <e-util/e-util.h> #include <libecal/e-cal-time-util.h> #include <libecal/e-cal-component.h> @@ -268,7 +268,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart gint start_offset, end_offset; gboolean all_day_event = FALSE; GnomeCalendarViewType view_type; - ECalComponentDateTime dt; + GError *error = NULL; start_offset = 0; end_offset = 0; @@ -325,15 +325,16 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart new_time.minute = old_dtstart.minute; new_time.second = old_dtstart.second; - new_dtstart = icaltime_as_timet_with_zone (new_time, default_zone); + new_dtstart = icaltime_as_timet_with_zone (new_time, old_dtstart.zone ? old_dtstart.zone : default_zone); } break; default: g_return_if_reached (); } - - itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, default_zone); + itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, old_dtstart.zone ? old_dtstart.zone : default_zone); + /* set the timezone properly */ + itime.zone = old_dtstart.zone ? old_dtstart.zone : default_zone; if (all_day_event) itime.is_date = TRUE; icalcomponent_set_dtstart (icalcomp, itime); @@ -352,26 +353,10 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart e_cal_component_set_uid (comp, uid); g_free (uid); - /* set the timezone properly */ - e_cal_component_get_dtstart (comp, &dt); - g_free ((char *) dt.tzid); - dt.tzid = icaltimezone_get_tzid (default_zone); - e_cal_component_set_dtstart (comp, &dt); - dt.tzid = NULL; - e_cal_component_free_datetime (&dt); - - e_cal_component_get_dtend (comp, &dt); - g_free ((char *) dt.tzid); - dt.tzid = icaltimezone_get_tzid (default_zone); - e_cal_component_set_dtend (comp, &dt); - dt.tzid = NULL; - e_cal_component_free_datetime (&dt); - e_cal_component_commit_sequence (comp); - /* FIXME Error handling */ uid = NULL; - if (e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), &uid, NULL)) { + if (e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), &uid, &error)) { gboolean strip_alarms = TRUE; if (uid) { @@ -379,14 +364,16 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart g_free (uid); } - 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)) && send_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)), client, comp, TRUE, &strip_alarms)) { itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL, NULL, NULL, strip_alarms); } } else { - g_message (G_STRLOC ": Could not create the object!"); + g_message (G_STRLOC ": Could not create the object! %s", error ? error->message : ""); + if (error) + g_error_free (error); } g_object_unref (comp); @@ -633,7 +620,7 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp)) + if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client)) && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)), event->comp_data->client, comp, TRUE)) itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, @@ -699,6 +686,52 @@ clipboard_get_calendar_cb (GtkClipboard *clipboard, } } +static void +add_related_timezones (icalcomponent *des_icalcomp, icalcomponent *src_icalcomp, ECal *client) +{ + icalproperty_kind look_in[] = { + ICAL_DTSTART_PROPERTY, + ICAL_DTEND_PROPERTY, + ICAL_NO_PROPERTY + }; + int i; + + g_return_if_fail (des_icalcomp != NULL); + g_return_if_fail (src_icalcomp != NULL); + g_return_if_fail (client != NULL); + + for (i = 0; look_in[i] != ICAL_NO_PROPERTY; i++) { + icalproperty *prop = icalcomponent_get_first_property (src_icalcomp, look_in[i]); + + if (prop) { + icalparameter *par = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); + + if (par) { + const char *tzid = icalparameter_get_tzid (par); + + if (tzid) { + GError *error = NULL; + icaltimezone *zone = NULL; + + if (!e_cal_get_timezone (client, tzid, &zone, &error)) { + g_warning ("%s: Cannot get timezone for '%s'. %s", G_STRFUNC, tzid, error ? error->message : ""); + if (error) + g_error_free (error); + } else if (zone && + icalcomponent_get_timezone (des_icalcomp, icaltimezone_get_tzid (zone)) == NULL) { + /* do not duplicate timezones in the component */ + icalcomponent *vtz_comp; + + vtz_comp = icaltimezone_get_component (zone); + if (vtz_comp) + icalcomponent_add_component (des_icalcomp, icalcomponent_new_clone (vtz_comp)); + } + } + } + } + } +} + void e_calendar_view_copy_clipboard (ECalendarView *cal_view) { @@ -720,8 +753,11 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view) for (l = selected; l != NULL; l = l->next) { event = (ECalendarViewEvent *) l->data; - if (event) + if (event) { e_cal_util_add_timezones_from_component (vcal_comp, event->comp_data->icalcomp); + + add_related_timezones (vcal_comp, event->comp_data->icalcomp, event->comp_data->client); + } } for (l = selected; l != NULL; l = l->next) { @@ -796,40 +832,42 @@ clipboard_get_calendar_data (ECalendarView *cal_view, const gchar *text) else in_top_canvas = FALSE; - /* FIXME Timezone handling */ if (kind == ICAL_VCALENDAR_COMPONENT) { - icalcomponent_kind child_kind; icalcomponent *subcomp; - subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT); - while (subcomp) { - child_kind = icalcomponent_isa (subcomp); - if (child_kind == ICAL_VEVENT_COMPONENT) { + /* add timezones first, to have them ready */ + for (subcomp = icalcomponent_get_first_component (icalcomp, ICAL_VTIMEZONE_COMPONENT); + subcomp; + subcomp = icalcomponent_get_next_component (icalcomp, ICAL_VTIMEZONE_COMPONENT)) { + icaltimezone *zone; + GError *error = NULL; - if (e_cal_util_component_has_recurrences (subcomp)) { - icalproperty *icalprop = icalcomponent_get_first_property (subcomp, ICAL_RRULE_PROPERTY); - if (icalprop) - icalproperty_remove_parameter_by_name (icalprop, "X-EVOLUTION-ENDDATE"); - } + zone = icaltimezone_new (); + icaltimezone_set_component (zone, subcomp); + if (!e_cal_add_timezone (client, zone, &error)) { + icalproperty *tzidprop = icalcomponent_get_first_property (subcomp, ICAL_TZID_PROPERTY); - e_calendar_view_add_event (cal_view, client, selected_time_start, - default_zone, subcomp, in_top_canvas); - } else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { - icaltimezone *zone; + g_warning ("%s: Add zone '%s' failed. %s", G_STRFUNC, tzidprop ? icalproperty_get_tzid (tzidprop) : "???", error ? error->message : ""); + if (error) + g_error_free (error); + } - zone = icaltimezone_new (); - icaltimezone_set_component (zone, subcomp); - e_cal_add_timezone (client, zone, NULL); + icaltimezone_free (zone, 1); + } - icaltimezone_free (zone, 1); + for (subcomp = icalcomponent_get_first_component (icalcomp, ICAL_VEVENT_COMPONENT); + subcomp; + subcomp = icalcomponent_get_next_component (icalcomp, ICAL_VEVENT_COMPONENT)) { + if (e_cal_util_component_has_recurrences (subcomp)) { + icalproperty *icalprop = icalcomponent_get_first_property (subcomp, ICAL_RRULE_PROPERTY); + if (icalprop) + icalproperty_remove_parameter_by_name (icalprop, "X-EVOLUTION-ENDDATE"); } - subcomp = icalcomponent_get_next_component ( - icalcomp, ICAL_ANY_COMPONENT); + e_calendar_view_add_event (cal_view, client, selected_time_start, default_zone, subcomp, in_top_canvas); } icalcomponent_free (icalcomp); - } else { e_calendar_view_add_event (cal_view, client, selected_time_start, default_zone, icalcomp, in_top_canvas); } @@ -868,6 +906,35 @@ clipboard_paste_received_cb (GtkClipboard *clipboard, g_object_unref (data); } +static void +e_calendar_view_paste_text (ECalendarView *cal_view) +{ + g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); + + if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text) + E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text (cal_view); +} + +static void +clipboard_paste_received_cb (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + gpointer data) +{ + if (gtk_clipboard_wait_is_text_available (clipboard)) { + e_calendar_view_paste_text (E_CALENDAR_VIEW (data)); + } else { + GdkAtom type = selection_data->type; + if (type == gdk_atom_intern (target_types[TARGET_TYPE_VCALENDAR].target, TRUE)) { + gchar *result = NULL; + result = g_strndup ((const gchar *) selection_data->data, + selection_data->length); + clipboard_get_calendar_data (E_CALENDAR_VIEW (data), result); + g_free (result); + } + } + g_object_unref (data); +} + void e_calendar_view_paste_clipboard (ECalendarView *cal_view) { @@ -982,7 +1049,7 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event) const char *uid; char *rid = NULL; - if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp)) + if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client)) && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)), event->comp_data->client, comp, TRUE)) @@ -1121,7 +1188,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) e_cal_component_free_datetime (&dt); - if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp)) + if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client)) && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)), event->comp_data->client, comp, TRUE) && !e_cal_get_save_schedules (event->comp_data->client)) { @@ -2024,7 +2091,7 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view, ECalComponent *comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); flags |= COMP_EDITOR_MEETING; - if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp) || !e_cal_component_has_attendees (comp)) + if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client) || !e_cal_component_has_attendees (comp)) flags |= COMP_EDITOR_USER_ORG; g_object_unref (comp); } @@ -2043,7 +2110,7 @@ e_calendar_view_modify_and_send (ECalComponent *comp, if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) { gboolean strip_alarms = TRUE; - 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)) && send_component_dialog (toplevel, client, comp, new, &strip_alarms)) { ECalComponent *send_comp = NULL; @@ -2349,13 +2416,25 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) tmp1 = get_label(dtstart.value, zone, default_zone); tmp = calculate_time (t_start, t_end); + /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/ + tmp2 = g_strdup_printf(_("Time: %s %s"), tmp1, tmp); + if (zone && !cal_comp_util_compare_event_timezones (newcomp, client, default_zone)) { + g_free (tmp); + g_free (tmp1); + + tmp1 = get_label (dtstart.value, zone, zone); + tmp = g_strconcat (tmp2, "\n\t[ ", tmp1, " ", icaltimezone_get_display_name (zone), " ]", NULL); + } else { + g_free (tmp); + tmp = tmp2; + tmp2 = NULL; + } + e_cal_component_free_datetime (&dtstart); e_cal_component_free_datetime (&dtend); - /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/ - tmp2 = g_strdup_printf(_("Time: %s %s"), tmp1, tmp); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start ((GtkBox *)hbox, gtk_label_new_with_mnemonic (tmp2), FALSE, FALSE, 0); + gtk_box_pack_start ((GtkBox *)hbox, gtk_label_new_with_mnemonic (tmp), FALSE, FALSE, 0); ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index 9f196a5b15..5ea596ad5d 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -27,6 +27,7 @@ #include <gtk/gtk.h> #include "e-cal-model.h" #include "gnome-cal.h" +#include "e-activity-handler.h" G_BEGIN_DECLS @@ -66,6 +67,7 @@ typedef enum { guint16 start_minute; \ guint16 end_minute; \ guint different_timezone : 1; \ + gboolean is_editable; \ GtkWidget *tooltip; \ gint timeout; \ GdkColor *color; \ @@ -166,6 +168,8 @@ void e_calendar_view_modify_and_send (ECalComponent *comp, CalObjModType mod, GtkWindow *toplevel, gboolean new); +void e_calendar_utils_show_error_silent (struct _GtkWidget *widget); +void e_calendar_utils_show_info_silent(struct _GtkWidget *widget); gboolean e_calendar_view_get_tooltips (ECalendarViewEventData *data); diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index d1ffb986de..6a07d9790a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1820,15 +1820,16 @@ set_text_as_bold (EDayViewEvent *event) break; } } - e_cal_component_free_attendee_list (attendees); - g_free (address); - g_object_unref (comp); /* The attendee has not yet accepted the meeting, display the summary as bolded. If the attendee is not present, it might have come through a mailing list. In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); + + e_cal_component_free_attendee_list (attendees); + g_free (address); + g_object_unref (comp); } /* This updates the text shown for an event. If the event start or end do not @@ -3250,6 +3251,13 @@ e_day_view_on_event_click (EDayView *day_view, !e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) && (pos == E_CALENDAR_VIEW_POS_TOP_EDGE || pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)) { + gboolean read_only = FALSE; + + if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) { + return; + } + + /* Grab the keyboard focus, so the event being edited is saved and we can use the Escape key to abort the resize. */ if (!GTK_WIDGET_HAS_FOCUS (day_view)) @@ -3724,9 +3732,12 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, gtk_target_list_unref (target_list); } } else { + gboolean read_only = FALSE; cursor = day_view->normal_cursor; - if (event) { + /* Check if the event is editable and client is not readonly while changing the cursor */ + if (event && event->is_editable && e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && !read_only) { + switch (pos) { case E_CALENDAR_VIEW_POS_LEFT_EDGE: cursor = day_view->move_cursor; @@ -3905,6 +3916,7 @@ e_day_view_update_resize (EDayView *day_view, EDayViewEvent *event; gint day, event_num; gboolean need_reshape = FALSE; + gboolean read_only = FALSE; #if 0 g_print ("Updating resize Row:%i\n", row); @@ -3918,6 +3930,10 @@ e_day_view_update_resize (EDayView *day_view, event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); + if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) { + return; + } + if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { row = MIN (row, day_view->resize_end_row); if (row != day_view->resize_start_row) { @@ -4009,12 +4025,15 @@ e_day_view_finish_long_event_resize (EDayView *day_view) } e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { @@ -4036,7 +4055,8 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); @@ -4116,11 +4136,14 @@ e_day_view_finish_resize (EDayView *day_view) day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ @@ -4141,7 +4164,8 @@ e_day_view_finish_resize (EDayView *day_view) e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -4291,6 +4315,11 @@ e_day_view_add_event (ECalComponent *comp, e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view)))) event.different_timezone = TRUE; + if (!e_cal_component_has_attendees (comp) || itip_organizer_is_user (comp, event.comp_data->client) || itip_sentby_is_user (comp, event.comp_data->client)) + event.is_editable = TRUE; + else + event.is_editable = FALSE; + /* Find out which array to add the event to. */ for (day = 0; day < add_event_data->day_view->days_shown; day++) { if (start >= add_event_data->day_view->day_starts[day] @@ -6124,19 +6153,23 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6359,11 +6392,14 @@ e_day_view_on_editing_stopped (EDayView *day_view, } else { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime olddt, dt; icaltimetype itt; @@ -6411,7 +6447,8 @@ e_day_view_on_editing_stopped (EDayView *day_view, e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6586,19 +6623,8 @@ e_day_view_auto_scroll_handler (gpointer data) if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use canvas items which have X windows. */ - - /* FIXME: Since GNOME 2.0 we can't do this, since the canvas - * won't update when its's thawed. Is this a bug or should we - * really be doing something else? Investigate. */ -#if 0 - gtk_layout_freeze (GTK_LAYOUT (day_view->main_canvas)); -#endif - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), scroll_x, new_scroll_y); -#if 0 - gtk_layout_thaw (GTK_LAYOUT (day_view->main_canvas)); -#endif } canvas_x = day_view->last_mouse_x + scroll_x; @@ -7523,11 +7549,14 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); @@ -7535,7 +7564,8 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); @@ -7725,19 +7755,23 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 07718846d7..91f24a973c 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -99,8 +99,6 @@ struct _EItipControlPrivate { gint view_only; }; -#define ACTION_DATA "EItipControl:Action" - /* HTML Strings */ #define HTML_BODY_START "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#336699\">" #define HTML_SEP "<hr color=#336699 align=\"left\" width=450>" @@ -2197,28 +2195,66 @@ url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpoint close (fd); } +static GtkWidget * +create_combo_box (void) +{ + GtkComboBox *combo; + GtkCellRenderer *cell; + GtkListStore *store; + + combo = GTK_COMBO_BOX (gtk_combo_box_new ()); + + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); + 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, + NULL); + + return GTK_WIDGET (combo); +} + static void option_activated_cb (GtkWidget *widget, gpointer data) { EItipControl *itip = E_ITIP_CONTROL (data); EItipControlPrivate *priv; + GtkTreeIter iter; + gint act; priv = itip->priv; - priv->action = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), ACTION_DATA)); + g_return_if_fail (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)); + + gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (widget)), &iter, 1, &act, -1); + + priv->action = act; } static void -add_option (EItipControl *itip, GtkWidget *menu, const char *text, char action) +add_option (EItipControl *itip, GtkWidget *combo, const char *text, char action) { - GtkWidget *item; + GtkTreeIter iter; + GtkListStore *store; + + store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (combo))); - item = gtk_menu_item_new_with_label (text); - g_signal_connect (item, "activate", G_CALLBACK (option_activated_cb), itip); - g_object_set_data (G_OBJECT (item), ACTION_DATA, GINT_TO_POINTER ((int)action)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - gtk_widget_show (item); + gtk_list_store_append (store, &iter); + gtk_list_store_set ( + store, &iter, + 0, text, + 1, (gint) action, + -1); + if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo)) == -1) { + gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); + g_signal_connect (combo, "changed", G_CALLBACK (option_activated_cb), itip); + } } static void @@ -2306,24 +2342,20 @@ static gboolean publish_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); + combo = create_combo_box (); - menu = gtk_menu_new (); - - add_option (itip, menu, _("Update"), 'U'); + add_option (itip, combo, _("Update"), 'U'); priv->action = 'U'; - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - - gtk_box_pack_start (GTK_BOX (priv->hbox.widget), option, FALSE, TRUE, 0); - gtk_widget_show (option); + gtk_box_pack_start (GTK_BOX (priv->hbox.widget), combo, FALSE, TRUE, 0); + gtk_widget_show (combo); insert_ok (priv->hbox.widget, itip); @@ -2334,26 +2366,22 @@ static gboolean request_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); + combo = create_combo_box (); - menu = gtk_menu_new (); - - add_option (itip, menu, _("Accept"), 'A'); - add_option (itip, menu, _("Tentatively accept"), 'T'); - add_option (itip, menu, _("Decline"), 'D'); + add_option (itip, combo, _("Accept"), 'A'); + add_option (itip, combo, _("Tentatively accept"), 'T'); + add_option (itip, combo, _("Decline"), 'D'); priv->action = 'A'; - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - - gtk_box_pack_start (GTK_BOX (priv->hbox.widget), option, FALSE, TRUE, 0); - gtk_widget_show (option); + gtk_box_pack_start (GTK_BOX (priv->hbox.widget), combo, FALSE, TRUE, 0); + gtk_widget_show (combo); insert_rsvp (priv->hbox.widget, itip); insert_ok (priv->hbox.widget, itip); @@ -2365,24 +2393,20 @@ static gboolean freebusy_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); + combo = create_combo_box (); - menu = gtk_menu_new (); - - add_option (itip, menu, _("Send Free/Busy Information"), 'F'); + add_option (itip, combo, _("Send Free/Busy Information"), 'F'); priv->action = 'F'; - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - - gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); - gtk_widget_show (option); + gtk_container_add (GTK_CONTAINER (priv->hbox.widget), combo); + gtk_widget_show (combo); insert_ok (priv->hbox.widget, itip); @@ -2393,24 +2417,20 @@ static gboolean reply_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); - - menu = gtk_menu_new (); + combo = create_combo_box (); - add_option (itip, menu, _("Update respondent status"), 'R'); + add_option (itip, combo, _("Update respondent status"), 'R'); priv->action = 'R'; - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - - gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); - gtk_widget_show (option); + gtk_container_add (GTK_CONTAINER (priv->hbox.widget), combo); + gtk_widget_show (combo); insert_ok (priv->hbox.widget, itip); @@ -2421,24 +2441,20 @@ static gboolean refresh_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); - - menu = gtk_menu_new (); - - add_option (itip, menu, _("Send Latest Information"), 'S'); - priv->action = 'R'; + combo = create_combo_box (); - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); + add_option (itip, combo, _("Send Latest Information"), 'S'); + priv->action = 'S'; - gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); - gtk_widget_show (option); + gtk_container_add (GTK_CONTAINER (priv->hbox.widget), combo); + gtk_widget_show (combo); insert_ok (priv->hbox.widget, itip); @@ -2449,24 +2465,20 @@ static gboolean cancel_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; - GtkWidget *option, *menu; + GtkWidget *combo; priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - option = gtk_option_menu_new (); - - menu = gtk_menu_new (); + combo = create_combo_box (); - add_option (itip, menu, _("Cancel"), 'C'); + add_option (itip, combo, _("Cancel"), 'C'); priv->action = 'C'; - gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); - - gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); - gtk_widget_show (option); + gtk_container_add (GTK_CONTAINER (priv->hbox.widget), combo); + gtk_widget_show (combo); insert_ok (priv->hbox.widget, itip); diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 78f87c23f5..aea75d4bd7 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -552,6 +552,7 @@ build_table (EMeetingListView *lview) col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable(col, TRUE); + gtk_tree_view_column_set_expand (col, TRUE); g_object_set (col, "min-width", 50, NULL); g_object_set_data (G_OBJECT (col), "mtg-store-col", GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL)); g_signal_connect (renderer, "cell_edited", G_CALLBACK (attendee_edited_cb), view); diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 80a238e8a7..6be38a0367 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -824,7 +824,10 @@ e_meeting_time_selector_destroy (GtkObject *object) mts->display_top = NULL; mts->display_main = NULL; - calendar_config_remove_notification (mts->fb_uri_not); + if (mts->fb_uri_not) { + calendar_config_remove_notification (mts->fb_uri_not); + mts->fb_uri_not = 0; + } if (mts->fb_refresh_not != 0) { g_source_remove (mts->fb_refresh_not); diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 490de9f919..abaad08695 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -186,6 +186,18 @@ memo_table_double_click_cb (EMemoTable *memo_table, memo_table_emit_open_component (memo_table, comp_data); } +static gboolean +query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +{ + EMemoTable *memo_table; + + g_return_val_if_fail (E_IS_MEMO_TABLE (user_data), FALSE); + + memo_table = E_MEMO_TABLE (user_data); + + return ec_query_tooltip (widget, x, y, keyboard_mode, tooltip, GTK_WIDGET (e_memo_table_get_table (memo_table)), memo_table->model); +} + static void memo_table_model_cal_view_progress_cb (EMemoTable *memo_table, const gchar *message, diff --git a/calendar/gui/e-memos.h b/calendar/gui/e-memos.h index 9f196ded22..b97cc0ac68 100644 --- a/calendar/gui/e-memos.h +++ b/calendar/gui/e-memos.h @@ -78,5 +78,6 @@ void e_memos_setup_view_menus (EMemos *memos, BonoboUIComponent *uic); void e_memos_discard_view_menus (EMemos *memos); EMemoTable *e_memos_get_calendar_table (EMemos *memos); +GtkWidget *e_memos_get_preview (EMemos *memos); #endif /* _E_MEMOS_H_ */ diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 997eaee4da..a314bc67d3 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -43,7 +43,6 @@ #include "widgets/menus/gal-view-menus.h" #include "dialogs/delete-error.h" #include "dialogs/task-editor.h" -#include "e-calendar-marshal.h" #include "cal-search-bar.h" #include "calendar-config.h" #include "calendar-component.h" diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 290a6831ed..53955c5bbe 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -1908,6 +1908,10 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL); + + e_cal_component_free_attendee_list (attendees); + g_free (address); + g_object_unref (comp); } /* This calls a given function for each event instance that matches the given @@ -3445,19 +3449,23 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end week_view->last_edited_comp_string = e_cal_component_get_as_string (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (week_view->main_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view))); @@ -3580,10 +3588,13 @@ e_week_view_on_editing_stopped (EWeekView *week_view, CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime dt; @@ -3635,7 +3646,8 @@ e_week_view_on_editing_stopped (EWeekView *week_view, e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view))); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 4db534611d..7e685dcf91 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -47,13 +47,13 @@ #include <widgets/menus/gal-view-etable.h> #include <widgets/menus/gal-define-views-dialog.h> #include "widgets/menus/gal-view-menus.h" +#include "e-util/e-util.h" #include "e-util/e-error.h" #include "e-util/e-util-private.h" #include "e-comp-editor-registry.h" #include "dialogs/delete-error.h" #include "dialogs/event-editor.h" #include "comp-util.h" -#include "e-calendar-marshal.h" #include "e-cal-model-calendar.h" #include "e-day-view.h" #include "e-day-view-config.h" @@ -295,9 +295,10 @@ gnome_calendar_class_init (GnomeCalendarClass *class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GnomeCalendarClass, source_added), NULL, NULL, - e_calendar_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, + 2, + G_TYPE_INT, G_TYPE_OBJECT); gnome_calendar_signals[SOURCE_REMOVED] = g_signal_new ("source_removed", @@ -305,9 +306,10 @@ gnome_calendar_class_init (GnomeCalendarClass *class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), NULL, NULL, - e_calendar_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, 1, - G_TYPE_OBJECT); + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, + 2, + G_TYPE_INT, G_TYPE_OBJECT); gnome_calendar_signals[GOTO_DATE] = g_signal_new ("goto_date", @@ -1033,11 +1035,6 @@ set_timezone (GnomeCalendar *calendar) e_cal_set_default_timezone (client, priv->zone, NULL); } - if (priv->default_client[i] - && e_cal_get_load_state (priv->default_client[i]) == E_CAL_LOAD_LOADED) - /* FIXME Error checking */ - e_cal_set_default_timezone (priv->default_client[i], priv->zone, NULL); - if (priv->views [priv->current_view_type]) e_calendar_view_set_timezone (priv->views [priv->current_view_type], priv->zone); } @@ -1527,6 +1524,8 @@ setup_widgets (GnomeCalendar *gcal) e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), gc_get_default_time, gcal); + e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), gc_get_default_time, gcal); + update_memo_view (gcal); } @@ -1544,6 +1543,9 @@ gnome_calendar_init (GnomeCalendar *gcal) if (non_intrusive_error_table == NULL) non_intrusive_error_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + if (non_intrusive_error_table == NULL) + non_intrusive_error_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + e_categories_register_change_listener (G_CALLBACK (categories_changed_cb), gcal); priv->todo_update_lock = g_mutex_new (); @@ -1666,6 +1668,8 @@ gnome_calendar_destroy (GtkObject *object) g_mutex_free (priv->todo_update_lock); + g_mutex_free (priv->todo_update_lock); + g_free (priv); gcal->priv = NULL; } @@ -2138,6 +2142,41 @@ non_intrusive_error_remove(GtkWidget *w, void *data) g_hash_table_remove(non_intrusive_error_table, data); } +struct _mclient_msg { + Message header; + ECalModel *model; + ECal *client; +}; + +static void +add_mclient_async (struct _mclient_msg *msg) +{ + e_cal_model_add_client (msg->model, msg->client); + + g_object_unref (msg->client); + g_object_unref (msg->model); + g_slice_free (struct _mclient_msg, msg); +} + +static void +add_mclient (ECalModel *model, ECal *client) +{ + struct _mclient_msg *msg; + + msg = g_slice_new0 (struct _mclient_msg); + msg->header.func = (MessageFunc) add_mclient_async; + msg->model = g_object_ref (model); + msg->client = g_object_ref (client); + + message_push ((Message *) msg); +} + +static void +non_intrusive_error_remove(GtkWidget *w, void *data) +{ + g_hash_table_remove(non_intrusive_error_table, data); +} + static void client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) { diff --git a/calendar/gui/goto-dialog.glade b/calendar/gui/goto-dialog.glade index ab832f335d..aeed7ae70d 100644 --- a/calendar/gui/goto-dialog.glade +++ b/calendar/gui/goto-dialog.glade @@ -10,6 +10,13 @@ <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_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <property name="has_separator">True</property> <child internal-child="vbox"> @@ -31,6 +38,7 @@ <property name="label" translatable="yes">_Select Today</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="response_id">0</property> </widget> </child> @@ -43,6 +51,7 @@ <property name="label">gtk-cancel</property> <property name="use_stock">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <property name="response_id">-6</property> </widget> </child> @@ -68,112 +77,22 @@ <property name="spacing">4</property> <child> - <widget class="GtkOptionMenu" id="month"> + <widget class="GtkComboBox" id="month-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">January</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">February</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">March</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget5"> - <property name="visible">True</property> - <property name="label" translatable="yes">April</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget6"> - <property name="visible">True</property> - <property name="label" translatable="yes">May</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">June</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">July</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">August</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget10"> - <property name="visible">True</property> - <property name="label" translatable="yes">September</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">October</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget12"> - <property name="visible">True</property> - <property name="label" translatable="yes">November</property> - <property name="use_underline">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="convertwidget13"> - <property name="visible">True</property> - <property name="label" translatable="yes">December</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> + <property name="items" translatable="yes">January +February +March +April +May +June +July +August +September +October +November +December</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/goto.c b/calendar/gui/goto.c index d0fe71b1d2..3c0cfc7576 100644 --- a/calendar/gui/goto.c +++ b/calendar/gui/goto.c @@ -37,7 +37,7 @@ typedef struct GladeXML *xml; GtkWidget *dialog; - GtkWidget *month; + GtkWidget *month_combobox; GtkWidget *year; ECalendar *ecal; GtkWidget *vbox; @@ -66,11 +66,8 @@ static void month_changed (GtkToggleButton *toggle, gpointer data) { GoToDialog *dlg = data; - GtkWidget *menu, *active; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month)); - active = gtk_menu_get_active (GTK_MENU (menu)); - dlg->month_val = g_list_index (GTK_MENU_SHELL (menu)->children, active); + dlg->month_val = gtk_combo_box_get_active (GTK_COMBO_BOX (dlg->month_combobox)); e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val); } @@ -179,14 +176,14 @@ get_widgets (GoToDialog *dlg) dlg->dialog = GW ("goto-dialog"); - dlg->month = GW ("month"); + dlg->month_combobox = GW ("month-combobox"); dlg->year = GW ("year"); dlg->vbox = GW ("vbox"); #undef GW return (dlg->dialog - && dlg->month + && dlg->month_combobox && dlg->year && dlg->vbox); } @@ -194,13 +191,9 @@ get_widgets (GoToDialog *dlg) static void goto_dialog_init_widgets (GoToDialog *dlg) { - GtkWidget *menu; GtkAdjustment *adj; - GList *l; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month)); - for (l = GTK_MENU_SHELL (menu)->children; l != NULL; l = l->next) - g_signal_connect (menu, "selection_done", G_CALLBACK (month_changed), dlg); + g_signal_connect (dlg->month_combobox, "changed", G_CALLBACK (month_changed), dlg); adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dlg->year)); g_signal_connect (adj, "value_changed", G_CALLBACK (year_changed), dlg); @@ -250,7 +243,7 @@ goto_dialog (GnomeCalendar *gcal) dlg->month_val = tt.month - 1; dlg->day_val = tt.day; - gtk_option_menu_set_history (GTK_OPTION_MENU (dlg->month), dlg->month_val); + gtk_combo_box_set_active (GTK_COMBO_BOX (dlg->month_combobox), dlg->month_val); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->year), dlg->year_val); create_ecal (dlg); diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 6b481d4a49..c6aa0214ca 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -122,13 +122,13 @@ itip_organizer_is_user (ECalComponent *comp, ECal *client) } gboolean -itip_sentby_is_user (ECalComponent *comp) +itip_sentby_is_user (ECalComponent *comp, ECal *client) { ECalComponentOrganizer organizer; const char *strip; gboolean user_sentby = FALSE; - if (!e_cal_component_has_organizer (comp)) + if (!e_cal_component_has_organizer (comp) ||e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER)) return FALSE; e_cal_component_get_organizer (comp, &organizer); @@ -935,7 +935,7 @@ comp_sentby (ECalComponent *comp, ECal *client) } } - 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)) { EAccount *a = itip_addresses_get_default (); organizer.value = g_strdup (organizer.value); diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h index 631c0a3430..9c8ffa1b60 100644 --- a/calendar/gui/itip-utils.h +++ b/calendar/gui/itip-utils.h @@ -52,7 +52,7 @@ EAccount *itip_addresses_get_default (void); gboolean itip_organizer_is_user (ECalComponent *comp, ECal *client); gboolean itip_organizer_is_user_ex (ECalComponent *comp, ECal *client, gboolean skip_cap_test); -gboolean itip_sentby_is_user (ECalComponent *comp); +gboolean itip_sentby_is_user (ECalComponent *comp, ECal *client); const gchar *itip_strip_mailto (const gchar *address); diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index 9a2b9df46e..5e16d3118b 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -1,24 +1,24 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* memos-component.c - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * +/* * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. * - * Authors: Rodrigo Moya <rodrigo@ximian.com> - * Nathan Owens <pianocomp81@yahoo.com> + * Authors: + * Rodrigo Moya <rodrigo@ximian.com> + * Nathan Owens <pianocomp81@yahoo.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * */ #ifdef HAVE_CONFIG_H diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 01604628f9..62a283f370 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -43,6 +43,7 @@ #include "evolution-shell-component-utils.h" #include "e-util/e-menu.h" #include "e-cal-menu.h" +#include "e-cal-component-preview.h" #include "e-util/e-menu.h" #include "itip-utils.h" @@ -94,11 +95,13 @@ sensitize_items(BonoboUIComponent *uic, struct _tasks_sensitize_item *items, gui } } +#define E_CAL_TASKS_PREVIEW_ACTIVE (1<<31) + static struct _tasks_sensitize_item tasks_sensitize_table[] = { { "TasksOpenTask", E_CAL_MENU_SELECT_ONE }, - { "TasksCut", E_CAL_MENU_SELECT_ANY | E_CAL_MENU_SELECT_EDITABLE }, + { "TasksCut", E_CAL_MENU_SELECT_ANY | E_CAL_MENU_SELECT_EDITABLE | E_CAL_TASKS_PREVIEW_ACTIVE }, { "TasksCopy", E_CAL_MENU_SELECT_ANY }, - { "TasksPaste", E_CAL_MENU_SELECT_EDITABLE }, + { "TasksPaste", E_CAL_MENU_SELECT_EDITABLE | E_CAL_TASKS_PREVIEW_ACTIVE }, { "TasksDelete", E_CAL_MENU_SELECT_ANY | E_CAL_MENU_SELECT_EDITABLE }, { "TasksMarkComplete", E_CAL_MENU_SELECT_ANY | E_CAL_MENU_SELECT_EDITABLE | E_CAL_MENU_SELECT_NOTCOMPLETE}, { "TasksPurge", E_CAL_MENU_SELECT_EDITABLE }, @@ -122,6 +125,7 @@ tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_s GPtrArray *events; GSList *selected = NULL, *l = NULL; ECalendarTable *cal_table; + GtkWidget *preview; uic = bonobo_control_get_ui_component (control); g_return_if_fail (uic != NULL); @@ -148,6 +152,12 @@ tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_s if (ecal) e_cal_is_read_only (ecal, &read_only, NULL); + preview = e_cal_component_preview_get_html (E_CAL_COMPONENT_PREVIEW (e_tasks_get_preview (tasks))); + if (preview && GTK_WIDGET_VISIBLE (preview) && GTK_WIDGET_HAS_FOCUS (preview)) + t->target.mask = t->target.mask | E_CAL_TASKS_PREVIEW_ACTIVE; + else + t->target.mask = t->target.mask & (~E_CAL_TASKS_PREVIEW_ACTIVE); + sensitize_items (uic, tasks_sensitize_table, t->target.mask); e_menu_update_target ((EMenu *)menu, (EMenuTarget *)t); } @@ -163,6 +173,16 @@ selection_changed_cb (ETasks *tasks, int n_selected, gpointer data) tasks_control_sensitize_commands (control, tasks, n_selected); } +static gboolean +tasks_control_focus_changed (GtkWidget *widget, GdkEventFocus *event, struct focus_changed_data *fc_data) +{ + g_return_val_if_fail (fc_data != NULL, FALSE); + + tasks_control_sensitize_commands (fc_data->control, fc_data->tasks, -1); + + return FALSE; +} + static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd), BONOBO_UI_VERB ("TasksMarkComplete", tasks_control_complete_cmd), diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 53fe6dcce6..613e62c1ca 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -363,9 +363,6 @@ configure_items (WeekdayPicker *wp) c = get_day_text (day); gnome_canvas_item_set (priv->labels[i], "text", c, -#if 0 - "font_gdk", gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (wp))), -#endif "x", (double) (i * box_width) + box_width / 2.0, "y", (double) (1 + PADDING), "anchor", GTK_ANCHOR_N, |