diff options
author | JP Rosevear <jpr@ximian.com> | 2001-02-09 04:50:49 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-02-09 04:50:49 +0800 |
commit | 67336a8d362a3ddb78d3daa82375ab647d75f5e4 (patch) | |
tree | 960a83b5452aa68821e11432f6df60db03b64fe7 /calendar/gui/event-editor.c | |
parent | 2ca1db97c9db0d22865b668bf0f3a1d03f77cdb6 (diff) | |
download | gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar.gz gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar.bz2 gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar.lz gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar.xz gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.tar.zst gsoc2013-evolution-67336a8d362a3ddb78d3daa82375ab647d75f5e4.zip |
Pull up from 0.9 branch
2001-02-08 JP Rosevear <jpr@ximian.com>
* 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
Diffstat (limited to 'calendar/gui/event-editor.c')
-rw-r--r-- | calendar/gui/event-editor.c | 174 |
1 files changed, 24 insertions, 150 deletions
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); } |