From 67336a8d362a3ddb78d3daa82375ab647d75f5e4 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 8 Feb 2001 20:50:49 +0000 Subject: Pull up from 0.9 branch 2001-02-08 JP Rosevear * gui/event-editor.c: Remove assorted menu/bonobo stuff * gui/dialogs/task-editor.c: Remove assorted menu/bonobo stuff (task_editor_construct): no longer suck out the glade contents into a bonobo win, listen for apply and close signals (tedit_apply_event_cb): listen for apply signal and save object (tedit_close_event_cb): listen for close signal and prompt to save if need be (task_editor_focus): new function to bring the dialog to the front * gui/dialogs/task-editor.h: new prototype * gui/e-meeting-edit.c (schedule_button_clicked_cb): no need to update widgets in the event editor since the event editor won't be open (e_meeting_editor_new): don't need the event editor reference any more * gui/e-meeting-edit.h: Change prototype * gui/e-day-view.c (e_day_view_on_event_right_click): Make schedule meeting a new contextual menu item (e_day_view_on_schedule_meet): new routine to schedule a meeting from the contextual menu * gui/e-calendar-table.c (e_calendar_table_open_task): Call task_editor_focus * gui/event-editor-dialog.glade: Update to be a property box * gui/dialogs/task-editor-dialog.glade: Update to be a property box svn path=/trunk/; revision=8115 --- calendar/ChangeLog | 61 +- calendar/gui/dialogs/task-editor-dialog.glade | 1040 ++++++++++++------------- calendar/gui/dialogs/task-editor.c | 208 ++--- calendar/gui/dialogs/task-editor.h | 16 +- calendar/gui/dialogs/task-page.glade | 1040 ++++++++++++------------- calendar/gui/e-calendar-table.c | 2 + calendar/gui/e-day-view.c | 41 +- calendar/gui/e-meeting-edit.c | 7 +- calendar/gui/e-meeting-edit.h | 5 +- calendar/gui/event-editor.c | 174 +---- 10 files changed, 1214 insertions(+), 1380 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 299d88078e..f4b252a734 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,38 @@ +2001-02-08 JP Rosevear + + * gui/event-editor.c: Remove assorted menu/bonobo stuff + + * gui/dialogs/task-editor.c: Remove assorted menu/bonobo stuff + (task_editor_construct): no longer suck out the glade contents + into a bonobo win, listen for apply and close signals + (tedit_apply_event_cb): listen for apply signal and save object + (tedit_close_event_cb): listen for close signal and prompt to save + if need be + (task_editor_focus): new function to bring the dialog to the front + + * gui/dialogs/task-editor.h: new prototype + + * gui/e-meeting-edit.c (schedule_button_clicked_cb): no need to + update widgets in the event editor since the event editor won't be + open + (e_meeting_editor_new): don't need the event editor reference any + more + + * gui/e-meeting-edit.h: Change prototype + + * gui/e-day-view.c (e_day_view_on_event_right_click): Make + schedule meeting a new contextual menu item + (e_day_view_on_schedule_meet): new routine to schedule a meeting + from the contextual menu + + * gui/e-calendar-table.c (e_calendar_table_open_task): Call + task_editor_focus + + * gui/event-editor-dialog.glade: Update to be a property box + + * gui/dialogs/task-editor-dialog.glade: Update to be a property + box + 2001-02-07 Iain Holmes * gui/calendar-summary.c (create_summary_view): Add a setter to the @@ -5,14 +40,6 @@ (set_property): The setter. (generate_html_summary): Sort the UIDs accodring to time. -2001-02-06 JP Rosevear - - * cal-util/cal-component.c (cal_component_set_categories): If the - categories string is empty, remove the property - (get_period_list): Fixes from clahey to handle the new rdate - format in libical - (set_period_list): ditto - 2001-02-06 JP Rosevear * gui/event-editor.c (fill_reminder_widgets): Match new @@ -31,6 +58,16 @@ * gui/dialogs/task-editor-dialog.glade: ditto +2001-02-07 JP Rosevear + + * gui/event-editor-dialog.glade: Fix spacing + +2001-02-06 JP Rosevear + + * gui/event-editor-dialog.glade: Gui tweaks for bugs 1248 and 1246 + + * gui/dialogs/task-editor-dialog.glade: ditto + 2001-02-06 JP Rosevear * gui/e-week-view.c (e_week_view_show_popup_menu): Make the menus more @@ -40,6 +77,14 @@ * gui/e-calendar-table.c: ditto +2001-02-06 JP Rosevear + + * cal-util/cal-component.c (cal_component_set_categories): If the + categories string is empty, remove the property + (get_period_list): Fixes from clahey to handle the new rdate + format in libical + (set_period_list): ditto + 2001-02-05 JP Rosevear * cal-util/cal-component.c (cal_component_alarm_set_trigger): Set diff --git a/calendar/gui/dialogs/task-editor-dialog.glade b/calendar/gui/dialogs/task-editor-dialog.glade index 000cb42cbd..98fc85ecf0 100644 --- a/calendar/gui/dialogs/task-editor-dialog.glade +++ b/calendar/gui/dialogs/task-editor-dialog.glade @@ -15,23 +15,28 @@ - GnomeApp + GnomePropertyBox task-editor-dialog False - task-editor-dialog - GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False - True + False False - True - GnomeDock - GnomeApp:dock - dock1 - True + GtkNotebook + GnomeDock:contents + notebook1 + 2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False 0 True @@ -39,33 +44,106 @@ - GtkNotebook - GnomeDock:contents - notebook1 - 2 - True - True - True - GTK_POS_TOP - False - 2 - 2 - False + GtkVBox + vbox1 + 4 + False + 4 - GtkVBox - vbox1 - 4 + GtkTable + table3 + 1 + 2 False - 4 + 4 + 4 + + 0 + False + True + + + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + summary + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkEntry + summary + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + + GtkHSeparator + hseparator1 + + 0 + False + True + + + + + GtkHBox + hbox4 + False + 0 + + 0 + False + True + GtkTable - table3 - 1 - 2 + table1 + 2 + 4 False - 4 + 2 4 0 @@ -75,47 +153,48 @@ GtkLabel - label3 - + label6 + GTK_JUSTIFY_CENTER False - 0.5 + 0 0.5 0 0 - summary 0 1 - 0 - 1 + 1 + 2 0 0 False False False False - False + True False - GtkEntry - summary - True - True - True - 0 - + GtkLabel + label5 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 - 1 - 2 + 0 + 1 0 1 0 0 - True + False False False False @@ -123,577 +202,488 @@ False - - - - GtkHSeparator - hseparator1 - - 0 - False - True - - - - - GtkHBox - hbox4 - False - 0 - - 0 - False - True - - - - GtkTable - table1 - 2 - 4 - False - 2 - 4 - - 0 - False - True - - - - 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 - - - - - GtkLabel - label9 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - percent-complete - - 2 - 3 - 0 - 1 - 0 - 0 - False - False - False - False - False - False - - - - - GtkSpinButton - percent-complete - 60 - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 - 0 - 100 - 10 - 10 - 10 - - 3 - 4 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - Custom - due-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:32:18 GMT - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - Custom - start-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:33:31 GMT - - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - - - GtkHSeparator - hseparator2 - - 0 - False - True - - - - - GtkHBox - hbox3 - False - 4 - - 0 - False - True - GtkLabel - label7 - + label9 + GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 - status + percent-complete - 0 - False - False + 2 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + False + False - GtkOptionMenu - status + GtkSpinButton + percent-complete + 60 True - Not Started -In Progress -Completed -Cancelled - - 0 - - 0 - False - False - - - - - GtkLabel - label8 - - GTK_JUSTIFY_CENTER + 1 + 0 + False + GTK_UPDATE_ALWAYS + False False - 0.5 - 0.5 - 0 - 0 - priority + 0 + 0 + 100 + 10 + 10 + 10 - 0 - False - False - - - - - GtkOptionMenu - priority - True - High -Normal -Low -Undefined - - 0 - - 0 - False - False + 3 + 4 + 0 + 1 + 0 + 0 + True + False + False + False + True + False - GtkLabel - label18 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - classification + Custom + due-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:32:18 GMT - 0 - False - False + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False - GtkOptionMenu - classification - True - None -Public -Private -Confidential - - 0 + Custom + start-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:33:31 GMT - 0 - False - False + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + GtkHSeparator + hseparator2 + + 0 + False + True + + + + + GtkHBox + hbox3 + False + 4 + + 0 + False + True + - GtkScrolledWindow - scrolledwindow1 - 150 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS + GtkLabel + label7 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + status 0 - True - True + False + False - - - GtkText - description - True - True - - - GtkHBox - hbox2 - False - 2 + GtkOptionMenu + status + True + Not Started +In Progress +Completed +Cancelled + + 0 0 False - True + False - - - GtkButton - contacts-button - True - - 0 - False - False - - - - GtkLabel - label16 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 4 - 0 - - - - - GtkEntry - contacts - True - True - True - 0 - - - 0 - True - True - - - - - GtkButton - categories-button - True - - 0 - False - False - - - - GtkLabel - label17 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 4 - 0 - - - - - GtkEntry - categories - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - Notebook:tab - label1 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table4 - 4 - 2 - 2 - False - 2 - 4 GtkLabel - label12 - + label8 + GTK_JUSTIFY_CENTER False - 0 + 0.5 0.5 0 0 + priority - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False + 0 + False + False + + + + + GtkOptionMenu + priority + True + High +Normal +Low +Undefined + + 0 + + 0 + False + False GtkLabel - label14 - + label18 + GTK_JUSTIFY_CENTER False - 0 + 0.5 0.5 0 0 + classification - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False + 0 + False + False + + + + + GtkOptionMenu + classification + True + None +Public +Private +Confidential + + 0 + + 0 + False + False + + + + + + GtkScrolledWindow + scrolledwindow1 + 150 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkText + description + True + True + + + + + + GtkHBox + hbox2 + False + 2 + + 0 + False + True + + + + GtkButton + contacts-button + True + + 0 + False + False + + + GtkLabel + label16 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 4 + 0 + GtkEntry - url + contacts True True True 0 - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False + 0 + True + True - Custom - completed-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:34:07 GMT + GtkButton + categories-button + True - 1 - 2 - 0 - 1 - 0 + 0 + False + False + + + + GtkLabel + label17 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 4 0 - True - False - False - False - True - False + + + + + GtkEntry + categories + True + True + True + 0 + + + 0 + True + True + + + + GtkLabel + Notebook:tab + label1 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkTable + table4 + 4 + 2 + 2 + False + 2 + 4 + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + GtkLabel - Notebook:tab - label2 - + label14 + GTK_JUSTIFY_CENTER False - 0.5 + 0 0.5 0 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkEntry + url + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + Custom + completed-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:34:07 GMT + + 1 + 2 + 0 + 1 + 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.c b/calendar/gui/dialogs/task-editor.c index 45961ded2b..936da0f8db 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -49,9 +49,6 @@ typedef struct { /* Glade XML data */ GladeXML *xml; - /* UI handler */ - BonoboUIComponent *uic; - /* Client to use */ CalClient *client; @@ -131,9 +128,9 @@ static const int classification_map[] = { static void task_editor_class_init (TaskEditorClass *class); static void task_editor_init (TaskEditor *tedit); -static gint app_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - gpointer data); +static void tedit_apply_event_cb (GtkWidget *widget, gint page_num, gpointer data); +static gint tedit_close_event_cb (GtkWidget *widget, gpointer data); +static gint tedit_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data); static void close_dialog (TaskEditor *tedit); static gboolean get_widgets (TaskEditor *tedit); static void init_widgets (TaskEditor *tedit); @@ -143,13 +140,6 @@ static void set_title_from_comp (TaskEditor *tedit, CalComponent *comp); static void clear_widgets (TaskEditor *tedit); static void fill_widgets (TaskEditor *tedit); -static void file_save_cb (BonoboUIComponent *uic, gpointer data, const char *path); -static void file_save_and_close_cb (BonoboUIComponent *uic, gpointer data, const char *path); -static void file_delete_cb (BonoboUIComponent *uic, gpointer data, const char *path); -static void file_close_cb (BonoboUIComponent *uic, gpointer data, const char *path); - -static void debug_xml_cb (BonoboUIComponent *uic, gpointer data, const char *path); - static void save_todo_object (TaskEditor *tedit); static void dialog_to_comp_object (TaskEditor *tedit); @@ -225,18 +215,6 @@ task_editor_new (void) return task_editor_construct (tedit); } -static BonoboUIVerb verbs [] = { - - BONOBO_UI_VERB ("FileSave", file_save_cb), - BONOBO_UI_VERB ("FileDelete", file_delete_cb), - BONOBO_UI_VERB ("FileClose", file_close_cb), - BONOBO_UI_VERB ("FileSaveAndClose", file_save_and_close_cb), - - BONOBO_UI_VERB ("DebugDumpXml", debug_xml_cb), - - BONOBO_UI_VERB_END -}; - /** * task_editor_construct: * @tedit: A #TaskEditor. @@ -251,7 +229,6 @@ TaskEditor * task_editor_construct (TaskEditor *tedit) { TaskEditorPrivate *priv; - GtkWidget *bonobo_win; g_return_val_if_fail (tedit != NULL, NULL); g_return_val_if_fail (IS_TASK_EDITOR (tedit), NULL); @@ -273,53 +250,17 @@ task_editor_construct (TaskEditor *tedit) init_widgets (tedit); - /* Construct the app */ - - priv->uic = bonobo_ui_component_new ("task-editor-dialog"); - if (!priv->uic) { - g_message ("task_editor_construct(): Could not create the UI component"); - goto error; - } - - bonobo_win = bonobo_window_new ("event-editor-dialog", "Event Editor"); - - /* FIXME: The sucking bit */ - { - GtkWidget *contents; - - contents = gnome_dock_get_client_area ( - GNOME_DOCK (GNOME_APP (priv->app)->dock)); - if (!contents) { - g_message ("event_editor_construct(): Could not get contents"); - goto error; - } - gtk_widget_ref (contents); - gtk_container_remove (GTK_CONTAINER (contents->parent), contents); - bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents); - gtk_widget_destroy (priv->app); - priv->app = GTK_WIDGET (bonobo_win); - } - - { - BonoboUIContainer *container = bonobo_ui_container_new (); - bonobo_ui_container_set_win (container, BONOBO_WINDOW (priv->app)); - bonobo_ui_component_set_container ( - priv->uic, bonobo_object_corba_objref (BONOBO_OBJECT (container))); - } - - bonobo_ui_component_add_verb_list_with_data ( - priv->uic, verbs, tedit); - - bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, - "evolution-task-editor-dialog.xml", - "evolution-task-editor"); - /* Hook to destruction of the dialog */ + gtk_signal_connect (GTK_OBJECT (priv->app), "apply", + GTK_SIGNAL_FUNC (tedit_apply_event_cb), tedit); + gtk_signal_connect (GTK_OBJECT (priv->app), "close", + GTK_SIGNAL_FUNC (tedit_close_event_cb), tedit); gtk_signal_connect (GTK_OBJECT (priv->app), "delete_event", - GTK_SIGNAL_FUNC (app_delete_event_cb), tedit); + GTK_SIGNAL_FUNC (tedit_delete_event_cb), tedit); + + /* Add focus to the summary entry */ + gtk_widget_grab_focus (GTK_WIDGET (priv->summary)); - /* Show the dialog */ - gtk_widget_show (priv->app); return tedit; @@ -342,10 +283,41 @@ task_editor_create_date_edit (void) return dedit; } +/* Callback used when the dialog box is destroyed */ +static void +tedit_apply_event_cb (GtkWidget *widget, gint page_num, gpointer data) +{ + TaskEditor *tedit; + + g_return_if_fail (IS_TASK_EDITOR (data)); + + tedit = TASK_EDITOR (data); + + if (page_num != -1) + return; + + save_todo_object (tedit); +} + +/* Callback used when the dialog box is destroyed */ +static gint +tedit_close_event_cb (GtkWidget *widget, gpointer data) +{ + TaskEditor *tedit; + + g_return_val_if_fail (IS_TASK_EDITOR (data), TRUE); + + tedit = TASK_EDITOR (data); + + if (prompt_to_save_changes (tedit)) + close_dialog (tedit); + + return TRUE; +} /* Callback used when the dialog box is destroyed */ static gint -app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +tedit_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { TaskEditor *tedit; @@ -490,11 +462,6 @@ task_editor_destroy (GtkObject *object) tedit = TASK_EDITOR (object); priv = tedit->priv; - if (priv->uic) { - bonobo_object_unref (BONOBO_OBJECT (priv->uic)); - priv->uic = NULL; - } - if (priv->app) { gtk_widget_destroy (priv->app); priv->app = NULL; @@ -680,6 +647,18 @@ task_editor_set_todo_object (TaskEditor *tedit, fill_widgets (tedit); } +void +task_editor_focus (TaskEditor *tedit) +{ + TaskEditorPrivate *priv; + + g_return_if_fail (tedit != NULL); + g_return_if_fail (IS_TASK_EDITOR (tedit)); + + priv = tedit->priv; + gtk_widget_show_now (priv->app); + raise_and_focus (priv->app); +} /* Creates an appropriate title for the task editor dialog */ static char * @@ -1019,80 +998,6 @@ dialog_to_comp_object (TaskEditor *tedit) cal_component_commit_sequence (comp); } -static void -debug_xml_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - TaskEditor *tedit = TASK_EDITOR (data); - TaskEditorPrivate *priv = tedit->priv; - - bonobo_window_dump (BONOBO_WINDOW (priv->app), "on demand"); -} - -/* File/Save callback */ -static void -file_save_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - TaskEditor *tedit; - - tedit = TASK_EDITOR (data); - save_todo_object (tedit); -} - -/* File/Save and Close callback */ -static void -file_save_and_close_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - TaskEditor *tedit; - - tedit = TASK_EDITOR (data); - save_todo_object (tedit); - close_dialog (tedit); -} - -/* File/Delete callback */ -static void -file_delete_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - TaskEditor *tedit; - TaskEditorPrivate *priv; - - tedit = TASK_EDITOR (data); - - g_return_if_fail (IS_TASK_EDITOR (tedit)); - - priv = tedit->priv; - - g_return_if_fail (priv->comp); - - if (delete_component_dialog (priv->comp, priv->app)) { - const char *uid; - - cal_component_get_uid (priv->comp, &uid); - - /* We don't check the return value; FALSE can mean the object - * was not in the server anyways. - */ - cal_client_remove_object (priv->client, uid); - - close_dialog (tedit); - } -} - -/* File/Close callback */ -static void -file_close_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - TaskEditor *tedit; - - g_return_if_fail (IS_TASK_EDITOR (data)); - - tedit = TASK_EDITOR (data); - - if (prompt_to_save_changes (tedit)) - close_dialog (tedit); -} - - static TaskEditorPriority priority_value_to_index (int priority_value) { @@ -1279,6 +1184,9 @@ task_editor_set_changed (TaskEditor *tedit, #endif priv->changed = changed; + + if (priv->app) + gnome_property_box_set_state (GNOME_PROPERTY_BOX (priv->app), changed); } diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h index 69e3bd41d8..7327803a72 100644 --- a/calendar/gui/dialogs/task-editor.h +++ b/calendar/gui/dialogs/task-editor.h @@ -54,15 +54,15 @@ struct _TaskEditorClass GtkObjectClass parent_class; }; +GtkType task_editor_get_type (void); +TaskEditor* task_editor_construct (TaskEditor *tedit); +TaskEditor* task_editor_new (void); +void task_editor_set_cal_client (TaskEditor *tedit, + CalClient *client); +void task_editor_set_todo_object (TaskEditor *tedit, + CalComponent *comp); +void task_editor_focus (TaskEditor *tedit); -GtkType task_editor_get_type (void); -TaskEditor* task_editor_construct (TaskEditor *tedit); -TaskEditor* task_editor_new (void); - -void task_editor_set_cal_client (TaskEditor *tedit, - CalClient *client); -void task_editor_set_todo_object (TaskEditor *tedit, - CalComponent *comp); END_GNOME_DECLS diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade index 000cb42cbd..98fc85ecf0 100644 --- a/calendar/gui/dialogs/task-page.glade +++ b/calendar/gui/dialogs/task-page.glade @@ -15,23 +15,28 @@ - GnomeApp + GnomePropertyBox task-editor-dialog False - task-editor-dialog - GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False - True + False False - True - GnomeDock - GnomeApp:dock - dock1 - True + GtkNotebook + GnomeDock:contents + notebook1 + 2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False 0 True @@ -39,33 +44,106 @@ - GtkNotebook - GnomeDock:contents - notebook1 - 2 - True - True - True - GTK_POS_TOP - False - 2 - 2 - False + GtkVBox + vbox1 + 4 + False + 4 - GtkVBox - vbox1 - 4 + GtkTable + table3 + 1 + 2 False - 4 + 4 + 4 + + 0 + False + True + + + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + summary + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkEntry + summary + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + + GtkHSeparator + hseparator1 + + 0 + False + True + + + + + GtkHBox + hbox4 + False + 0 + + 0 + False + True + GtkTable - table3 - 1 - 2 + table1 + 2 + 4 False - 4 + 2 4 0 @@ -75,47 +153,48 @@ GtkLabel - label3 - + label6 + GTK_JUSTIFY_CENTER False - 0.5 + 0 0.5 0 0 - summary 0 1 - 0 - 1 + 1 + 2 0 0 False False False False - False + True False - GtkEntry - summary - True - True - True - 0 - + GtkLabel + label5 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 - 1 - 2 + 0 + 1 0 1 0 0 - True + False False False False @@ -123,577 +202,488 @@ False - - - - GtkHSeparator - hseparator1 - - 0 - False - True - - - - - GtkHBox - hbox4 - False - 0 - - 0 - False - True - - - - GtkTable - table1 - 2 - 4 - False - 2 - 4 - - 0 - False - True - - - - 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 - - - - - GtkLabel - label9 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - percent-complete - - 2 - 3 - 0 - 1 - 0 - 0 - False - False - False - False - False - False - - - - - GtkSpinButton - percent-complete - 60 - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 - 0 - 100 - 10 - 10 - 10 - - 3 - 4 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - Custom - due-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:32:18 GMT - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - Custom - start-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:33:31 GMT - - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - - - GtkHSeparator - hseparator2 - - 0 - False - True - - - - - GtkHBox - hbox3 - False - 4 - - 0 - False - True - GtkLabel - label7 - + label9 + GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 - status + percent-complete - 0 - False - False + 2 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + False + False - GtkOptionMenu - status + GtkSpinButton + percent-complete + 60 True - Not Started -In Progress -Completed -Cancelled - - 0 - - 0 - False - False - - - - - GtkLabel - label8 - - GTK_JUSTIFY_CENTER + 1 + 0 + False + GTK_UPDATE_ALWAYS + False False - 0.5 - 0.5 - 0 - 0 - priority + 0 + 0 + 100 + 10 + 10 + 10 - 0 - False - False - - - - - GtkOptionMenu - priority - True - High -Normal -Low -Undefined - - 0 - - 0 - False - False + 3 + 4 + 0 + 1 + 0 + 0 + True + False + False + False + True + False - GtkLabel - label18 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - classification + Custom + due-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:32:18 GMT - 0 - False - False + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False - GtkOptionMenu - classification - True - None -Public -Private -Confidential - - 0 + Custom + start-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:33:31 GMT - 0 - False - False + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + GtkHSeparator + hseparator2 + + 0 + False + True + + + + + GtkHBox + hbox3 + False + 4 + + 0 + False + True + - GtkScrolledWindow - scrolledwindow1 - 150 - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS + GtkLabel + label7 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + status 0 - True - True + False + False - - - GtkText - description - True - True - - - GtkHBox - hbox2 - False - 2 + GtkOptionMenu + status + True + Not Started +In Progress +Completed +Cancelled + + 0 0 False - True + False - - - GtkButton - contacts-button - True - - 0 - False - False - - - - GtkLabel - label16 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 4 - 0 - - - - - GtkEntry - contacts - True - True - True - 0 - - - 0 - True - True - - - - - GtkButton - categories-button - True - - 0 - False - False - - - - GtkLabel - label17 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 4 - 0 - - - - - GtkEntry - categories - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - Notebook:tab - label1 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table4 - 4 - 2 - 2 - False - 2 - 4 GtkLabel - label12 - + label8 + GTK_JUSTIFY_CENTER False - 0 + 0.5 0.5 0 0 + priority - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False + 0 + False + False + + + + + GtkOptionMenu + priority + True + High +Normal +Low +Undefined + + 0 + + 0 + False + False GtkLabel - label14 - + label18 + GTK_JUSTIFY_CENTER False - 0 + 0.5 0.5 0 0 + classification - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False + 0 + False + False + + + + + GtkOptionMenu + classification + True + None +Public +Private +Confidential + + 0 + + 0 + False + False + + + + + + GtkScrolledWindow + scrolledwindow1 + 150 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkText + description + True + True + + + + + + GtkHBox + hbox2 + False + 2 + + 0 + False + True + + + + GtkButton + contacts-button + True + + 0 + False + False + + + GtkLabel + label16 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 4 + 0 + GtkEntry - url + contacts True True True 0 - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False + 0 + True + True - Custom - completed-date - task_editor_create_date_edit - 0 - 0 - Sun, 10 Sep 2000 17:34:07 GMT + GtkButton + categories-button + True - 1 - 2 - 0 - 1 - 0 + 0 + False + False + + + + GtkLabel + label17 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 4 0 - True - False - False - False - True - False + + + + + GtkEntry + categories + True + True + True + 0 + + + 0 + True + True + + + + GtkLabel + Notebook:tab + label1 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkTable + table4 + 4 + 2 + 2 + False + 2 + 4 + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + GtkLabel - Notebook:tab - label2 - + label14 + GTK_JUSTIFY_CENTER False - 0.5 + 0 0.5 0 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkEntry + url + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + Custom + completed-date + task_editor_create_date_edit + 0 + 0 + Sun, 10 Sep 2000 17:34:07 GMT + + 1 + 2 + 0 + 1 + 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/e-calendar-table.c b/calendar/gui/e-calendar-table.c index ab3db722b1..eb3bf5e2b4 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -524,6 +524,8 @@ e_calendar_table_open_task (ECalendarTable *cal_table, comp = calendar_model_get_component (cal_table->model, row); task_editor_set_todo_object (tedit, comp); + + task_editor_focus (tedit); } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index b84ce99157..bbf0732122 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -42,6 +42,7 @@ #include #include #include +#include "e-meeting-edit.h" /* Images */ #include "bell.xpm" @@ -324,6 +325,8 @@ static void e_day_view_on_delete_occurrence (GtkWidget *widget, gpointer data); static void e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data); +static void e_day_view_on_schedule_meet (GtkWidget *widget, + gpointer data); static void e_day_view_on_unrecur_appointment (GtkWidget *widget, gpointer data); static EDayViewEvent* e_day_view_get_popup_menu_event (EDayView *day_view); @@ -3008,6 +3011,10 @@ e_day_view_on_event_right_click (EDayView *day_view, }; static struct menu_item child_items[] = { + { N_("Schedule meeting"), (GtkSignalFunc) e_day_view_on_schedule_meet, NULL, TRUE }, + + { NULL, NULL, NULL, TRUE}, + { N_("Edit this appointment..."), (GtkSignalFunc) e_day_view_on_edit_appointment, NULL, TRUE }, { N_("Delete this appointment"), (GtkSignalFunc) e_day_view_on_delete_appointment, NULL, TRUE }, @@ -3018,6 +3025,7 @@ e_day_view_on_event_right_click (EDayView *day_view, static struct menu_item recur_child_items[] = { { N_("Make this appointment movable"), (GtkSignalFunc) e_day_view_on_unrecur_appointment, NULL, TRUE }, + { N_("Schedule meeting"), (GtkSignalFunc) e_day_view_on_schedule_meet, NULL, TRUE }, { NULL, NULL, NULL, TRUE}, @@ -3051,19 +3059,21 @@ e_day_view_on_event_right_click (EDayView *day_view, not_being_edited = TRUE; if (cal_component_has_recurrences (event->comp)) { - items = 7; + items = 8; context_menu = &recur_child_items[0]; context_menu[0].sensitive = not_being_edited; - context_menu[2].sensitive = not_being_edited; + context_menu[1].sensitive = not_being_edited; context_menu[3].sensitive = not_being_edited; context_menu[4].sensitive = not_being_edited; - context_menu[6].sensitive = have_selection; + context_menu[5].sensitive = not_being_edited; + context_menu[7].sensitive = have_selection; } else { - items = 4; + items = 6; context_menu = &child_items[0]; context_menu[0].sensitive = not_being_edited; - context_menu[1].sensitive = not_being_edited; - context_menu[3].sensitive = have_selection; + context_menu[2].sensitive = not_being_edited; + context_menu[3].sensitive = not_being_edited; + context_menu[5].sensitive = have_selection; } } @@ -3183,6 +3193,25 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data) } +static void +e_day_view_on_schedule_meet (GtkWidget *widget, gpointer data) +{ + EDayView *day_view; + EDayViewEvent *event; + EMeetingEditor *editor; + + day_view = E_DAY_VIEW (data); + + event = e_day_view_get_popup_menu_event (day_view); + if (event == NULL) + return; + + editor = e_meeting_editor_new (event->comp, day_view->client); + + e_meeting_edit (editor); + e_meeting_editor_free (editor); +} + static void e_day_view_on_unrecur_appointment (GtkWidget *widget, gpointer data) { diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c index e8280a151e..934c284ae7 100644 --- a/calendar/gui/e-meeting-edit.c +++ b/calendar/gui/e-meeting-edit.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -54,7 +55,6 @@ struct _EMeetingEditorPrivate { CalComponent *comp; CalClient *client; icalcomponent *icalcomp, *vevent; - EventEditor *ee; gint numentries; /* How many attendees are there? */ gboolean dirty; /* Has anything changed? */ @@ -454,8 +454,6 @@ schedule_button_clicked_cb (GtkWidget *widget, gpointer data) cal_component_free_datetime (&cal_dtstart); cal_component_free_datetime (&cal_dtend); - event_editor_update_widgets (priv->ee); - priv->dirty = TRUE; } @@ -831,7 +829,7 @@ organizer_changed_cb (GtkWidget *widget, gpointer data) /* ------------------------------------------------------------ */ EMeetingEditor * -e_meeting_editor_new (CalComponent *comp, CalClient *client, EventEditor *ee) +e_meeting_editor_new (CalComponent *comp, CalClient *client) { EMeetingEditor *object; EMeetingEditorPrivate *priv; @@ -843,7 +841,6 @@ e_meeting_editor_new (CalComponent *comp, CalClient *client, EventEditor *ee) priv->comp = comp; priv->client = client; priv->icalcomp = cal_component_get_icalcomponent (comp); - priv->ee = ee; object->priv = priv; diff --git a/calendar/gui/e-meeting-edit.h b/calendar/gui/e-meeting-edit.h index 8d564b2a5e..e29453ecba 100644 --- a/calendar/gui/e-meeting-edit.h +++ b/calendar/gui/e-meeting-edit.h @@ -27,7 +27,6 @@ #include #include #include -#include "event-editor.h" typedef struct _EMeetingEditor EMeetingEditor; @@ -36,8 +35,8 @@ struct _EMeetingEditor { }; -EMeetingEditor * e_meeting_editor_new (CalComponent *comp, CalClient *client, - EventEditor *ee); +EMeetingEditor * e_meeting_editor_new (CalComponent *comp, CalClient *client); + void e_meeting_edit (EMeetingEditor *editor); void e_meeting_editor_free (EMeetingEditor *editor); diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c index 420d8136ae..51dc50d90c 100644 --- a/calendar/gui/event-editor.c +++ b/calendar/gui/event-editor.c @@ -117,9 +117,6 @@ struct _EventEditorPrivate { /* Glade XML data */ GladeXML *xml; - /* UI handler */ - BonoboUIComponent *uic; - /* Client to use */ CalClient *client; @@ -329,11 +326,6 @@ event_editor_destroy (GtkObject *object) ee = EVENT_EDITOR (object); priv = ee->priv; - if (priv->uic) { - bonobo_object_unref (BONOBO_OBJECT (priv->uic)); - priv->uic = NULL; - } - free_exception_clist_data (GTK_CLIST (priv->recurrence_exception_list)); if (priv->app) { @@ -1010,7 +1002,8 @@ get_widgets (EventEditor *ee) #undef GW - return (priv->general_summary + return (priv->app + && priv->general_summary && priv->start_time && priv->end_time && priv->all_day_event @@ -2484,120 +2477,41 @@ close_dialog (EventEditor *ee) +/* Callback used when the dialog box is "applied" */ static void -debug_xml_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - EventEditor *ee = EVENT_EDITOR (data); - EventEditorPrivate *priv = ee->priv; - - bonobo_window_dump (BONOBO_WINDOW (priv->app), "on demand"); -} - -/* File/Save callback */ -static void -file_save_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - EventEditor *ee; - - ee = EVENT_EDITOR (data); - save_event_object (ee); -} - -/* File/Save and Close callback */ -static void -file_save_and_close_cb (BonoboUIComponent *uic, gpointer data, const char *path) +ee_apply_event_cb (GtkWidget *widget, gint page_num, gpointer data) { EventEditor *ee; - ee = EVENT_EDITOR (data); - save_event_object (ee); - close_dialog (ee); -} - -/* File/Delete callback */ -static void -file_delete_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - EventEditor *ee; - EventEditorPrivate *priv; + g_return_if_fail (IS_EVENT_EDITOR (data)); ee = EVENT_EDITOR (data); - g_return_if_fail (IS_EVENT_EDITOR (ee)); - - priv = ee->priv; - - g_return_if_fail (priv->comp); - - if (delete_component_dialog (priv->comp, priv->app)) { - const char *uid; - - cal_component_get_uid (priv->comp, &uid); - - /* We don't check the return value; FALSE can mean the object - * was not in the server anyways. - */ - cal_client_remove_object (priv->client, uid); - - close_dialog (ee); - } + if (page_num != -1) + return; + + save_event_object (ee); } -/* File/Close callback */ -static void -file_close_cb (BonoboUIComponent *uic, gpointer data, const char *path) +/* Callback used when the dialog box is destroyed */ +static gint +ee_close_event_cb (GtkWidget *widget, gpointer data) { EventEditor *ee; - g_return_if_fail (IS_EVENT_EDITOR (data)); + g_return_val_if_fail (IS_EVENT_EDITOR (data), TRUE); ee = EVENT_EDITOR (data); if (prompt_to_save_changes (ee)) close_dialog (ee); + + return TRUE; } -static void -schedule_meeting_cb (BonoboUIComponent *uic, gpointer data, const char *path) -{ - EventEditor *ee; - EventEditorPrivate *priv; - EMeetingEditor *editor; - - ee = EVENT_EDITOR (data); - - g_return_if_fail (IS_EVENT_EDITOR (ee)); - - priv = (EventEditorPrivate *)ee->priv; - - editor = e_meeting_editor_new (priv->comp, priv->client, ee); - e_meeting_edit (editor); - e_meeting_editor_free (editor); -} - - -/* - * NB. there is an insane amount of replication here between - * this and the task-editor. - */ -static BonoboUIVerb verbs [] = { - BONOBO_UI_VERB ("FileSave", file_save_cb), - BONOBO_UI_VERB ("FileDelete", file_delete_cb), - BONOBO_UI_VERB ("FileClose", file_close_cb), - BONOBO_UI_VERB ("FileSaveAndClose", file_save_and_close_cb), - - BONOBO_UI_VERB ("ActionScheduleMeeting", schedule_meeting_cb), - - BONOBO_UI_VERB ("DebugDumpXml", debug_xml_cb), - - BONOBO_UI_VERB_END -}; - - - /* Callback used when the dialog box is destroyed */ static gint -app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +ee_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { EventEditor *ee; @@ -2625,7 +2539,6 @@ EventEditor * event_editor_construct (EventEditor *ee) { EventEditorPrivate *priv; - GtkWidget *bonobo_win; g_return_val_if_fail (ee != NULL, NULL); g_return_val_if_fail (IS_EVENT_EDITOR (ee), NULL); @@ -2647,59 +2560,17 @@ event_editor_construct (EventEditor *ee) init_widgets (ee); - priv->uic = bonobo_ui_component_new ("event-editor-dialog"); - if (!priv->uic) { - g_message ("task_editor_construct(): Could not create the UI component"); - goto error; - } - - /* Construct the app */ - bonobo_win = bonobo_window_new ("event-editor-dialog", "Event Editor"); - - /* FIXME: The sucking bit */ - { - GtkWidget *contents; - - contents = gnome_dock_get_client_area ( - GNOME_DOCK (GNOME_APP (priv->app)->dock)); - if (!contents) { - g_message ("event_editor_construct(): Could not get contents"); - goto error; - } - gtk_widget_ref (contents); - gtk_container_remove (GTK_CONTAINER (contents->parent), contents); - bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents); - gtk_widget_destroy (priv->app); - priv->app = bonobo_win; - } - - { - BonoboUIContainer *container = bonobo_ui_container_new (); - bonobo_ui_container_set_win (container, BONOBO_WINDOW (priv->app)); - bonobo_ui_component_set_container ( - priv->uic, bonobo_object_corba_objref (BONOBO_OBJECT (container))); - } - - bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, ee); - - bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, - "evolution-event-editor.xml", - "evolution-event-editor"); - /* Hook to destruction of the dialog */ - + gtk_signal_connect (GTK_OBJECT (priv->app), "apply", + GTK_SIGNAL_FUNC (ee_apply_event_cb), ee); + gtk_signal_connect (GTK_OBJECT (priv->app), "close", + GTK_SIGNAL_FUNC (ee_close_event_cb), ee); gtk_signal_connect (GTK_OBJECT (priv->app), "delete_event", - GTK_SIGNAL_FUNC (app_delete_event_cb), ee); - + GTK_SIGNAL_FUNC (ee_delete_event_cb), ee); /* Add focus to the summary entry */ - gtk_widget_grab_focus (GTK_WIDGET (priv->general_summary)); - /* Show the dialog */ - - gtk_widget_show (priv->app); - return ee; error: @@ -3408,6 +3279,9 @@ event_editor_set_changed (EventEditor *ee, #endif priv->changed = changed; + + if (priv->app) + gnome_property_box_set_state (GNOME_PROPERTY_BOX (priv->app), changed); } -- cgit v1.2.3