From e4a68478f7fed9fdf32feae4cca56fb1f4b71411 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Thu, 18 Dec 2003 02:41:53 +0000 Subject: Add the concept of a source client, where the object lives currently. The 2003-12-17 Hans Petter Jansson * gui/dialogs/comp-editor.c: Add the concept of a source client, where the object lives currently. The plain client is where it will be stored. (comp_editor_finalize): If we have a source client, disconnect from and unref it. (save_comp): Check if the object is being moved, and if so, remove it from the source client, and make the target client the new source. (comp_editor_append_page): Connect to client_changed signal. (real_set_e_cal): Change an old gtk_signal_disconnect_by_data() to the GLib equivalent, and don't cast ECal to GtkObject. If the source client is not set, make it equivalent to the target client. (page_client_changed_cb): Implement. Handles a client change. * gui/dialogs/comp-editor-page.c (comp_editor_page_class_init): Add a new signal, "client_changed", that notifies that the ECal client was changed from one of the editor pages. (comp_editor_page_set_e_cal): Fix two bugs in this function; if the same client is set twice, its ref count could drop to 0. Additionally, it was unreffing the new client instead of the old one. (comp_editor_page_notify_client_changed): Implement. * gui/dialogs/event-page.c (event_page_fill_widgets): Fill in the source menu. (get_widgets): Get the source menu. (source_changed_cb): Implement. Try to open a client for the new source, and if successful, notify of the change. Show a dialog on failure, and revert to last selected source. (init_widgets): Connect to source menu. (event_page_create_source_option_menu): Implement Glade helper. * gui/dialogs/task-page.c (task_page_fill_widgets): Fill in the source menu. (get_widgets): Get the source menu. (source_changed_cb): Implement, similar to the event page, but for tasks. (init_widgets): Connect to source menu. (task_page_construct): Fix a message booboo. (task_page_create_source_option_menu): Implement Glade helper. * gui/dialogs/event-page.glade: Add source menu widget. * gui/dialogs/task-page.glade: Add source menu widget. svn path=/trunk/; revision=23974 --- calendar/gui/dialogs/comp-editor-page.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'calendar/gui/dialogs/comp-editor-page.h') diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index 6046a7c039..84d7d9d196 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -46,7 +46,8 @@ typedef struct { typedef struct { GtkObject object; - /* Some of the pages need the ECal to access timezone data. */ + /* Some of the pages need the ECal to access timezone data. Also, + * the event page needs to know it to fill the source option menu. */ ECal *client; /* The GtkAccelGroup for the page. We install this when the page is @@ -66,6 +67,7 @@ typedef struct { void (* summary_changed) (CompEditorPage *page, const char *summary); void (* dates_changed) (CompEditorPage *page, const char *dates); + void (* client_changed) (CompEditorPage *page, ECal *client); /* Virtual methods */ @@ -99,6 +101,8 @@ void comp_editor_page_notify_summary_changed (CompEditorPage *page, const char *summary); void comp_editor_page_notify_dates_changed (CompEditorPage *page, CompEditorPageDates *dates); +void comp_editor_page_notify_client_changed (CompEditorPage *page, + ECal *client); void comp_editor_page_display_validation_error (CompEditorPage *page, const char *msg, GtkWidget *field); -- cgit v1.2.3