diff options
author | Damon Chaplin <damon@helixcode.com> | 2000-07-26 03:49:15 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2000-07-26 03:49:15 +0800 |
commit | cd27c67fbc2f2a363579ce612c5937a4b12d1e49 (patch) | |
tree | 8e8d54ce72794dcc736ab075013264dc3d154217 | |
parent | 516b594aa9e8abf1643905e7eb48e21f8684c1aa (diff) | |
download | gsoc2013-evolution-cd27c67fbc2f2a363579ce612c5937a4b12d1e49.tar.gz gsoc2013-evolution-cd27c67fbc2f2a363579ce612c5937a4b12d1e49.tar.zst gsoc2013-evolution-cd27c67fbc2f2a363579ce612c5937a4b12d1e49.zip |
new ECalendarTable to show an ETable view for Todo/Event items.
2000-07-25 Damon Chaplin <damon@helixcode.com>
* gui/e-calendar-table.[hc]: new ECalendarTable to show an ETable view
for Todo/Event items.
* gui/task-assigned-to.xpm:
* gui/task-recurring.xpm:
* gui/task-assigned.xpm:
* gui/task.xpm: new pixmaps (all the same at present) to go in the
icon column of the ETable.
* gui/event-editor.c: hid the silly 'Calendar' labels on the
GnomeDateEdits and hid the times when you select 'All day event'.
Also adjusted the time_t's so that when an all day event finishes on
say midnight 13th May, we show 12th May in the dialog, since it
implicitly includes all of that day up to midnight.
* gui/dialogs/task-editor-dialog.glade:
* gui/dialogs/task-editor.[hc]: unfinished dialog to edit tasks.
* gui/gncal-todo.c: temporary hack so that we can use the simple dialog
with our new ETable.
svn path=/trunk/; revision=4323
24 files changed, 4714 insertions, 549 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index ebaeef0b7a..645caefdab 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,26 @@ +2000-07-25 Damon Chaplin <damon@helixcode.com> + + * gui/e-calendar-table.[hc]: new ECalendarTable to show an ETable view + for Todo/Event items. + + * gui/task-assigned-to.xpm: + * gui/task-recurring.xpm: + * gui/task-assigned.xpm: + * gui/task.xpm: new pixmaps (all the same at present) to go in the + icon column of the ETable. + + * gui/event-editor.c: hid the silly 'Calendar' labels on the + GnomeDateEdits and hid the times when you select 'All day event'. + Also adjusted the time_t's so that when an all day event finishes on + say midnight 13th May, we show 12th May in the dialog, since it + implicitly includes all of that day up to midnight. + + * gui/dialogs/task-editor-dialog.glade: + * gui/dialogs/task-editor.[hc]: unfinished dialog to edit tasks. + + * gui/gncal-todo.c: temporary hack so that we can use the simple dialog + with our new ETable. + 2000-07-23 Damon Chaplin <damon@helixcode.com> * cal-util/calobj.h: added a few more fields. diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index fc5e6eb216..3eb1273c44 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -26,10 +26,11 @@ LINK_FLAGS = \ dialogs/libcal-dialogs.a \ $(top_builddir)/calendar/cal-client/libcal-client.la \ $(top_builddir)/calendar/cal-util/libcal-util.la \ - $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/widgets/e-paned/libepaned.a \ $(top_builddir)/widgets/e-text/libetext.a \ $(top_builddir)/widgets/e-table/libetable.a \ + $(top_builddir)/widgets/misc/libemiscwidgets.a \ + $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/libversit/libversit.la \ $(top_builddir)/libical/src/libical/libical.a @@ -51,6 +52,8 @@ evolution_calendar_SOURCES = \ control-factory.h \ component-factory.c \ component-factory.h \ + e-calendar-table.h \ + e-calendar-table.c \ e-day-view-main-item.c \ e-day-view-main-item.h \ e-day-view-time-item.c \ diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index 0777685848..fbd0db7a6a 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -1,3 +1,5 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + /* Evolution calendar - Data model for ETable * * Copyright (C) 2000 Helix Code, Inc. @@ -19,9 +21,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ +/* We need this for strptime. */ +#define _XOPEN_SOURCE + #include <config.h> +#include <ctype.h> +#include <time.h> #include <gtk/gtksignal.h> +#include <libgnomeui/gnome-messagebox.h> +#include <libgnomeui/gnome-stock.h> #include "calendar-model.h" +#include "calendar-commands.h" @@ -38,6 +48,12 @@ typedef struct { /* UID -> array index hash */ GHashTable *uid_index_hash; + + /* The row currently being added via the 'click-to-add' row. */ + gint row_being_added; + + /* Source ID of our idle function to add the new row. */ + guint idle_id; } CalendarModelPrivate; @@ -51,11 +67,17 @@ static int calendar_model_row_count (ETableModel *etm); static void *calendar_model_value_at (ETableModel *etm, int col, int row); static void calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *value); static gboolean calendar_model_is_cell_editable (ETableModel *etm, int col, int row); +static gint calendar_model_append_row (ETableModel *etm); +static gboolean calendar_model_commit_new_row (gpointer data); static void *calendar_model_duplicate_value (ETableModel *etm, int col, const void *value); static void calendar_model_free_value (ETableModel *etm, int col, void *value); static void *calendar_model_initialize_value (ETableModel *etm, int col); static gboolean calendar_model_value_is_empty (ETableModel *etm, int col, const void *value); +#if 0 static char * calendar_model_value_to_string (ETableModel *etm, int col, const void *value); +#endif +static void load_objects (CalendarModel *model); +static int remove_object (CalendarModel *model, const char *uid); static ETableModelClass *parent_class; @@ -112,6 +134,7 @@ calendar_model_class_init (CalendarModelClass *class) etm_class->value_at = calendar_model_value_at; etm_class->set_value_at = calendar_model_set_value_at; etm_class->is_cell_editable = calendar_model_is_cell_editable; + etm_class->append_row = calendar_model_append_row; etm_class->duplicate_value = calendar_model_duplicate_value; etm_class->free_value = calendar_model_free_value; etm_class->initialize_value = calendar_model_initialize_value; @@ -132,6 +155,9 @@ calendar_model_init (CalendarModel *model) priv->objects = g_array_new (FALSE, TRUE, sizeof (iCalObject *)); priv->uid_index_hash = g_hash_table_new (g_str_hash, g_str_equal); + + priv->row_being_added = -1; + priv->idle_id = 0; } /* Called from g_hash_table_foreach_remove(), frees a stored UID->index @@ -183,6 +209,10 @@ calendar_model_destroy (GtkObject *object) model = CALENDAR_MODEL (object); priv = model->priv; + /* Remove any idle function. */ + if (priv->idle_id) + g_source_remove (priv->idle_id); + /* Free the calendar client interface object */ if (priv->client) { @@ -234,6 +264,42 @@ calendar_model_row_count (ETableModel *etm) return priv->objects->len; } +static char* +get_time_t (time_t *t, gboolean skip_midnight) +{ + static char buffer[32]; + struct tm *tmp_tm; + + if (*t <= 0) { + buffer[0] = '\0'; + } else { + tmp_tm = localtime (t); + + if (skip_midnight && tmp_tm->tm_hour == 0 + && tmp_tm->tm_min == 0 && tmp_tm->tm_sec == 0) + strftime (buffer, 32, "%a %x", tmp_tm); + else + strftime (buffer, 32, "%a %x %T", tmp_tm); + } + + return buffer; +} + +static char* +get_geo (iCalGeo *geo) +{ + static gchar buffer[32]; + + if (!geo->valid) + buffer[0] = '\0'; + else + g_snprintf (buffer, 32, "%g, %g", geo->latitude, + geo->longitude); + + return buffer; +} + + /* value_at handler for the calendar table model */ static void * calendar_model_value_at (ETableModel *etm, int col, int row) @@ -241,6 +307,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row) CalendarModel *model; CalendarModelPrivate *priv; iCalObject *ico; + static char buffer[16]; model = CALENDAR_MODEL (etm); priv = model->priv; @@ -256,40 +323,45 @@ calendar_model_value_at (ETableModel *etm, int col, int row) return ico->comment ? ico->comment : ""; case ICAL_OBJECT_FIELD_COMPLETED: - return &ico->completed; + return get_time_t (&ico->completed, FALSE); case ICAL_OBJECT_FIELD_CREATED: - return &ico->created; + return get_time_t (&ico->created, FALSE); case ICAL_OBJECT_FIELD_DESCRIPTION: return ico->desc ? ico->desc : ""; case ICAL_OBJECT_FIELD_DTSTAMP: - return &ico->dtstamp; + return get_time_t (&ico->dtstamp, FALSE); case ICAL_OBJECT_FIELD_DTSTART: - return &ico->dtstart; + return get_time_t (&ico->dtstart, FALSE); case ICAL_OBJECT_FIELD_DTEND: - return &ico->dtend; + return get_time_t (&ico->dtend, FALSE); case ICAL_OBJECT_FIELD_GEO: - return &ico->geo; + return get_geo (&ico->geo); case ICAL_OBJECT_FIELD_LAST_MOD: - return &ico->last_mod; + return get_time_t (&ico->last_mod, FALSE); case ICAL_OBJECT_FIELD_LOCATION: return ico->location ? ico->location : ""; case ICAL_OBJECT_FIELD_ORGANIZER: - return ico->organizer; + if (ico->organizer && ico->organizer->name) + return ico->organizer->name; + else + return ""; case ICAL_OBJECT_FIELD_PERCENT: - return &ico->percent; + g_snprintf (buffer, 16, "%i", ico->percent); + return buffer; case ICAL_OBJECT_FIELD_PRIORITY: - return &ico->priority; + g_snprintf (buffer, 16, "%i", ico->priority); + return buffer; case ICAL_OBJECT_FIELD_SUMMARY: return ico->summary ? ico->summary : ""; @@ -301,6 +373,38 @@ calendar_model_value_at (ETableModel *etm, int col, int row) return (gpointer) (ico->dalarm.enabled || ico->aalarm.enabled || ico->palarm.enabled || ico->malarm.enabled); + case ICAL_OBJECT_FIELD_ICON: + /* FIXME: Also support 'Assigned to me' & 'Assigned to someone + else'. */ + if (ico->recur) + return GINT_TO_POINTER (1); + else + return GINT_TO_POINTER (0); + + case ICAL_OBJECT_FIELD_COMPLETE: + /* FIXME: Should check if the Completed field is set? */ + return GINT_TO_POINTER (ico->completed > 0); + + case ICAL_OBJECT_FIELD_RECURRING: + return GINT_TO_POINTER (ico->recur != NULL); + + case ICAL_OBJECT_FIELD_OVERDUE: + /* I don't think calling time() is too slow. It takes about + 4 times as long as calling strlen() on a 20-char string + on my machine. */ + if (ico->percent != 100 + && ico->dtend > 0 + && ico->dtend < time (NULL)) + return GINT_TO_POINTER (TRUE); + return GINT_TO_POINTER (FALSE); + + case ICAL_OBJECT_FIELD_COLOR: + if (ico->percent != 100 + && ico->dtend > 0 + && ico->dtend < time (NULL)) + return "red"; + return NULL; + default: g_message ("calendar_model_value_at(): Requested invalid column %d", col); return NULL; @@ -320,32 +424,217 @@ set_string (char **dest, const char *value) *dest = NULL; } + +static gboolean +string_is_empty (const char *value) +{ + const char *p; + gboolean empty = TRUE; + + if (value) { + p = value; + while (*p) { + if (!isspace (*p)) { + empty = FALSE; + break; + } + p++; + } + } + return empty; +} + + +/* FIXME: We need to set the "transient_for" property for the dialog, but + the model doesn't know anything about the windows. */ +static void +show_date_warning () +{ + GtkWidget *dialog; + char buffer[32], message[256]; + time_t t; + struct tm *tmp_tm; + + t = time (NULL); + tmp_tm = localtime (&t); + strftime (buffer, 32, "%a %x %T", tmp_tm); + + g_snprintf (message, 256, + _("The date must be entered in the format: \n\n%s"), + buffer); + + dialog = gnome_message_box_new (message, + GNOME_MESSAGE_BOX_ERROR, + GNOME_STOCK_BUTTON_OK, NULL); + gtk_widget_show (dialog); +} + + /* Replaces a time_t value */ static void -set_time_t (time_t *dest, const time_t *value) +set_time_t (time_t *dest, const char *value) +{ + struct tm tmp_tm; + struct tm *today_tm; + time_t t; + const char *p; + + if (string_is_empty (value)) { + *dest = 0; + } else { + /* Skip any weekday name. */ + p = strptime (value, "%a", &tmp_tm); + if (!p) + p = value; + + /* Try to match the full date & time, or without the seconds, + or just the date, or just the time with/without seconds. + The info pages say we should clear the tm before calling + strptime. It also means that if we don't match a time we + get 00:00:00 which is good. */ + memset (&tmp_tm, 0, sizeof (tmp_tm)); + if (!strptime (value, "%x %T", &tmp_tm)) { + memset (&tmp_tm, 0, sizeof (tmp_tm)); + if (!strptime (value, "%x %H:%M", &tmp_tm)) { + memset (&tmp_tm, 0, sizeof (tmp_tm)); + if (!strptime (value, "%x", &tmp_tm)) { + memset (&tmp_tm, 0, sizeof (tmp_tm)); + if (!strptime (value, "%T", &tmp_tm)) { + memset (&tmp_tm, 0, sizeof (tmp_tm)); + if (!strptime (value, "%H:%M", &tmp_tm)) { + + g_warning ("Couldn't parse date string"); + show_date_warning (); + return; + } + } + + /* We only got a time, so we use the + current day. */ + t = time (NULL); + today_tm = localtime (&t); + tmp_tm.tm_mday = today_tm->tm_mday; + tmp_tm.tm_mon = today_tm->tm_mon; + tmp_tm.tm_year = today_tm->tm_year; + } + } + } + + tmp_tm.tm_isdst = -1; + *dest = mktime (&tmp_tm); + } +} + + +/* FIXME: We need to set the "transient_for" property for the dialog, but + the model doesn't know anything about the windows. */ +static void +show_geo_warning () { - *dest = *value; + GtkWidget *dialog; + + dialog = gnome_message_box_new (_("The geographical position must be entered in the format: \n\n45.436845,125.862501"), + GNOME_MESSAGE_BOX_ERROR, + GNOME_STOCK_BUTTON_OK, NULL); + gtk_widget_show (dialog); } + /* Replaces a geo value */ static void -set_geo (iCalGeo *dest, const iCalGeo *value) +set_geo (iCalGeo *dest, const char *value) { - *dest = *value; + double latitude, longitude; + gint matched; + + if (!string_is_empty (value)) { + matched = sscanf (value, "%lg , %lg", &latitude, &longitude); + + if (matched != 2) { + show_geo_warning (); + } else { + dest->valid = TRUE; + dest->latitude = latitude; + dest->longitude = longitude; + } + } else { + dest->valid = FALSE; + dest->latitude = 0.0; + dest->longitude = 0.0; + } } /* Replaces a person value */ static void set_person (iCalPerson **dest, const iCalPerson *value) { - /* FIXME */ + /* FIXME: This can't be set at present so it shouldn't be called. */ } +/* FIXME: We need to set the "transient_for" property for the dialog, but + the model doesn't know anything about the windows. */ +static void +show_percent_warning () +{ + GtkWidget *dialog; + + dialog = gnome_message_box_new (_("The percent value must be between 0 and 100"), + GNOME_MESSAGE_BOX_ERROR, + GNOME_STOCK_BUTTON_OK, NULL); + gtk_widget_show (dialog); +} + + /* Sets an int value */ static void -set_int (int *dest, const int *value) +set_percent (int *dest, const char *value) { - *dest = *value; + gint matched, percent; + + if (!string_is_empty (value)) { + matched = sscanf (value, "%i", &percent); + + if (matched != 1 || percent < 0 || percent > 100) { + show_percent_warning (); + } else { + *dest = percent; + } + } else { + *dest = 0; + } +} + +/* FIXME: We need to set the "transient_for" property for the dialog, but + the model doesn't know anything about the windows. */ +static void +show_priority_warning () +{ + GtkWidget *dialog; + + dialog = gnome_message_box_new (_("The priority must be between 0 and 10"), + GNOME_MESSAGE_BOX_ERROR, + GNOME_STOCK_BUTTON_OK, NULL); + gtk_widget_show (dialog); +} + + +/* Sets an int value */ +static void +set_priority (int *dest, const char *value) +{ + gint matched, priority; + + if (!string_is_empty (value)) { + matched = sscanf (value, "%i", &priority); + + if (matched != 1 || priority < 0 || priority > 10) { + show_priority_warning (); + } else { + *dest = priority; + } + } else { + *dest = 0; + } } /* set_value_at handler for the calendar table model */ @@ -371,6 +660,7 @@ calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *val break; case ICAL_OBJECT_FIELD_COMPLETED: + /* FIXME: Set status, percent etc. fields as well. */ set_time_t (&ico->completed, value); break; @@ -411,11 +701,12 @@ calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *val break; case ICAL_OBJECT_FIELD_PERCENT: - set_int (&ico->percent, value); + /* FIXME: If set to 0 or 100 set other fields. */ + set_percent (&ico->percent, value); break; case ICAL_OBJECT_FIELD_PRIORITY: - set_int (&ico->priority, value); + set_priority (&ico->priority, value); break; case ICAL_OBJECT_FIELD_SUMMARY: @@ -426,8 +717,23 @@ calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *val set_string (&ico->url, value); break; + case ICAL_OBJECT_FIELD_COMPLETE: + /* FIXME: Need a ical_object_XXX function to mark an item + complete, which will also set the 'Completed' time and + maybe others such as the last modified fields. */ + ico->percent = 100; + ico->completed = time (NULL); + break; + case ICAL_OBJECT_FIELD_HAS_ALARMS: - g_message ("calendar_model_set_value_at(): HAS_ALARMS is not a settable field!"); + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + case ICAL_OBJECT_FIELD_COLOR: + /* These are all computed fields which can't be set, so we + do nothing. Note that the 'click-to-add' item will set all + fields when finished, so we don't want to output warnings + here. */ break; default: @@ -435,7 +741,9 @@ calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *val break; } - if (!cal_client_update_object (priv->client, ico)) + if (ico->new) + g_print ("Skipping update - new iCalObject\n"); + else if (!cal_client_update_object (priv->client, ico)) g_message ("calendar_model_set_value_at(): Could not update the object!"); } @@ -450,10 +758,19 @@ calendar_model_is_cell_editable (ETableModel *etm, int col, int row) priv = model->priv; g_return_val_if_fail (col >= 0 && col < ICAL_OBJECT_FIELD_NUM_FIELDS, FALSE); - g_return_val_if_fail (row >= 0 && row < priv->objects->len, FALSE); + /* We can't check this as 'click-to-add' passes row 0. */ + /*g_return_val_if_fail (row >= 0 && row < priv->objects->len, FALSE);*/ switch (col) { + case ICAL_OBJECT_FIELD_CREATED: + case ICAL_OBJECT_FIELD_DTSTAMP: + case ICAL_OBJECT_FIELD_LAST_MOD: + case ICAL_OBJECT_FIELD_GEO: case ICAL_OBJECT_FIELD_HAS_ALARMS: + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + case ICAL_OBJECT_FIELD_COLOR: return FALSE; default: @@ -461,6 +778,82 @@ calendar_model_is_cell_editable (ETableModel *etm, int col, int row) } } +static gint +calendar_model_append_row (ETableModel *etm) +{ + CalendarModel *model; + CalendarModelPrivate *priv; + iCalObject *ico; + gint *new_idx; + + g_print ("In calendar_model_append_row\n"); + + model = CALENDAR_MODEL (etm); + priv = model->priv; + + if (priv->row_being_added != -1 || priv->idle_id != 0) { + g_warning ("Already adding row"); + return -1; + } + + ico = ical_new ("", user_name, ""); + ico->type = ICAL_TODO; + ico->new = TRUE; + + g_array_append_val (priv->objects, ico); + new_idx = g_new (int, 1); + *new_idx = priv->objects->len - 1; + g_hash_table_insert (priv->uid_index_hash, ico->uid, new_idx); + + /* Notify the views about the new row. */ + e_table_model_row_inserted (etm, *new_idx); + + /* We add an idle function to pass the new iCalObject to the server. + We can't do it here since the values haven't been set yet. + Maybe we could connect to the "row_inserted" signal, though I'm + not sure when that is emitted. */ + priv->row_being_added = *new_idx; + priv->idle_id = g_idle_add_full (G_PRIORITY_HIGH, + calendar_model_commit_new_row, + model, NULL); + + return *new_idx; +} + +static gboolean +calendar_model_commit_new_row (gpointer data) +{ + CalendarModel *model; + CalendarModelPrivate *priv; + iCalObject *ico; + + g_print ("Committing new row\n"); + + model = CALENDAR_MODEL (data); + priv = model->priv; + + if (priv->row_being_added == -1) { + g_warning ("No row to commit"); + priv->idle_id = 0; + return FALSE; + } + + ico = g_array_index (priv->objects, iCalObject *, + priv->row_being_added); + + if (!cal_client_update_object (priv->client, ico)) { + /* FIXME: Show error dialog. */ + g_message ("calendar_model_commit_new_row(): Could not add new object!"); + remove_object (model, ico->uid); + e_table_model_row_deleted (E_TABLE_MODEL (model), + priv->row_being_added); + } + + priv->row_being_added = -1; + priv->idle_id = 0; + return FALSE; +} + /* Duplicates a string value */ static char * dup_string (const char *value) @@ -469,44 +862,56 @@ dup_string (const char *value) } /* Duplicates a time_t value */ -static time_t * -dup_time_t (const time_t *value) +static char * +dup_time_t (const char *value) { + return g_strdup (value); + +#if 0 time_t *t; t = g_new (time_t, 1); *t = *value; return t; +#endif } /* Duplicates a geo value */ -static iCalGeo * -dup_geo (const iCalGeo *value) +static char * +dup_geo (const char *value) { + return g_strdup (value); + +#if 0 iCalGeo *geo; geo = g_new (iCalGeo, 1); *geo = *value; return geo; +#endif } /* Duplicates a person value */ -static iCalPerson * -dup_person (const iCalPerson *value) +static char * +dup_person (const char *value) { /* FIXME */ - return NULL; + return g_strdup (value); } /* Duplicates an int value */ -static int * -dup_int (const int *value) +static char * +dup_int (const char *value) { + return g_strdup (value); + +#if 0 int *v; v = g_new (int, 1); *v = *value; return v; +#endif } /* duplicate_value handler for the calendar table model */ @@ -564,6 +969,13 @@ calendar_model_duplicate_value (ETableModel *etm, int col, const void *value) case ICAL_OBJECT_FIELD_HAS_ALARMS: return (void *) value; + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_COMPLETE: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + case ICAL_OBJECT_FIELD_COLOR: + return (void *) value; + default: g_message ("calendar_model_duplicate_value(): Requested invalid column %d", col); return NULL; @@ -575,10 +987,23 @@ static void calendar_model_free_value (ETableModel *etm, int col, void *value) { g_return_if_fail (col >= 0 && col < ICAL_OBJECT_FIELD_NUM_FIELDS); - g_return_if_fail (value != NULL); - /* FIXME: this requires special handling for iCalPerson */ - g_free (value); + switch (col) { + case ICAL_OBJECT_FIELD_ORGANIZER: + /* FIXME: this requires special handling for iCalPerson */ + + break; + case ICAL_OBJECT_FIELD_HAS_ALARMS: + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_COMPLETE: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + case ICAL_OBJECT_FIELD_COLOR: + /* Do nothing. */ + break; + default: + g_free (value); + } } /* Initializes a string value */ @@ -589,20 +1014,25 @@ init_string (void) } /* Initializes a time_t value */ -static time_t * +static char * init_time_t (void) { + return g_strdup (""); +#if 0 time_t *t; t = g_new (time_t, 1); *t = -1; return t; +#endif } /* Initializes a geo value */ -static iCalGeo * +static char * init_geo (void) { + return g_strdup (""); +#if 0 iCalGeo *geo; geo = g_new (iCalGeo, 1); @@ -610,25 +1040,30 @@ init_geo (void) geo->latitude = 0.0; geo->longitude = 0.0; return geo; +#endif } /* Initializes a person value */ -static iCalPerson * +static char * init_person (void) { /* FIXME */ - return NULL; + return g_strdup (""); } /* Initializes an int value */ -static int * +static char * init_int (void) { + return g_strdup (""); + +#if 0 int *v; v = g_new (int, 1); *v = 0; return v; +#endif } /* initialize_value handler for the calendar table model */ @@ -686,49 +1121,54 @@ calendar_model_initialize_value (ETableModel *etm, int col) case ICAL_OBJECT_FIELD_HAS_ALARMS: return NULL; /* "false" */ + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_COMPLETE: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + return GINT_TO_POINTER (0); + + case ICAL_OBJECT_FIELD_COLOR: + return NULL; + default: g_message ("calendar_model_initialize_value(): Requested invalid column %d", col); return NULL; } } -/* Returns whether a string is empty */ -static gboolean -string_is_empty (const char *str) -{ - return !(str && *str); -} /* Returns whether a time_t is empty */ static gboolean -time_t_is_empty (const time_t *t) +time_t_is_empty (const char *str) { - return (*t == -1); + return string_is_empty (str); +#if 0 + return (*t <= 0); +#endif } /* Returns whether a geo is empty */ static gboolean -geo_is_empty (const iCalGeo *geo) +geo_is_empty (const char *str) { + return string_is_empty (str); +#if 0 return !geo->valid; +#endif } /* Returns whether a person is empty */ static gboolean -person_is_empty (const iCalPerson *person) +person_is_empty (const char *str) { /* FIXME */ - return TRUE; -} - -/* Returns whether an int is empty */ -static gboolean -int_is_empty (const int *value) -{ - return FALSE; + return string_is_empty (str); } -/* value_is_empty handler for the calendar model */ +/* value_is_empty handler for the calendar model. This should return TRUE + unless a significant value has been set. The 'click-to-add' feature + checks all fields to see if any are not empty and if so it adds a new + row, so we only want to return FALSE if we have a useful object. */ static gboolean calendar_model_value_is_empty (ETableModel *etm, int col, const void *value) { @@ -769,10 +1209,10 @@ calendar_model_value_is_empty (ETableModel *etm, int col, const void *value) return person_is_empty (value); case ICAL_OBJECT_FIELD_PERCENT: - return int_is_empty (value); + return string_is_empty (value); case ICAL_OBJECT_FIELD_PRIORITY: - return int_is_empty (value); + return string_is_empty (value); case ICAL_OBJECT_FIELD_SUMMARY: return string_is_empty (value); @@ -781,7 +1221,12 @@ calendar_model_value_is_empty (ETableModel *etm, int col, const void *value) return string_is_empty (value); case ICAL_OBJECT_FIELD_HAS_ALARMS: - return FALSE; + case ICAL_OBJECT_FIELD_ICON: + case ICAL_OBJECT_FIELD_COMPLETE: + case ICAL_OBJECT_FIELD_RECURRING: + case ICAL_OBJECT_FIELD_OVERDUE: + case ICAL_OBJECT_FIELD_COLOR: + return TRUE; default: g_message ("calendar_model_value_is_empty(): Requested invalid column %d", col); @@ -805,6 +1250,20 @@ calendar_model_new (void) return CALENDAR_MODEL (gtk_type_new (TYPE_CALENDAR_MODEL)); } + +/* Callback used when a calendar is loaded into the server */ +static void +cal_loaded_cb (CalClient *client, + CalClientLoadStatus status, + CalendarModel *model) +{ + g_return_if_fail (IS_CALENDAR_MODEL (model)); + + load_objects (model); + e_table_model_changed (E_TABLE_MODEL (model)); +} + + /* Removes an object from the model and updates all the indices that follow. * Returns the index of the object that was removed, or -1 if no object with * such UID was found. @@ -996,6 +1455,8 @@ load_objects (CalendarModel *model) g_assert (ico->uid != NULL); + /* FIXME: Why doesn't it just store the index in the hash + table as a GINT_TO_POINTER? - Damon. */ idx = g_new (int, 1); g_array_append_val (priv->objects, ico); @@ -1007,6 +1468,17 @@ load_objects (CalendarModel *model) cal_obj_uid_list_free (uids); } +CalClient* +calendar_model_get_cal_client (CalendarModel *model) +{ + CalendarModelPrivate *priv; + + priv = model->priv; + + return priv->client; +} + + /** * calendar_model_set_cal_client: * @model: A calendar model. @@ -1046,6 +1518,8 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy priv->type = type; if (priv->client) { + gtk_signal_connect (GTK_OBJECT (priv->client), "cal_loaded", + GTK_SIGNAL_FUNC (cal_loaded_cb), model); gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated", GTK_SIGNAL_FUNC (obj_updated_cb), model); gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed", @@ -1056,3 +1530,51 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy e_table_model_changed (E_TABLE_MODEL (model)); } + + +void +calendar_model_delete_task (CalendarModel *model, + gint row) +{ + CalendarModelPrivate *priv; + iCalObject *ico; + + priv = model->priv; + ico = g_array_index (priv->objects, iCalObject *, row); + + if (!cal_client_remove_object (priv->client, ico->uid)) + g_message ("calendar_model_mark_task_complete(): Could not update the object!"); +} + + +void +calendar_model_mark_task_complete (CalendarModel *model, + gint row) +{ + CalendarModelPrivate *priv; + iCalObject *ico; + + priv = model->priv; + ico = g_array_index (priv->objects, iCalObject *, row); + + /* FIXME: Need a function to do all this. */ + ico->percent = 100; + ico->completed = time (NULL); + + if (!cal_client_update_object (priv->client, ico)) + g_message ("calendar_model_mark_task_complete(): Could not update the object!"); +} + + +/* Frees the objects stored in the calendar model */ +iCalObject* +calendar_model_get_cal_object (CalendarModel *model, + gint row) +{ + CalendarModelPrivate *priv; + + priv = model->priv; + + return g_array_index (priv->objects, iCalObject *, row); +} + diff --git a/calendar/gui/calendar-model.h b/calendar/gui/calendar-model.h index 7e28436e59..d3317b11eb 100644 --- a/calendar/gui/calendar-model.h +++ b/calendar/gui/calendar-model.h @@ -51,11 +51,22 @@ struct _CalendarModelClass { ETableModelClass parent_class; }; -GtkType calendar_model_get_type (void); +GtkType calendar_model_get_type (void); -CalendarModel *calendar_model_new (void); +CalendarModel* calendar_model_new (void); -void calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjType type); +CalClient* calendar_model_get_cal_client (CalendarModel *model); +void calendar_model_set_cal_client (CalendarModel *model, + CalClient *client, + CalObjType type); + +void calendar_model_mark_task_complete (CalendarModel *model, + gint row); +void calendar_model_delete_task (CalendarModel *model, + gint row); + +iCalObject* calendar_model_get_cal_object (CalendarModel *model, + gint row); diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index 6caf99e8f5..227cb5aa07 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -14,13 +14,17 @@ noinst_LIBRARIES = libcal-dialogs.a libcal_dialogs_a_SOURCES = \ alarm-notify-dialog.c \ - alarm-notify-dialog.h + alarm-notify-dialog.h \ + task-editor.c \ + task-editor.h glade_DATA = \ - alarm-notify.glade + alarm-notify.glade \ + task-editor-dialog.glade glade_messages = \ - alarm-notify.glade.h + alarm-notify.glade.h \ + task-editor-dialog.glade.h EXTRA_DIST = \ $(glade_DATA) \ diff --git a/calendar/gui/dialogs/task-editor-dialog.glade b/calendar/gui/dialogs/task-editor-dialog.glade new file mode 100644 index 0000000000..56f7f83422 --- /dev/null +++ b/calendar/gui/dialogs/task-editor-dialog.glade @@ -0,0 +1,822 @@ +<?xml version="1.0"?> +<GTK-Interface> + +<project> + <name>task-editor-dialog</name> + <program_name>task-editor-dialog</program_name> + <directory></directory> + <source_directory>src</source_directory> + <pixmaps_directory>pixmaps</pixmaps_directory> + <language>C</language> + <gnome_support>True</gnome_support> + <gettext_support>True</gettext_support> + <output_translatable_strings>True</output_translatable_strings> + <translatable_strings_file>task-editor-dialog.glade.h</translatable_strings_file> +</project> + +<widget> + <class>GnomeApp</class> + <name>task-editor-dialog</name> + <visible>False</visible> + <type>GTK_WINDOW_TOPLEVEL</type> + <position>GTK_WIN_POS_NONE</position> + <modal>False</modal> + <allow_shrink>False</allow_shrink> + <allow_grow>True</allow_grow> + <auto_shrink>False</auto_shrink> + <enable_layout_config>True</enable_layout_config> + + <widget> + <class>GnomeDock</class> + <child_name>GnomeApp:dock</child_name> + <name>dock1</name> + <allow_floating>True</allow_floating> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkNotebook</class> + <child_name>GnomeDock:contents</child_name> + <name>notebook1</name> + <border_width>2</border_width> + <can_focus>True</can_focus> + <show_tabs>True</show_tabs> + <show_border>True</show_border> + <tab_pos>GTK_POS_TOP</tab_pos> + <scrollable>False</scrollable> + <tab_hborder>2</tab_hborder> + <tab_vborder>2</tab_vborder> + <popup_enable>False</popup_enable> + + <widget> + <class>GtkVBox</class> + <name>vbox1</name> + <border_width>4</border_width> + <homogeneous>False</homogeneous> + <spacing>4</spacing> + + <widget> + <class>GtkTable</class> + <name>table3</name> + <rows>2</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>4</row_spacing> + <column_spacing>4</column_spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label3</name> + <label>S_ubject:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>entry1</default_focus_target> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry1</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label10</name> + <label>Owner:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label11</name> + <label></label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkHSeparator</class> + <name>hseparator1</name> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox4</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkTable</class> + <name>table1</name> + <rows>2</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>2</row_spacing> + <column_spacing>4</column_spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit1</name> + <show_time>True</show_time> + <use_24_format>False</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit2</name> + <show_time>True</show_time> + <use_24_format>True</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label6</name> + <label>Sta_rt Date:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label5</name> + <label>_Due Date:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + </widget> + + <widget> + <class>GtkHSeparator</class> + <name>hseparator2</name> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox3</name> + <homogeneous>False</homogeneous> + <spacing>4</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label7</name> + <label>_Status:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>combo-entry1</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo1</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items>Not Started +In Progress +Completed +Cancelled +</items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>combo-entry1</name> + <width>60</width> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>Not Started</text> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label8</name> + <label>_Priority:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>combo-entry2</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo2</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items>High +Normal +Low +</items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>combo-entry2</name> + <width>60</width> + <can_focus>True</can_focus> + <editable>False</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>High</text> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label9</name> + <label>% Comp_lete:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>spinbutton1</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkSpinButton</class> + <name>spinbutton1</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>False</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>10</step> + <page>10</page> + <page_size>10</page_size> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow1</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkText</class> + <name>text1</name> + <height>150</height> + <can_focus>True</can_focus> + <editable>True</editable> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox2</name> + <homogeneous>False</homogeneous> + <spacing>2</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkButton</class> + <name>button3</name> + <can_focus>True</can_focus> + <label>_Contacts...</label> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry2</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>button4</name> + <can_focus>True</can_focus> + <label>Ca_tegories...</label> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry3</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>checkbutton1</name> + <can_focus>True</can_focus> + <label>Private</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label1</name> + <label>Task</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + + <widget> + <class>GtkTable</class> + <name>table4</name> + <border_width>4</border_width> + <rows>4</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>2</row_spacing> + <column_spacing>4</column_spacing> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit3</name> + <show_time>True</show_time> + <use_24_format>True</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label12</name> + <label>Date Completed:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label13</name> + <label>Location:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label14</name> + <label>URL:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry4</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry5</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label15</name> + <label>Resources:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry6</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label2</name> + <label>Details</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> +</widget> + +</GTK-Interface> diff --git a/calendar/gui/dialogs/task-editor-dialog.glade.h b/calendar/gui/dialogs/task-editor-dialog.glade.h new file mode 100644 index 0000000000..9ee959817f --- /dev/null +++ b/calendar/gui/dialogs/task-editor-dialog.glade.h @@ -0,0 +1,33 @@ +/* + * Translatable strings file generated by Glade. + * Add this file to your project's POTFILES.in. + * DO NOT compile it as part of your application. + */ + +gchar *s = N_("S_ubject:"); +gchar *s = N_("Owner:"); +gchar *s = N_("Sta_rt Date:"); +gchar *s = N_("_Due Date:"); +gchar *s = N_("_Status:"); +gchar *s = N_("Not Started\n" + "In Progress\n" + "Completed\n" + "Cancelled\n" + ""); +gchar *s = N_("Not Started"); +gchar *s = N_("_Priority:"); +gchar *s = N_("High\n" + "Normal\n" + "Low\n" + ""); +gchar *s = N_("High"); +gchar *s = N_("% Comp_lete:"); +gchar *s = N_("_Contacts..."); +gchar *s = N_("Ca_tegories..."); +gchar *s = N_("Private"); +gchar *s = N_("Task"); +gchar *s = N_("Date Completed:"); +gchar *s = N_("Location:"); +gchar *s = N_("URL:"); +gchar *s = N_("Resources:"); +gchar *s = N_("Details"); diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c new file mode 100644 index 0000000000..51495d8145 --- /dev/null +++ b/calendar/gui/dialogs/task-editor.c @@ -0,0 +1,482 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Author : + * Damon Chaplin <damon@helixcode.com> + * + * Copyright 2000, Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +/* + * TaskEditor - a GtkObject which handles a libglade-loaded dialog to edit + * tasks. + */ + +#include <config.h> +#include <gnome.h> +#include <glade/glade.h> +#include <e-util/e-util.h> +#include <cal-client/cal-client.h> +#include "task-editor.h" + + +typedef struct { + /* Glade XML data */ + GladeXML *xml; + + /* UI handler */ + BonoboUIHandler *uih; + + /* Calendar object we are editing; this is an internal copy and is not + * one of the read-only objects from the parent calendar. + */ + iCalObject *ico; + + /* Widgets from the Glade file */ + + GtkWidget *app; + +} TaskEditorPrivate; + + +static void task_editor_class_init (TaskEditorClass *class); +static void task_editor_init (TaskEditor *tedit); +TaskEditor * task_editor_construct (TaskEditor *tedit); +static gboolean get_widgets (TaskEditor *tedit); +static void init_widgets (TaskEditor *tedit); +static void create_menu (TaskEditor *tedit); +static void create_toolbar (TaskEditor *tedit); +static void task_editor_destroy (GtkObject *object); + +static GtkObjectClass *parent_class; + +E_MAKE_TYPE(task_editor, "TaskEditor", TaskEditor, + task_editor_class_init, task_editor_init, GTK_TYPE_OBJECT) + + +static void +task_editor_class_init (TaskEditorClass *class) +{ + GtkObjectClass *object_class; + + object_class = (GtkObjectClass *) class; + + parent_class = gtk_type_class (GTK_TYPE_OBJECT); + + + object_class->destroy = task_editor_destroy; +} + + +static void +task_editor_init (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + + priv = g_new0 (TaskEditorPrivate, 1); + tedit->priv = priv; +} + + +/** + * task_editor_new: + * @Returns: a new #TaskEditor. + * + * Creates a new #TaskEditor. + **/ +TaskEditor * +task_editor_new (void) +{ + TaskEditor *tedit; + + tedit = TASK_EDITOR (gtk_type_new (task_editor_get_type ())); + + return task_editor_construct (tedit); +} + + +/** + * task_editor_construct: + * @tedit: A #TaskEditor. + * + * Constructs a task editor by loading its Glade XML file. + * + * Return value: The same object as @tedit, or NULL if the widgets could not be + * created. In the latter case, the task editor will automatically be + * destroyed. + **/ +TaskEditor * +task_editor_construct (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + + g_return_val_if_fail (tedit != NULL, NULL); + g_return_val_if_fail (IS_TASK_EDITOR (tedit), NULL); + + priv = tedit->priv; + + /* Load the content widgets */ + + priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/task-editor-dialog.glade", NULL); + if (!priv->xml) { + g_message ("task_editor_construct(): Could not load the Glade XML file!"); + goto error; + } + + if (!get_widgets (tedit)) { + g_message ("task_editor_construct(): Could not find all widgets in the XML file!"); + goto error; + } + + init_widgets (tedit); + + /* Construct the app */ + + priv->uih = bonobo_ui_handler_new (); + if (!priv->uih) { + g_message ("task_editor_construct(): Could not create the UI handler"); + goto error; + } + + bonobo_ui_handler_set_app (priv->uih, GNOME_APP (priv->app)); + + create_menu (tedit); + create_toolbar (tedit); + + /* Hook to destruction of the dialog */ + +#if 0 + gtk_signal_connect (GTK_OBJECT (priv->app), "delete_event", + GTK_SIGNAL_FUNC (app_delete_event_cb), tedit); +#endif + + /* Show the dialog */ + + gtk_widget_show (priv->app); + + return tedit; + + error: + + gtk_object_unref (GTK_OBJECT (tedit)); + return NULL; +} + + +/* Gets the widgets from the XML file and returns if they are all available. + * For the widgets whose values can be simply set with e-dialog-utils, it does + * that as well. + */ +static gboolean +get_widgets (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + + priv = tedit->priv; + +#define GW(name) glade_xml_get_widget (priv->xml, name) + + priv->app = GW ("task-editor-dialog"); + + return TRUE; +} + + +/* Hooks the widget signals */ +static void +init_widgets (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + + priv = tedit->priv; + +} + + +/* Menu bar */ + +static GnomeUIInfo file_new_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Task"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Task _Request"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Mail Message"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Appointment"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Meeting Re_quest"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Contact"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Task"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Task _Request"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Journal Entry"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Note"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Ch_oose Form..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo file_page_setup_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Memo Style"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Define Print _Styles..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo file_menu[] = { + GNOMEUIINFO_MENU_NEW_SUBTREE (file_new_menu), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: S_end"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_SAVE_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_SAVE_AS_ITEM (NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Save Attac_hments..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Delete"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Move to Folder..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Cop_y to Folder..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("Page Set_up"), file_page_setup_menu), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Print Pre_view"), NULL, NULL), + GNOMEUIINFO_MENU_PRINT_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_PROPERTIES_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CLOSE_ITEM (NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo edit_object_menu[] = { + GNOMEUIINFO_ITEM_NONE ("FIXME: what goes here?", NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo edit_menu[] = { + GNOMEUIINFO_MENU_UNDO_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_REDO_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CUT_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_COPY_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_PASTE_ITEM (NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Paste _Special..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_CLEAR_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_SELECT_ALL_ITEM (NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Mark as U_nread"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_FIND_ITEM (NULL, NULL), + GNOMEUIINFO_MENU_FIND_AGAIN_ITEM (NULL, NULL), + GNOMEUIINFO_SUBTREE (N_("_Object"), edit_object_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_previous_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Unread Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: In_complete Task"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Fi_rst Item in Folder"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_next_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Unread Item"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: In_complete Task"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Last Item in Folder"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_toolbars_menu[] = { + { GNOME_APP_UI_TOGGLEITEM, N_("FIXME: _Standard"), NULL, NULL, NULL, NULL, + GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL }, + { GNOME_APP_UI_TOGGLEITEM, N_("FIXME: __Formatting"), NULL, NULL, NULL, NULL, + GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL }, + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Customize..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo view_menu[] = { + GNOMEUIINFO_SUBTREE (N_("Pre_vious"), view_previous_menu), + GNOMEUIINFO_SUBTREE (N_("Ne_xt"), view_next_menu), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("_Toolbars"), view_toolbars_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo insert_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _File..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: It_em..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Object..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo format_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Font..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Paragraph..."), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo tools_forms_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Ch_oose Form..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Desi_gn This Form"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: D_esign a Form..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Publish _Form..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Pu_blish Form As..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Script _Debugger"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo tools_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Spelling..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Chec_k Names"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Address _Book..."), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_SUBTREE (N_("_Forms"), tools_forms_menu), + GNOMEUIINFO_END +}; + +static GnomeUIInfo actions_menu[] = { + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _New Task"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: S_end Status Report"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Mark Complete"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Rec_urrence..."), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: S_kip Occurrence"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Assig_n Task"), NULL, NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: _Reply"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Reply to A_ll"), NULL, NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: For_ward"), NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo help_menu[] = { + GNOMEUIINFO_ITEM_NONE ("FIXME: fix Bonobo so it supports help items!", NULL, NULL), + GNOMEUIINFO_END +}; + +static GnomeUIInfo main_menu[] = { + GNOMEUIINFO_MENU_FILE_TREE (file_menu), + GNOMEUIINFO_MENU_EDIT_TREE (edit_menu), + GNOMEUIINFO_MENU_VIEW_TREE (view_menu), + GNOMEUIINFO_SUBTREE (N_("_Insert"), insert_menu), + GNOMEUIINFO_SUBTREE (N_("F_ormat"), format_menu), + GNOMEUIINFO_SUBTREE (N_("_Tools"), tools_menu), + GNOMEUIINFO_SUBTREE (N_("Actio_ns"), actions_menu), + GNOMEUIINFO_MENU_HELP_TREE (help_menu), + GNOMEUIINFO_END +}; + + +/* Creates the menu bar for the event editor */ +static void +create_menu (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + BonoboUIHandlerMenuItem *list; + + priv = tedit->priv; + + bonobo_ui_handler_create_menubar (priv->uih); + + list = bonobo_ui_handler_menu_parse_uiinfo_list_with_data (main_menu, + tedit); + bonobo_ui_handler_menu_add_list (priv->uih, "/", list); +} + + +/* Toolbar */ + +static GnomeUIInfo toolbar[] = { + GNOMEUIINFO_ITEM_STOCK (N_("FIXME: Save and Close"), + N_("Save the task and close the dialog box"), + NULL, + GNOME_STOCK_PIXMAP_SAVE), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Print..."), + N_("Print this item"), NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Insert File..."), + N_("Insert a file as an attachment"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Recurrence..."), + N_("Configure recurrence rules"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Assign Task..."), + N_("Assign the task to someone"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Delete"), + N_("Delete this item"), NULL), + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Previous"), + N_("Go to the previous item"), NULL), + GNOMEUIINFO_ITEM_NONE (N_("FIXME: Next"), + N_("Go to the next item"), NULL), + GNOMEUIINFO_ITEM_STOCK (N_("FIXME: Help"), + N_("See online help"), NULL, GNOME_STOCK_PIXMAP_HELP), + GNOMEUIINFO_END +}; + + +/* Creates the toolbar for the event editor */ +static void +create_toolbar (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + BonoboUIHandlerToolbarItem *list; + GnomeDockItem *dock_item; + GtkWidget *toolbar_child; + + priv = tedit->priv; + + bonobo_ui_handler_create_toolbar (priv->uih, "Toolbar"); + + /* Fetch the toolbar. What a pain in the ass. */ + + dock_item = gnome_app_get_dock_item_by_name (GNOME_APP (priv->app), GNOME_APP_TOOLBAR_NAME); + g_assert (dock_item != NULL); + + toolbar_child = gnome_dock_item_get_child (dock_item); + g_assert (toolbar_child != NULL && GTK_IS_TOOLBAR (toolbar_child)); + + /* Turn off labels as GtkToolbar sucks */ + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar_child), GTK_TOOLBAR_ICONS); + + list = bonobo_ui_handler_toolbar_parse_uiinfo_list_with_data (toolbar, + tedit); + bonobo_ui_handler_toolbar_add_list (priv->uih, "/Toolbar", list); +} + + +static void +task_editor_destroy (GtkObject *object) +{ + TaskEditor *tedit; + + g_return_if_fail (object != NULL); + g_return_if_fail (IS_TASK_EDITOR (object)); + + tedit = TASK_EDITOR (object); + + +} + + diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h new file mode 100644 index 0000000000..159b969ab9 --- /dev/null +++ b/calendar/gui/dialogs/task-editor.h @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Author : + * Damon Chaplin <damon@helixcode.com> + * + * Copyright 2000, Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ +#ifndef _TASK_EDITOR_H_ +#define _TASK_EDITOR_H_ + +#include <gtk/gtkobject.h> +#include <libgnome/gnome-defs.h> +#include <bonobo.h> + +BEGIN_GNOME_DECLS + + +#define TASK_EDITOR(obj) GTK_CHECK_CAST (obj, task_editor_get_type (), TaskEditor) +#define TASK_EDITOR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, task_editor_get_type (), TaskEditorClass) +#define IS_TASK_EDITOR(obj) GTK_CHECK_TYPE (obj, task_editor_get_type ()) + + +typedef struct _TaskEditor TaskEditor; +typedef struct _TaskEditorClass TaskEditorClass; + +struct _TaskEditor +{ + GtkObject object; + + /* Private data */ + gpointer priv; +}; + +struct _TaskEditorClass +{ + GtkObjectClass parent_class; +}; + + +GtkType task_editor_get_type (void); +TaskEditor* task_editor_new (void); + + + +END_GNOME_DECLS + +#endif /* _TASK_EDITOR_H_ */ diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade new file mode 100644 index 0000000000..56f7f83422 --- /dev/null +++ b/calendar/gui/dialogs/task-page.glade @@ -0,0 +1,822 @@ +<?xml version="1.0"?> +<GTK-Interface> + +<project> + <name>task-editor-dialog</name> + <program_name>task-editor-dialog</program_name> + <directory></directory> + <source_directory>src</source_directory> + <pixmaps_directory>pixmaps</pixmaps_directory> + <language>C</language> + <gnome_support>True</gnome_support> + <gettext_support>True</gettext_support> + <output_translatable_strings>True</output_translatable_strings> + <translatable_strings_file>task-editor-dialog.glade.h</translatable_strings_file> +</project> + +<widget> + <class>GnomeApp</class> + <name>task-editor-dialog</name> + <visible>False</visible> + <type>GTK_WINDOW_TOPLEVEL</type> + <position>GTK_WIN_POS_NONE</position> + <modal>False</modal> + <allow_shrink>False</allow_shrink> + <allow_grow>True</allow_grow> + <auto_shrink>False</auto_shrink> + <enable_layout_config>True</enable_layout_config> + + <widget> + <class>GnomeDock</class> + <child_name>GnomeApp:dock</child_name> + <name>dock1</name> + <allow_floating>True</allow_floating> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkNotebook</class> + <child_name>GnomeDock:contents</child_name> + <name>notebook1</name> + <border_width>2</border_width> + <can_focus>True</can_focus> + <show_tabs>True</show_tabs> + <show_border>True</show_border> + <tab_pos>GTK_POS_TOP</tab_pos> + <scrollable>False</scrollable> + <tab_hborder>2</tab_hborder> + <tab_vborder>2</tab_vborder> + <popup_enable>False</popup_enable> + + <widget> + <class>GtkVBox</class> + <name>vbox1</name> + <border_width>4</border_width> + <homogeneous>False</homogeneous> + <spacing>4</spacing> + + <widget> + <class>GtkTable</class> + <name>table3</name> + <rows>2</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>4</row_spacing> + <column_spacing>4</column_spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label3</name> + <label>S_ubject:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>entry1</default_focus_target> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry1</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label10</name> + <label>Owner:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label11</name> + <label></label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkHSeparator</class> + <name>hseparator1</name> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox4</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkTable</class> + <name>table1</name> + <rows>2</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>2</row_spacing> + <column_spacing>4</column_spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit1</name> + <show_time>True</show_time> + <use_24_format>False</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit2</name> + <show_time>True</show_time> + <use_24_format>True</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label6</name> + <label>Sta_rt Date:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label5</name> + <label>_Due Date:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + </widget> + + <widget> + <class>GtkHSeparator</class> + <name>hseparator2</name> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox3</name> + <homogeneous>False</homogeneous> + <spacing>4</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label7</name> + <label>_Status:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>combo-entry1</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo1</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items>Not Started +In Progress +Completed +Cancelled +</items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>combo-entry1</name> + <width>60</width> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>Not Started</text> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label8</name> + <label>_Priority:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>combo-entry2</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>combo2</name> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items>High +Normal +Low +</items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>combo-entry2</name> + <width>60</width> + <can_focus>True</can_focus> + <editable>False</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>High</text> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label9</name> + <label>% Comp_lete:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <default_focus_target>spinbutton1</default_focus_target> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkSpinButton</class> + <name>spinbutton1</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>False</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>10</step> + <page>10</page> + <page_size>10</page_size> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow1</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkText</class> + <name>text1</name> + <height>150</height> + <can_focus>True</can_focus> + <editable>True</editable> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox2</name> + <homogeneous>False</homogeneous> + <spacing>2</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkButton</class> + <name>button3</name> + <can_focus>True</can_focus> + <label>_Contacts...</label> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry2</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>button4</name> + <can_focus>True</can_focus> + <label>Ca_tegories...</label> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry3</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>checkbutton1</name> + <can_focus>True</can_focus> + <label>Private</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label1</name> + <label>Task</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + + <widget> + <class>GtkTable</class> + <name>table4</name> + <border_width>4</border_width> + <rows>4</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>2</row_spacing> + <column_spacing>4</column_spacing> + + <widget> + <class>GnomeDateEdit</class> + <name>dateedit3</name> + <show_time>True</show_time> + <use_24_format>True</use_24_format> + <week_start_monday>False</week_start_monday> + <lower_hour>7</lower_hour> + <upper_hour>19</upper_hour> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label12</name> + <label>Date Completed:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label13</name> + <label>Location:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label14</name> + <label>URL:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry4</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry5</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label15</name> + <label>Resources:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>entry6</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label2</name> + <label>Details</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> +</widget> + +</GTK-Interface> diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c new file mode 100644 index 0000000000..c98b17f729 --- /dev/null +++ b/calendar/gui/e-calendar-table.c @@ -0,0 +1,481 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Author : + * Damon Chaplin <damon@helixcode.com> + * + * Copyright 2000, Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +/* + * ECalendarTable - displays the iCalendar objects in a table (an ETable). + * Used for calendar events and tasks. + */ + +#include <config.h> +#include <gdk/gdkkeysyms.h> +#include <libgnomeui/gnome-popup-menu.h> +#include <e-table/e-table-scrolled.h> +#include <e-table/e-cell-checkbox.h> +#include <e-table/e-cell-toggle.h> +#include <e-table/e-cell-text.h> +#include "e-calendar-table.h" +#include "calendar-model.h" + +/* Pixmaps. */ +#include "task.xpm" +#include "task-recurring.xpm" +#include "task-assigned.xpm" +#include "task-assigned-to.xpm" + +#include <e-table/check-filled.xpm> + + +static void e_calendar_table_class_init (ECalendarTableClass *class); +static void e_calendar_table_init (ECalendarTable *cal_table); +static void e_calendar_table_destroy (GtkObject *object); + +static void e_calendar_table_on_double_click (ETable *table, + gint row, + ECalendarTable *cal_table); +static gint e_calendar_table_on_right_click (ETable *table, + gint row, + gint col, + GdkEventButton *event, + ECalendarTable *cal_table); +static void e_calendar_table_on_open_task (GtkWidget *menuitem, + gpointer data); +static void e_calendar_table_on_mark_task_complete (GtkWidget *menuitem, + gpointer data); +static void e_calendar_table_on_delete_task (GtkWidget *menuitem, + gpointer data); +static gint e_calendar_table_on_key_press (ETable *table, + gint row, + gint col, + GdkEventKey *event, + ECalendarTable *cal_table); + +static void e_calendar_table_open_task (ECalendarTable *cal_table, + gint row); + +/* The icons to represent the task. */ +#define E_CALENDAR_MODEL_NUM_ICONS 4 +static char** icon_xpm_data[E_CALENDAR_MODEL_NUM_ICONS] = { + task_xpm, task_recurring_xpm, task_assigned_xpm, task_assigned_to_xpm +}; +static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 }; + +static GtkTableClass *parent_class; + + +GtkType +e_calendar_table_get_type (void) +{ + static GtkType e_calendar_table_type = 0; + + if (!e_calendar_table_type){ + GtkTypeInfo e_calendar_table_info = { + "ECalendarTable", + sizeof (ECalendarTable), + sizeof (ECalendarTableClass), + (GtkClassInitFunc) e_calendar_table_class_init, + (GtkObjectInitFunc) e_calendar_table_init, + NULL, /* reserved 1 */ + NULL, /* reserved 2 */ + (GtkClassInitFunc) NULL + }; + + parent_class = gtk_type_class (GTK_TYPE_TABLE); + e_calendar_table_type = gtk_type_unique (GTK_TYPE_TABLE, + &e_calendar_table_info); + } + + return e_calendar_table_type; +} + + +static void +e_calendar_table_class_init (ECalendarTableClass *class) +{ + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + + object_class = (GtkObjectClass *) class; + widget_class = (GtkWidgetClass *) class; + + /* Method override */ + object_class->destroy = e_calendar_table_destroy; + +#if 0 + widget_class->realize = e_calendar_table_realize; + widget_class->unrealize = e_calendar_table_unrealize; + widget_class->style_set = e_calendar_table_style_set; + widget_class->size_allocate = e_calendar_table_size_allocate; + widget_class->focus_in_event = e_calendar_table_focus_in; + widget_class->focus_out_event = e_calendar_table_focus_out; + widget_class->key_press_event = e_calendar_table_key_press; +#endif +} + + +#define E_CALENDAR_TABLE_SPEC \ + "<ETableSpecification click-to-add=\"1\">" \ + "<columns-shown>" \ + "<column> 16 </column>" \ + "<column> 17 </column>" \ + "<column> 13 </column>" \ + "</columns-shown>" \ + "<grouping> </grouping>" \ + "</ETableSpecification>" + +#define e_cell_time_new e_cell_text_new +#define e_cell_time_compare g_str_compare +#define e_cell_geo_pos_new e_cell_text_new +#define e_cell_geo_pos_compare g_str_compare + +static void +e_calendar_table_init (ECalendarTable *cal_table) +{ + GtkWidget *table; + ETableModel *model; + ETableHeader *header; + ECell *cell; + ETableCol *column; + gint i; + GdkPixbuf *pixbuf; + GdkColormap *colormap; + gboolean success[E_CALENDAR_TABLE_COLOR_LAST]; + gint nfailed; + + /* Allocate the colors we need. */ + colormap = gtk_widget_get_colormap (GTK_WIDGET (cal_table)); + + cal_table->colors[E_CALENDAR_TABLE_COLOR_OVERDUE].red = 65535; + cal_table->colors[E_CALENDAR_TABLE_COLOR_OVERDUE].green = 0; + cal_table->colors[E_CALENDAR_TABLE_COLOR_OVERDUE].blue = 0; + + nfailed = gdk_colormap_alloc_colors (colormap, cal_table->colors, + E_CALENDAR_TABLE_COLOR_LAST, + FALSE, TRUE, success); + if (nfailed) + g_warning ("Failed to allocate all colors"); + + + cal_table->model = calendar_model_new (); + model = E_TABLE_MODEL (cal_table->model); + + header = e_table_header_new (); + gtk_object_ref (GTK_OBJECT (header)); + gtk_object_sink (GTK_OBJECT (header)); + + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_COMMENT, _("Comment"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_COMMENT); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_COMPLETED, _("Completed"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_COMPLETED); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_CREATED, _("Created"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_CREATED); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_DESCRIPTION, _("Description"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_DESCRIPTION); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_DTSTAMP, _("Timestamp"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_DTSTAMP); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_DTSTART, _("Start Date"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_DTSTART); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_DTEND, _("End Date"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_DTEND); + + cell = e_cell_geo_pos_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_GEO, _("Geographical Position"), + 1.0, 10, cell, e_cell_geo_pos_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_GEO); + + cell = e_cell_time_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_LAST_MOD, _("Last Modification Date"), + 1.0, 10, cell, e_cell_time_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_LAST_MOD); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_LOCATION, _("Location"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_LOCATION); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_ORGANIZER, _("Organizer"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_ORGANIZER); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_PERCENT, _("% Complete"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_PERCENT); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_PRIORITY, _("Priority"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_PRIORITY); + + /* FIXME: This should really be 'Subject' in the big view. */ + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", ICAL_OBJECT_FIELD_COMPLETE, + "bold_column", ICAL_OBJECT_FIELD_OVERDUE, + "color_column", ICAL_OBJECT_FIELD_COLOR, + NULL); + column = e_table_col_new (ICAL_OBJECT_FIELD_SUMMARY, _("TaskPad"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_SUMMARY); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_URL, _("URL"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_URL); + + cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + column = e_table_col_new (ICAL_OBJECT_FIELD_HAS_ALARMS, _("Reminder"), + 1.0, 10, cell, g_str_compare, TRUE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_HAS_ALARMS); + + /* Create pixmaps. */ + if (!icon_pixbufs[0]) { + for (i = 0; i < E_CALENDAR_MODEL_NUM_ICONS; i++) { + icon_pixbufs[i] = gdk_pixbuf_new_from_xpm_data ( + (const char **) icon_xpm_data[i]); + } + } + + cell = e_cell_toggle_new (0, 4, icon_pixbufs); + column = e_table_col_new_with_pixbuf (ICAL_OBJECT_FIELD_ICON, + icon_pixbufs[0], 0.0, 16, cell, + g_int_compare, FALSE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_ICON); + + cell = e_cell_checkbox_new (); + pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) check_filled_xpm); + column = e_table_col_new_with_pixbuf (ICAL_OBJECT_FIELD_COMPLETE, + pixbuf, 0.0, 16, cell, + g_int_compare, FALSE); + e_table_header_add_column (header, column, ICAL_OBJECT_FIELD_COMPLETE); + + + table = e_table_scrolled_new (header, model, E_CALENDAR_TABLE_SPEC); + gtk_object_set (GTK_OBJECT (table), + "click_to_add_message", "Click here to add a new Task", + NULL); + gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_show (table); + + gtk_signal_connect (GTK_OBJECT (table), "double_click", + GTK_SIGNAL_FUNC (e_calendar_table_on_double_click), + cal_table); + gtk_signal_connect (GTK_OBJECT (table), "right_click", + GTK_SIGNAL_FUNC (e_calendar_table_on_right_click), + cal_table); + gtk_signal_connect (GTK_OBJECT (table), "key_press", + GTK_SIGNAL_FUNC (e_calendar_table_on_key_press), + cal_table); +} + + +/** + * e_calendar_table_new: + * @Returns: a new #ECalendarTable. + * + * Creates a new #ECalendarTable. + **/ +GtkWidget * +e_calendar_table_new (void) +{ + GtkWidget *cal_table; + + cal_table = GTK_WIDGET (gtk_type_new (e_calendar_table_get_type ())); + + return cal_table; +} + + +static void +e_calendar_table_destroy (GtkObject *object) +{ + ECalendarTable *cal_table; + + cal_table = E_CALENDAR_TABLE (object); + + + + GTK_OBJECT_CLASS (parent_class)->destroy (object); +} + + +void +e_calendar_table_set_cal_client (ECalendarTable *cal_table, + CalClient *client) +{ + g_print ("In e_calendar_table_set_cal_client\n"); + + calendar_model_set_cal_client (cal_table->model, client, + CALOBJ_TYPE_TODO); +} + + +static void +e_calendar_table_on_double_click (ETable *table, + gint row, + ECalendarTable *cal_table) +{ + g_print ("In e_calendar_table_on_double_click row:%i\n", row); + + e_calendar_table_open_task (cal_table, row); +} + + +static GnomeUIInfo e_calendar_table_popup_uiinfo[] = { + { GNOME_APP_UI_ITEM, N_("Open..."), + N_("Open the task"), e_calendar_table_on_open_task, + NULL, NULL, 0, 0, 0, 0 }, + { GNOME_APP_UI_ITEM, N_("Mark Complete"), + N_("Mark the task complete"), e_calendar_table_on_mark_task_complete, + NULL, NULL, 0, 0, 0, 0 }, + { GNOME_APP_UI_ITEM, N_("Delete"), + N_("Delete the task"), e_calendar_table_on_delete_task, + NULL, NULL, 0, 0, 0, 0 }, + + GNOMEUIINFO_END +}; + + +typedef struct _ECalendarMenuData ECalendarMenuData; +struct _ECalendarMenuData { + ECalendarTable *cal_table; + gint row; +}; + +static gint +e_calendar_table_on_right_click (ETable *table, + gint row, + gint col, + GdkEventButton *event, + ECalendarTable *cal_table) +{ + ECalendarMenuData menu_data; + GtkWidget *popup_menu; + + menu_data.cal_table = cal_table; + menu_data.row = row; + + popup_menu = gnome_popup_menu_new (e_calendar_table_popup_uiinfo); + gnome_popup_menu_do_popup_modal (popup_menu, NULL, NULL, event, + &menu_data); + + gtk_widget_destroy (popup_menu); + + return TRUE; +} + + +static void +e_calendar_table_on_open_task (GtkWidget *menuitem, + gpointer data) +{ + ECalendarMenuData *menu_data = (ECalendarMenuData*) data; + + e_calendar_table_open_task (menu_data->cal_table, + menu_data->row); +} + + +static void +e_calendar_table_on_mark_task_complete (GtkWidget *menuitem, + gpointer data) +{ + ECalendarMenuData *menu_data = (ECalendarMenuData*) data; + + calendar_model_mark_task_complete (menu_data->cal_table->model, + menu_data->row); +} + + +static void +e_calendar_table_on_delete_task (GtkWidget *menuitem, + gpointer data) +{ + ECalendarMenuData *menu_data = (ECalendarMenuData*) data; + + calendar_model_delete_task (menu_data->cal_table->model, + menu_data->row); +} + + + +static gint +e_calendar_table_on_key_press (ETable *table, + gint row, + gint col, + GdkEventKey *event, + ECalendarTable *cal_table) +{ + g_print ("In e_calendar_table_on_key_press\n"); + + if (event->keyval == GDK_Delete) { + g_print (" delete key!!!\n"); + + calendar_model_delete_task (cal_table->model, row); + } + + return FALSE; +} + + +static void +e_calendar_table_open_task (ECalendarTable *cal_table, + gint row) +{ + iCalObject *ico; + +#if 0 + task_editor_new (); + /* FIXME: Set iCalObject to edit. */ +#endif + + ico = calendar_model_get_cal_object (cal_table->model, row); + + gncal_todo_edit (calendar_model_get_cal_client (cal_table->model), + ico); +} + + diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h new file mode 100644 index 0000000000..eed021e846 --- /dev/null +++ b/calendar/gui/e-calendar-table.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/* + * Author : + * Damon Chaplin <damon@helixcode.com> + * + * Copyright 2000, Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ +#ifndef _E_CALENDAR_TABLE_H_ +#define _E_CALENDAR_TABLE_H_ + +#include <gtk/gtktable.h> +#include "calendar-model.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * ECalendarTable - displays the iCalendar objects in a table (an ETable). + * Used for calendar events and tasks. + */ + +/* These index our colors array. */ +typedef enum +{ + E_CALENDAR_TABLE_COLOR_OVERDUE, + + E_CALENDAR_TABLE_COLOR_LAST +} ECalendarTableColors; + + +#define E_CALENDAR_TABLE(obj) GTK_CHECK_CAST (obj, e_calendar_table_get_type (), ECalendarTable) +#define E_CALENDAR_TABLE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_table_get_type (), ECalendarTableClass) +#define E_IS_CALENDAR_TABLE(obj) GTK_CHECK_TYPE (obj, e_calendar_table_get_type ()) + + +typedef struct _ECalendarTable ECalendarTable; +typedef struct _ECalendarTableClass ECalendarTableClass; + +struct _ECalendarTable +{ + GtkTable table; + + CalendarModel *model; + + /* Colors for drawing. */ + GdkColor colors[E_CALENDAR_TABLE_COLOR_LAST]; +}; + +struct _ECalendarTableClass +{ + GtkTableClass parent_class; +}; + + +GtkType e_calendar_table_get_type (void); +GtkWidget* e_calendar_table_new (void); + + +void e_calendar_table_set_cal_client (ECalendarTable *cal_table, + CalClient *client); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _E_CALENDAR_TABLE_H_ */ diff --git a/calendar/gui/event-editor-dialog.glade b/calendar/gui/event-editor-dialog.glade index 8e6b2f6e30..d166bca079 100644 --- a/calendar/gui/event-editor-dialog.glade +++ b/calendar/gui/event-editor-dialog.glade @@ -72,7 +72,7 @@ <column_spacing>4</column_spacing> <child> <padding>0</padding> - <expand>True</expand> + <expand>False</expand> <fill>True</fill> </child> @@ -187,7 +187,7 @@ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <child> <padding>0</padding> - <expand>True</expand> + <expand>False</expand> <fill>True</fill> </child> @@ -327,11 +327,12 @@ </widget> <widget> - <class>GtkFrame</class> - <name>frame6</name> - <label>Alarms</label> - <label_xalign>0</label_xalign> - <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> + <class>GtkScrolledWindow</class> + <name>scrolledwindow3</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> <child> <padding>0</padding> <expand>True</expand> @@ -339,445 +340,11 @@ </child> <widget> - <class>GtkTable</class> - <name>table4</name> - <border_width>4</border_width> - <rows>4</rows> - <columns>5</columns> - <homogeneous>False</homogeneous> - <row_spacing>4</row_spacing> - <column_spacing>4</column_spacing> - - <widget> - <class>GtkSpinButton</class> - <name>alarm-display-amount</name> - <can_focus>True</can_focus> - <climb_rate>1</climb_rate> - <digits>0</digits> - <numeric>True</numeric> - <update_policy>GTK_UPDATE_ALWAYS</update_policy> - <snap>False</snap> - <wrap>False</wrap> - <value>0</value> - <lower>0</lower> - <upper>100</upper> - <step>1</step> - <page>10</page> - <page_size>10</page_size> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkSpinButton</class> - <name>alarm-audio-amount</name> - <can_focus>True</can_focus> - <climb_rate>1</climb_rate> - <digits>0</digits> - <numeric>False</numeric> - <update_policy>GTK_UPDATE_ALWAYS</update_policy> - <snap>False</snap> - <wrap>False</wrap> - <value>0</value> - <lower>0</lower> - <upper>100</upper> - <step>1</step> - <page>10</page> - <page_size>10</page_size> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkSpinButton</class> - <name>alarm-program-amount</name> - <can_focus>True</can_focus> - <climb_rate>1</climb_rate> - <digits>0</digits> - <numeric>False</numeric> - <update_policy>GTK_UPDATE_ALWAYS</update_policy> - <snap>False</snap> - <wrap>False</wrap> - <value>0</value> - <lower>0</lower> - <upper>100</upper> - <step>1</step> - <page>10</page> - <page_size>10</page_size> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkSpinButton</class> - <name>alarm-mail-amount</name> - <can_focus>True</can_focus> - <climb_rate>1</climb_rate> - <digits>0</digits> - <numeric>False</numeric> - <update_policy>GTK_UPDATE_ALWAYS</update_policy> - <snap>False</snap> - <wrap>False</wrap> - <value>0</value> - <lower>0</lower> - <upper>100</upper> - <step>1</step> - <page>10</page> - <page_size>10</page_size> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkOptionMenu</class> - <name>alarm-display-unit</name> - <can_focus>True</can_focus> - <items>Minutes -Hours -Days -</items> - <initial_choice>0</initial_choice> - <child> - <left_attach>2</left_attach> - <right_attach>3</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>False</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkOptionMenu</class> - <name>alarm-audio-unit</name> - <can_focus>True</can_focus> - <items>Minutes -Hours -Days -</items> - <initial_choice>0</initial_choice> - <child> - <left_attach>2</left_attach> - <right_attach>3</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>False</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkOptionMenu</class> - <name>alarm-program-unit</name> - <can_focus>True</can_focus> - <items>Minutes -Hours -Days -</items> - <initial_choice>0</initial_choice> - <child> - <left_attach>2</left_attach> - <right_attach>3</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>False</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkOptionMenu</class> - <name>alarm-mail-unit</name> - <can_focus>True</can_focus> - <items>Minutes -Hours -Days -</items> - <initial_choice>0</initial_choice> - <child> - <left_attach>2</left_attach> - <right_attach>3</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>False</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkEntry</class> - <name>alarm-mail-mail-to</name> - <can_focus>True</can_focus> - <editable>True</editable> - <text_visible>True</text_visible> - <text_max_length>0</text_max_length> - <text></text> - <child> - <left_attach>4</left_attach> - <right_attach>5</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GnomeFileEntry</class> - <name>alarm-program-run-program</name> - <max_saved>10</max_saved> - <directory>False</directory> - <modal>False</modal> - <child> - <left_attach>4</left_attach> - <right_attach>5</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - - <widget> - <class>GtkEntry</class> - <child_name>GnomeEntry:entry</child_name> - <name>alarm-program-run-program-entry</name> - <can_focus>True</can_focus> - <editable>True</editable> - <text_visible>True</text_visible> - <text_max_length>0</text_max_length> - <text></text> - </widget> - </widget> - - <widget> - <class>GtkCheckButton</class> - <name>alarm-display</name> - <can_focus>True</can_focus> - <label>_Display</label> - <active>False</active> - <draw_indicator>True</draw_indicator> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkCheckButton</class> - <name>alarm-audio</name> - <can_focus>True</can_focus> - <label>_Audio</label> - <active>False</active> - <draw_indicator>True</draw_indicator> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkCheckButton</class> - <name>alarm-program</name> - <can_focus>True</can_focus> - <label>_Program</label> - <active>False</active> - <draw_indicator>True</draw_indicator> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkCheckButton</class> - <name>alarm-mail</name> - <can_focus>True</can_focus> - <label>_Mail</label> - <active>False</active> - <draw_indicator>True</draw_indicator> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkLabel</class> - <name>label18</name> - <label>Mail _to:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>7.45058e-09</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <focus_target>alarm-mail-mail-to</focus_target> - <child> - <left_attach>3</left_attach> - <right_attach>4</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkLabel</class> - <name>label17</name> - <label>_Run program:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <focus_target>alarm-program-run-program-entry</focus_target> - <child> - <left_attach>3</left_attach> - <right_attach>4</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <class>GtkText</class> + <name>description</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text></text> </widget> </widget> @@ -789,7 +356,7 @@ Days <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <child> <padding>0</padding> - <expand>True</expand> + <expand>False</expand> <fill>True</fill> </child> @@ -862,6 +429,461 @@ Days </widget> <widget> + <class>GtkTable</class> + <name>table4</name> + <border_width>4</border_width> + <rows>4</rows> + <columns>5</columns> + <homogeneous>False</homogeneous> + <row_spacing>4</row_spacing> + <column_spacing>4</column_spacing> + + <widget> + <class>GtkSpinButton</class> + <name>alarm-display-amount</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>True</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>1</step> + <page>10</page> + <page_size>10</page_size> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkSpinButton</class> + <name>alarm-audio-amount</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>False</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>1</step> + <page>10</page> + <page_size>10</page_size> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkSpinButton</class> + <name>alarm-program-amount</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>False</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>1</step> + <page>10</page> + <page_size>10</page_size> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkSpinButton</class> + <name>alarm-mail-amount</name> + <can_focus>True</can_focus> + <climb_rate>1</climb_rate> + <digits>0</digits> + <numeric>False</numeric> + <update_policy>GTK_UPDATE_ALWAYS</update_policy> + <snap>False</snap> + <wrap>False</wrap> + <value>0</value> + <lower>0</lower> + <upper>100</upper> + <step>1</step> + <page>10</page> + <page_size>10</page_size> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkOptionMenu</class> + <name>alarm-display-unit</name> + <can_focus>True</can_focus> + <items>Minutes +Hours +Days +</items> + <initial_choice>0</initial_choice> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkOptionMenu</class> + <name>alarm-audio-unit</name> + <can_focus>True</can_focus> + <items>Minutes +Hours +Days +</items> + <initial_choice>0</initial_choice> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkOptionMenu</class> + <name>alarm-program-unit</name> + <can_focus>True</can_focus> + <items>Minutes +Hours +Days +</items> + <initial_choice>0</initial_choice> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkOptionMenu</class> + <name>alarm-mail-unit</name> + <can_focus>True</can_focus> + <items>Minutes +Hours +Days +</items> + <initial_choice>0</initial_choice> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>alarm-mail-mail-to</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <left_attach>4</left_attach> + <right_attach>5</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GnomeFileEntry</class> + <name>alarm-program-run-program</name> + <max_saved>10</max_saved> + <directory>False</directory> + <modal>False</modal> + <child> + <left_attach>4</left_attach> + <right_attach>5</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GnomeEntry:entry</child_name> + <name>alarm-program-run-program-entry</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + </widget> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>alarm-display</name> + <can_focus>True</can_focus> + <label>_Display</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>alarm-audio</name> + <can_focus>True</can_focus> + <label>_Audio</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>alarm-program</name> + <can_focus>True</can_focus> + <label>_Program</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkCheckButton</class> + <name>alarm-mail</name> + <can_focus>True</can_focus> + <label>_Mail</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label18</name> + <label>Mail _to:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>7.45058e-09</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <focus_target>alarm-mail-mail-to</focus_target> + <child> + <left_attach>3</left_attach> + <right_attach>4</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label17</name> + <label>_Run program:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <focus_target>alarm-program-run-program-entry</focus_target> + <child> + <left_attach>3</left_attach> + <right_attach>4</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label42</name> + <label>Reminder</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + + <widget> <class>GtkVBox</class> <name>vbox3</name> <border_width>6</border_width> diff --git a/calendar/gui/event-editor-dialog.glade.h b/calendar/gui/event-editor-dialog.glade.h index c789432d31..d921f3746a 100644 --- a/calendar/gui/event-editor-dialog.glade.h +++ b/calendar/gui/event-editor-dialog.glade.h @@ -11,7 +11,11 @@ gchar *s = N_("Time"); gchar *s = N_("Start time:"); gchar *s = N_("End time:"); gchar *s = N_("A_ll day event"); -gchar *s = N_("Alarms"); +gchar *s = N_("Classification"); +gchar *s = N_("Pu_blic"); +gchar *s = N_("Pri_vate"); +gchar *s = N_("_Confidential"); +gchar *s = N_("General"); gchar *s = N_("Minutes\n" "Hours\n" "Days\n" @@ -34,11 +38,7 @@ gchar *s = N_("_Program"); gchar *s = N_("_Mail"); gchar *s = N_("Mail _to:"); gchar *s = N_("_Run program:"); -gchar *s = N_("Classification"); -gchar *s = N_("Pu_blic"); -gchar *s = N_("Pri_vate"); -gchar *s = N_("_Confidential"); -gchar *s = N_("General"); +gchar *s = N_("Reminder"); gchar *s = N_("Recurrence rule"); gchar *s = N_("None"); gchar *s = N_("Daily"); diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c index caf653e1bc..ef5951368c 100644 --- a/calendar/gui/event-editor.c +++ b/calendar/gui/event-editor.c @@ -53,6 +53,8 @@ typedef struct { GtkWidget *end_time; GtkWidget *all_day_event; + GtkWidget *description; + GtkWidget *alarm_display; GtkWidget *alarm_program; GtkWidget *alarm_audio; @@ -331,6 +333,8 @@ get_widgets (EventEditor *ee) priv->end_time = GW ("end-time"); priv->all_day_event = GW ("all-day-event"); + priv->description = GW ("description"); + priv->alarm_display = GW ("alarm-display"); priv->alarm_program = GW ("alarm-program"); priv->alarm_audio = GW ("alarm-audio"); @@ -397,6 +401,7 @@ get_widgets (EventEditor *ee) && priv->start_time && priv->end_time && priv->all_day_event + && priv->description && priv->alarm_display && priv->alarm_program && priv->alarm_audio @@ -526,6 +531,8 @@ static void init_widgets (EventEditor *ee) { EventEditorPrivate *priv; + GnomeDateEdit *gde; + GtkWidget *widget; priv = ee->priv; @@ -576,6 +583,27 @@ init_widgets (EventEditor *ee) GTK_SIGNAL_FUNC (recurrence_exception_deleted), ee); gtk_signal_connect (GTK_OBJECT (priv->recurrence_exception_change), "clicked", GTK_SIGNAL_FUNC (recurrence_exception_changed), ee); + + /* Hide the stupid 'Calendar' labels. */ + gde = GNOME_DATE_EDIT (priv->start_time); + gtk_widget_hide (gde->cal_label); + widget = gde->date_entry; + gtk_box_set_child_packing (GTK_BOX (widget->parent), widget, + FALSE, FALSE, 0, GTK_PACK_START); + widget = gde->time_entry; + gtk_box_set_child_packing (GTK_BOX (widget->parent), widget, + FALSE, FALSE, 0, GTK_PACK_START); + gtk_box_set_spacing (GTK_BOX (widget->parent), 2); + + gde = GNOME_DATE_EDIT (priv->end_time); + gtk_widget_hide (gde->cal_label); + widget = gde->date_entry; + gtk_box_set_child_packing (GTK_BOX (widget->parent), widget, + FALSE, FALSE, 0, GTK_PACK_START); + widget = gde->time_entry; + gtk_box_set_child_packing (GTK_BOX (widget->parent), widget, + FALSE, FALSE, 0, GTK_PACK_START); + gtk_box_set_spacing (GTK_BOX (widget->parent), 2); } /* Fills the widgets with default values */ @@ -593,6 +621,7 @@ clear_widgets (EventEditor *ee) e_dialog_editable_set (priv->general_owner, _("?")); e_dialog_editable_set (priv->general_summary, NULL); + e_dialog_editable_set (priv->description, NULL); /* Start and end times */ @@ -673,6 +702,7 @@ fill_widgets (EventEditor *ee) { EventEditorPrivate *priv; GList *list; + time_t dtstart, dtend; priv = ee->priv; @@ -689,13 +719,26 @@ fill_widgets (EventEditor *ee) e_dialog_editable_set (priv->general_summary, priv->ico->summary); + e_dialog_editable_set (priv->description, priv->ico->desc); + /* Start and end times */ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), ee); gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), ee); - e_dialog_dateedit_set (priv->start_time, priv->ico->dtstart); - e_dialog_dateedit_set (priv->end_time, priv->ico->dtend); + /* All-day events are inclusive, i.e. if the end date shown is 2nd Feb + then the event includes all of the 2nd Feb. We would normally show + 3rd Feb as the end date, since it really ends at midnight on 3rd, + so we have to subtract a day so we only show the 2nd. */ + dtstart = priv->ico->dtstart; + dtend = priv->ico->dtend; + if (time_day_begin (dtstart) == dtstart + && time_day_begin (dtend) == dtend) { + dtend = time_add_day (dtend, -1); + } + + e_dialog_dateedit_set (priv->start_time, dtstart); + e_dialog_dateedit_set (priv->end_time, dtend); gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time), ee); gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time), ee); @@ -875,13 +918,20 @@ dialog_to_ical_object (EventEditor *ee) if (ico->summary) g_free (ico->summary); - ico->summary = e_dialog_editable_get (priv->general_summary); + if (ico->desc) + g_free (ico->desc); + ico->desc = e_dialog_editable_get (priv->description); + ico->dtstart = e_dialog_dateedit_get (priv->start_time); ico->dtend = e_dialog_dateedit_get (priv->end_time); + /* If the all_day toggle is set, the end date is inclusive of the + entire day on which it points to. */ all_day_event = e_dialog_toggle_get (priv->all_day_event); + if (all_day_event) + ico->dtend = time_day_end (ico->dtend); ico->dalarm.enabled = e_dialog_toggle_get (priv->alarm_display); ico->aalarm.enabled = e_dialog_toggle_get (priv->alarm_program); @@ -1586,8 +1636,8 @@ check_all_day (EventEditor *ee) ev_end = e_dialog_dateedit_get (priv->end_time); /* all day event checkbox */ - if (get_time_t_hour (ev_start) <= day_begin && - get_time_t_hour (ev_end) >= day_end) + if (time_day_begin (ev_start) == ev_start + && time_day_begin (ev_end) == ev_end) e_dialog_toggle_set (priv->all_day_event, TRUE); else e_dialog_toggle_set (priv->all_day_event, FALSE); @@ -1600,24 +1650,57 @@ static void set_all_day (GtkWidget *toggle, EventEditor *ee) { EventEditorPrivate *priv; - struct tm tm; - time_t start_t; + struct tm start_tm, end_tm; + time_t start_t, end_t; + gboolean all_day; + int flags; priv = ee->priv; + /* If the all_day toggle is set, the end date is inclusive of the + entire day on which it points to. */ + all_day = GTK_TOGGLE_BUTTON (toggle)->active; + start_t = e_dialog_dateedit_get (priv->start_time); - tm = *localtime (&start_t); - tm.tm_hour = day_begin; - tm.tm_min = 0; - tm.tm_sec = 0; - e_dialog_dateedit_set (priv->start_time, mktime (&tm)); - - if (GTK_TOGGLE_BUTTON (toggle)->active) - tm.tm_hour = day_end; + start_tm = *localtime (&start_t); + start_tm.tm_min = 0; + start_tm.tm_sec = 0; + + if (all_day) + start_tm.tm_hour = 0; else - tm.tm_hour++; + start_tm.tm_hour = day_begin; + + e_dialog_dateedit_set (priv->start_time, mktime (&start_tm)); + + end_t = e_dialog_dateedit_get (priv->end_time); + end_tm = *localtime (&end_t); + end_tm.tm_min = 0; + end_tm.tm_sec = 0; + + if (all_day) { + /* mktime() will fix this if we go past the end of the month.*/ + end_tm.tm_hour = 0; + } else { + if (end_tm.tm_year == start_tm.tm_year + && end_tm.tm_mon == start_tm.tm_mon + && end_tm.tm_mday == start_tm.tm_mday + && end_tm.tm_hour <= start_tm.tm_hour) + end_tm.tm_hour = start_tm.tm_hour + 1; + } - e_dialog_dateedit_set (priv->end_time, mktime (&tm)); + flags = gnome_date_edit_get_flags (GNOME_DATE_EDIT (priv->start_time)); + if (all_day) + flags &= ~GNOME_DATE_EDIT_SHOW_TIME; + else + flags |= GNOME_DATE_EDIT_SHOW_TIME; + gnome_date_edit_set_flags (GNOME_DATE_EDIT (priv->start_time), flags); + gnome_date_edit_set_flags (GNOME_DATE_EDIT (priv->end_time), flags); + + e_dialog_dateedit_set (priv->end_time, mktime (&end_tm)); + + gtk_widget_hide (GNOME_DATE_EDIT (priv->start_time)->cal_label); + gtk_widget_hide (GNOME_DATE_EDIT (priv->end_time)->cal_label); } /* @@ -1680,7 +1763,7 @@ check_times (GnomeDateEdit *gde, EventEditor *ee) start = e_dialog_dateedit_get (priv->start_time); end = e_dialog_dateedit_get (priv->end_time); - if (start >= end) { + if (start > end) { tm_start = *localtime (&start); tm_end = *localtime (&end); diff --git a/calendar/gui/evolution-calendar-control.c b/calendar/gui/evolution-calendar-control.c new file mode 100644 index 0000000000..7ebe2b5f8e --- /dev/null +++ b/calendar/gui/evolution-calendar-control.c @@ -0,0 +1,201 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#include <config.h> +#include <gnome.h> +#include <glade/glade.h> +#include <bonobo.h> +#include <bonobo/bonobo-control.h> +#include <glade/glade.h> + +#ifdef USING_OAF +#include <liboaf/liboaf.h> +#else +#include <libgnorba/gnorba.h> +#endif + +#include <cal-util/timeutil.h> +#include <gui/alarm.h> +#include <gui/gnome-cal.h> +#include <gui/calendar-commands.h> + +#define PROPERTY_CALENDAR_URI "folder_uri" + +#define PROPERTY_CALENDAR_URI_IDX 1 + +#ifdef USING_OAF +#define CONTROL_FACTORY_ID "OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc" +#else +#define CONTROL_FACTORY_ID "control-factory:calendar" +#endif + +CORBA_Environment ev; +CORBA_ORB orb; + + +static void +control_activate_cb (BonoboControl *control, + gboolean activate, + gpointer user_data) +{ + if (activate) + calendar_control_activate (control, user_data); + else + calendar_control_deactivate (control); +} + + + +static void +init_bonobo (int *argc, char **argv) +{ +#ifdef USING_OAF + /* FIXME: VERSION instead of "0.0". */ + gnome_init_with_popt_table ("evolution-calendar", "0.0", + *argc, argv, oaf_popt_options, + 0, NULL); + oaf_init (*argc, argv); +#else + gnome_CORBA_init_with_popt_table ( + "evolution-calendar", "0.0", + argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); +#endif + + if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) + g_error (_("Could not initialize Bonobo")); + + glade_gnome_init (); +} + + + +static void +get_prop (BonoboPropertyBag *bag, + BonoboArg *arg, + guint arg_id, + gpointer user_data) +{ + /*GnomeCalendar *gcal = user_data;*/ + + switch (arg_id) { + + case PROPERTY_CALENDAR_URI_IDX: + /* + if (fb && fb->uri) + BONOBO_ARG_SET_STRING (arg, fb->uri); + else + BONOBO_ARG_SET_STRING (arg, ""); + */ + break; + + default: + g_warning ("Unhandled arg %d\n", arg_id); + } +} + +static void +set_prop (BonoboPropertyBag *bag, + const BonoboArg *arg, + guint arg_id, + gpointer user_data) +{ + GnomeCalendar *gcal = user_data; + char *filename; + + switch (arg_id) { + + case PROPERTY_CALENDAR_URI_IDX: + printf ("set_prop: '%s'\n", BONOBO_ARG_GET_STRING (arg)); + filename = g_strdup_printf ("%s/calendar.vcf", + BONOBO_ARG_GET_STRING (arg)); + calendar_set_uri (gcal, filename); + g_free (filename); + break; + + default: + g_warning ("Unhandled arg %d\n", arg_id); + break; + } +} + + +static void +calendar_properties_init (GnomeCalendar *gcal) +{ + gcal->properties = bonobo_property_bag_new (get_prop, set_prop, gcal); + + bonobo_property_bag_add (gcal->properties, + PROPERTY_CALENDAR_URI, + PROPERTY_CALENDAR_URI_IDX, + BONOBO_ARG_STRING, + NULL, + _("The URI that the calendar will display"), + 0); + + bonobo_control_set_property_bag (gcal->control, gcal->properties); +} + + + +static BonoboObject * +calendar_control_factory (BonoboGenericFactory *Factory, void *closure) +{ + BonoboControl *control; + + /* Create the control. */ + GnomeCalendar *cal = new_calendar (full_name, NULL, NULL, 0); + + gtk_widget_show (GTK_WIDGET (cal)); + + control = bonobo_control_new (GTK_WIDGET (cal)); + cal->control = control; + + calendar_properties_init (cal); + + gtk_signal_connect (GTK_OBJECT (control), "activate", + control_activate_cb, cal); + + return BONOBO_OBJECT (control); +} + + +static void +calendar_control_factory_init (void) +{ + static BonoboGenericFactory *factory = NULL; + + if (factory != NULL) + return; + + puts ("XXXXXX - initializing calendar factory!!!"); + + factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID, calendar_control_factory, NULL); + + if (factory == NULL) + g_error ("I could not register a Calendar control factory."); +} + + +int +main (int argc, char **argv) +{ + init_bonobo (&argc, argv); + glade_gnome_init (); + alarm_init (); + e_cursors_init (); + + init_calendar (); + + //g_log_set_always_fatal ((GLogLevelFlags) 0xFFFF); + g_log_set_always_fatal (G_LOG_LEVEL_ERROR | + G_LOG_LEVEL_CRITICAL | + G_LOG_LEVEL_WARNING); + + CORBA_exception_init (&ev); + + calendar_control_factory_init (); + component_factory_init (); + + bonobo_main (); + + return 0; +} diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c index 7ef0689cc1..6d1ead3118 100644 --- a/calendar/gui/gncal-todo.c +++ b/calendar/gui/gncal-todo.c @@ -9,6 +9,7 @@ #include <config.h> #include <string.h> #include <gnome.h> +#include <cal-client/cal-client.h> #include "event-editor.h" #include "gncal-todo.h" #include "calendar-commands.h" @@ -59,7 +60,7 @@ static void ok_button (GtkWidget *widget, GnomeDialog *dialog) { iCalObject *ico; - GncalTodo *todo; + CalClient *cal_client; GtkEntry *entry; GnomeDateEdit *due_date; GtkText *comment; @@ -67,7 +68,7 @@ ok_button (GtkWidget *widget, GnomeDialog *dialog) ico = gtk_object_get_user_data (GTK_OBJECT (dialog)); - todo = GNCAL_TODO (gtk_object_get_data (GTK_OBJECT (dialog), "gncal_todo")); + cal_client = (CalClient*) (gtk_object_get_data (GTK_OBJECT (dialog), "cal_client")); entry = GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (dialog), "summary_entry")); due_date = GNOME_DATE_EDIT (gtk_object_get_data(GTK_OBJECT(dialog), "due_date")); priority = GTK_SPIN_BUTTON (gtk_object_get_data(GTK_OBJECT(dialog), "priority")); @@ -82,7 +83,7 @@ ok_button (GtkWidget *widget, GnomeDialog *dialog) ico->comment = gtk_editable_get_chars( GTK_EDITABLE(comment), 0, -1); ico->user_data = NULL; - if (!cal_client_update_object (todo->calendar->client, ico)) + if (!cal_client_update_object (cal_client, ico)) g_message ("ok_button(): Could not update the object!"); ical_object_unref (ico); @@ -113,8 +114,10 @@ delete_event (GtkWidget *widget, GdkEvent *event, GnomeDialog *dialog) return TRUE; } -static void -simple_todo_editor (GncalTodo *todo, iCalObject *ico) +/* I've hacked this so we can use it separate from the rest of GncalTodo. + This whole file will go once we've got the new editor working. */ +void +gncal_todo_edit (CalClient *client, iCalObject *ico) { GtkWidget *dialog; GtkWidget *hbox; @@ -138,8 +141,10 @@ simple_todo_editor (GncalTodo *todo, iCalObject *ico) GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); +#if 0 gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (todo->calendar)))); +#endif hbox = gtk_hbox_new (FALSE, 4); gtk_container_border_width (GTK_CONTAINER (hbox), 4); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), @@ -228,7 +233,7 @@ simple_todo_editor (GncalTodo *todo, iCalObject *ico) gtk_object_set_user_data (GTK_OBJECT (dialog), ico); ical_object_ref (ico); - gtk_object_set_data (GTK_OBJECT (dialog), "gncal_todo", todo); + gtk_object_set_data (GTK_OBJECT (dialog), "cal_client", client); gtk_object_set_data (GTK_OBJECT (dialog), "summary_entry", entry); gtk_object_set_data (GTK_OBJECT (dialog), "due_date", due_entry); gtk_object_set_data (GTK_OBJECT (dialog), "priority", pri_spin); @@ -271,14 +276,18 @@ add_todo (GncalTodo *todo) ico->type = ICAL_TODO; ico->new = TRUE; - simple_todo_editor (todo, ico); +#if 0 + gncal_todo_edit (todo, ico); +#endif ical_object_unref (ico); } static void edit_todo (GncalTodo *todo) { - simple_todo_editor (todo, get_clist_selected_ico (todo->clist)); +#if 0 + gncal_todo_edit (todo, get_clist_selected_ico (todo->clist)); +#endif } static void diff --git a/calendar/gui/gncal-todo.h b/calendar/gui/gncal-todo.h index 51cfadea3f..6034df295b 100644 --- a/calendar/gui/gncal-todo.h +++ b/calendar/gui/gncal-todo.h @@ -49,6 +49,7 @@ GtkWidget *gncal_todo_new (GnomeCalendar *calendar); void gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags); +void gncal_todo_edit (CalClient *client, iCalObject *ico); END_GNOME_DECLS diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 6291cd67cd..bf3ce408d5 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -23,10 +23,10 @@ #include <cal-util/timeutil.h> #include "dialogs/alarm-notify-dialog.h" #include "alarm.h" +#include "e-calendar-table.h" #include "e-day-view.h" #include "e-week-view.h" #include "event-editor.h" -#include "gncal-todo.h" #include "gnome-cal.h" #include "calendar-commands.h" @@ -208,9 +208,17 @@ setup_widgets (GnomeCalendar *gcal) gcal); /* The ToDo list. */ +#if 0 gcal->todo = gncal_todo_new (gcal); e_paned_pack2 (E_PANED (vpane), gcal->todo, TRUE, TRUE); gtk_widget_show (gcal->todo); +#endif + + gcal->todo = e_calendar_table_new (); + e_paned_pack2 (E_PANED (vpane), gcal->todo, TRUE, TRUE); + gtk_widget_show (gcal->todo); + e_calendar_table_set_cal_client (E_CALENDAR_TABLE (gcal->todo), + gcal->client); /* The Day View. */ @@ -796,7 +804,9 @@ gnome_calendar_update_all (GnomeCalendar *cal) e_week_view_update_all_events (E_WEEK_VIEW (cal->week_view)); e_week_view_update_all_events (E_WEEK_VIEW (cal->month_view)); +#if 0 gncal_todo_update (GNCAL_TODO (cal->todo), NULL, TRUE); +#endif gnome_calendar_tag_calendar (cal, cal->gtk_calendar); } @@ -870,7 +880,9 @@ gnome_calendar_object_updated_cb (GtkWidget *cal_client, e_week_view_update_event (E_WEEK_VIEW (gcal->week_view), uid); e_week_view_update_event (E_WEEK_VIEW (gcal->month_view), uid); +#if 0 gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, TRUE); +#endif gnome_calendar_tag_calendar (gcal, gcal->gtk_calendar); } @@ -890,7 +902,9 @@ gnome_calendar_object_removed_cb (GtkWidget *cal_client, e_week_view_remove_event (E_WEEK_VIEW (gcal->week_view), uid); e_week_view_remove_event (E_WEEK_VIEW (gcal->month_view), uid); +#if 0 gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, CHANGE_ALL); +#endif gnome_calendar_tag_calendar (gcal, gcal->gtk_calendar); } @@ -931,7 +945,7 @@ typedef struct static void -gnome_calendar_load_cb (GtkWidget *cal_client, +gnome_calendar_load_cb (CalClient *cal_client, CalClientLoadStatus status, load_or_create_data *locd) { @@ -1242,7 +1256,9 @@ gnome_calendar_colors_changed (GnomeCalendar *gcal) g_return_if_fail (GNOME_IS_CALENDAR (gcal)); todo_style_changed = 1; +#if 0 gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, 0); +#endif } void @@ -1252,7 +1268,9 @@ gnome_calendar_todo_properties_changed (GnomeCalendar *gcal) g_return_if_fail (GNOME_IS_CALENDAR (gcal)); todo_style_changed = 1; +#if 0 gncal_todo_update (GNCAL_TODO (gcal->todo), NULL, 0); +#endif } diff --git a/calendar/gui/main.c b/calendar/gui/main.c index de8d8e1c2a..6876fbd6b5 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -75,6 +75,7 @@ main (int argc, char **argv) init_bonobo (&argc, argv); glade_gnome_init (); alarm_init (); + e_cursors_init (); init_calendar (); diff --git a/calendar/gui/task-assigned-to.xpm b/calendar/gui/task-assigned-to.xpm new file mode 100644 index 0000000000..f5b0ab6f25 --- /dev/null +++ b/calendar/gui/task-assigned-to.xpm @@ -0,0 +1,120 @@ +/* XPM */ +static char * task_assigned_to_xpm[] = { +"16 16 101 2", +" c None", +". c #0F0E0D", +"+ c #3B2F22", +"@ c #080808", +"# c #292623", +"$ c #CBBFAD", +"% c #BEA47E", +"& c #AD9A7E", +"* c #000000", +"= c #232221", +"- c #CDC8C1", +"; c #CBC5BF", +"> c #766D62", +", c #887053", +"' c #A38664", +") c #A49887", +"! c #F6DEBC", +"~ c #957D59", +"{ c #151211", +"] c #F3EFEA", +"^ c #BBB7B0", +"/ c #A69E97", +"( c #FEFEFE", +"_ c #F8F7F5", +": c #524C45", +"< c #BBA382", +"[ c #A59176", +"} c #F6DBB8", +"| c #E79E3C", +"1 c #CB783E", +"2 c #171716", +"3 c #EFE8DF", +"4 c #716A61", +"5 c #FDFCFC", +"6 c #605D57", +"7 c #26221F", +"8 c #86735E", +"9 c #D5C0A0", +"0 c #C4AD8B", +"a c #F9E9D5", +"b c #C97138", +"c c #121110", +"d c #E9E8E7", +"e c #73604D", +"f c #332F29", +"g c #534C40", +"h c #D3BFA0", +"i c #D0BB98", +"j c #D0BA96", +"k c #F9E7D1", +"l c #CA773D", +"m c #090807", +"n c #B1B1AF", +"o c #FBFBF9", +"p c #CAB290", +"q c #D5C0A1", +"r c #D0BA97", +"s c #FBEFDF", +"t c #CB793E", +"u c #272625", +"v c #F4F4F4", +"w c #F4EFE7", +"x c #D0BA98", +"y c #CFB896", +"z c #F9EAD5", +"A c #CC793A", +"B c #0F0F0D", +"C c #100F0E", +"D c #494949", +"E c #FDFCFB", +"F c #DACBB0", +"G c #F5D9B4", +"H c #CA7537", +"I c #B79F80", +"J c #B0A693", +"K c #262525", +"L c #939292", +"M c #ECE3D5", +"N c #FBF3E8", +"O c #CA7337", +"P c #C7B08E", +"Q c #D3C2A5", +"R c #918776", +"S c #0B0A0A", +"T c #555453", +"U c #828282", +"V c #A09179", +"W c #897C67", +"X c #5B5245", +"Y c #191716", +"Z c #413E3C", +"` c #978368", +" . c #867C6A", +".. c #70685D", +"+. c #1C1B18", +"@. c #1D1C1A", +"#. c #575654", +"$. c #887B68", +"%. c #676055", +"&. c #141211", +"*. c #0F0F0E", +" ", +" . + @ @ ", +" @ # $ % & @ * * ", +" @ = - ; > , ' ) @ * ! ~ * ", +" { ] ^ / ( _ : < [ @ * } | 1 * ", +" 2 3 4 5 6 7 8 9 0 * a | b * ", +" c d e f g h i j * k | l * ", +" m n o p q r j * s | t * ", +" u v w x y * z | A * B ", +" C D E F * G | H * I J @ ", +" K L M * N O * P Q R S ", +" @ T * U * * V W X Y @ ", +" Z * * ` ...+.@ @ ", +" @.#.$.%.&.@ @ ", +" * *.@ @ ", +" @ @ "}; diff --git a/calendar/gui/task-assigned.xpm b/calendar/gui/task-assigned.xpm new file mode 100644 index 0000000000..89faae95f1 --- /dev/null +++ b/calendar/gui/task-assigned.xpm @@ -0,0 +1,120 @@ +/* XPM */ +static char * task_assigned_xpm[] = { +"16 16 101 2", +" c None", +". c #0F0E0D", +"+ c #3B2F22", +"@ c #080808", +"# c #292623", +"$ c #CBBFAD", +"% c #BEA47E", +"& c #AD9A7E", +"* c #000000", +"= c #232221", +"- c #CDC8C1", +"; c #CBC5BF", +"> c #766D62", +", c #887053", +"' c #A38664", +") c #A49887", +"! c #F6DEBC", +"~ c #957D59", +"{ c #151211", +"] c #F3EFEA", +"^ c #BBB7B0", +"/ c #A69E97", +"( c #FEFEFE", +"_ c #F8F7F5", +": c #524C45", +"< c #BBA382", +"[ c #A59176", +"} c #F6DBB8", +"| c #E79E3C", +"1 c #CB783E", +"2 c #171716", +"3 c #EFE8DF", +"4 c #716A61", +"5 c #FDFCFC", +"6 c #605D57", +"7 c #26221F", +"8 c #86735E", +"9 c #D5C0A0", +"0 c #C4AD8B", +"a c #F9E9D5", +"b c #C97138", +"c c #121110", +"d c #E9E8E7", +"e c #73604D", +"f c #332F29", +"g c #534C40", +"h c #D3BFA0", +"i c #D0BB98", +"j c #D0BA96", +"k c #F9E7D1", +"l c #CA773D", +"m c #090807", +"n c #B1B1AF", +"o c #FBFBF9", +"p c #CAB290", +"q c #D5C0A1", +"r c #D0BA97", +"s c #FBEFDF", +"t c #CB793E", +"u c #272625", +"v c #F4F4F4", +"w c #F4EFE7", +"x c #D0BA98", +"y c #CFB896", +"z c #F9EAD5", +"A c #CC793A", +"B c #0F0F0D", +"C c #100F0E", +"D c #494949", +"E c #FDFCFB", +"F c #DACBB0", +"G c #F5D9B4", +"H c #CA7537", +"I c #B79F80", +"J c #B0A693", +"K c #262525", +"L c #939292", +"M c #ECE3D5", +"N c #FBF3E8", +"O c #CA7337", +"P c #C7B08E", +"Q c #D3C2A5", +"R c #918776", +"S c #0B0A0A", +"T c #555453", +"U c #828282", +"V c #A09179", +"W c #897C67", +"X c #5B5245", +"Y c #191716", +"Z c #413E3C", +"` c #978368", +" . c #867C6A", +".. c #70685D", +"+. c #1C1B18", +"@. c #1D1C1A", +"#. c #575654", +"$. c #887B68", +"%. c #676055", +"&. c #141211", +"*. c #0F0F0E", +" ", +" . + @ @ ", +" @ # $ % & @ * * ", +" @ = - ; > , ' ) @ * ! ~ * ", +" { ] ^ / ( _ : < [ @ * } | 1 * ", +" 2 3 4 5 6 7 8 9 0 * a | b * ", +" c d e f g h i j * k | l * ", +" m n o p q r j * s | t * ", +" u v w x y * z | A * B ", +" C D E F * G | H * I J @ ", +" K L M * N O * P Q R S ", +" @ T * U * * V W X Y @ ", +" Z * * ` ...+.@ @ ", +" @.#.$.%.&.@ @ ", +" * *.@ @ ", +" @ @ "}; diff --git a/calendar/gui/task-recurring.xpm b/calendar/gui/task-recurring.xpm new file mode 100644 index 0000000000..b3c6126e03 --- /dev/null +++ b/calendar/gui/task-recurring.xpm @@ -0,0 +1,120 @@ +/* XPM */ +static char * task_recurring_xpm[] = { +"16 16 101 2", +" c None", +". c #0F0E0D", +"+ c #3B2F22", +"@ c #080808", +"# c #292623", +"$ c #CBBFAD", +"% c #BEA47E", +"& c #AD9A7E", +"* c #000000", +"= c #232221", +"- c #CDC8C1", +"; c #CBC5BF", +"> c #766D62", +", c #887053", +"' c #A38664", +") c #A49887", +"! c #F6DEBC", +"~ c #957D59", +"{ c #151211", +"] c #F3EFEA", +"^ c #BBB7B0", +"/ c #A69E97", +"( c #FEFEFE", +"_ c #F8F7F5", +": c #524C45", +"< c #BBA382", +"[ c #A59176", +"} c #F6DBB8", +"| c #E79E3C", +"1 c #CB783E", +"2 c #171716", +"3 c #EFE8DF", +"4 c #716A61", +"5 c #FDFCFC", +"6 c #605D57", +"7 c #26221F", +"8 c #86735E", +"9 c #D5C0A0", +"0 c #C4AD8B", +"a c #F9E9D5", +"b c #C97138", +"c c #121110", +"d c #E9E8E7", +"e c #73604D", +"f c #332F29", +"g c #534C40", +"h c #D3BFA0", +"i c #D0BB98", +"j c #D0BA96", +"k c #F9E7D1", +"l c #CA773D", +"m c #090807", +"n c #B1B1AF", +"o c #FBFBF9", +"p c #CAB290", +"q c #D5C0A1", +"r c #D0BA97", +"s c #FBEFDF", +"t c #CB793E", +"u c #272625", +"v c #F4F4F4", +"w c #F4EFE7", +"x c #D0BA98", +"y c #CFB896", +"z c #F9EAD5", +"A c #CC793A", +"B c #0F0F0D", +"C c #100F0E", +"D c #494949", +"E c #FDFCFB", +"F c #DACBB0", +"G c #F5D9B4", +"H c #CA7537", +"I c #B79F80", +"J c #B0A693", +"K c #262525", +"L c #939292", +"M c #ECE3D5", +"N c #FBF3E8", +"O c #CA7337", +"P c #C7B08E", +"Q c #D3C2A5", +"R c #918776", +"S c #0B0A0A", +"T c #555453", +"U c #828282", +"V c #A09179", +"W c #897C67", +"X c #5B5245", +"Y c #191716", +"Z c #413E3C", +"` c #978368", +" . c #867C6A", +".. c #70685D", +"+. c #1C1B18", +"@. c #1D1C1A", +"#. c #575654", +"$. c #887B68", +"%. c #676055", +"&. c #141211", +"*. c #0F0F0E", +" ", +" . + @ @ ", +" @ # $ % & @ * * ", +" @ = - ; > , ' ) @ * ! ~ * ", +" { ] ^ / ( _ : < [ @ * } | 1 * ", +" 2 3 4 5 6 7 8 9 0 * a | b * ", +" c d e f g h i j * k | l * ", +" m n o p q r j * s | t * ", +" u v w x y * z | A * B ", +" C D E F * G | H * I J @ ", +" K L M * N O * P Q R S ", +" @ T * U * * V W X Y @ ", +" Z * * ` ...+.@ @ ", +" @.#.$.%.&.@ @ ", +" * *.@ @ ", +" @ @ "}; diff --git a/calendar/gui/task.xpm b/calendar/gui/task.xpm new file mode 100644 index 0000000000..8115025e20 --- /dev/null +++ b/calendar/gui/task.xpm @@ -0,0 +1,120 @@ +/* XPM */ +static char * task_xpm[] = { +"16 16 101 2", +" c None", +". c #0F0E0D", +"+ c #3B2F22", +"@ c #080808", +"# c #292623", +"$ c #CBBFAD", +"% c #BEA47E", +"& c #AD9A7E", +"* c #000000", +"= c #232221", +"- c #CDC8C1", +"; c #CBC5BF", +"> c #766D62", +", c #887053", +"' c #A38664", +") c #A49887", +"! c #F6DEBC", +"~ c #957D59", +"{ c #151211", +"] c #F3EFEA", +"^ c #BBB7B0", +"/ c #A69E97", +"( c #FEFEFE", +"_ c #F8F7F5", +": c #524C45", +"< c #BBA382", +"[ c #A59176", +"} c #F6DBB8", +"| c #E79E3C", +"1 c #CB783E", +"2 c #171716", +"3 c #EFE8DF", +"4 c #716A61", +"5 c #FDFCFC", +"6 c #605D57", +"7 c #26221F", +"8 c #86735E", +"9 c #D5C0A0", +"0 c #C4AD8B", +"a c #F9E9D5", +"b c #C97138", +"c c #121110", +"d c #E9E8E7", +"e c #73604D", +"f c #332F29", +"g c #534C40", +"h c #D3BFA0", +"i c #D0BB98", +"j c #D0BA96", +"k c #F9E7D1", +"l c #CA773D", +"m c #090807", +"n c #B1B1AF", +"o c #FBFBF9", +"p c #CAB290", +"q c #D5C0A1", +"r c #D0BA97", +"s c #FBEFDF", +"t c #CB793E", +"u c #272625", +"v c #F4F4F4", +"w c #F4EFE7", +"x c #D0BA98", +"y c #CFB896", +"z c #F9EAD5", +"A c #CC793A", +"B c #0F0F0D", +"C c #100F0E", +"D c #494949", +"E c #FDFCFB", +"F c #DACBB0", +"G c #F5D9B4", +"H c #CA7537", +"I c #B79F80", +"J c #B0A693", +"K c #262525", +"L c #939292", +"M c #ECE3D5", +"N c #FBF3E8", +"O c #CA7337", +"P c #C7B08E", +"Q c #D3C2A5", +"R c #918776", +"S c #0B0A0A", +"T c #555453", +"U c #828282", +"V c #A09179", +"W c #897C67", +"X c #5B5245", +"Y c #191716", +"Z c #413E3C", +"` c #978368", +" . c #867C6A", +".. c #70685D", +"+. c #1C1B18", +"@. c #1D1C1A", +"#. c #575654", +"$. c #887B68", +"%. c #676055", +"&. c #141211", +"*. c #0F0F0E", +" ", +" . + @ @ ", +" @ # $ % & @ * * ", +" @ = - ; > , ' ) @ * ! ~ * ", +" { ] ^ / ( _ : < [ @ * } | 1 * ", +" 2 3 4 5 6 7 8 9 0 * a | b * ", +" c d e f g h i j * k | l * ", +" m n o p q r j * s | t * ", +" u v w x y * z | A * B ", +" C D E F * G | H * I J @ ", +" K L M * N O * P Q R S ", +" @ T * U * * V W X Y @ ", +" Z * * ` ...+.@ @ ", +" @.#.$.%.&.@ @ ", +" * *.@ @ ", +" @ @ "}; |