From cd27c67fbc2f2a363579ce612c5937a4b12d1e49 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 25 Jul 2000 19:49:15 +0000 Subject: new ECalendarTable to show an ETable view for Todo/Event items. 2000-07-25 Damon Chaplin * 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 --- calendar/gui/dialogs/Makefile.am | 10 +- calendar/gui/dialogs/task-editor-dialog.glade | 822 ++++++++++++++++++++++++ calendar/gui/dialogs/task-editor-dialog.glade.h | 33 + calendar/gui/dialogs/task-editor.c | 482 ++++++++++++++ calendar/gui/dialogs/task-editor.h | 63 ++ calendar/gui/dialogs/task-page.glade | 822 ++++++++++++++++++++++++ 6 files changed, 2229 insertions(+), 3 deletions(-) create mode 100644 calendar/gui/dialogs/task-editor-dialog.glade create mode 100644 calendar/gui/dialogs/task-editor-dialog.glade.h create mode 100644 calendar/gui/dialogs/task-editor.c create mode 100644 calendar/gui/dialogs/task-editor.h create mode 100644 calendar/gui/dialogs/task-page.glade (limited to 'calendar/gui/dialogs') 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 @@ + + + + + task-editor-dialog + task-editor-dialog + + src + pixmaps + C + True + True + True + task-editor-dialog.glade.h + + + + GnomeApp + task-editor-dialog + False + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GnomeDock + GnomeApp:dock + dock1 + True + + 0 + True + True + + + + GtkNotebook + GnomeDock:contents + notebook1 + 2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + + GtkVBox + vbox1 + 4 + False + 4 + + + GtkTable + table3 + 2 + 2 + False + 4 + 4 + + 0 + False + True + + + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + entry1 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + GtkEntry + entry1 + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label10 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label11 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + GtkHSeparator + hseparator1 + + 0 + False + True + + + + + GtkHBox + hbox4 + False + 0 + + 0 + False + True + + + + GtkTable + table1 + 2 + 2 + False + 2 + 4 + + 0 + False + True + + + + GnomeDateEdit + dateedit1 + True + False + False + 7 + 19 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GnomeDateEdit + dateedit2 + True + True + False + 7 + 19 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label6 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label5 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + + GtkHSeparator + hseparator2 + + 0 + False + True + + + + + GtkHBox + hbox3 + False + 4 + + 0 + False + True + + + + GtkLabel + label7 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + combo-entry1 + + 0 + False + False + + + + + GtkCombo + combo1 + False + True + False + True + False + Not Started +In Progress +Completed +Cancelled + + + 0 + True + True + + + + GtkEntry + GtkCombo:entry + combo-entry1 + 60 + True + True + True + 0 + Not Started + + + + + GtkLabel + label8 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + combo-entry2 + + 0 + False + False + + + + + GtkCombo + combo2 + False + True + False + True + False + High +Normal +Low + + + 0 + True + True + + + + GtkEntry + GtkCombo:entry + combo-entry2 + 60 + True + False + True + 0 + High + + + + + GtkLabel + label9 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + spinbutton1 + + 0 + False + False + + + + + GtkSpinButton + spinbutton1 + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 10 + 10 + 10 + + 0 + True + True + + + + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkText + text1 + 150 + True + True + + + + + + GtkHBox + hbox2 + False + 2 + + 0 + False + True + + + + GtkButton + button3 + True + + + 0 + False + False + + + + + GtkEntry + entry2 + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + button4 + True + + + 0 + False + False + + + + + GtkEntry + entry3 + True + True + True + 0 + + + 0 + True + True + + + + + GtkCheckButton + checkbutton1 + True + + False + True + + 0 + False + False + + + + + + + GtkLabel + Notebook:tab + label1 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkTable + table4 + 4 + 4 + 2 + False + 2 + 4 + + + GnomeDateEdit + dateedit3 + True + True + False + 7 + 19 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label13 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + entry4 + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry5 + True + True + True + 0 + + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label15 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + entry6 + True + True + True + 0 + + + 1 + 2 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + + + GtkLabel + Notebook:tab + label2 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + 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 + * + * 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 +#include +#include +#include +#include +#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 + * + * 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 +#include +#include + +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 @@ + + + + + task-editor-dialog + task-editor-dialog + + src + pixmaps + C + True + True + True + task-editor-dialog.glade.h + + + + GnomeApp + task-editor-dialog + False + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GnomeDock + GnomeApp:dock + dock1 + True + + 0 + True + True + + + + GtkNotebook + GnomeDock:contents + notebook1 + 2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + + GtkVBox + vbox1 + 4 + False + 4 + + + GtkTable + table3 + 2 + 2 + False + 4 + 4 + + 0 + False + True + + + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + entry1 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + GtkEntry + entry1 + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label10 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label11 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + GtkHSeparator + hseparator1 + + 0 + False + True + + + + + GtkHBox + hbox4 + False + 0 + + 0 + False + True + + + + GtkTable + table1 + 2 + 2 + False + 2 + 4 + + 0 + False + True + + + + GnomeDateEdit + dateedit1 + True + False + False + 7 + 19 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GnomeDateEdit + dateedit2 + True + True + False + 7 + 19 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label6 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label5 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + + GtkHSeparator + hseparator2 + + 0 + False + True + + + + + GtkHBox + hbox3 + False + 4 + + 0 + False + True + + + + GtkLabel + label7 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + combo-entry1 + + 0 + False + False + + + + + GtkCombo + combo1 + False + True + False + True + False + Not Started +In Progress +Completed +Cancelled + + + 0 + True + True + + + + GtkEntry + GtkCombo:entry + combo-entry1 + 60 + True + True + True + 0 + Not Started + + + + + GtkLabel + label8 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + combo-entry2 + + 0 + False + False + + + + + GtkCombo + combo2 + False + True + False + True + False + High +Normal +Low + + + 0 + True + True + + + + GtkEntry + GtkCombo:entry + combo-entry2 + 60 + True + False + True + 0 + High + + + + + GtkLabel + label9 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + spinbutton1 + + 0 + False + False + + + + + GtkSpinButton + spinbutton1 + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 10 + 10 + 10 + + 0 + True + True + + + + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkText + text1 + 150 + True + True + + + + + + GtkHBox + hbox2 + False + 2 + + 0 + False + True + + + + GtkButton + button3 + True + + + 0 + False + False + + + + + GtkEntry + entry2 + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + button4 + True + + + 0 + False + False + + + + + GtkEntry + entry3 + True + True + True + 0 + + + 0 + True + True + + + + + GtkCheckButton + checkbutton1 + True + + False + True + + 0 + False + False + + + + + + + GtkLabel + Notebook:tab + label1 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkTable + table4 + 4 + 4 + 2 + False + 2 + 4 + + + GnomeDateEdit + dateedit3 + True + True + False + 7 + 19 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label13 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + entry4 + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry5 + True + True + True + 0 + + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label15 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + entry6 + True + True + True + 0 + + + 1 + 2 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + + + GtkLabel + Notebook:tab + label2 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + -- cgit v1.2.3