aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-06-06 21:56:29 +0800
committerMilan Crha <mcrha@redhat.com>2013-06-06 21:57:38 +0800
commit9e33bb17287ecb26c3fed164e7b441475dc1b2cb (patch)
tree9ca07200b7655489dbae0b4d66a95f5ade9242a8 /calendar
parent824f6a531d3455c37c69657cde6ed823f48d9116 (diff)
downloadgsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar.gz
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar.bz2
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar.lz
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar.xz
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.tar.zst
gsoc2013-evolution-9e33bb17287ecb26c3fed164e7b441475dc1b2cb.zip
Bug #555130 - Redesign task editor
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/Makefile.am4
-rw-r--r--calendar/gui/dialogs/task-details-page.c789
-rw-r--r--calendar/gui/dialogs/task-details-page.h75
-rw-r--r--calendar/gui/dialogs/task-details-page.ui453
-rw-r--r--calendar/gui/dialogs/task-editor.c62
-rw-r--r--calendar/gui/dialogs/task-page.c522
-rw-r--r--calendar/gui/dialogs/task-page.ui407
7 files changed, 884 insertions, 1428 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index f95464f2f0..42e6730103 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -43,7 +43,6 @@ ecalendarinclude_HEADERS = \
select-source-dialog.h \
send-comp.h \
task-editor.h \
- task-details-page.h \
task-page.h
libcal_dialogs_la_LIBADD = \
@@ -101,8 +100,6 @@ libcal_dialogs_la_SOURCES = \
send-comp.h \
task-editor.c \
task-editor.h \
- task-details-page.c \
- task-details-page.h \
task-page.c \
task-page.h
@@ -115,7 +112,6 @@ ui_DATA = \
memo-page.ui \
recurrence-page.ui \
schedule-page.ui \
- task-details-page.ui \
task-page.ui
CLEANFILES = $(BUILT_SOURCES)
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
deleted file mode 100644
index e40db5ba86..0000000000
--- a/calendar/gui/dialogs/task-details-page.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/*
- * Evolution calendar - task details page
- *
- * This program is free software; you can redistribute it and/or
- * 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
- * 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/>
- *
- *
- * Authors:
- * Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "../e-timezone-entry.h"
-#include "comp-editor-util.h"
-#include "task-details-page.h"
-
-#define TASK_DETAILS_PAGE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPagePrivate))
-
-struct _TaskDetailsPagePrivate {
- GtkBuilder *builder;
-
- /* Widgets from the UI file */
- GtkWidget *main;
-
- GtkWidget *status_combo;
- GtkWidget *priority_combo;
- GtkWidget *percent_complete;
-
- GtkWidget *date_completed_label;
- GtkWidget *completed_date;
-
- GtkWidget *url_label;
- GtkWidget *url_entry;
- GtkWidget *url;
-};
-
-/* Note that these two arrays must match. */
-static const gint status_map[] = {
- ICAL_STATUS_NONE,
- ICAL_STATUS_INPROCESS,
- ICAL_STATUS_COMPLETED,
- ICAL_STATUS_CANCELLED,
- -1
-};
-
-typedef enum {
- PRIORITY_HIGH,
- PRIORITY_NORMAL,
- PRIORITY_LOW,
- PRIORITY_UNDEFINED
-} TaskEditorPriority;
-
-static const gint priority_map[] = {
- PRIORITY_HIGH,
- PRIORITY_NORMAL,
- PRIORITY_LOW,
- PRIORITY_UNDEFINED,
- -1
-};
-
-G_DEFINE_TYPE (TaskDetailsPage, task_details_page, TYPE_COMP_EDITOR_PAGE)
-
-static TaskEditorPriority
-priority_value_to_index (gint priority_value)
-{
- TaskEditorPriority retval;
-
- if (priority_value == 0)
- retval = PRIORITY_UNDEFINED;
- else if (priority_value <= 4)
- retval = PRIORITY_HIGH;
- else if (priority_value == 5)
- retval = PRIORITY_NORMAL;
- else
- retval = PRIORITY_LOW;
-
- return retval;
-}
-
-static gint
-priority_index_to_value (TaskEditorPriority priority)
-{
- gint retval;
-
- switch (priority) {
- case PRIORITY_UNDEFINED:
- retval = 0;
- break;
- case PRIORITY_HIGH:
- retval = 3;
- break;
- case PRIORITY_NORMAL:
- retval = 5;
- break;
- case PRIORITY_LOW:
- retval = 7;
- break;
- default:
- retval = 0;
- break;
- }
-
- return retval;
-}
-
-/* Fills the widgets with default values */
-static void
-clear_widgets (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = tdpage->priv;
-
- /* Date completed */
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), -1);
-
- /* URL */
- gtk_entry_set_text (GTK_ENTRY (priv->url), "");
-}
-
-static void
-sensitize_widgets (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv = tdpage->priv;
- CompEditor *editor;
- GtkWidget *entry;
- ECalClient *client;
- gboolean read_only;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
- client = comp_editor_get_client (editor);
-
- read_only = e_client_is_readonly (E_CLIENT (client));
-
- 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);
-
- entry = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
- gtk_editable_set_editable (GTK_EDITABLE (entry), !read_only);
-}
-
-static void
-task_details_page_dispose (GObject *object)
-{
- TaskDetailsPagePrivate *priv;
-
- priv = TASK_DETAILS_PAGE_GET_PRIVATE (object);
-
- if (priv->main != NULL) {
- g_object_unref (priv->main);
- priv->main = NULL;
- }
-
- if (priv->builder != NULL) {
- g_object_unref (priv->builder);
- priv->builder = NULL;
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (task_details_page_parent_class)->dispose (object);
-}
-
-static GtkWidget *
-task_details_page_get_widget (CompEditorPage *page)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- return priv->main;
-}
-
-static void
-task_details_page_focus_main_widget (CompEditorPage *page)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- gtk_widget_grab_focus (priv->status_combo);
-}
-
-static gboolean
-task_details_page_fill_widgets (CompEditorPage *page,
- ECalComponent *comp)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
- gint *priority_value, *percent = NULL;
- TaskEditorPriority priority;
- icalproperty_status status;
- CompEditor *editor;
- const gchar *url;
- struct icaltimetype *completed = NULL;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
-
- /* Clean the screen */
- clear_widgets (tdpage);
-
- /* Percent Complete. */
- e_cal_component_get_percent (comp, &percent);
- if (percent) {
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), *percent);
- } else {
- /* FIXME: Could check if task is completed and set 100%. */
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 0);
- }
-
- /* Status. */
- e_cal_component_get_status (comp, &status);
- if (status == ICAL_STATUS_NONE || status == ICAL_STATUS_NEEDSACTION) {
- /* Try to use the percent value. */
- if (percent) {
- if (*percent == 100)
- status = ICAL_STATUS_COMPLETED;
- else if (*percent > 0)
- status = ICAL_STATUS_INPROCESS;
- else
- status = ICAL_STATUS_NONE;
- } else
- status = ICAL_STATUS_NONE;
- }
- e_dialog_combo_box_set (priv->status_combo, status, status_map);
-
- if (percent)
- e_cal_component_free_percent (percent);
-
- /* Completed Date. */
- e_cal_component_get_completed (comp, &completed);
- if (completed) {
- icaltimezone *utc_zone, *zone;
-
- /* Completed is in UTC, but that would confuse the user, so
- * we convert it to local time. */
- utc_zone = icaltimezone_get_utc_timezone ();
- zone = comp_editor_get_timezone (editor);
-
- icaltimezone_convert_time (completed, utc_zone, zone);
-
- e_date_edit_set_date (
- E_DATE_EDIT (priv->completed_date),
- completed->year, completed->month,
- completed->day);
- e_date_edit_set_time_of_day (
- E_DATE_EDIT (priv->completed_date),
- completed->hour,
- completed->minute);
-
- e_cal_component_free_icaltimetype (completed);
- }
-
- /* Priority. */
- e_cal_component_get_priority (comp, &priority_value);
- if (priority_value) {
- priority = priority_value_to_index (*priority_value);
- e_cal_component_free_priority (priority_value);
- } else {
- priority = PRIORITY_UNDEFINED;
- }
- e_dialog_combo_box_set (priv->priority_combo, priority, priority_map);
-
- /* URL */
- e_cal_component_get_url (comp, &url);
- gtk_entry_set_text (GTK_ENTRY (priv->url), url ? url : "");
-
- sensitize_widgets (tdpage);
-
- return TRUE;
-}
-
-static gboolean
-task_details_page_fill_component (CompEditorPage *page,
- ECalComponent *comp)
-{
- TaskDetailsPage *tdpage;
- TaskDetailsPagePrivate *priv;
- struct icaltimetype icalcomplete, icaltoday;
- icalproperty_status status;
- TaskEditorPriority priority;
- CompEditor *editor;
- gint priority_value, percent;
- const gchar *text;
- gboolean date_set;
- icaltimezone *zone;
-
- tdpage = TASK_DETAILS_PAGE (page);
- priv = tdpage->priv;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
- zone = comp_editor_get_timezone (editor);
-
- /* Percent Complete. */
- percent = gtk_spin_button_get_value_as_int (
- GTK_SPIN_BUTTON (priv->percent_complete));
- e_cal_component_set_percent (comp, &percent);
-
- /* Status. */
- status = e_dialog_combo_box_get (priv->status_combo, status_map);
- e_cal_component_set_status (comp, status);
-
- /* Priority. */
- 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);
-
- icalcomplete = icaltime_null_time ();
-
- /* COMPLETED must be in UTC. */
- icalcomplete.is_utc = 1;
-
- /* Completed Date. */
- if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->completed_date)) ||
- !e_date_edit_time_is_valid (E_DATE_EDIT (priv->completed_date))) {
- comp_editor_page_display_validation_error (
- page, _("Completed date is wrong"),
- priv->completed_date);
- return FALSE;
- }
-
- date_set = e_date_edit_get_date (
- E_DATE_EDIT (priv->completed_date),
- &icalcomplete.year,
- &icalcomplete.month,
- &icalcomplete.day);
-
- if (date_set) {
- e_date_edit_get_time_of_day (
- E_DATE_EDIT (priv->completed_date),
- &icalcomplete.hour,
- &icalcomplete.minute);
-
- /* COMPLETED today or before */
- icaltoday = icaltime_current_time_with_zone (zone);
- icaltimezone_convert_time (
- &icaltoday, zone,
- icaltimezone_get_utc_timezone ());
-
- if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) {
- comp_editor_page_display_validation_error (
- page, _("Completed date is wrong"),
- priv->completed_date);
- return FALSE;
- }
-
- /* COMPLETED must be in UTC, so we assume that the date in the
- * dialog is in the current timezone, and we now convert it
- * to UTC. FIXME: We should really use one timezone for the
- * entire time the dialog is shown. Otherwise if the user
- * changes the timezone, the COMPLETED date may get changed
- * as well. */
- icaltimezone_convert_time (
- &icalcomplete, zone,
- icaltimezone_get_utc_timezone ());
- e_cal_component_set_completed (comp, &icalcomplete);
- } else {
- e_cal_component_set_completed (comp, NULL);
- }
-
- /* URL. */
- text = gtk_entry_get_text (GTK_ENTRY (priv->url));
- e_cal_component_set_url (comp, text);
-
- return TRUE;
-}
-
-static gboolean
-task_details_page_fill_timezones (CompEditorPage *page,
- GHashTable *timezones)
-{
- icaltimezone *zone;
-
- /* Add UTC timezone, which is the one
- * used for the DATE-COMPLETED property. */
- zone = icaltimezone_get_utc_timezone ();
- if (zone != NULL) {
- gconstpointer tzid = icaltimezone_get_tzid (zone);
-
- if (!g_hash_table_lookup (timezones, tzid))
- g_hash_table_insert (timezones, (gpointer) tzid, zone);
- }
-
- return TRUE;
-}
-
-static void
-task_details_page_class_init (TaskDetailsPageClass *class)
-{
- GObjectClass *object_class;
- CompEditorPageClass *editor_page_class;
-
- g_type_class_add_private (class, sizeof (TaskDetailsPagePrivate));
-
- object_class = G_OBJECT_CLASS (class);
- object_class->dispose = task_details_page_dispose;
-
- editor_page_class = COMP_EDITOR_PAGE_CLASS (class);
- editor_page_class->get_widget = task_details_page_get_widget;
- editor_page_class->focus_main_widget = task_details_page_focus_main_widget;
- editor_page_class->fill_widgets = task_details_page_fill_widgets;
- editor_page_class->fill_component = task_details_page_fill_component;
- editor_page_class->fill_timezones = task_details_page_fill_timezones;
-}
-
-static void
-task_details_page_init (TaskDetailsPage *tdpage)
-{
- tdpage->priv = TASK_DETAILS_PAGE_GET_PRIVATE (tdpage);
-}
-
-/* Gets the widgets from the XML file and returns if they are all available. */
-static gboolean
-get_widgets (TaskDetailsPage *tdpage)
-{
- CompEditorPage *page = COMP_EDITOR_PAGE (tdpage);
- TaskDetailsPagePrivate *priv;
- GSList *accel_groups;
- GtkWidget *toplevel;
- GtkWidget *parent;
-
- priv = tdpage->priv;
-
-#define GW(name) e_builder_get_widget (priv->builder, name)
-
- priv->main = GW ("task-details-page");
- if (!priv->main)
- return FALSE;
-
- /* Get the GtkAccelGroup from the toplevel window, so we can install
- * it when the notebook page is mapped. */
- toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
- if (accel_groups)
- page->accel_group = g_object_ref (accel_groups->data);
-
- g_object_ref (priv->main);
- parent = gtk_widget_get_parent (priv->main);
- gtk_container_remove (GTK_CONTAINER (parent), priv->main);
-
- 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");
-
- priv->completed_date = GW ("completed-date");
- gtk_widget_show (priv->completed_date);
-
- priv->url_label = GW ("url_label");
-
- priv->url_entry = GW ("url_entry");
- gtk_widget_show (priv->url_entry);
- priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
- atk_object_set_name (gtk_widget_get_accessible (priv->url), _("Web Page"));
-
-#undef GW
-
- return (priv->status_combo
- && priv->priority_combo
- && priv->percent_complete
- && priv->date_completed_label
- && priv->completed_date
- && priv->url_label
- && priv->url);
-}
-
-static void
-complete_date_changed (TaskDetailsPage *tdpage,
- time_t ctime,
- gboolean complete)
-{
- CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
- icaltimezone *zone;
- struct icaltimetype completed_tt = icaltime_null_time ();
-
- /* Get the current time in UTC. */
- zone = icaltimezone_get_utc_timezone ();
- completed_tt = icaltime_from_timet_with_zone (ctime, FALSE, zone);
- completed_tt.is_utc = TRUE;
-
- dates.start = NULL;
- dates.end = NULL;
- dates.due = NULL;
- if (complete)
- dates.complete = &completed_tt;
-
- /* Notify upstream */
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tdpage),
- &dates);
-}
-
-static void
-date_changed_cb (EDateEdit *dedit,
- TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv = tdpage->priv;
- CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
- struct icaltimetype completed_tt = icaltime_null_time ();
- icalproperty_status status;
- gboolean date_set;
-
- if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tdpage)))
- return;
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE);
-
- date_set = e_date_edit_get_date (
- E_DATE_EDIT (priv->completed_date),
- &completed_tt.year,
- &completed_tt.month,
- &completed_tt.day);
- e_date_edit_get_time_of_day (
- E_DATE_EDIT (priv->completed_date),
- &completed_tt.hour,
- &completed_tt.minute);
-
- 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_combo_box_set (
- priv->status_combo,
- ICAL_STATUS_NONE,
- status_map);
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 0);
- }
- } else {
- if (status != ICAL_STATUS_COMPLETED) {
- e_dialog_combo_box_set (
- priv->status_combo,
- ICAL_STATUS_COMPLETED,
- status_map);
- }
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 100);
- }
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), FALSE);
-
- /* Notify upstream */
- dates.complete = &completed_tt;
- comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tdpage), &dates);
-}
-
-static void
-status_changed (GtkWidget *combo,
- TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
- icalproperty_status status;
- CompEditor *editor;
- time_t ctime = -1;
-
- priv = tdpage->priv;
-
- if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tdpage)))
- return;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE);
-
- status = e_dialog_combo_box_get (priv->status_combo, status_map);
- if (status == ICAL_STATUS_NONE) {
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 0);
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, 0, FALSE);
- } else if (status == ICAL_STATUS_INPROCESS) {
- gint percent_complete = gtk_spin_button_get_value_as_int (
- GTK_SPIN_BUTTON (priv->percent_complete));
- if (percent_complete <= 0 || percent_complete >= 100)
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 50);
-
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, 0, FALSE);
- } else if (status == ICAL_STATUS_COMPLETED) {
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (priv->percent_complete), 100);
- ctime = time (NULL);
- e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
- complete_date_changed (tdpage, ctime, TRUE);
- }
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), FALSE);
-
- comp_editor_set_changed (editor, TRUE);
-}
-
-static void
-percent_complete_changed (GtkAdjustment *adj,
- TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
- gint percent;
- icalproperty_status status;
- CompEditor *editor;
- gboolean complete;
- time_t ctime = -1;
-
- priv = tdpage->priv;
-
- if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tdpage)))
- return;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE);
-
- percent = gtk_spin_button_get_value_as_int (
- GTK_SPIN_BUTTON (priv->percent_complete));
- if (percent == 100) {
- complete = TRUE;
- ctime = time (NULL);
- status = ICAL_STATUS_COMPLETED;
- } else {
- complete = FALSE;
-
- if (percent == 0)
- status = ICAL_STATUS_NONE;
- else
- status = ICAL_STATUS_INPROCESS;
- }
-
- 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);
-
- comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), FALSE);
-
- comp_editor_set_changed (editor, TRUE);
-}
-
-/* Hooks the widget signals */
-static void
-init_widgets (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv;
- GtkAdjustment *adjustment;
- CompEditor *editor;
-
- priv = tdpage->priv;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
-
- /* Make sure the EDateEdit widgets use our timezones to get the
- * current time. */
- e_date_edit_set_get_time_callback (
- E_DATE_EDIT (priv->completed_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- g_object_ref (editor),
- (GDestroyNotify) g_object_unref);
-
- /* These are created by hand, so hook the mnemonics manually */
- gtk_label_set_mnemonic_widget (
- GTK_LABEL (priv->date_completed_label),
- priv->completed_date);
- gtk_label_set_mnemonic_widget (
- GTK_LABEL (priv->url_label),
- priv->url_entry);
-
- /* 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_COMBO_BOX (priv->status_combo), "changed",
- G_CALLBACK (status_changed), tdpage);
-
- adjustment = gtk_spin_button_get_adjustment (
- GTK_SPIN_BUTTON (priv->percent_complete));
- g_signal_connect (
- adjustment, "value_changed",
- G_CALLBACK (percent_complete_changed), tdpage);
-
- /* Priority */
- g_signal_connect_swapped (
- GTK_COMBO_BOX (priv->priority_combo), "changed",
- G_CALLBACK (comp_editor_page_changed), tdpage);
-
- /* Completed Date */
- g_signal_connect (
- priv->completed_date, "changed",
- G_CALLBACK (date_changed_cb), tdpage);
- g_signal_connect_swapped (
- priv->completed_date, "changed",
- G_CALLBACK (comp_editor_page_changed), tdpage);
-
- /* URL */
- g_signal_connect_swapped (
- priv->url, "changed",
- G_CALLBACK (comp_editor_page_changed), tdpage);
-}
-
-/**
- * task_details_page_construct:
- * @tdpage: An task details page.
- *
- * Constructs an task page by loading its Glade data.
- *
- * Return value: The same object as @tdpage, or NULL if the widgets could not
- * be created.
- **/
-TaskDetailsPage *
-task_details_page_construct (TaskDetailsPage *tdpage)
-{
- TaskDetailsPagePrivate *priv = tdpage->priv;
- CompEditor *editor;
-
- editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
-
- priv->builder = gtk_builder_new ();
- e_load_ui_builder_definition (priv->builder, "task-details-page.ui");
-
- if (!get_widgets (tdpage)) {
- g_message (
- "task_details_page_construct(): "
- "Could not find all widgets in the XML file!");
- return NULL;
- }
-
- init_widgets (tdpage);
-
- g_signal_connect_swapped (
- editor, "notify::client",
- G_CALLBACK (sensitize_widgets), tdpage);
-
- return tdpage;
-}
-
-/**
- * task_details_page_new:
- *
- * Creates a new task details page.
- *
- * Return value: A newly-created task details page, or NULL if the page could
- * not be created.
- **/
-TaskDetailsPage *
-task_details_page_new (CompEditor *editor)
-{
- TaskDetailsPage *tdpage;
-
- tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, "editor", editor, NULL);
- if (!task_details_page_construct (tdpage)) {
- g_object_unref (tdpage);
- g_return_val_if_reached (NULL);
- }
-
- return tdpage;
-}
diff --git a/calendar/gui/dialogs/task-details-page.h b/calendar/gui/dialogs/task-details-page.h
deleted file mode 100644
index 585ab0ba23..0000000000
--- a/calendar/gui/dialogs/task-details-page.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Evolution calendar - Main page of the task editor dialog
- *
- * This program is free software; you can redistribute it and/or
- * 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
- * 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/>
- *
- *
- * Authors:
- * Federico Mena-Quintero <federico@ximian.com>
- * Miguel de Icaza <miguel@ximian.com>
- * Seth Alves <alves@hungry.com>
- * JP Rosevear <jpr@ximian.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef TASK_DETAILS_PAGE_H
-#define TASK_DETAILS_PAGE_H
-
-#include "comp-editor.h"
-#include "comp-editor-page.h"
-
-/* Standard GObject macros */
-#define TYPE_TASK_DETAILS_PAGE \
- (task_details_page_get_type ())
-#define TASK_DETAILS_PAGE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPage))
-#define TASK_DETAILS_PAGE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), TYPE_TASK_DETAILS_PAGE, TaskDetailsPageClass))
-#define IS_TASK_DETAILS_PAGE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), TYPE_TASK_DETAILS_PAGE))
-#define IS_TASK_DETAILS_PAGE_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((obj), TYPE_TASK_DETAILS_PAGE))
-#define TASK_DETAILS_PAGE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), TYPE_TASK_DETAILS_PAGE, TaskDetailsPageClass))
-
-G_BEGIN_DECLS
-
-typedef struct _TaskDetailsPage TaskDetailsPage;
-typedef struct _TaskDetailsPageClass TaskDetailsPageClass;
-typedef struct _TaskDetailsPagePrivate TaskDetailsPagePrivate;
-
-struct _TaskDetailsPage {
- CompEditorPage page;
- TaskDetailsPagePrivate *priv;
-};
-
-struct _TaskDetailsPageClass {
- CompEditorPageClass parent_class;
-};
-
-GType task_details_page_get_type (void);
-TaskDetailsPage *task_details_page_construct (TaskDetailsPage *tdpage);
-TaskDetailsPage *task_details_page_new (CompEditor *editor);
-
-G_END_DECLS
-
-#endif /* TASK_DETAILS_PAGE_H */
diff --git a/calendar/gui/dialogs/task-details-page.ui b/calendar/gui/dialogs/task-details-page.ui
deleted file mode 100644
index 90ec08f293..0000000000
--- a/calendar/gui/dialogs/task-details-page.ui
+++ /dev/null
@@ -1,453 +0,0 @@
-<?xml version="1.0"?>
-<!--*- mode: xml -*-->
-<interface>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">100</property>
- <property name="lower">0</property>
- <property name="page_increment">10</property>
- <property name="step_increment">1</property>
- <property name="page_size">0</property>
- <property name="value">0</property>
- </object>
- <object class="GtkListStore" id="model1">
- <columns>
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task priority">High</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task priority">Normal</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task priority">Low</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task priority">Undefined</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model2">
- <columns>
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task status">Not Started</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task status">In Progress</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task status">Completed</col>
- </row>
- <row>
- <col id="0" translatable="yes" comments="To Translators: This is task status">Canceled</col>
- </row>
- </data>
- </object>
- <object class="GtkWindow" id="task-details-toplevel">
- <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>
- <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>
- <property name="urgency_hint">False</property>
- <child>
- <object class="GtkVBox" id="task-details-page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Status</property>
- <property name="use_underline">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="single_line_mode">False</property>
- <property name="angle">0</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
- <child>
- <object class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes"/>
- <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">12</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
- <child>
- <object class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Stat_us:</property>
- <property name="use_underline">True</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="single_line_mode">False</property>
- <property name="angle">0</property>
- <property name="mnemonic_widget">status-combobox</property>
- </object>
- <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="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P_ercent complete:</property>
- <property name="use_underline">True</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="mnemonic_widget">percent-complete</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</property>
- <property name="use_underline">True</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="single_line_mode">False</property>
- <property name="angle">0</property>
- <property name="mnemonic_widget">priority-combobox</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="date_completed_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Date completed:</property>
- <property name="use_underline">True</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="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <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="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="percent-complete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">adjustment1</property>
- </object>
- <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="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="EDateEdit" type-func="e_date_edit_get_type" id="completed-date">
- <property name="visible">True</property>
- <property name="show-date">True</property>
- <property name="show-time">True</property>
- <property name="allow-no-date-set">True</property>
- <accessibility>
- <relation target="date_completed_label" type="labelled-by"/>
- </accessibility>
- </object>
- <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="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="priority-combobox">
- <property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- <property name="model">model1</property>
- <child>
- <object class="GtkCellRendererText" id="renderer1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <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="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="status-combobox">
- <property name="visible">True</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- <property name="model">model2</property>
- <child>
- <object class="GtkCellRendererText" id="renderer2"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <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>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Miscellaneous</property>
- <property name="use_underline">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="single_line_mode">False</property>
- <property name="angle">0</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
- <child>
- <object class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes"/>
- <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">12</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table2">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">1</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>
- <object class="GtkLabel" id="url_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Web Page:</property>
- <property name="use_underline">True</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="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <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="x_options">fill</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="EUrlEntry" type-func="e_url_entry_get_type" id="url_entry">
- <property name="visible">True</property>
- </object>
- <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">fill</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 07ad568f9d..89b77ab011 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -33,7 +33,6 @@
#include <glib/gi18n.h>
#include "task-page.h"
-#include "task-details-page.h"
#include "cancel-comp.h"
#include "task-editor.h"
@@ -43,8 +42,6 @@
struct _TaskEditorPrivate {
TaskPage *task_page;
- TaskDetailsPage *task_details_page;
- GtkWidget *task_details_window;
EMeetingStore *model;
gboolean assignment_shown;
@@ -67,19 +64,10 @@ static const gchar *ui =
" <menu action='insert-menu'>"
" <menuitem action='send-options'/>"
" </menu>"
-" <menu action='options-menu'>"
-" <menu action='classification-menu'>"
-" <menuitem action='classify-public'/>"
-" <menuitem action='classify-private'/>"
-" <menuitem action='classify-confidential'/>"
-" </menu>"
-" <menuitem action='option-status'/>"
-" </menu>"
" </menubar>"
" <toolbar name='main-toolbar'>"
" <placeholder name='content'>"
" <toolitem action='view-time-zone'/>"
-" <toolitem action='option-status'/>"
" </placeholder>"
" </toolbar>"
"</ui>";
@@ -93,29 +81,12 @@ static gboolean task_editor_send_comp (CompEditor *editor,
G_DEFINE_TYPE (TaskEditor, task_editor, TYPE_COMP_EDITOR)
static void
-action_option_status_cb (GtkAction *action,
- TaskEditor *editor)
-{
- gtk_widget_show (editor->priv->task_details_window);
-}
-
-static void
action_send_options_cb (GtkAction *action,
TaskEditor *editor)
{
task_page_send_options_clicked_cb (editor->priv->task_page);
}
-static GtkActionEntry task_entries[] = {
-
- { "option-status",
- "stock_view-details",
- N_("_Status Details"),
- "<Control>t",
- N_("Click to change or view the status details of the task"),
- G_CALLBACK (action_option_status_cb) }
-};
-
static GtkActionEntry assigned_task_entries[] = {
{ "send-options",
@@ -147,11 +118,6 @@ task_editor_dispose (GObject *object)
priv->task_page = NULL;
}
- if (priv->task_details_page) {
- g_object_unref (priv->task_details_page);
- priv->task_details_page = NULL;
- }
-
if (priv->model) {
g_object_unref (priv->model);
priv->model = NULL;
@@ -290,7 +256,6 @@ task_editor_init (TaskEditor *te)
CompEditor *editor = COMP_EDITOR (te);
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
- GtkWidget *content_area;
GtkAction *action;
const gchar *id;
GError *error = NULL;
@@ -300,33 +265,6 @@ task_editor_init (TaskEditor *te)
te->priv->assignment_shown = TRUE;
te->priv->updating = FALSE;
- te->priv->task_details_window = gtk_dialog_new_with_buttons (
- _("Task Details"), GTK_WINDOW (te), GTK_DIALOG_MODAL,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
- g_signal_connect (
- te->priv->task_details_window, "response",
- G_CALLBACK (gtk_widget_hide), NULL);
- g_signal_connect (
- te->priv->task_details_window, "delete-event",
- G_CALLBACK (gtk_widget_hide), NULL);
-
- te->priv->task_details_page = task_details_page_new (editor);
- content_area = gtk_dialog_get_content_area (
- GTK_DIALOG (te->priv->task_details_window));
- gtk_container_add (
- GTK_CONTAINER (content_area),
- comp_editor_page_get_widget (
- (CompEditorPage *) te->priv->task_details_page));
- gtk_widget_show_all (
- gtk_bin_get_child (GTK_BIN (te->priv->task_details_window)));
- comp_editor_append_page (
- editor, COMP_EDITOR_PAGE (te->priv->task_details_page), NULL, FALSE);
-
- action_group = comp_editor_get_action_group (editor, "individual");
- gtk_action_group_add_actions (
- action_group, task_entries,
- G_N_ELEMENTS (task_entries), te);
-
action_group = comp_editor_get_action_group (editor, "coordinated");
gtk_action_group_add_actions (
action_group, assigned_task_entries,
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 1eb5f00354..fcc00fae5d 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -78,9 +78,16 @@ struct _TaskPagePrivate {
GtkWidget *due_date;
GtkWidget *start_date;
+ GtkWidget *completed_date;
GtkWidget *timezone;
GtkWidget *timezone_label;
+ GtkWidget *status_combo;
+ GtkWidget *priority_combo;
+ GtkWidget *percent_complete;
+ GtkWidget *classification_combo;
+ GtkWidget *web_page_entry;
+
GtkWidget *description;
GtkWidget *categories_btn;
@@ -123,12 +130,79 @@ static const gint classification_map[] = {
-1
};
+/* Note that these two arrays must match. */
+static const gint status_map[] = {
+ ICAL_STATUS_NONE,
+ ICAL_STATUS_INPROCESS,
+ ICAL_STATUS_COMPLETED,
+ ICAL_STATUS_CANCELLED,
+ -1
+};
+
+typedef enum {
+ PRIORITY_HIGH,
+ PRIORITY_NORMAL,
+ PRIORITY_LOW,
+ PRIORITY_UNDEFINED
+} TaskEditorPriority;
+
+static const gint priority_map[] = {
+ PRIORITY_HIGH,
+ PRIORITY_NORMAL,
+ PRIORITY_LOW,
+ PRIORITY_UNDEFINED,
+ -1
+};
+
static gboolean task_page_fill_timezones (CompEditorPage *page, GHashTable *timezones);
static void task_page_select_organizer (TaskPage *tpage, const gchar *backend_address);
static void set_subscriber_info_string (TaskPage *tpage, const gchar *backend_address);
G_DEFINE_TYPE (TaskPage, task_page, TYPE_COMP_EDITOR_PAGE)
+static TaskEditorPriority
+priority_value_to_index (gint priority_value)
+{
+ TaskEditorPriority retval;
+
+ if (priority_value == 0)
+ retval = PRIORITY_UNDEFINED;
+ else if (priority_value <= 4)
+ retval = PRIORITY_HIGH;
+ else if (priority_value == 5)
+ retval = PRIORITY_NORMAL;
+ else
+ retval = PRIORITY_LOW;
+
+ return retval;
+}
+
+static gint
+priority_index_to_value (TaskEditorPriority priority)
+{
+ gint retval;
+
+ switch (priority) {
+ case PRIORITY_UNDEFINED:
+ retval = 0;
+ break;
+ case PRIORITY_HIGH:
+ retval = 3;
+ break;
+ case PRIORITY_NORMAL:
+ retval = 5;
+ break;
+ case PRIORITY_LOW:
+ retval = 7;
+ break;
+ default:
+ retval = 0;
+ break;
+ }
+
+ return retval;
+}
+
static gboolean
get_current_identity (TaskPage *page,
gchar **name,
@@ -194,6 +268,7 @@ clear_widgets (TaskPage *tpage)
{
TaskPagePrivate *priv = tpage->priv;
CompEditor *editor;
+ GtkWidget *entry;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
@@ -211,6 +286,14 @@ clear_widgets (TaskPage *tpage)
/* Categories */
gtk_entry_set_text (GTK_ENTRY (priv->categories), "");
+
+ e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), -1);
+ e_dialog_combo_box_set (priv->status_combo, ICAL_STATUS_NONE, status_map);
+ e_dialog_combo_box_set (priv->priority_combo, PRIORITY_UNDEFINED, priority_map);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->percent_complete), 0);
+
+ entry = e_url_entry_get_entry (E_URL_ENTRY (priv->web_page_entry));
+ gtk_entry_set_text (GTK_ENTRY (entry), "");
}
static gboolean
@@ -266,6 +349,7 @@ sensitize_widgets (TaskPage *tpage)
ECalClient *client;
GtkActionGroup *action_group;
GtkAction *action;
+ GtkWidget *entry;
gboolean read_only, sens = TRUE, sensitize;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
@@ -310,6 +394,15 @@ sensitize_widgets (TaskPage *tpage)
gtk_widget_set_sensitive (priv->categories_btn, !read_only);
gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only);
+ gtk_widget_set_sensitive (priv->completed_date, !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->classification_combo, !read_only);
+
+ entry = e_url_entry_get_entry (E_URL_ENTRY (priv->web_page_entry));
+ gtk_editable_set_editable (GTK_EDITABLE (entry), !read_only);
+
gtk_widget_set_sensitive (priv->organizer, !read_only);
gtk_widget_set_sensitive (priv->add, (!read_only && sens));
gtk_widget_set_sensitive (priv->edit, (!read_only && sens));
@@ -492,6 +585,11 @@ task_page_fill_widgets (CompEditorPage *page,
icaltimezone *zone, *default_zone;
gchar *backend_addr = NULL;
gboolean active;
+ gint *priority_value, *percent = NULL;
+ TaskEditorPriority priority;
+ icalproperty_status status;
+ const gchar *url;
+ struct icaltimetype *completed = NULL;
tpage = TASK_PAGE (page);
priv = tpage->priv;
@@ -754,6 +852,74 @@ task_page_fill_widgets (CompEditorPage *page,
g_free (backend_addr);
+ /* Percent Complete. */
+ e_cal_component_get_percent (comp, &percent);
+ if (percent) {
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), *percent);
+ } else {
+ /* FIXME: Could check if task is completed and set 100%. */
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 0);
+ }
+
+ /* Status. */
+ e_cal_component_get_status (comp, &status);
+ if (status == ICAL_STATUS_NONE || status == ICAL_STATUS_NEEDSACTION) {
+ /* Try to use the percent value. */
+ if (percent) {
+ if (*percent == 100)
+ status = ICAL_STATUS_COMPLETED;
+ else if (*percent > 0)
+ status = ICAL_STATUS_INPROCESS;
+ else
+ status = ICAL_STATUS_NONE;
+ } else
+ status = ICAL_STATUS_NONE;
+ }
+ e_dialog_combo_box_set (priv->status_combo, status, status_map);
+
+ if (percent)
+ e_cal_component_free_percent (percent);
+
+ /* Completed Date. */
+ e_cal_component_get_completed (comp, &completed);
+ if (completed) {
+ icaltimezone *utc_zone, *zone;
+
+ /* Completed is in UTC, but that would confuse the user, so
+ * we convert it to local time. */
+ utc_zone = icaltimezone_get_utc_timezone ();
+ zone = comp_editor_get_timezone (editor);
+
+ icaltimezone_convert_time (completed, utc_zone, zone);
+
+ e_date_edit_set_date (
+ E_DATE_EDIT (priv->completed_date),
+ completed->year, completed->month,
+ completed->day);
+ e_date_edit_set_time_of_day (
+ E_DATE_EDIT (priv->completed_date),
+ completed->hour,
+ completed->minute);
+
+ e_cal_component_free_icaltimetype (completed);
+ }
+
+ /* Priority. */
+ e_cal_component_get_priority (comp, &priority_value);
+ if (priority_value) {
+ priority = priority_value_to_index (*priority_value);
+ e_cal_component_free_priority (priority_value);
+ } else {
+ priority = PRIORITY_UNDEFINED;
+ }
+ e_dialog_combo_box_set (priv->priority_combo, priority, priority_map);
+
+ /* URL */
+ e_cal_component_get_url (comp, &url);
+ gtk_entry_set_text (GTK_ENTRY (e_url_entry_get_entry (E_URL_ENTRY (priv->web_page_entry))), url ? url : "");
+
sensitize_widgets (tpage);
return TRUE;
@@ -775,6 +941,13 @@ task_page_fill_component (CompEditorPage *page,
gboolean start_date_set, due_date_set;
GtkTextBuffer *text_buffer;
GtkTextIter text_iter_start, text_iter_end;
+ struct icaltimetype icalcomplete, icaltoday;
+ icalproperty_status status;
+ TaskEditorPriority priority;
+ gint priority_value, percent;
+ const gchar *text;
+ gboolean date_set;
+ icaltimezone *zone;
tpage = TASK_PAGE (page);
priv = tpage->priv;
@@ -783,6 +956,7 @@ task_page_fill_component (CompEditorPage *page,
editor = comp_editor_page_get_editor (page);
client = comp_editor_get_client (editor);
flags = comp_editor_get_flags (editor);
+ zone = comp_editor_get_timezone (editor);
/* Summary. */
@@ -976,6 +1150,77 @@ task_page_fill_component (CompEditorPage *page,
set_attendees (comp, e_meeting_store_get_attendees (priv->meeting_store));
}
+ /* Percent Complete. */
+ percent = gtk_spin_button_get_value_as_int (
+ GTK_SPIN_BUTTON (priv->percent_complete));
+ e_cal_component_set_percent (comp, &percent);
+
+ /* Status. */
+ status = e_dialog_combo_box_get (priv->status_combo, status_map);
+ e_cal_component_set_status (comp, status);
+
+ /* Priority. */
+ 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);
+
+ icalcomplete = icaltime_null_time ();
+
+ /* COMPLETED must be in UTC. */
+ icalcomplete.is_utc = 1;
+
+ /* Completed Date. */
+ if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->completed_date)) ||
+ !e_date_edit_time_is_valid (E_DATE_EDIT (priv->completed_date))) {
+ comp_editor_page_display_validation_error (
+ page, _("Completed date is wrong"),
+ priv->completed_date);
+ return FALSE;
+ }
+
+ date_set = e_date_edit_get_date (
+ E_DATE_EDIT (priv->completed_date),
+ &icalcomplete.year,
+ &icalcomplete.month,
+ &icalcomplete.day);
+
+ if (date_set) {
+ e_date_edit_get_time_of_day (
+ E_DATE_EDIT (priv->completed_date),
+ &icalcomplete.hour,
+ &icalcomplete.minute);
+
+ /* COMPLETED today or before */
+ icaltoday = icaltime_current_time_with_zone (zone);
+ icaltimezone_convert_time (
+ &icaltoday, zone,
+ icaltimezone_get_utc_timezone ());
+
+ if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) {
+ comp_editor_page_display_validation_error (
+ page, _("Completed date is wrong"),
+ priv->completed_date);
+ return FALSE;
+ }
+
+ /* COMPLETED must be in UTC, so we assume that the date in the
+ * dialog is in the current timezone, and we now convert it
+ * to UTC. FIXME: We should really use one timezone for the
+ * entire time the dialog is shown. Otherwise if the user
+ * changes the timezone, the COMPLETED date may get changed
+ * as well. */
+ icaltimezone_convert_time (
+ &icalcomplete, zone,
+ icaltimezone_get_utc_timezone ());
+ e_cal_component_set_completed (comp, &icalcomplete);
+ } else {
+ e_cal_component_set_completed (comp, NULL);
+ }
+
+ /* URL. */
+ text = gtk_entry_get_text (GTK_ENTRY (e_url_entry_get_entry (E_URL_ENTRY (priv->web_page_entry))));
+ e_cal_component_set_url (comp, text);
+
return TRUE;
}
@@ -997,6 +1242,16 @@ task_page_fill_timezones (CompEditorPage *page,
g_hash_table_insert (timezones, (gpointer) icaltimezone_get_tzid (zone), zone);
}
+ /* Add UTC timezone, which is the one
+ * used for the DATE-COMPLETED property. */
+ zone = icaltimezone_get_utc_timezone ();
+ if (zone != NULL) {
+ gconstpointer tzid = icaltimezone_get_tzid (zone);
+
+ if (!g_hash_table_lookup (timezones, tzid))
+ g_hash_table_insert (timezones, (gpointer) tzid, zone);
+ }
+
return TRUE;
}
@@ -1495,6 +1750,13 @@ get_widgets (TaskPage *tpage)
priv->start_date = e_builder_get_widget (priv->builder, "start-date");
gtk_widget_show (priv->start_date);
+ priv->completed_date = e_builder_get_widget (priv->builder, "completed-date");
+ priv->status_combo = e_builder_get_widget (priv->builder, "status-combobox");
+ priv->priority_combo = e_builder_get_widget (priv->builder, "priority-combobox");
+ priv->percent_complete = e_builder_get_widget (priv->builder, "percent-complete");
+ priv->classification_combo = e_builder_get_widget (priv->builder, "classification-combobox");
+ priv->web_page_entry = e_builder_get_widget (priv->builder, "web-page-entry");
+
priv->timezone = e_builder_get_widget (priv->builder, "timezone");
priv->timezone_label = e_builder_get_widget (priv->builder, "timezone-label");
priv->attendees_label = e_builder_get_widget (priv->builder, "attendees-label");
@@ -1548,6 +1810,12 @@ get_widgets (TaskPage *tpage)
&& priv->categories_btn
&& priv->categories
&& priv->organizer
+ && priv->completed_date
+ && priv->status_combo
+ && priv->priority_combo
+ && priv->percent_complete
+ && priv->classification_combo
+ && priv->web_page_entry
);
}
@@ -1914,6 +2182,210 @@ task_page_send_options_clicked_cb (TaskPage *tpage)
e_send_options_dialog_run (priv->sod, toplevel, E_ITEM_TASK);
}
+static void
+complete_date_changed (TaskPage *tpage,
+ time_t ctime,
+ gboolean complete)
+{
+ CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
+ icaltimezone *zone;
+ struct icaltimetype completed_tt = icaltime_null_time ();
+
+ /* Get the current time in UTC. */
+ zone = icaltimezone_get_utc_timezone ();
+ completed_tt = icaltime_from_timet_with_zone (ctime, FALSE, zone);
+ completed_tt.is_utc = TRUE;
+
+ dates.start = NULL;
+ dates.end = NULL;
+ dates.due = NULL;
+ if (complete)
+ dates.complete = &completed_tt;
+
+ /* Notify upstream */
+ comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tpage),
+ &dates);
+}
+
+static void
+completed_date_changed_cb (EDateEdit *dedit,
+ TaskPage *tpage)
+{
+ TaskPagePrivate *priv = tpage->priv;
+ CompEditorPageDates dates = {NULL, NULL, NULL, NULL};
+ struct icaltimetype completed_tt = icaltime_null_time ();
+ icalproperty_status status;
+ gboolean date_set;
+
+ if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage)))
+ return;
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), TRUE);
+
+ date_set = e_date_edit_get_date (
+ E_DATE_EDIT (priv->completed_date),
+ &completed_tt.year,
+ &completed_tt.month,
+ &completed_tt.day);
+ e_date_edit_get_time_of_day (
+ E_DATE_EDIT (priv->completed_date),
+ &completed_tt.hour,
+ &completed_tt.minute);
+
+ 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_combo_box_set (
+ priv->status_combo,
+ ICAL_STATUS_NONE,
+ status_map);
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 0);
+ }
+ } else {
+ if (status != ICAL_STATUS_COMPLETED) {
+ e_dialog_combo_box_set (
+ priv->status_combo,
+ ICAL_STATUS_COMPLETED,
+ status_map);
+ }
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 100);
+ }
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), FALSE);
+
+ /* Notify upstream */
+ dates.complete = &completed_tt;
+ comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tpage), &dates);
+}
+
+static void
+status_changed (GtkWidget *combo,
+ TaskPage *tpage)
+{
+ TaskPagePrivate *priv;
+ icalproperty_status status;
+ CompEditor *editor;
+ time_t ctime = -1;
+
+ priv = tpage->priv;
+
+ if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage)))
+ return;
+
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), TRUE);
+
+ status = e_dialog_combo_box_get (priv->status_combo, status_map);
+ if (status == ICAL_STATUS_NONE) {
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 0);
+ e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
+ complete_date_changed (tpage, 0, FALSE);
+ } else if (status == ICAL_STATUS_INPROCESS) {
+ gint percent_complete = gtk_spin_button_get_value_as_int (
+ GTK_SPIN_BUTTON (priv->percent_complete));
+ if (percent_complete <= 0 || percent_complete >= 100)
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 50);
+
+ e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
+ complete_date_changed (tpage, 0, FALSE);
+ } else if (status == ICAL_STATUS_COMPLETED) {
+ gtk_spin_button_set_value (
+ GTK_SPIN_BUTTON (priv->percent_complete), 100);
+ ctime = time (NULL);
+ e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
+ complete_date_changed (tpage, ctime, TRUE);
+ }
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), FALSE);
+
+ comp_editor_set_changed (editor, TRUE);
+}
+
+static void
+percent_complete_changed (GtkAdjustment *adj,
+ TaskPage *tpage)
+{
+ TaskPagePrivate *priv;
+ gint percent;
+ icalproperty_status status;
+ CompEditor *editor;
+ gboolean complete;
+ time_t ctime = -1;
+
+ priv = tpage->priv;
+
+ if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage)))
+ return;
+
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), TRUE);
+
+ percent = gtk_spin_button_get_value_as_int (
+ GTK_SPIN_BUTTON (priv->percent_complete));
+ if (percent == 100) {
+ complete = TRUE;
+ ctime = time (NULL);
+ status = ICAL_STATUS_COMPLETED;
+ } else {
+ complete = FALSE;
+
+ if (percent == 0)
+ status = ICAL_STATUS_NONE;
+ else
+ status = ICAL_STATUS_INPROCESS;
+ }
+
+ 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 (tpage, ctime, complete);
+
+ comp_editor_page_set_updating (COMP_EDITOR_PAGE (tpage), FALSE);
+
+ comp_editor_set_changed (editor, TRUE);
+}
+
+static gboolean
+task_page_transform_classification_to_combo (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ gint action_value;
+
+ g_return_val_if_fail (source_value != NULL, FALSE);
+ g_return_val_if_fail (target_value != NULL, FALSE);
+
+ action_value = g_value_get_int (source_value);
+ g_value_set_int (target_value, action_value - 1);
+
+ return TRUE;
+}
+
+static gboolean
+task_page_transform_classification_from_combo (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ gint combo_value;
+
+ g_return_val_if_fail (source_value != NULL, FALSE);
+ g_return_val_if_fail (target_value != NULL, FALSE);
+
+ combo_value = g_value_get_int (source_value);
+ g_value_set_int (target_value, combo_value + 1);
+
+ return TRUE;
+}
+
/* Hooks the widget signals */
static gboolean
init_widgets (TaskPage *tpage)
@@ -1924,6 +2396,7 @@ init_widgets (TaskPage *tpage)
GtkTextBuffer *text_buffer;
icaltimezone *zone;
gboolean active;
+ GtkAdjustment *adjustment;
priv = tpage->priv;
@@ -2045,6 +2518,45 @@ init_widgets (TaskPage *tpage)
zone = comp_editor_get_timezone (editor);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->timezone), zone);
+ /* Make sure the EDateEdit widgets use our timezones to get the
+ * current time. */
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->completed_date),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
+
+ /* 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_COMBO_BOX (priv->status_combo), "changed",
+ G_CALLBACK (status_changed), tpage);
+
+ adjustment = gtk_spin_button_get_adjustment (
+ GTK_SPIN_BUTTON (priv->percent_complete));
+ g_signal_connect (
+ adjustment, "value_changed",
+ G_CALLBACK (percent_complete_changed), tpage);
+
+ /* Priority */
+ g_signal_connect_swapped (
+ GTK_COMBO_BOX (priv->priority_combo), "changed",
+ G_CALLBACK (comp_editor_page_changed), tpage);
+
+ /* Completed Date */
+ g_signal_connect (
+ priv->completed_date, "changed",
+ G_CALLBACK (completed_date_changed_cb), tpage);
+ g_signal_connect_swapped (
+ priv->completed_date, "changed",
+ G_CALLBACK (comp_editor_page_changed), tpage);
+
+ /* URL */
+ g_signal_connect_swapped (
+ e_url_entry_get_entry (E_URL_ENTRY (priv->web_page_entry)), "changed",
+ G_CALLBACK (comp_editor_page_changed), tpage);
+
action = comp_editor_get_action (editor, "view-time-zone");
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
task_page_set_show_timezone (tpage, active);
@@ -2076,6 +2588,16 @@ init_widgets (TaskPage *tpage)
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
task_page_set_show_categories (tpage, active);
+ /* Classification */
+ action = comp_editor_get_action (editor, "classify-public");
+ g_object_bind_property_full (
+ action, "current-value",
+ priv->classification_combo, "active",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE,
+ task_page_transform_classification_to_combo,
+ task_page_transform_classification_from_combo,
+ NULL, NULL);
+
return TRUE;
}
diff --git a/calendar/gui/dialogs/task-page.ui b/calendar/gui/dialogs/task-page.ui
index 79ab45043f..8269f09ef7 100644
--- a/calendar/gui/dialogs/task-page.ui
+++ b/calendar/gui/dialogs/task-page.ui
@@ -1,27 +1,90 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 2.12 -->
- <!-- interface-requires evolution 0.0 -->
- <!-- interface-naming-policy toplevel-contextual -->
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkListStore" id="classification-model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task classification">Public</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task classification">Private</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task classification">Confidential</col>
+ </row>
+ </data>
+ </object>
<object class="GtkListStore" id="model1">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
</object>
+ <object class="GtkAdjustment" id="percent-adjustment">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkListStore" id="priority-model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task priority">High</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task priority">Normal</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task priority">Low</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task priority">Undefined</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="status-model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task status">Not Started</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task status">In Progress</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task status">Completed</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes" comments="To Translators: This is task status">Canceled</col>
+ </row>
+ </data>
+ </object>
<object class="GtkWindow" id="task-toplevel">
+ <property name="can_focus">False</property>
<property name="title">window1</property>
<child>
<object class="GtkVBox" id="task-page">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">3</property>
- <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="generic-info">
+ <property name="can_focus">False</property>
<child>
<object class="GtkImage" id="generic-info-image">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -33,6 +96,7 @@
<child>
<object class="GtkLabel" id="generic-info-msgs">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -51,15 +115,18 @@
<child>
<object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="hbox15">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="padding">4</property>
<property name="position">0</property>
</packing>
@@ -67,13 +134,15 @@
<child>
<object class="GtkTable" id="table3">
<property name="visible">True</property>
- <property name="n_rows">8</property>
- <property name="n_columns">2</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">10</property>
+ <property name="n_columns">4</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="summary-label">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">Su_mmary:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
@@ -83,25 +152,27 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="org-task-label">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">Organi_zer:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="due-date-label">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">D_ue date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
@@ -111,13 +182,14 @@
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="start-date-label">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">Sta_rt date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
@@ -127,7 +199,7 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
@@ -139,29 +211,31 @@
<property name="use_underline">True</property>
</object>
<packing>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="timezone-label">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">Time zone:</property>
</object>
<packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkLabel" id="label18">
<property name="visible">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">_Description:</property>
<property name="use_underline">True</property>
@@ -169,8 +243,8 @@
<property name="mnemonic_widget">description</property>
</object>
<packing>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
+ <property name="top_attach">9</property>
+ <property name="bottom_attach">10</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
@@ -219,9 +293,9 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="y_padding">3</property>
@@ -229,12 +303,10 @@
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="height_request">100</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
- <property name="height_request">100</property>
<child>
<object class="GtkTextView" id="description">
<property name="width_request">400</property>
@@ -247,9 +319,9 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">9</property>
+ <property name="bottom_attach">10</property>
<property name="y_padding">3</property>
</packing>
</child>
@@ -260,16 +332,17 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
<property name="y_padding">3</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="list-box">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<placeholder/>
@@ -277,7 +350,7 @@
<child>
<object class="GtkVButtonBox" id="attendee-box">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="add-attendee">
@@ -327,6 +400,7 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
@@ -334,7 +408,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
@@ -345,7 +419,7 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkButton" id="invite">
<property name="visible">True</property>
@@ -354,15 +428,18 @@
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<object class="GtkHBox" id="hbox14">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="stock">gtk-jump-to</property>
</object>
<packing>
@@ -374,6 +451,7 @@
<child>
<object class="GtkLabel" id="attendees-label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Atte_ndees...</property>
<property name="use_underline">True</property>
</object>
@@ -408,26 +486,38 @@
<child>
<object class="GtkHBox" id="hbox12">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkComboBox" id="organizer">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="model">model1</property>
- <property name="has-entry">True</property>
- <property name="entry-text-column">0</property>
+ <property name="has_entry">True</property>
+ <property name="entry_text_column">0</property>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="combobox-entry2">
+ <property name="can_focus">False</property>
+ </object>
+ </child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox13">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="group-label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
<property name="label" translatable="yes">_List:</property>
<property name="use_underline">True</property>
</object>
@@ -444,20 +534,22 @@
<property name="visible">True</property>
</object>
<packing>
- <property name="position">1</property>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="right_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="y_padding">3</property>
@@ -470,33 +562,258 @@
</object>
<packing>
<property name="left_attach">1</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="y_options"/>
+ <property name="y_padding">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="status-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Status:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">status-combobox</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="completed-date-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Date _completed:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">completed-date</property>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="EDateEdit" type-func="e_date_edit_get_type" id="completed-date">
+ <property name="visible">True</property>
+ <property name="show-date">True</property>
+ <property name="show-time">False</property>
+ <property name="allow-no-date-set">True</property>
+ <accessibility>
+ <relation target="completed-date-label" type="labelled-by"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="percent-complete-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Percent complete:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">percent-complete</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="priority-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Priorit_y:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">priority-combobox</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="classification-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">C_lassification:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">classification-combobox</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="web-page-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Web Page:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">web-page-entry</property>
+ </object>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="status-combobox">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">status-model</property>
+ <child>
+ <object class="GtkCellRendererText" id="renderer2"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="priority-combobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">priority-model</property>
+ <child>
+ <object class="GtkCellRendererText" id="renderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="classification-combobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">classification-model</property>
+ <child>
+ <object class="GtkCellRendererText" id="renderer4"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="EUrlEntry" type-func="e_url_entry_get_type" id="web-page-entry">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
- <property name="y_options"></property>
- <property name="y_padding">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="percent-complete">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">percent-adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox16">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="padding">4</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>