aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog2539
-rw-r--r--calendar/cal-client/cal-client.c453
-rw-r--r--calendar/cal-client/cal-client.h29
-rw-r--r--calendar/cal-util/cal-component.c60
-rw-r--r--calendar/cal-util/cal-component.h22
-rw-r--r--calendar/cal-util/cal-recur.c34
-rw-r--r--calendar/cal-util/cal-util.c30
-rw-r--r--calendar/cal-util/cal-util.h7
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c168
-rw-r--r--calendar/conduits/todo/todo-conduit.c77
-rw-r--r--calendar/gui/alarm-notify/.cvsignore7
-rw-r--r--calendar/gui/alarm-notify/Makefile.am58
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c248
-rw-r--r--calendar/gui/calendar-model.c135
-rw-r--r--calendar/gui/calendar-offline-handler.c53
-rw-r--r--calendar/gui/comp-editor-factory.c70
-rw-r--r--calendar/gui/comp-util.c3
-rw-r--r--calendar/gui/dialogs/Makefile.am26
-rw-r--r--calendar/gui/dialogs/alarm-options.c42
-rw-r--r--calendar/gui/dialogs/alarm-options.glade953
-rw-r--r--calendar/gui/dialogs/alarm-page.c373
-rw-r--r--calendar/gui/dialogs/alarm-page.glade827
-rw-r--r--calendar/gui/dialogs/cancel-comp.c14
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c30
-rw-r--r--calendar/gui/dialogs/comp-editor.c178
-rw-r--r--calendar/gui/dialogs/event-editor.c101
-rw-r--r--calendar/gui/dialogs/event-page.c195
-rw-r--r--calendar/gui/dialogs/event-page.glade1187
-rw-r--r--calendar/gui/dialogs/meeting-page.c315
-rw-r--r--calendar/gui/dialogs/meeting-page.h12
-rw-r--r--calendar/gui/dialogs/recur-comp.c24
-rw-r--r--calendar/gui/dialogs/recurrence-page.c510
-rw-r--r--calendar/gui/dialogs/schedule-page.c63
-rw-r--r--calendar/gui/dialogs/send-comp.c14
-rw-r--r--calendar/gui/dialogs/task-details-page.c78
-rw-r--r--calendar/gui/dialogs/task-details-page.glade643
-rw-r--r--calendar/gui/dialogs/task-editor.c118
-rw-r--r--calendar/gui/e-calendar-table.c240
-rw-r--r--calendar/gui/e-day-view.c583
-rw-r--r--calendar/gui/e-itip-control.c482
-rw-r--r--calendar/gui/e-meeting-attendee.c40
-rw-r--r--calendar/gui/e-meeting-model.c171
-rw-r--r--calendar/gui/e-tasks.c73
-rw-r--r--calendar/gui/e-week-view.c389
-rw-r--r--calendar/gui/gnome-cal.c323
-rw-r--r--calendar/gui/itip-control-factory.c282
-rw-r--r--calendar/gui/itip-utils.c255
-rw-r--r--calendar/gui/itip-utils.h15
-rw-r--r--calendar/gui/misc.c2
-rw-r--r--calendar/pcs/cal-backend-file.c619
-rw-r--r--calendar/pcs/cal-backend.c501
-rw-r--r--calendar/pcs/cal-backend.h33
-rw-r--r--calendar/pcs/cal.c265
53 files changed, 6161 insertions, 7808 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 89682e69c6..ce74a21ba9 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,514 +1,125 @@
-2003-04-01 JP Rosevear <jpr@ximian.com>
+2003-02-25 JP Rosevear <jpr@ximian.com>
- Fix for #17231 (Evo portion)
-
- * conduits/todo/todo-conduit.c (comp_from_remote_record): test for
- secret flag properly
-
- * conduits/calendar/calendar-conduit.c (comp_from_remote_record):
- ditto
-
-2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
- added filename (tasks.ics/calendar.ics) to the URI if it does not
- contain it.
-
-2003-03-31 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39961
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback):
- (e_meeting_time_selector_autopick_menu_position_callback): use the
- button's allocation to position the popup menu.
-
-2003-03-29 Not Zed <NotZed@Ximian.com>
-
- Fixes #39895
-
- * gui/e-day-view.h (EDayViewColors): add an unfocussed colour to
- draw the selection in when we're not focussed.
-
- * gui/e-day-view.c (e_day_view_realize): Initialise
- E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED to be 1/2 saturation of
- the focussed colour.
-
- * gui/e-day-view-main-item.c (e_day_view_main_item_draw): Use the
- UFOCUSSED colour if we aren't focussed, rather than just not
- drawing anything.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (get_servers): the shell client is a
- g_object now, ref appropriately
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (comp_destroy_cb)
- (e_day_view_on_long_event_button_press)
- (e_day_view_on_event_button_press)
- (e_day_view_on_long_event_click)
- (e_day_view_on_event_click)
- (e_day_view_on_event_double_click)
- (e_day_view_on_delete_appointment): Hold weak references to the
- CalComponent instead of connecting to the "destroy" signal.
-
- * gui/e-week-view.c (comp_destroy_cb)
- (e_week_view_on_text_item_event): Ditto.
-
-2003-03-28 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39954
-
- * gui/dialogs/recurrence-page.c (make_recurrence_special):
- Destroy would-be children of the container before the container.
-
-2003-03-28 JP Rosevear <jpr@ximian.com>
-
- * gui/dialogs/meeting-page.c (meeting_page_init): init new members
- (get_current_account): get a matching account for the currently
- selected user in the combo
- (meeting_page_finalize): unref the meeting attendee if there is
- one
- (meeting_page_fill_widgets): don't set the combo list here
- (clear_widgets): set the default organizer here and if we don't
- have an organizer, add the default organizer as an attendee
- (meeting_page_fill_component): use get_current_account
- (org_changed_cb): if this is a new meeting and the organizer
- changes, change the attendee
- (change_clicked_cb): no need to set the default here
- (init_widgets): reflect changed callback name
- (meeting_page_construct): set the combo strings here
- (popup_delete_cb): remove the organizer attendee if the user
- explicitly deletes it
-
- * gui/e-meeting-model.c (attendee_changed_cb): set row properly
-
- * gui/itip-utils.c (comp_to_list): skip the user themselves if
- cancelling or requesting
-
-2003-03-26 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c (gnome_calendar_import_data_fn): use
- g_object_unref for CalClient's.
- (create_checkboxes_control): use g_signal_connect.
-
- * cal-client/cal-client.c (cal_client_get_load_state): return correct
- values in g_return_val_if_fail.
-
-2003-03-26 Jack Jia <jack.jia@sun.com>
-
- * calendar/gui/dialogs/alarm-options.c
- (malarm_widgets_to_alarm): add a parameter(TC_CORBA_string) to
- the bonobo_widget_get_property.
+ * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
+ let the user change to an email organizer if the back end is not
+ an email address
+
+2003-02-20 JP Rosevear <jpr@ximian.com>
+
+ * gui/e-itip-control.c (class_init): override finalize, not
+ destroy
+ (start_calendar_server): take itip as a param and gtk_main_quit if
+ it gets destroyed while we are waiting for the cal client to load
+ (start_default_server): ditto
+ (get_servers): take itip as a param and don't load if we've been
+ destroyed, check for an except when retrieving the folder list
+ (init): ref the html control
+ (finalize): clean up, unref html control
+ (write_html): if the html widget has been destroyed, don't write
+ anything out
+ (show_current_todo): pass extra param
+ (show_current): ref/unref the itip control to avoid finalization while
+ we are working, pass extra param
+ (button_selected_cb): pass extra param
+ (object_requested_cb): ditto
+
+2003-02-18 JP Rosevear <jpr@ximian.com>
+
+ Fixes #38218
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * gui/itip-utils.c: Update for e_notice move
-
- * gui/tasks-control.c (confirm_expunge): Move the code that used
- to be e_gnome_dialog_set_parent here, since it was marked
- deprecated and this was the only place using it.
-
- * gui/dialogs/comp-editor.c: Update for e_notice move
- (page_changed_cb, page_summary_changed_cb, page_dates_changed_cb):
- Pass a parent_window to e_notice.
-
- * gui/dialogs/meeting-page.c: Update for e_notice move.
- (meeting_page_fill_component, meeting_page_fill_component,
- popup_delegate_cb): Pass a parent_window to e_notice
-
-2003-03-25 Dan Winship <danw@ximian.com>
-
- * cal-util/cal-util.c (cal_util_parse_ics_file): Utility wrapper
- around icalparser.
-
- * cal-util/test-recur.c (main): Use it
-
- * pcs/cal-backend-file.c (open_cal): Likewise
-
- * gui/comp-editor-factory.c (open_client): Add the OpenClient to
- the hash before calling cal_client_open_calendar, since in some
- failure cases, that will call cal_opened_cb (which will free the
- oc) with a failure immediately, causing a crash if we then try to
- deref it.
+ * gui/calendar-offline-handler.c (backend_cal_opened_online): set
+ the backend to REMOTE mode when it opens
+ (backend_go_online): prepare to set calendar mode to REMOTE
+ (impl_goOnline): get all the local calendars and set to REMOTE
-2003-03-21 JP Rosevear <jpr@ximian.com>
+2003-02-11 JP Rosevear <jpr@ximian.com>
- Fixes #32248
+ Fixes #37881
- * conduits/todo/todo-conduit.c (comp_from_remote_record): make
- sure the due date is actually a date
+ * gui/e-meeting-model.c (process_section): if the attendee is the
+ empty string, try to get the email
-2003-03-21 JP Rosevear <jpr@ximian.com>
+2003-02-11 JP Rosevear <jpr@ximian.com>
- Fixes #31660
+ Fixes #37883
- * conduits/calendar/calendar-conduit.c (rrules_mostly_equal):
- check if the rrules are equal other than until/count
- (find_last_cb): update the data with the start timet
- (local_record_from_comp): handle the case where the recurrence
- rule ends after a certain number occurrences
- (comp_from_remote_record): same
-
-2003-03-20 JP Rosevear <jpr@ximian.com>
-
- * conduits/calendar/calendar-conduit.c
- (e_calendar_context_destroy): calcomponents are gobjects now
- (calconduit_load_configuration): ref and sink to avoid warnings
-
- * conduits/todo/todo-conduit.c (todoconduit_load_configuration):
- ref and sink to avoid warnings
- (e_todo_context_destroy): calcomponents are gobjects now
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/cancel-comp.c (cancel_component_dialog): use a
- GtkMessageDialog and deal correctly with the dialog's reponses.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39770
-
- * gui/itip-utils.c (itip_Send_comp): check the CORBA exception instead
- of the g_return_val_if_fail. Also, use a CORBA_Object for the value
- returned from bonobo_activation_activate_from_id.
+ * idl/evolution-calendar.idl: getLdapAttribute can raise NotFound
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c: removed activation of shell_client.
- (importer_destroy_cb): no need to unref shell_client.
- (connect_to_shell): removed.
- (ical_importer_new, vcal_importer_new): don't call connect_to_shell.
-
-2003-03-20 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/ical-importer.c (get_uri_from_folder_path): removed.
- (load_file_fn, vcal_load_file_fn): use physical_uri instead of
- folderpath.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name".
- [#39692]
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/send-comp.c (send_component_dialog): use GtkMessageDialog
- instead of gnome_question_dialog, and deal correctly with the dialog's
- response.
-
-2003-03-18 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #34505
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added removal
- of the alarm itself in the calendar if the (new) argument says so.
- Also, set expecting_update flag to TRUE.
- (add_component_alarms): initialize expecting_update to FALSE.
- (remove_alarms): don't remove the component if expecting_update is
- TRUE.
- (obj_updated_cb, notify_dialog_cb, procedure_notification): adapted
- to changes in remove_queued_alarm.
+2003-02-11 JP Rosevear <jpr@ximian.com>
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #34095
-
- * gui/e-meeting-model.c (append_row): Don't leak meeting attendees;
- unref the attendee after it's assigned to model.
-
- * gui/dialogs/meeting-page.c (meeting_page_destroy): Free the actual
- array of deleted attendees.
-
- * gui/dialogs/event-editor.c (event_editor_destroy): Free the private
- structure.
-
- * gui/itip-utils.c (comp_description): Rework free/busy information
- composer so we can free date/time information after use. Then free it.
- (itip_send_comp): Free the allocated CORBA buffer for attachment data.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_component):
- Free the destination contacts string once we're done with it.
-
- * gui/e-calendar-table.c (invisible_destroyed): Unref the invisible.
-
- * gui/e-day-view.c (invisible_destroyed): Ditto.
-
- * gui/e-week-view.c (invisible_destroyed): Ditto.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39757
-
- * gui/dialogs/alarm-page.c (sensitize_buttons): Somehow this code
- reverted to thinking it was dealing with a GtkCList, when in reality
- it's a GtkTreeView. Fix that, so the buttons are sensitized correctly.
-
-2003-03-17 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes #39736
-
- * gui/e-day-view.c: Reduce the size of the large-digits font so it's
- en par with the one in 1.2.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39740
-
- * gui/e-meeting-model.c (is_cell_editable): check row number is valid
- before using it as index for the GPtrArray.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #39356
-
- * gui/Makefile.am:
- * gui/tasks-migrate.[ch]: removed tasks migration obsolete stuff.
-
- * gui/calendar-component.c (owner_set_cb): don't call tasks_migrate.
-
-2003-03-14 Rodrigo Moya <rodrigo@ximian.com>
+ Fixes #37806, #37697
- * pcs/cal-factory.c (impl_CalFactory_uriList): set_release
- on the sequence we create.
-
- * cal-client/cal-client.c (cal_client_uri_list): don't leak the
- string sequence returned by CalFactory_uriList.
-
-2003-03-13 Rodrigo Moya <rodrigo@ximian.com>
+ * gui/e-itip-control.c (e_itip_control_set_data): if the text is
+ null or the empty string, just clear the widget
+ (init): set the html widget to initially be blank
- * pcs/query-backend.c (query_backend_new): use a weak ref instead
- of connecting to backend's "destroy" signal.
- (backend_destroyed_cb, query_destroyed_cb): changed to be weak
- reference callbacks.
+2003-02-07 JP Rosevear <jpr@ximian.com>
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal.c (impl_Cal_get_ldap_attribute): implement
- * gui/dialogs/save-comp.c (save_component_dialog): don't use
- GNOME_STOCK_* defines, but GTK_STOCK_*.
-
-2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/save-comp.[ch] (save_component_dialog): corrected
- button ordering and changed the return type to be a GtkResponseType.
-
- * gui/dialogs/comp-editor.c (prompt_to_save_changes): adapted to
- changes in save_component_dialog.
-
-2003-03-11 Dan Winship <danw@ximian.com>
-
- * gui/calendar-config.c (on_timezone_set): Update for timezone
- dialog API changes.
-
- * gui/e-timezone-entry.c: Likewise
-
-2003-03-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_open): issue more descriptive
- warnings.
-
-2003-03-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify.c (alarm_notify_add_calendar): if we
- already have the client loaded, don't remove it, just increment its
- reference count.
-
- * gui/alarm-notify/alarm-queue.c (remove_queued_alarm): added new
- argument to specify whether we want the component's structure removed
- if no more alarms exist, and only free the structure if TRUE.
- (remove_alarms): added same new argument and pass it over to
- remove_queued_alarm.
- (remove_comp, obj_updated_cb): passed new argument to remove_alarms.
- (procedure_notification): passed new argument to remove_queued_alarm.
- (obj_removed_cb): set all freed pointers to NULL.
- (notify_dialog_cb): only remove the alarm if the pointers are not NULL.
-
-2003-03-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/save.c (get_calendars_to_load): create the array
- to be returned only once.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-queue.c (display_notification): ref the CalClient.
- (notify_dialog_cb): unref the CalClient.
-
-2003-03-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/alarm-notify-dialog.[ch]
- (alarm_notify_dialog_disable_buttons): new function.
- (alarm_notify_dialog): made it return a pointer to the dialog structure.
+ * pcs/cal-backend.h: add virtual method
- * gui/alarm-notify/alarm-queue.c (remove_alarms, remove_comp): splitted
- alarm removal out of remove_comp.
- (obj_updated_cb): remove the component only when needed. In normal
- updates, just update the internal structure.
- (edit_component): don't get a CompQueuedAlarms as argument, since it
- might be removed.
- (on_dialog_obj_updated_cb, on_dialog_obj_removed_cb): callbacks for
- modifications during dialog display.
- (notify_dialog_cb): disconnect from "obj_*ed" signals and call
- edit_component with the new set of arguments.
- (display_notification): added more data to the closure structure.
+ * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call
+ get_ldap_attribute_method
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid
+ get_ldap_attribute method
- Fixes #31382
+ * idl/evolution-calendar.idl: add getLdapAttribute method
- * gui/e-meeting-model.c (async_read): don't assume the buffer is
- always full, but use GNOME_VFS_ERROR_EOF instead for knowing when
- the read has finished.
+ * gui/e-meeting-model.c (process_section): take simple card list
+ as arg and try to use the ldap attribute (if any) as the attendee,
+ else use the email address
+ (select_names_ok_cb): get the simple card list
-2003-03-05 JP Rosevear <jpr@ximian.com>
+ * cal-client/cal-client.h: add proto
- * gui/apps_evolution_calendar.schemas: fix defaults and
- descriptions to match what calendar-config wants them to be
+ * cal-client/cal-client.c (cal_client_init): init ldap_attribute
+ to NULL
+ (cal_client_destroy): free ldap_attribute
+ (cal_client_get_ldap_attribute): accessor
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (show_current): g_objectify ref/unref
+2003-02-07 Rodrigo Moya <rodrigo@ximian.com>
- * gui/itip-bonobo-control.c (set_data_idle_cb): as above
- (pstream_load): ditto
+ Fixes #37706
- * gui/dialogs/alarm-options.c (alarm_to_malarm_widgets): as above
+ * gui/comp-editor-factory.c (cal_opened_cb): added PERMISSION_DENIED
+ case for not ending process on g_assert_not_reached.
-2003-03-05 JP Rosevear <jpr@ximian.com>
-
- * gui/e-itip-control.c (class_init): override finalize, not
- destroy
- (start_calendar_server): take itip as a param and gtk_main_quit if
- it gets destroyed while we are waiting for the cal client to load
- (start_default_server): ditto
- (get_servers): take itip as a param and don't load if we've been
- destroyed, check for an except when retrieving the folder list
- (init): ref the html control
- (destroy): mark ourselves as destroyed
- (finalize): clean up, unref html control
- (write_html): if the html widget has been destroyed, don't write
- anything out
- (show_current_todo): pass extra param
- (show_current): ref/unref the itip control to avoid finalization while
- we are working, pass extra param
- (button_selected_cb): pass extra param
- (object_requested_cb): ditto
-
-2003-03-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_go_offline,
- backend_go_online): cast CalClient's to GObject, not GtkObject.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
+2003-02-05 JP Rosevear <jpr@ximian.com>
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
- let the user change to an email organizer if the back end is not
- an email addres
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-offline-handler.c (backend_cal_opened_online): set
- the backend to REMOTE mode when it opens
- (backend_go_online): prepare to set calendar mode to REMOTE
- (impl_goOnline): get all the local calendars and set to REMOTE
+ * gui/itip-utils.c (itip_organizer_is_user): call
+ cal_client_get_cal_address instead of cal_client_get_email_address
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/e-meeting-model.c (process_section): if the attendee is the
- empty string, try to get the email
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37883
-
- * idl/evolution-calendar.idl: getLdapAttribute can raise NotFound
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37806, #37697
-
- * gui/e-itip-control.c (e_itip_control_set_data): if the text is
- null or the empty string, just clear the widget
- (init): set the html widget to initially be blank
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * pcs/cal.c (impl_Cal_get_ldap_attribute): implement
+ * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
- * pcs/cal-backend.h: add virtual method
+ * pcs/cal.c (impl_Cal_get_cal_address): implement updated method
+ name
+ (cal_class_init): set method implementation
- * pcs/cal-backend.c (cal_backend_get_ldap_attribute): call
- get_ldap_attribute_method
+ * pcs/cal-backend.c (cal_backend_class_init): init get_cal_address
+ virtual function
+ (cal_backend_get_cal_address): call proper function
- * pcs/cal-backend-file.c (cal_backend_file_class_init): overrid
- get_ldap_attribute method
+ * pcs/cal-backend.h: update proto, rename get_email_address
+ virtual function to get_cal_address virtual function
- * idl/evolution-calendar.idl: add getLdapAttribute method
+ * pcs/cal-backend-file.c (cal_backend_file_class_init): match
+ get_cal_address call
+ (cal_backend_file_get_cal_address): rename from
+ cal_backend_file_get_email_address
- * gui/e-meeting-model.c (process_section): take simple card list
- as arg and try to use the ldap attribute (if any) as the attendee,
- else use the email address
- (select_names_ok_cb): get the simple card list
+ * cal-client/cal-client.c: rename email_address private member to
+ cal_address
+ (cal_client_init): init cal_address
+ (cal_client_destroy): free cal_address and properly free
+ alarm_email_address
+ (cal_client_get_cal_address): rename from
+ cal_client_get_email_address and call proper corba function
- * cal-client/cal-client.h: add proto
-
- * cal-client/cal-client.c (cal_client_init): init ldap_attribute
- to NULL
- (cal_client_destroy): free ldap_attribute
- (cal_client_get_ldap_attribute): accessor
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/itip-utils.c (itip_organizer_is_user): call
- cal_client_get_cal_address instead of cal_client_get_email_address
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): ditto
-
- * pcs/cal.c (impl_Cal_get_cal_address): implement updated method
- name
- (cal_class_init): set method implementation
-
- * pcs/cal-backend.c (cal_backend_class_init): init get_cal_address
- virtual function
- (cal_backend_get_cal_address): call proper function
-
- * pcs/cal-backend.h: update proto, rename get_email_address
- virtual function to get_cal_address virtual function
-
- * pcs/cal-backend-file.c (cal_backend_file_class_init): match
- get_cal_address call
- (cal_backend_file_get_cal_address): rename from
- cal_backend_file_get_email_address
-
- * cal-client/cal-client.c: rename email_address private member to
- cal_address
- (cal_client_init): init cal_address
- (cal_client_destroy): free cal_address and properly free
- alarm_email_address
- (cal_client_get_cal_address): rename from
- cal_client_get_email_address and call proper corba function
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * idl/evolution-calendar.idl: fix comment
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/calendar-model.c (calendar_model_append_row): update FIXME
- note
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
+ * cal-client/cal-client.h: update proto
+
+2003-02-05 JP Rosevear <jpr@ximian.com>
* gui/dialogs/recur-comp.h: fix copyright
@@ -516,19 +127,26 @@
(recur_component_dialog): say "recurring journal entry" instead of
just "recurring journal"
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Partially Fixes #23606 (from Jack Jia <jack.jia@sun.com>)
-
- * gui/dialogs/schedule-page.c (update_time): handle no end date if
- the start is date only
+2003-02-05 JP Rosevear <jpr@ximian.com>
- * gui/dialogs/event-page.c (update_time): ditto
+ * idl/evolution-calendar.idl: fix comment
-2003-03-04 JP Rosevear <jpr@ximian.com>
+2003-02-05 JP Rosevear <jpr@ximian.com>
+
+ * gui/calendar-model.c (calendar_model_append_row): update FIXME
+ note
- Merging in 1.2 stuff
+2003-02-04 JP Rosevear <jpr@ximian.com>
+
+ Partially Fixes #23606 (from Jack Jia <jack.jia@sun.com>)
+ * gui/dialogs/schedule-page.c (update_time): handle no end date if
+ the start is date only
+
+ * gui/dialogs/event-page.c (update_time): ditto
+
+2003-01-31 JP Rosevear <jpr@ximian.com>
+
Fixes #35598
* gui/dialogs/task-details-page.c
@@ -540,6 +158,8 @@
* gui/dialogs/task-details-page.glade: remove needs-action menu
item
+2003-01-30 JP Rosevear <jpr@ximian.com>
+
Fixes #36763
* gui/dialogs/alarm-page.c (add_clicked_cb): if no address was set
@@ -568,12 +188,24 @@
NULL
* idl/evolution-calendar.idl: add getAlarmEmailAddress method
-
+
+2003-30-01 Ronald Kuetemeier <ronald@kuetemeier.com>
+
+ Fixes #35572
+
+ * gui/alarm-notify/alarm-queue.c: set saved_notification_time to last
+ notification time when we update the config to last notification, so
+ alarms will not get trigged again if a new calendar window is opened.
+
+2003-01-29 JP Rosevear <jpr@ximian.com>
+
Fixes #37102
* gui/dialogs/task-editor.c (set_menu_sens): don't allow task
assignment if the backend says not to
+2003-01-28 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (fill_component): kill warning
(preview_recur): display the recurrences in the dtstart timezone
if possible
@@ -587,14 +219,20 @@
* gui/tag-calendar.h (tag_calendar_by_comp): update proto
+2003-01-28 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (recurrence_page_set_dates): make
sure we always update the preview
+2003-01-27 JP Rosevear <jpr@ximian.com>
+
* conduits/todo/todo-conduit.c (add_record): make sure to create a
unique uid for the record
* conduits/calendar/calendar-conduit.c (add_record): ditto
+2003-01-24 JP Rosevear <jpr@ximian.com>
+
* conduits/todo/todo-conduit.c (e_todo_context_new): init default
comp and timezone to NULL
(e_todo_context_destroy): unref default comp
@@ -608,9 +246,13 @@
(pre_sync): get the default comp via the client
(add_record): pass the default comp as the base comp
+2003-01-24 JP Rosevear <jpr@ximian.com>
+
* conduits/calendar/calendar-conduit.c (local_record_from_comp):
only add the recurrence rule if its not an instance
+2003-01-22 JP Rosevear <jpr@ximian.com>
+
* gui/itip-control-factory.c (set_data_idle_cb): idle call back to
set control data
(pstream_load): set the data in an idle callback to avoid deadlock
@@ -625,6 +267,16 @@
(e_itip_control_set_view_only): accessor
(e_itip_control_get_view_only): ditto
+2003-01-22 Jack Jia <jack.jia@sun.com>
+
+ Fixes #34927
+
+ * gui/e-meeting-model.c (async_open): Call process_callback function
+ to process the data when it can not open free-busy url correctly.
+ Don't try to close the invalid handle.
+
+2003-01-20 JP Rosevear <jpr@ximian.com>
+
Fixes #36909
* gui/dialogs/alarm-page.c (button_options_clicked_cb): indicate
@@ -636,19 +288,27 @@
repeating is not allowed, sensitize the widgets appropriately
(alarm_options_dialog_run): store the repeat param
+2003-01-16 JP Rosevear <jpr@ximian.com>
+
* gui/calendar-model.c (calendar_model_append_row): guard against
saving before the calendar is open
* gui/e-day-view.c (e_day_view_key_press): ditto
+2003-01-15 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/comp-editor.c (page_changed_cb): change warning
dialog to not mention email
(page_summary_changed_cb): ditto
(page_dates_changed_cb): ditto
+2003-01-13 JP Rosevear <jpr@ximian.com>
+
* gui/itip-utils.c (itip_organizer_is_user): make the compare case
insensitive
+2003-01-12 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.c (meeting_page_fill_widgets): don't
allow the organizer to be changed if its not an email address
@@ -664,17 +324,25 @@
* pcs/cal.c (build_fb_seq): set the max
+2003-01-09 JP Rosevear <jpr@ximian.com>
+
* gui/e-meeting-model.c
(e_meeting_model_add_attendee_with_defaults): correct typo and set
rsvp appropriately
+2003-01-06 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/send-comp.c (send_component_dialog): if save
schedules, return FALSE for now
+2003-01-03 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/recurrence-page.c (sensitize_recur_widgets):
de-sensitize the preview widget if we are viewing an instance
(preview_recur): return if the comp is an instance
+2003-01-02 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/event-page.glade: name the show time frame
* gui/dialogs/event-page.c (event_page_fill_widgets)
@@ -682,6 +350,8 @@
(event_page_fill_widgets): hide/show frame as needed
(get_widgets): get the frame
+2003-01-02 JP Rosevear <jpr@ximian.com>
+
* gui/alarm-notify/alarm-queue.c (mail_notification): kill mail
notification code
@@ -707,11 +377,15 @@
* pcs/cal.c (impl_Cal_get_static_capabilities): ditto
+2002-12-30 JP Rosevear <jpr@ximian.com>
+
* gui/alarm-notify/alarm-queue.c (get_default_address): utility
routine to snag address info
* gui/alarm-notify/Makefile.am: build composer idl
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* *.c: pass client param for send an cancel params
* gui/dialogs/send-comp.c (send_component_dialog): take client as
@@ -725,6 +399,8 @@
* gui/dialogs/cancel-comp.h (cancel_component_dialog): update proto
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/alarm-options.glade: add Send To: button
* gui/dialogs/alarm-options.c (addressbook_clicked_cb): display
@@ -732,6 +408,8 @@
(setup_select_names): attach above to Send To: button clicked
signal
+2002-12-20 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/alarm-options.c (get_widgets): get mail alarm
widgets
(setup_select_names): add the select names widget
@@ -762,6 +440,8 @@
* cal-util/cal-component.h: new protos
+2002-12-18 JP Rosevear <jpr@ximian.com>
+
* gui/calendar-model.c (calendar_model_append_row): use
cal_comp_task_new_with_defaults
@@ -776,6 +456,8 @@
* gui/comp-util.c (cal_comp_task_new_with_defaults): new utility
routine
+2002-12-18 JP Rosevear <jpr@ximian.com>
+
* cal-util/cal-util.c (generate_absolute_triggers): skip omitted
alarm types
(add_alarm_occurrences_cb): ditto
@@ -791,10 +473,14 @@
* pcs/cal-backend.c (cal_backend_get_scheduling_information):
remove dead param
+2002-12-17 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.h: delete proto
* gui/dialogs/meeting-page.c: remove dead routine
+2002-12-17 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/event-editor.c (event_editor_edit_comp): we don't
need to add the organizer as an attendee ourselves, just set the
edit level properly
@@ -838,6 +524,8 @@
* cal-client/cal-client.h: add a proto, delete a proto
+2002-12-16 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/meeting-page.c (right_click_cb): if the attendee is
not fully editable, don't allow deletion
(meeting_page_construct): keep the default organizer as an itip
@@ -885,6 +573,8 @@
* pcs/cal.c (impl_Cal_get_scheduling_information): implement above
+2002-12-11 JP Rosevear <jpr@ximian.com>
+
* gui/e-day-view.c: pass NULL as parent to recur dialog
* gui/e-week-view.c: ditto
@@ -900,14 +590,25 @@
* gui/dialogs/recur-comp.c (recur_component_dialog): take a parent
argument and set the dialog parent if non-null
- * gui/e-week-view.c (e_day_view_on_editing_stopped): Don't update
- appointment if both the old and the new summary texts are empty.
-
+2002-12-11 Jack Jia <jack.jia@sun.com>
+
+ Fixes #34933
+
+ * gui/e-day-view.c (e_day_view_on_editing_stopped): Don't update
+ appointment if both the old and the new summary texts are empty.
+
+ * gui/e-week-view.c (e_day_view_on_editing_stopped): Don't update
+ appointment if both the old and the new summary texts are empty.
+
+2002-12-10 JP Rosevear <jpr@ximian.com>
+
* gui/e-week-view.c (e_week_view_show_popup_menu): mask out "make
moveable" if its an instance
* gui/e-day-view.c (e_day_view_on_event_right_click): ditto
+2002-12-09 JP Rosevear <jpr@ximian.com>
+
* gui/e-week-view.c (e_week_view_on_editing_stopped): if its
an instance, show the recur comp dialog and modify it based on the
response (or not if cancel is hit)
@@ -928,12 +629,16 @@
* gui/dialogs/recur-comp.h: update proto
+2002-12-06 JP Rosevear <jpr@ximian.com>
+
* gui/e-day-view.c (e_day_view_on_long_event_click): allow
dragging if its an instance
(e_day_view_on_event_click): ditto
(e_day_view_on_top_canvas_motion): ditto
(e_day_view_on_main_canvas_motion): ditto
+2002-12-06 JP Rosevear <jpr@ximian.com>
+
* gui/dialogs/comp-editor.c (save_comp): if its an instance,
update with the mod type
(real_edit_comp): ask the user what instances they want to change
@@ -943,686 +648,25 @@
* gui/dialogs/Makefile.am: Compile new files
- * gui/e-day-view.c (e_day_view_on_delete_occurrence): if its an
- instance, just remove with THIS mod
-
- * gui/e-week-view.c (e_week_view_on_delete_occurrence): ditto
-
- * cal-client/cal-client.c (cal_client_remove_object_with_mod):
- send the mod parameter to the backend
- (cal_client_remove_object): implement with above
- (cal_client_update_object_with_mod): send the mod parameter to the
- backend
- (cal_client_update_object): implement with above
-
- * cal-client/cal-client.h: new protos
-
- * cal-client/cal-client.c (cal_client_is_read_only): return
- booleans in the pre conditions
- (cal_client_update_object): pass mod param
- (cal_client_update_objects): ditto
- (cal_client_remove_object): ditto
- (cal_client_ensure_timezone_on_server): ditto
-
- * pcs/cal.c (impl_Cal_update_objects): take mod param
- (impl_Cal_remove_object): ditto
-
- * pcs/cal-backend.h: fix protos
-
- * pcs/cal-backend.c (cal_backend_update_objects): take mod param
- (cal_backend_remove_object): ditto
-
- * pcs/cal-backend-file.c (cal_backend_file_update_objects): take
- mod param
- (cal_backend_file_remove_object): ditto
-
- * cal-util/cal-util.h: add mod enum
-
- * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): if
- its an instance, just report the instance
-
- * cal-util/cal-component.h: new protos
-
- * cal-util/cal-component.c (cal_component_is_instance): indicate
- whether the component is an instance or not
- (cal_component_free_range): free a range
-
- * idl/evolution-calendar.idl: get remove and update to take mod
- type
-
-2003-03-03 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/alarm-page.c
- * gui/dialogs/event-page.c
- * gui/dialogs/meeting-page.c
- * gui/dialogs/recurrence-page.c
- * gui/dialogs/schedule-page.c
- * gui/dialogs/task-details-page.c
- * gui/dialogs/task-page.c (get_widgets): gtk_widget_unparent() ->
- gtk_container_remove(). The former caused crashes in the
- addressbook's name-selector.
-
-2003-03-01 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am: Do importers after the other dirs, as it relies on
- generated files from there. This is still not optimal... Should
- probably introduce dependencies.
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * importers/Makefile.am: Shlibify.
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in.in:
- Shlibify.
-
- * importers/icalendar-importer.c: Add necessary includes.
- (importer_destroy_cb): This is now a GWeakNotify func. gtk_ -> g_.
- (ical_importer_new)
- (vcal_importer_new)
- (gnome_calendar_importer_destroy_cb): Destroy signal -> weak ref.
-
- * importers/main.c: Add necessary includes. Shlibify.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/Makefile.am: build libcal-dialogs as an uninstalled
- shared library
- ($(IDL_GENERATED_H), etc): Only generate
- Evolution-Addressbook-SelectNames.h, not the corresponding .c
- files, or we'll get duplicate symbol errors trying to link this
- into libevolution_calendar.la
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Update for
- that (and eliminate libtool portability warnings)
-
-2003-02-28 Hans Petter Jansson <hpj@ximian.com>
-
- * Makefile.am (SUBDIRS): Add importers/.
-
- * importers/Makefile.am (server_in_files)
- (server_DATA): Insert $(libexecdir).
-
- * importers/icalendar-importer.c (connect_to_shell):
- oaf_activate_from_id() -> bonobo_activation_activate_from_id().
- (load_vcalendar_file): U_() -> _().
-
- * importers/GNOME_Evolution_Calendar_Importer.server.in:
- Renamed to corresponding .in.in.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Remove
- libalarm.a, which was not being used by the calendar.
-
- * gui/main.c: Remove unneeded alarm.h include.
-
- * gui/alarm-notify/Makefile.am (noinst_LIBRARIES): Stop building
- libalarm.a
- (evolution_alarm_notify_SOURCES): Add alarm.c, alarm.h
- (evolution_alarm_notify_LDADD): Remove libalarm.a
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduits/todo/Makefile.am: link to versist libtool object
-
- * conduits/calendar/Makefile.am: ditto
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes alarm notification work.
-
- * gui/alarm-notify/notify-main.c (main): Initialize GTK. Don't
- initialize bonobo activation - bonobo_init() does that for us.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- This makes creating appointments and tasks from the "New" button work.
-
- * gui/main.c (comp_editor_factory_fn): Doesn't need to take any args.
- (factory): Add a handler for CompEditorFactory.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #37895.
-
- * gui/e-day-view.c (e_day_view_destroy): g_object_unref () ->
- pango_font_description_free ().
- (e_day_view_style_set): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
-
-2003-02-26 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes Ximian #38306.
-
- * gui/e-itip-control.c (clean_up): Do nothing if the private structure
- has been freed. Don't call non-g_free() freers with NULL pointers.
- (destroy): Do nothing if the private structure has been freed. Clear
- pointers to freed blocks.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Use fixed margins of 5% of page
- width/height. This is the same cheat as gtkhtml employs to get
- around the fact that GNOME_PRINT_KEY_PAGE_MARGIN_* don't return
- useful values (I think). It sort of sucks, but is better than
- no margins at all.
- (print_comp): Ditto.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-config.c (calendar_config_get_default_view): Get
- default view from correct key.
-
-2003-02-25 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/cal-prefs-dialog.c (get_widgets): Show start/end-of-day
- widgets.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_is_read_only): Don't warn
- if calendar isn't loaded... Doesn't seem to hurt, but this should
- probably be investigated further.
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- If we have no contacts, don't bother trying to set them in the
- widget. Used to pass a NULL list, which would lead to much anxiety
- in callees.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets):
- If we have no potential organizers, emit a sensible warning.
-
- * gui/dialogs/task-page.c (init_widgets): Don't try to connect to
- the "changed" signal of the GtkTextView -- we listen to the
- GtkTextBuffer now.
-
-2003-02-20 Not Zed <NotZed@Ximian.com>
-
- * gui/e-itip-control.c (destroy): dont unref accounts anymore.
- (change_status): itipAddress -> EAccount.
-
- * gui/calendar-model.c (calendar_model_destroy): dont unref
- accounts anymore.
- (calendar_model_value_at): simplify logic using account_list_find.
-
- * gui/dialogs/task-editor.c (task_editor_edit_comp): use new
- itip_addresses interfaces.
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): use new
- itip_addresses_* interfaces. Should probably be using e_account
- directly.
- (meeting_page_finalize): dont unref the accounts list.
-
- * gui/dialogs/event-editor.c (event_editor_edit_comp): dont unref
- accounts anymore.
-
- * gui/itip-utils.c (itip_addresses_get_default): Just use
- e_account_list_get_default.
- (itip_addresses_get): dont ref the account object, just keep 1 ref
- to it.
- (find_account): remove.
- (itip_organizer_is_user): use e_account_list_find now.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
-
-2003-02-19 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/meeting-page.c: addresses->accounts
- (meeting_page_finalize): unref accounts.
-
- * gui/dialogs/event-editor.c: Use EAccountList api's
-
- * pcs/cal-backend-util.c (cal_backend_mail_account_get): Removed,
- use a global EAccountList instead.
- (cal_backend_mail_account_get_default): Use the global
- EAccountList directly.
- (cal_backend_mail_account_is_valid): And here too.
-
- * gui/itip-utils.h: Removed ItipAddress structure.
-
- * gui/itip-utils.c (itip_addresses_get): Change it to return a
- global account object, so we dont need to duplicate all account
- info in the calendar.
- (itip_addresses_free, itip_address_free): Removed, use
- g_object_unref.
- (itip_addresses_get_default): Return an EAccount.
- (find_account): helper to lookup accounts based on name/address.
- (itip_organizer_is_user): Use helper to find account.
- (itip_sentby_is_user): "
- (comp_limit_attendees): "
- (comp_sentby): Update to use an EAccount direclty.
- (get_address): Removed, now redundant.
-
- * gui/e-itip-control.c: Changed priv->addresses to be accounts
- EAccountList.
- (destroy): unref accounts.
- (find_my_address): Change to use accounts list directly, also fix
- a small potential memleak.
-
- * gui/calendar-model.c: Change priv->addresses to be a direct
- reference to an EAccountList, renamed priv->accounts.
- (calendar_model_destroy): unref accounts.
- (calendar_model_value_at): Use EAccountList directly to lookup
- members.
-
- * gui/calendar-config.c (calendar_config_get_timezone)
- (calendar_config_set_timezone): Fix timezone key.
- (calendar_config_get_24_hour_format): Same for 24 hour format key.
- (calendar_config_set_24_hour_format): And here.
- (calendar_config_get_week_start_day): "
- (calendar_config_set_week_start_day): "
- (calendar_config_get_day_start_hour): "
- (calendar_config_set_day_start_hour): "
- (calendar_config_get_day_start_minute): "
- (calendar_config_set_day_start_minute): "
- (calendar_config_get_day_end_hour): "
- (calendar_config_set_day_end_hour): "
- (calendar_config_get_day_end_minute)
- (calendar_config_set_day_end_minute)
- (calendar_config_get_time_divisions)
- (calendar_config_set_time_divisions)
- (calendar_config_get_dnav_show_week_no)
- (calendar_config_set_dnav_show_week_no)
- (calendar_config_get_default_view)
- (calendar_config_set_default_view)
- (calendar_config_get_hpane_pos, calendar_config_set_hpane_pos)
- (calendar_config_get_vpane_pos, calendar_config_set_vpane_pos)
- (calendar_config_get_month_hpane_pos)
- (calendar_config_set_month_hpane_pos)
- (calendar_config_get_month_vpane_pos)
- (calendar_config_set_month_vpane_pos)
- (calendar_config_get_compress_weekend)
- (calendar_config_set_compress_weekend)
- (calendar_config_get_show_event_end)
- (calendar_config_set_show_event_end)
- (calendar_config_get_working_days)
- (calendar_config_set_working_days)
- (calendar_config_get_hide_completed_tasks)
- (calendar_config_set_hide_completed_tasks)
- (calendar_config_get_hide_completed_tasks_units)
- (calendar_config_set_hide_completed_tasks_units)
- (calendar_config_get_hide_completed_tasks_value)
- (calendar_config_set_hide_completed_tasks_value)
- (calendar_config_get_confirm_delete)
- (calendar_config_set_confirm_delete)
- (calendar_config_get_confirm_expunge)
- (calendar_config_set_confirm_expunge)
- (calendar_config_get_tasks_due_today_color)
- (calendar_config_set_tasks_due_today_color)
- (calendar_config_get_tasks_overdue_color)
- (calendar_config_set_tasks_overdue_color)
- (calendar_config_get_use_default_reminder)
- (calendar_config_set_use_default_reminder)
- (calendar_config_get_default_reminder_interval)
- (calendar_config_set_default_reminder_interval)
- (calendar_config_get_default_reminder_units)
- (calendar_config_set_default_reminder_units)
- (calendar_config_default_calendar_folder)
- (calendar_config_default_tasks_folder): Update config paths for
- new config convention, etc.
-
- * gui/alarm-notify/save.c (KEY_LAST_NOTIFICATION_TIME, etc):
- Updated keys to lowercase/proper path.
- (save_calendars_to_load): Store the calendars list as a gconf
- list.
- (get_calendars_to_load): Load the calendars list as a gconf list.
- (save_blessed_program): Similar, for the blessed program list.
- (is_blessed_program): Same here.
-
- * gui/alarm-notify/config-data.c (config_data_get_timezone): Update
- the path to the timezone key.
- (config_data_get_24_hour_format): Fix path to config option.
-
- * conduits/todo/todo-conduit.c (get_default_timezone): lower-case
- the timezone key.
-
- * conduits/calendar/calendar-conduit.c (get_default_timezone):
- lower-case the timezone key.
-
- * cal-client/cal-client.c (get_default_uri): Use the proper path
- to get the default folder uri's.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/gnome-cal.c (backend_died_cb): Appease the compiler.
- (gnome_calendar_update_paned_quanta): Don't actually try to set
- the quantum properties. The quantum code should probably go away
- entirely now that the panes update during resize, but let's keep
- it around for a bit more.
-
- * gui/dialogs/event-editor.c (event_editor_construct): Ref & sink
- the pages.
-
- * gui/dialogs/task-editor.c (task_editor_construct): Ref & sink
- the pages.
-
-2003-02-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/cal-search-bar.c (make_suboptions): Eliminate
- e_utf8_to_gtk_string ().
-
- * gui/e-timezone-entry.c (e_timezone_entry_get_display_name):
- Ditto.
-
- * gui/calendar-model.c (date_value_to_string):
- e_utf8_from_locale_string () -> g_locale_to_utf8 ().
- (calendar_model_value_to_string): Ditto.
-
- * gui/e-cell-date-edit-text.c (ecd_get_text): Ditto.
-
- * gui/e-itip-control.c (write_label_piece): Ditto.
-
- * gui/print.c (format_date): Ditto.
- (print_week_view_background): Ditto.
- (print_month_summary): Ditto.
- (print_date_label): Ditto.
- (print_comp_item): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- Ditto.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/task-details-page.c (get_widgets): Show the custom
- widgets, since libglade appears to not want to do that.
-
- * gui/dialogs/task-page.c (clear_widgets): Make the description
- field use a GtkTextView.
- (task_page_fill_widgets): Ditto.
- (task_page_fill_component): Ditto.
- (init_widgets): Ditto.
- (get_widgets): Show the custom widgets, since libglade doesn't do it.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_unref_categories): Add an
- iteration statement. Fixes hang in wombat.
-
-2003-02-22 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Commit fixes from
- Grzegorz Goawski <grzegol@pld.org.pl>.
-
-2003-02-21 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-model.c (calendar_model_class_init): GObject, not
- GtkObject.
- (calendar_model_destroy): -> calendar_model_finalize ().
-
- * gui/calendar-view.c (calendar_view_class_init): GObject, not
- GtkObject.
- (calendar_view_destroy): -> calendar_view_finalize ().
-
- * gui/comp-editor-factory.c (comp_editor_factory_class_init):
- GObject, not GtkObject.
- (comp_editor_factory_destroy): -> comp_editor_factory_finalize ().
-
- * gui/e-day-view.c (e_day_view_long_event_button_press):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
- (e_day_view_on_event_button_press): Ditto.
- (e_day_view_on_long_event_click): Ditto.
- (e_day_view_on_event_click): Ditto.
- (e_day_view_on_event_double_click): Ditto.
- (e_day_view_on_delete_appointment): Ditto.
-
- * gui/e-week-view.c (e_week_view_on_text_item_event):
- gtk_signal_disconnect () -> g_signal_handler_disconnect ().
-
- * gui/alarm-notify/alarm-notify.c (AlarmNotify_RemoveCalendar):
- Don't cast to GtkObject.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * cal-client/Makefile.am (libcal_client_la_LIBADD): depend on
- libcal-util, libwombat, and libeutil
- (client_test_LDADD): Remove those deps from here
-
- * cal-util/Makefile.am (libcal_util_la_LIBADD): depend on
- libical-evolution.la
- (test_recur_LDADD): Remove that dependency here (and an ancient
- libversit dependency).
-
- * gui/alarm-notify/Makefile.am (evolution_alarm_notify_LDADD):
- remove some deps
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD): Likewise.
-
-2003-02-20 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/apps_evolution_calendar.schemas: Add GConf schemas.
-
- * gui/Makefile.am (EXTRA_DIST): Dist GConf schemas.
- (install-data-local): Install GConf schemas.
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (libevolution_calendar_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/ and likewise for
- libetimezonedialog
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/Makefile.am: Split $(CORBA_GENERATED_H) rule from the
- $(CORBA_GENERATED_C) rule to that it autogens properly when using
- parallel makes.
- * cal-client/Makefile.am: Likewise.
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Fix path to
- the calendar's GAL Views directory. [Pointed out by Grzegorz
- Goawski.]
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- Enable printing for calendar and tasks.
-
- * gui/print.c: Set default font to be "Sans". Store the PrintConfig
- globally instead of PaperInfo (which doesn't exist anymore).
- (get_font_for_size): Don't use
- gnome_font_face_find_closest_from_weight_slant() anymore, since
- it's broken. Instead, use gnome_font_face_find() and put bold- and
- italicness in the name to look for. Descenders can now be negative,
- so have to take the absolute value to get font height.
- (print_comp): Use global, persistent print configuration.
- GnomePrintDialog is now a GtkDialog. Remove manual configuration
- parameter shuffling. Set up page using new methods.
- (print_calendar): Like print_comp(). For month view, force landscape
- mode by temporarily setting it in the config, and remove the old hack.
- (print_setup): Port. I'm not sure this works, but at least it
- compiles now. How do I test this code path?
- (print_day_view): Pass NULL for page denominator.
- (print_week_view): Ditto.
- (print_month_view): Ditto.
- (print_year_view): Ditto.
- (print_comp_item): Add missing gnome_print_beginpage(). How did this
- work before?
-
- * gui/tasks-control.c: Store the PrintConfig globally instead of
- passing individual parameters every time. Persistent too.
- (print_title): Look for "Sans Bold" instead of "Times" with
- GNOME_FONT_BOLD property. Don't use find_closest_from_weight_slant().
- (print_tasks): Set up page using new methods. GnomePrintMaster ->
- GnomePrintJob. Get params from global config instead of args.
- (tasks_control_print_cmd): Use global, persistent print configuration.
- Remove manual portrait/landscape hack. GnomePrintDialog is now a
- GtkDialog. Set params in global config instead of passing them to
- print_tasks().
- (tasks_control_print_preview_cmd): print_tasks() now takes fewer
- args.
-
-2003-02-11 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Don't use gtk_scrolled_window_set_scrollbar_spacing() anymore.
-
-2003-02-10 Hans Petter Jansson <hpj@ximian.com>
-
- * pcs/cal-backend-file.c (save): Don't try to make an error string
- from an uninitialized GnomeVFSResult.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am: Make the CORBA IDL compilation work with
- parallel makes.
- * gui/dialogs/Makefile.am: Likewise.
- * gui/alarm-notify/Makefile.am: Likewise.
-
-2003-02-07 Rodney Dawes <dobey@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- remove this file, as it's generated now
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in.in:
- Add this file to generate the .server.in from, with hardcoded path
- * gui/alarm-notify/Makefile.am: Hardcode path in server file
-
-2003-02-07 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #37706
-
- * gui/comp-editor-factory.c (cal_opened_cb): added PERMISSION_DENIED
- case for not ending process on g_assert_not_reached.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/e-day-view-time-item.c
- (e_day_view_time_item_show_popup_menu): Use
- e_auto_kill_popup_menu_on_selection_done() instead of
- e_auto_kill_popup_menu_on_hide().
- * gui/dialogs/meeting-page.c (right_click_cb): Likewise.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/event-page.c (make_timezone_entry): show the widget
- before returning it.
-
- * importers/main.c (main): s/PACKAGE/GETTEXT_PACKAGE/ in gettext
- init
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/Makefile.am (INCLUDES): Remove cruft. Rename ICONSDIR to
- IMAGESDIR.
- (gladedir, etspecdir, serverdir): Remove definitions
- (libevolution_calendar_la_LDFLAGS): Remove -export-dynamic, add
- -module.
-
- * gui/calendar-config.c: #include <string.h>
-
- * gui/calendar-component.c (add_creatable_item):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/comp-util.c: #include <string.h>
-
- * gui/e-alarm-list.c: #include e-time-utils.h
- (row_deleted): Remove unused variable.
- (e_alarm_list_append): Likewise.
-
- * gui/e-date-time-list.c: #include e-time-utils.h, timeutil.h,
- calendar-config.h
- (row_deleted): Remove unused variable
- (e_date_time_list_append): Likewise.
-
- * gui/e-day-view.c (e_day_view_unrealize): Remove unused var
- (e_day_view_style_set): Likewise.
- (e_day_view_set_event_font_cb): Likewise.
-
- * gui/e-day-view-time-item.c: #include <string.h>
- (e_day_view_time_item_get_column_width): Remove unused variable.
-
- * gui/e-itip-control.c: #include <unistd.h>
- (url_requested_cb): s/ICONSDIR/IMAGESDIR/
-
- * gui/e-week-view.c (e_week_view_unrealize): Remove unused variable
- (e_week_view_style_set): Likewise
-
- * gui/e-week-view-titles-item.c: #include string.h
- * gui/itip-bonobo-control.c: Likewise
- * gui/print.c: Likewise
-
-
- * gui/alarm-notify/Makefile.am: Use privlibexecdir.
- (INCLUDES): Remove cruft.
- (gladedir, serversdir): Remove definitions
- (evolution_alarm_notify_LDFLAGS): Remove no-longer-needed
- -export-dynamic.
-
- * gui/alarm-notify/alarm-notify-dialog.c (write_html_heading):
- s/ICONSDIR/IMAGESDIR
-
- * gui/alarm-notify/notify-main.c (main): Fix up gettext
- initialization
-
-
- * gui/dialogs/Makefile.am (INCLUDES): Remove cruft. Rename
- ICONSDIR to IMAGESDIR.
- (gladedir, etspecdir): Remove definitions
-
- * gui/dialogs/alarm-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_reminder): Remove unused variable.
- (alarm_page_fill_component): Likewise.
- (alarm_page_set_summary): Likewise.
- (delete_clicked_cb): Likewise.
-
- * gui/dialogs/comp-editor.c (make_icon_from_comp):
- s/ICONSDIR/IMAGESDIR/
-
- * gui/dialogs/event-page.c: #include <string.h>
-
- * gui/dialogs/meeting-page.c (meeting_page_construct): Remove
- unused variable.
- (meeting_page_fill_widgets): Likewise
-
- * gui/dialogs/recurrence-page.c: #include gtktreeselection.h and
- gtkcellrenderertext.h
- (append_exception): Remove unused variable
- (fill_component): Likewise
- (recurrence_page_set_summary): Likewise.
- (exception_delete_cb): Likewise
-
-
- * cal-client/Makefile.am (libcal_clientincludedir): Define in
- terms of privincludedir
-
- * cal-client/client-test.c (main): Fix up gettext initialization
-
- * cal-client/cal-client.c (cal_client_construct): Likewise
-
-
- * cal-util/Makefile.am (INCLUDES): Remove cruft.
- (libcal_utilincludedir): Define in terms of privincludedir
-
-
- * pcs/Makefile.am (INCLUDES): Remove cruft.
- (pcsincludedir): Define in terms of privincludedir
-
- * pcs/cal-backend-file.c (cal_backend_file_finalize): Remove
- unused variable
-
-
- * importers/Makefile.am: Update this some although it's not
- currently being built
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/alarm-notify/notify-main.c (main):
- s/glade_gnome_init/glade_init/
-
- * gui/calendar-offline-handler.c: s/BonoboXObject/BonoboObject/
+2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
- * gui/comp-editor-factory.c: Likewise
+ Fixes #35003
-2003-02-05 Dan Winship <danw@ximian.com>
+ * gui/misc.[ch] (get_uri_without_password): new function for
+ removing the password from the CalClient's uris.
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
+ * gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
+ get_uri_without_password for messages.
+ (backend_error_cb): likewise.
+ (backend_died_cb): likewise.
+ (gnome_calendar_open): likewise.
+ (open_error, method_error, permission_error): likewise.
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
+ * gui/e-tasks.c (e_tasks_open): hide the password from the URI
+ being displayed in messages.
+ (backend_error_cb): likewise.
- From evolution-1-2-branch:
+2002-12-02 Dan Winship <danw@ximian.com>
* gui/e-itip-control.c (write_recurrence_piece): Describe
recurrences, if we can. #30993
@@ -1634,1138 +678,103 @@
just the date, for describing the end of recurrences (since the
time in the UNTIL is the *beginning* of the last instance, which
would confuse people).
- (update_item): Set the VCALENDAR's METHOD.
- (ok_clicked_cb): Use update_item, not remove_item, to process a
- cancelation. Part of #33875.
-
- * pcs/cal-backend-file.c (cal_backend_file_cancel_object): New,
- handle an ICAL_METHOD_CANCEL update.
- (cal_backend_file_update_objects): Call
- cal_backend_file_update_object or cal_backend_file_cancel_object
- as appropriate.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_on_invite_others_button_draw):
- Rename to e_meeting_time_selector_on_invite_others_button_expose()
- and handle "expose-event" instead of "draw".
- (e_meeting_time_selector_construct): The "draw" signal doesn't exist
- anymore - connect to "expose-event" instead.
-
- * gui/dialogs/event-page.c (clear_widgets): Clear the GtkTextBuffer
- for the description.
- (event_page_fill_widgets): Use the GtkTextBuffer.
- (event_page_fill_component): Use the GtkTextBuffer.
- (init_widgets): Create a GtkTextBuffer for the GtkTextView. Set word
- wrap. Connect to the "changed" signal of the model instead of the view.
-
-2003-02-04 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_paint_day_top): Use PangoLayout to
- draw text.
-
-2003-02-02 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_set_event_font_cb): Skip setting the
- "font_gdk" arg for now.
- (e_day_view_update_main_canvas_drag): Ditto.
-
- * gui/e-week-view.c (e_week_view_style_set): Ditto.
-
- * gui/weekday-picker.c (configure_items): Ditto.
-
- * gui/dialogs/event-page.c (get_widgets): Show custom widgets
- manually, since the visibility specified in the Glade XML appears
- to not have any effect.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
-2003-01-30 Ronald Kuetemeier <ronald@kuetemeier.com>
-
- Fixes #35572
-
- * gui/alarm-notify/alarm-queue.c: set saved_notification_time to last
- notification time when we update the config to last notification, so
- alarms will not get trigged again if a new calendar window is opened.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/todo/todo-conduit.c: CalClient and CalComponent are
- GObjects.
-
- * conduits/calendar/calendar-conduit.c: same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * conduits/calendar/calendar-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * conduits/todo/todo-conduit.c (start_calendar_server):
- fix warning.
- (get_default_timezone): BonoboConfigDatabase -> e_config_listener.
- (accept_all_cookies): remove.
- (conduit_get_gpilot_conduit): remove the oaf initialization stuff.
-
- * Makefile.am (CONDUIT_DIR): uncomment the conduit stuff.
-
-2003-01-26 Hans Petter Jansson <hpj@ximian.com>
-
- Make clicks, drags and resizes work, and pangoize remaining strings.
- Fix EText placement.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
- Use Pango.
-
- * gui/e-day-view.c (e_day_view_on_top_canvas_button_press):
- Don't add scroll offset, it's already factored in.
- (e_day_view_on_main_canvas_button_press): Ditto.
- (e_day_view_on_top_canvas_motion): Ditto.
- (e_day_view_on_main_canvas_motion): Ditto.
- (e_day_view_reshape_long_event): Don't set the "font_gdk" property.
- Its non-existence will prevent the other properties from being set as
- well.
- (e_day_view_reshape_day_event): Ditto.
- (e_day_view_update_top_canvas_drag): Ditto.
- (e_day_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
- (e_day_view_check_auto_scroll): Factor out scroll offset before
- checking the pointer's position relative to widget.
- (e_day_view_auto_scroll_handler): Don't freeze the canvas when
- scrolling - it will fail to update the canvas. If this is not
- intended behaviour, it's a bug in the canvas, I think.
- (e_day_view_on_main_canvas_drag_motion): Factor in the scroll offset
- before checking for auto-scroll, since the function requires this.
-
- * gui/e-week-view.c (e_week_view_reshape_event_span): Don't set the
- "font_gdk" property. Its non-existence will prevent the other
- properties from being set as well.
- (e_week_view_start_editing_event): ETextEventProcessor is a GObject
- now. So use g_signal_stuff.
-
-2003-01-25 Hans Petter Jansson <hpj@ximian.com>
-
- Mainly making all views use PangoLayouts for text. When drawing a
- PangoLayout, the draw offset is the top left corner of the layout,
- not the text's baseline. Keep this in mind when viewing the
- changes. I'll be brief about the exact changes, since they speak
- better for themselves.
-
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
- Use Pango.
- (e_day_view_time_item_draw): Use Pango.
-
- * gui/e-day-view-top-item.c (e_day_view_top_item_draw): Use Pango.
- (e_day_view_top_item_draw_long_event): Add some FIXME text so we can
- see when this is being used. Is it in use at all?
-
- * gui/e-day-view.c: No longer specify an explicit X font string for
- the large font. Use the main font, and change the point size.
- (e_day_view_init): Use Pango.
- (e_day_view_style_set): Use Pango. Comment out the gdk_font setting
- for the drag text items for now.
-
- * gui/e-day-view.h: Use Pango.
-
- * gui/e-week-view-event-item.c (e_week_view_draw_time): Use Pango.
-
- * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day):
- Use Pango.
-
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw):
- Use Pango.
-
- * gui/e-week-view.c: No longer specify an explicit X font string for
- the small font. Use the main font, and change the point size.
- (e_week_view_init): Use Pango.
- (e_week_view_destroy): Use Pango.
- (get_string_width): Implemented for convenience.
- (get_digit_width): Implemented for convenience.
- (e_week_view_style_set): Use Pango.
- (e_week_view_recalc_cell_sizes): Use Pango.
- (e_week_view_get_time_string_width): Use Pango.
-
- * gui/e-week-view.h: Use Pango.
-
- Following are some random UTF-8 fixes and a crash fix.
-
- * gui/itip-utils.c (comp_description): Use g_locale_to_utf8 ().
-
- * gui/dialogs/comp-editor.c (make_title_from_comp): Return a
- UTF-8 string.
-
- * gui/dialogs/alarm-page.c (alarm_page_set_summary): Pass UTF-8
- directly to GTK.
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Ditto.
-
- * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): Ditto.
- (meeting_page_construct): Ditto.
-
- * gui/dialogs/recurrence-page.c (recurrence_page_set_summary): Ditto.
-
- * gui/dialogs/event-editor.c (event_editor_finalize): Fix crash caused
- by gtk_object_destroy()-ing a non-GtkObject.
-
-2003-01-24 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_on_editing_stopped): Don't insist
- appointment is updated if both old and new summary are blank.
-
- * gui/e-week-view.c (e_week_view_on_editing_stopped): Ditto.
-
- * gui/e-timezone-entry.c (on_button_clicked): Timezone dialog is now
- a GtkDialog. Treat it as such.
-
- * gui/goto.c (ecal_event): Goto dialog is now a GtkDialog. Treat it
- as such.
- (goto_dialog): Ditto.
-
- * gui/goto-dialog.glade: Set the return IDs from the dialog buttons.
-
- * gui/dialogs/meeting-page.c (popup_delegate_cb): Enable the delegate
- dialog. It's now a GtkDialog, so treat it like one.
- (right_click_cb): Use GTK stock item, not GNOME (that doesn't work
- anymore).
-
- * gui/e-delegate-dialog.glade: Set the return IDs from dialog buttons.
-
- * gui/print.c (print_calendar): Correct the print dialog init. Code
- is still not enabled, though.
-
- * gui/tasks-control.c (print_tasks): Add a warning about printing
- being disabled.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/dialogs/Makefile.am (iconsdir): Remove, this is now defined
- in configure.in.
-
- * gui/Makefile.am (iconsdir): Remove; this is now defined in
- configure.in.
-
- * gui/alarm-notify/Makefile.am (iconsdir): Remove; this is now
- defined in configure.in.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/dialogs/event-page.c (get_widgets): GTK_OBJECT -> G_OBJECT cast.
-
- * gui/dialogs/alarm-page.c (get_widgets): Ditto.
-
- * gui/dialogs/meeting-page.c (get_widgets): Ditto.
-
- * gui/dialogs/recurrence-page.c (get_widgets): Ditto.
-
- * gui/dialogs/schedule-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-details-page.c (get_widget): Ditto.
-
- * gui/dialogs/task-page.c (get_widget): Ditto.
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): Add a
- FIXME comment to think about.
+2002-11-30 Hans Petter Jansson <hpj@ximian.com>
- * gui/dialogs/comp-editor.c (comp_editor_merge_ui): Add a terminating
- NULL to the concatenation.
-
-2003-01-23 Hans Petter Jansson <hpj@ximian.com>
-
- Fixes some trivial, but distracting, warnings.
-
- * gui/calendar-config.c (on_timezone_set): Fix constness.
-
- * gui/e-timezone-entry.c (on_button_clicked): Fix constness.
-
- * gui/dialogs/event-page.c (contacts_changed_cb): Fix constness.
-
- * gui/dialogs/task-page.c (contacts_changed_cb): Fix constness.
-
- * gui/e-itip-control.c (start_default_server): Cast callback with
- G_CALLBACK ().
-
- * gui/dialogs/schedule-page.c (init_widgets): Cast callback with
- G_CALLBACK ().
-
- * gui/calendar-offline-handler.c (impl_dispose): Takes GObject,
- not GtkObject.
- (impl_finalize): Ditto.
-
- * gui/calendar-view.c (calendar_view_edit): Now takes parent window
- as second arg.
-
- * gui/e-meeting-model.c (select_names_ok_cb): Fix constness.
- (get_select_name_dialog): Cast callback to BonoboListenerCallbackFn.
-
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_options_menu_position_callback): Add the
- push_in arg to arg list. This was crash-prone before.
- (e_meeting_time_selector_autopick_menu_position_callback): Ditto.
-
- * gui/alarm-notify/alarm-notify-dialog.c: Include e-unicode.h.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/Makefile.am (componentdir): Removed definition; this is now
- defined in configure.in.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * pcs/cal-backend.c (cal_backend_ref_categories): Do not put the
- category in both the changed_categories and the categories hashes;
- fixes a double-free when finalizing the CalBackend.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/gnome-cal.c (gnome_calendar_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/e-tasks.c (e_tasks_setup_view_menus): Use
- EVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install libcal-util.la in $(privlibdir)
- instead of $(libdir).
-
- * gui/dialogs/comp-editor.c (setup_widgets): Get
- evolution-comp-editor.xml from EVOLUTION_UIDIR.
- (comp_editor_merge_ui): Get the file in EVOLUTION_UIDIR.
-
- * gui/tasks-control.c (tasks_control_activate): Get
- evolution-tasks.xml from EVOLUTION_UI_DIRECTORY.
-
- * gui/calendar-commands.c (calendar_control_activate): Get
- evolution-calendar.xml from EVOLUTION_UI_DIRECTORY.
-
- * pcs/Makefile.am (pcsincludedir): Version using $(BASE_VERSION).
-
- * importers/Makefile.am: Install evolution-calendar-importer in
- $(libexecdir)/evolution/$(BASE_VERSION).
- (sounddir): Remove.
-
- * gui/dialogs/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
- (etspecdir): Likewise.
-
- * gui/Makefile.am (help_base): Remove.
- (install-data-local): Do not make the $(help_base)/C directory.
- (etspecdir): Version using $(BASE_VERSION).
- (gladedir): Likewise.
- (iconsdir): Likewise.
- (INCLUDES): Update the EVOLUTION_IMAGESDIR define to be versioned,
- and add a -DEVOLUTION_GALVIEWSDIR.
-
- * cal-util/Makefile.am: Install evolution-alarm-notify in
- $(libexecdir)/evolution/$(BASE_VERSION).
-
- * cal-util/Makefile.am (libcal_utilincludedir): Version using
- $(BASE_VERSION).
- * gui/alarm-notify/Makefile.am (iconsdir): Likewise.
- (gladedir): Likewise.
-
- * cal-client/Makefile.am: Install libcal-client.la in privlibdir
- instead of libdir.
- (libcal_clientincludedir): Version using $(BASE_VERSION).
-
-2003-01-18 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/print.c (print_calendar): Create a GnomePrintDialog,
- not a GnomePrinterDialog. They're different things. Patch from
- Chema.
-
-2003-01-17 Dan Winship <danw@ximian.com>
-
- * pcs/cal-backend.c: Move some non-file-backend-specific stuff
- from cal-backend-file here so it can be shared with other
- backends.
- (CalBackendPrivate): add this, containing the categories hashes
- and the (formerly public) clients list.
- (cal_backend_init, cal_backend_finalize): Handle backend->priv.
- (cal_destroy_cb): Simplify this (and redo it as a weak notify
- func)
- (cal_backend_add_cal): Keep a weak ref on the cal rather than
- connecting to its "destroy" signal. Call notify_categories_changed
- to let the new cal know about them.
- (get_object): Default implementation of cal_backend_get_object.
- that calls cal_component_get_as_string on the return value of
- cal_backend_get_object_component.
- (cal_backend_notify_mode, cal_backend_notify_update,
- cal_backend_notify_remove, cal_backend_notify_error): Notify each
- Cal about something.
- (cal_backend_ref_categories, cal_backend_unref_categories):
- Maintain a list of categories that are used by components in the
- backend, and trigger categories_changed notifications as needed.
-
- * pcs/cal-backend-file.c: Remove stuff that was moved to
- CalBackend (notify funcs, category handling, get_object
- implementation)
-
-2003-01-16 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-alarm-list.[ch]: Implement EAlarmList as CalComponentAlarm
- list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-alarm-list.[ch].
-
- * gui/dialogs/alarm-page.[ch]: Use GtkTreeView with the new
- EAlarmList as model for the alarm list. Update copyright.
-
- * gui/dialogs/recurrence-page.[ch]: Update copyright.
- (free_exception_date_time): Removed.
- (fill_exception_widgets): Kill a lingering clist operation.
-
-2003-01-15 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct):
- Create accel groups for popup menus. Fixes crash.
-
- * gui/e-date-time-list.[ch]: Implement EDateTimeList as
- CalComponentDateTime list with a GtkTreeModel interface.
-
- * gui/Makefile.am: Add e-date-time-list.[ch].
-
- * gui/dialogs/recurrence-page.c: Use GtkTreeView with the new
- EDateTimeList as model for the exception list.
-
- * gui/e-day-view.c: Silence warnings caused by missing casts.
-
- * gui/e-week-view.c: Silence warnings caused by missing casts.
-
-2003-01-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/Makefile.am: Added libevolution_calendar_la_LDFLAGS, and
- avoid versioning the shlib component
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * cal-client/Makefile.am (CORBA_SOURCES_GENERATED): Renamed from
- CORBA_GENERATED.
- (CORBA_GENERATED): New, put both $(CORBA_SOURCES_GENERATED) and
- $(CORBA_HEADERS_GENERATED) in it.
- (BUILT_SOURCES): Put $(CORBA_GENERATED) in here.
-
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
+ * gui/e-meeting-model.c (append_row): Don't leak meeting attendees;
+ unref the attendee after it's assigned to model.
+ (select_names_ok_cb): Free the destinations string after we're done
+ with it.
- * gui/e-calendar-table.c (tasks_popup_menu): Cast signal handlers
- to GtkSignalFunc, avoid warnings.
+ * gui/dialogs/meeting-page.c (meeting_page_destroy): Free the actual
+ array of deleted attendees.
- * gui/gnome-cal.c (set_view): Only set view ID if we have an instance.
+ * gui/dialogs/event-editor.c (event_editor_destroy): Free the private
+ structure.
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
+ * gui/itip-utils.c (comp_description): Rework free/busy information
+ composer so we can free date/time information after use. Then free it.
+ (itip_send_comp): Free the allocated CORBA buffer for attachment data.
- * cal-util/Makefile.am (EXTRA_DIST): cal-util-marshal.list.
+ * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_component):
+ Free the destination contacts string once we're done with it.
- * Makefile.am: Comment out the CONDUIT_DIR stuff for now.
+ * gui/e-calendar-table.c (invisible_destroyed): Unref the invisible.
-2003-01-14 Rodney Dawes <dobey@ximian.com>
+ * gui/e-day-view.c (invisible_destroyed): Ditto.
- * gui/gnome-cal.c: Use GtkPaned instead of EPaned
+ * gui/e-week-view.c (invisible_destroyed): Ditto.
-2003-01-14 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/e-day-view.c (e_day_view_init): Work around canvas crashes
- by ensuring rectangles have an initial width.
-
-2003-01-13 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/config-control-factory.h: Removed.
- * gui/config-control-factory.c: Removed.
-
- * gui/itip-bonobo-control.c: Renamed from itip-control-factory.c.
- (itip_bonobo_control_new): New.
- (itip_control_factory_init): Removed.
-
- * gui/itip-bonobo-control.h: Renamed from itip-control-factory.h.
-
- * gui/tasks-control-factory.c: Removed.
- * gui/tasks-control-factory.h: Removed.
-
- * gui/control-factory.c (control_factory_init): Removed.
-
- * gui/Makefile.am: Updated to build everything as
- libevolution-calendar.so and install in the COMPONENTDIR.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Updated to build the
- component as a shared library.
-
- * gui/main.c (main): Removed.
-
- * gui/calendar-component.c (calendar_component_get_object): New.
- (owner_set_cb): Do not store the shell pointer in shells.
- (owner_unset_cb): Do not remove the shell pointer from shells;
- instead, just set global_shell_client to NULL.
-
- * gui/calendar-component.h: Renamed from component-factory.h.
- * gui/calendar-component.c: Renamed from component-factory.c.
-
-2003-01-10 Ettore Perazzoli <ettore@ximian.com>
-
- * importers/icalendar-importer.c (connect_to_shell):
- CORBA_Object_release() the CORBA shell.
-
-2003-01-09 Dan Winship <danw@ximian.com>
-
- * gui/dialogs/recurrence-page.c (make_recur_month_num_submenu,
- make_recur_month_num_menu, month_num_menu_selection_done_cb): Use
- the new cal_recur_nth[] array. The way this was done before didn't
- localize properly.
-
- * cal-util/cal-recur.c (cal_recur_nth): array of localized month
- day names ("1st" - "31st")
-
- * cal-util/cal-component.c (cal_component_set_recurid): Allow
- recur_id to be NULL to clear the recurrence id. (Based on a story
- by JP on evolution-1-2-recurid-branch)
-
- * gui/print.c: Remove unused gnome-print-copies.h #include
-
- * pcs/query.c (query_new): Use g_object_weak_ref rather than
- connecting to "destroy" (which doesn't actually exist on a
- CalBackend)
- (backend_destroyed_cb): Update prototype.
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/alarm-notify/Makefile.am: Icons are now in
- $(datadir)/evolution/images instead of
- $(datadir)/images/evolution.
- * gui/Makefile.am: Likewise.
- * gui/dialogs/Makefile.am: Likewise.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * idl/Makefile.am: remove idldir definition. (It's defined in
- configure.in now)
-
-2002-12-19 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate):
- Replace gtk_signal_disconnect_by_data() with
- g_signal_handlers_disconnect_matched(). Former takes GtkObject,
- latter takes GObject.
-
- * gui/calendar-model.c (calendar_model_destroy): Ditto.
- (update_query): Ditto.
- (calendar_model_set_cal_client): Ditto.
+2002-11-26 Dan Winship <danw@ximian.com>
- * gui/e-day-view.c (e_day_view_destroy): Ditto.
- (update_query): Ditto.
- (e_day_view_set_cal_client): Ditto.
-
- * gui/e-tasks.c (query_eval_error_cb): Ditto.
- (query_query_done_cb): Ditto.
-
- * gui/e-week-view.c (e_week_view_destroy): Ditto.
- (update_query): Ditto.
- (e_week_view_set_cal_client): Ditto.
-
- * gui/gnome-cal.c (update_query): Ditto.
- (gnome_calendar_destroy): Ditto.
-
- * gui/tasks-control.c (tasks_control_deactivate): Ditto.
-
- * gui/e-comp-editor-registry.c (foreach_close_cb): Replace
- gtk_signal_handler_(un)block_by_data() with
- g_signal_handlers_(un)block_matched(). Former takes GtkObject, latter
- takes GObject.
-
- * gui/dialogs/alarm-page.c (alarm_page_get_type): Replace with
- E_MAKE_TYPE().
- (alarm_page_class_init): Use GObject as base class instead of
- GtkObject, and set up finalization instead of destroy handler.
- (alarm_page_destroy): Change to alarm_page_finalize() and assume
- parent is GObject, not GtkObject.
- (alarm_page_new): Use g_object_new(), not gtk_type_new().
-
- * gui/dialogs/event-page.c: Same general changes as above file.
- (update_time): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (clear_widgets): Ditto.
- (times_updated): Ditto.
-
- * gui/dialogs/recurrence-page.c: Same general changes as above file.
- (clear_widgets): Replace gtk_signal_handler_(un)block_by_data()
- with g_signal_handlers_(un)block_matched().
- (append_exception): Ditto.
- (fill_ending_date): Ditto.
- (recurrence_page_fill_widgets): Ditto.
-
- * gui/dialogs/comp-editor.c: Same general changes as above file.
- (comp_editor_finalize): Replace gtk_signal_disconnect_by_data()
- with g_signal_handlers_disconnect_matched().
- (comp_editor_remove_page): Ditto.
-
- * gui/dialogs/event-editor.c: Same general changes as above file.
- * gui/dialogs/meeting-page.c: Same general changes as above file.
- * gui/dialogs/schedule-page.c: Same general changes as above file.
- * gui/dialogs/task-details-page.c: Same general changes.
- * gui/dialogs/task-editor.c: Same general changes as above file.
- * gui/dialogs/task-page.c: Same general changes as above file.
- * gui/dialogs/e-delegate-dialog.c: Same general changes.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Use camel_text_to_html()
- instead.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/e-itip-control.c (write_html): Correctly convert text.value
- into HTML here (ie, don't pass "<i>None</i>" into e_text_to_html()
- if text.value is NULL).
-
-2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
-
- Fixes #35003
-
- * gui/misc.[ch] (get_uri_without_password): new function for
- removing the password from the CalClient's uris.
-
- * gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
- get_uri_without_password for messages.
- (backend_error_cb): likewise.
- (backend_died_cb): likewise.
- (gnome_calendar_open): likewise.
- (open_error, method_error, permission_error): likewise.
+ * gui/e-itip-control.c (update_item): Set the VCALENDAR's METHOD.
+ (ok_clicked_cb): Use update_item, not remove_item, to process a
+ cancelation. Part of #33875.
- * gui/e-tasks.c (e_tasks_open): hide the password from the URI
- being displayed in messages.
- (backend_error_cb): likewise.
+ * pcs/cal-backend-file.c (cal_backend_file_cancel_object): New,
+ handle an ICAL_METHOD_CANCEL update.
+ (cal_backend_file_update_objects): Call
+ cal_backend_file_update_object or cal_backend_file_cancel_object
+ as appropriate.
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-query.c (cal_query_done_status_enum_get_type):
- Implement GType for this enumeration.
- (cal_query_class_init): Use the enumeration instead of the
- abstract one.
-
- * cal-client/cal-query.h: Add type macro and proto for enum.
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * gui/component-factory.c (create_view): Pass the env argument to
- bonobo_control_set_property ().
-
- * gui/e-meeting-model.c (class_init): We're no longer derived from
- GtkObject, so use GObject class methods instead. destroy->finalize.
- (destroy): Zapped.
- (finalize): Implement based on old destroy ().
-
-2002-12-06 Hans Petter Jansson <hpj@ximian.com>
-
- * cal-client/cal-client.c (cal_client_open_status_enum_get_type):
- Create a non-abstract enumeration type derived from GEnum.
- (cal_client_set_mode_status_enum_get_type): Ditto.
- (cal_mode_enum_get_type): Ditto.
- (cal_client_class_init): Use our enumerations and not the abstract
- one.
- (cal_client_finalize): Don't destroy factories, since the CalClient
- doesn't own them anymore. They're shared between CalClients now.
- (get_factories): Implement. Move the factory setup code here from
- cal_client_construct (), and cache the factories. This is hopefully
- temporary, until wombat goes away or is fixed.
- (cal_client_construct): Most of the code moved to get_factories ().
-
- * cal-client/cal-client.h: Add enumeration type macros and protos.
-
- * gui/cal-search-bar.c (cal_search_bar_get_type): Removed in favour
- of E_MAKE_TYPE, which uses GObject calls.
- (cal_search_bar_class_init): Use g_type_class_peek_parent ().
-
- * gui/calendar-model.c (calendar_model_get_type):
- (calendar_model_class_init): Ditto, like above file.
- * gui/calendar-view.c (calendar_view_get_type):
- (calendar_view_class_init): Ditto.
- * gui/e-calendar-table.c (e_calendar_table_get_type):
- (e_calendar_table_class_init): Ditto.
- * gui/e-comp-editor-registry.c (e_comp_editor_registry_get_type):
- (class_init): Ditto.
- * gui/e-day-view-main-item.c (e_day_view_main_item_get_type):
- (e_day_view_main_item_class_init): Ditto.
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_type):
- (e_day_view_time_item_class_init): Ditto.
- * gui/e-day-view-top-item.c (e_day_view_top_item_get_type):
- (e_day_view_top_item_class_init): Ditto.
- * gui/e-day-view.c (e_day_view_get_type):
- (e_day_view_class_init): Ditto.
- * gui/e-itip-control.c (e_itip_control_get_type):
- (class_init): Ditto.
- * gui/e-meeting-attendee.c (e_meeting_attendee_get_type):
- (class_init): Ditto.
- * gui/e-meeting-model.c (e_meeting_model_get_type):
- (class_init): Ditto.
- * gui/e-meeting-time-sel-item.c
- (e_meeting_time_selector_item_get_type):
- (e_meeting_time_selector_item_class_init): Ditto.
- * gui/e-meeting-time-sel.c
- (e_meeting_time_selector_get_type):
- (e_meeting_time_selector_class_init): Ditto.
- * gui/e-timezone-entry.c (e_timezone_entry_get_type):
- (e_timezone_entry_class_init): Ditto.
- * gui/e-week-view-event-item.c (e_week_view_event_item_get_type):
- (e_week_view_event_item_class_init): Ditto.
- * gui/e-week-view-main-item.c (e_week_view_main_item_get_type):
- (e_week_view_main_item_class_init): Ditto.
- * gui/e-week-view-titles-item.c (e_week_view_titles_item_get_type):
- (e_week_view_titles_item_class_init): Ditto.
- * gui/gnome-cal.c (gnome_calendar_get_type):
- (gnome_calendar_class_init): Ditto.
- * gui/weekday-picker.c (weekday_picker_get_type):
- (weekday_picker_class_init): Ditto.
-
- * gui/e-week-view.c (e_week_view_get_type):
- (e_week_view_class_init): Ditto, but parent_class init was moved
- from get_type() to class_init().
-
- * gui/calendar-view-factory.c (calendar_view_factory_get_type):
- (calendar_view_factory_class_init): Ditto, and set up finalize
- callback instead of destroy.
- (calendar_view_factory_finalize): It's a GObject, so implement this.
- (celendar_view_factory_destroy): Move code to _finalize() and remove.
-
- * gui/main.c (init_bonobo): Remove extraneous bonobo_activation_init().
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * gui/itip-utils.[ch]: run fix.sh over this.
-
- * gui/dialogs/*.[ch]: run fix.sh over all of this.
+ * cal-util/cal-component.c (cal_component_set_recurid): If
+ @recur_id is NULL, clear the recurrence-id.
2002-11-26 Richard Li <Richard.Li@Sun.COM>
* cal-client/cal-client.c (cal_client_construct): removed extra call
to CORBA_exception_init.
-2002-11-22 Not Zed <NotZed@Ximian.com>
-
- * gui/dialogs/delete-comp.c (delete_component_dialog): Changed
- e_messagebox -> gtk_messagedialog.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component-factory.c (create_view): pass type to
- bonobo_control_set_property.
-
-2002-11-20 Not Zed <NotZed@Ximian.com>
-
- * gui/Makefile.am (EXTRA_DIST): fix typo, servers_in_files ->
- server_in_files.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * Makefile.am: Added rule to generate
- GNOME_Evolution_Calendar.server.in from
- GNOME_Evolution_Calendar.server.in.in, substituting @LIBEXECDIR@.
- Also, install evolution-calendar in $libexecdir instead of
- $bindir.
-
- * gui/GNOME_Evolution_Calendar.server.in.in: Renamed from
- GNOME_Evolution_Calendar.server.in. Prepended the executable name
- with @LIBEXECDIR@.
-
-2002-11-19 Not Zed <NotZed@Ximian.com>
+2002-11-15 JP Rosevear <jpr@ximian.com>
- * gui/e-meeting-model.c (get_select_name_dialog): pass type to
- bonobo_widget::set_property.
- (select_names_ok_cb): ", for get_property.
-
- * gui/dialogs/e-delegate-dialog.c (e_delegate_dialog_construct):
- pass type to bonobo_widget::set_property & plug small leak.
- (e_delegate_dialog_get_delegate): ", for get_property.
- (e_delegate_dialog_get_delegate_name): "
-
- * gui/dialogs/comp-editor-util.c (comp_editor_contacts_to_widget):
- pass type to bonobo_widget::set_property.
- (comp_editor_contacts_to_component): ", for get_property
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
- use new e_table_header_compute_height signature.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
+ * gui/e-day-view.c (e_day_view_on_delete_occurrence): if its an
+ instance, just remove with THIS mod
- * gui/component-factory.c: Use bonobo_main_quit instead of gtk
+ * gui/e-week-view.c (e_week_view_on_delete_occurrence): ditto
-2002-11-13 Federico Mena Quintero <federico@ximian.com>
-
- * cal-client/cal-query.c: #include <string.h>
- (obj_removed_cb): Fixed prototype.
-
- * cal-client/cal-client.c (get_objects_atomically): Fix use of
- g_signal_handler_disconnect().
-
- * cal-client/client-test.c (create_client): Add G_CALLBACK casts.
-
-2002-11-12 Federico Mena Quintero <federico@ximian.com>
-
- * pcs/cal-backend-util.c: #include <string.h>
-
- * pcs/cal.c: Fixed prototypes of the CORBA method implementations.
-
- * pcs/cal-backend-file.c (cal_backend_file_dispose): Added a
- dispose method.
- (cal_backend_file_get_free_busy): Converted to use EConfigListener
- rather than BonoboConfigDatabase.
-
- * gui/alarm-notify/alarm-notify.c: #include <string.h>, fix use of
- g_hash_table_lookup_extended().
-
- * gui/alarm-notify/alarm-notify-dialog.c: Substitute deprecated
- GTK+ functions for new ones.
-
- * gui/alarm-notify/alarm-queue.c: Likewise.
-
- * gui/alarm-notify/notify-main.c: #include <string.h>,
- <gtk/gtkmain.h>.
-
- * gui/alarm-notify/save.c: #include <string.h>.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c (calendar_control_deactivate): Use
- g_object_set_data(..., NULL) instead of gtk_object_remove_data().
-
- * gui/calendar-commands.c: Use g_object_{set,get}_* functions
- instead of gtk_object_{set,get}_*.
- * gui/calendar-commands.c: Likewise.
- * gui/calendar-config.c: Likewise.
- * gui/control-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view-main-item.c: Likewise.
- * gui/e-day-view-time-item.c: Likewise.
- * gui/e-day-view-top-item.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel-item.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-week-view-event-item.c: Likewise.
- * gui/e-week-view-layout.c: Likewise.
- * gui/e-week-view-main-item.c: Likewise.
- * gui/e-week-view-titles-item.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/print.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_object_ref()/g_object_unref()
- instead of gtk_object_ref/gtk_object_unref().
- * gui/calendar-config.c: Likewise.
- * gui/calendar-model.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/comp-util.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/goto.c: Likewise.
- * gui/itip-utils.c: Likewise.
- * gui/print.c: Likewise.
- * gui/tasks-control.c: Likewise.
- * gui/tasks-migrate.c: Likewise.
-
- * gui/cal-search-bar.c: Use g_object_new() instead of
- gtk_type_new().
- * gui/calendar-model.c: Likewise.
- * gui/calendar-view-factory.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/calendar-view.c: Likewise.
- * gui/comp-editor-factory.c: Likewise.
- * gui/e-calendar-table.c: Likewise.
- * gui/e-cell-date-edit-text.c: Likewise.
- * gui/e-comp-editor-registry.c: Likewise.
- * gui/e-day-view.c: Likewise.
- * gui/e-itip-control.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-attendee.c: Likewise.
- * gui/e-meeting-model.c: Likewise.
- * gui/e-meeting-time-sel.c: Likewise.
- * gui/e-tasks.c: Likewise.
- * gui/e-timezone-entry.c: Likewise.
- * gui/e-week-view.c: Likewise.
- * gui/gnome-cal.c: Likewise.
- * gui/weekday-picker.c: Likewise.
-
- * gui/e-itip-control.c (get_servers): g_object_unref the
- shell_client instead of using bonobo_object_unref().
-
- * gui/component-factory.c (owner_set_cb): Use
- evolution_shell_client_corba_objref() instead of
- bonobo_object_corba_objref().
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-commands.c: Use g_signal_connect() instead of
- gtk_signal_connect().
- * calendar-commands.c: Likewise.
- * calendar-config.c: Likewise.
- * calendar-model.c: Likewise.
- * comp-editor-factory.c: Likewise.
- * component-factory.c: Likewise.
- * control-factory.c: Likewise.
- * e-calendar-table.c: Likewise.
- * e-comp-editor-registry.c: Likewise.
- * e-day-view-time-item.c: Likewise.
- * e-day-view.c: Likewise.
- * e-itip-control.c: Likewise.
- * e-meeting-model.c: Likewise.
- * e-meeting-time-sel.c: Likewise.
- * e-tasks.c: Likewise.
- * e-timezone-entry.c: Likewise.
- * e-week-view.c: Likewise.
- * gnome-cal.c: Likewise.
- * goto.c: Likewise.
- * tasks-control.c: Likewise.
- * tasks-migrate.c: Likewise.
- * weekday-picker.c: Likewise.
-
-2002-11-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/calendar-offline-handler.c
- (calendar_offline_handler_class_init): GObjectified.
- (impl_finalize): Finalize impl.
- (impl_dispose): Dispose impl.
- (calendar_offline_handler_new): Use g_object_new().
- (backend_cal_opened): use g_signal_connect() instead of
- gtk_signal_connect().
- (backend_go_offline): Likewise.
- (backend_cal_opened): g_object_unref() instead of
- gtk_object_unref().
- (backend_go_offline): Likewise.
-
-2002-11-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/evolution-calendar-importer.h: use GLib macros.
-
- * importers/main.c (init_importer): use bonobo_generic_factory_new,
- not bonobo_generic_factory_new_multi.
- (main): don't use libgnome functions.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/client-test.c: don't use GTK, we don't need it.
-
-2002-11-07 JP Rosevear <jpr@ximian.com>
-
- * Initial port of gui/ subdir to GNOME 2
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * importers/icalendar-importer.c: removed non-existant headers.
-
- * importers/Makefile.am: changes for BonoboActivation.
-
- * gui/GNOME_Evolution_Calendar.server.in: install to $libdir, not
- $datadir.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-client/query-listener.[ch]: converted to BonoboObject.
-
- * gui/dialogs/comp-editor-util.c (parse_contact_string): use glib's
- g_utf8_strchr.
-
- * gui/dialogs/delete-comp.c: removed non-existant headers. Use
- GtkStock instead of GnomeStock.
-
- * gui/dialogs/e-delegate-dialog.c: converted to BonoboActivation.
- (e_delegate_dialog_construct): adapted to changes in glade_xml_new.
-
-2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal.[ch]: converted to BonoboObject.
- (impl_Cal_get_query): bonobo_object_unref the query returned by
- cal_backend_get_query if we can't duplicate it.
-
- * pcs/query.[ch]:
- * pcs/cal-factory.[ch]: converted to BonoboObject.
-
- * pcs/query-backend.[ch]:
- * pcs/cal-backend-file.[ch]:
- * pcs/cal-backend.[ch]: GObjectify.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/cal-prefs-dialog.c: #include gtkoptionmenu.h.
- (cal_prefs_dialog_new): adapted to changes in glade_xml_new.
-
- * gui/dialogs/event-page.h:
- * gui/dialogs/meeting-page.h:
- * gui/dialogs/recurrence-page.h:
- * gui/dialogs/schedule-page.h:
- * gui/dialogs/task-details-page.h:
- * gui/dialogs/task-page.h:
- * gui/cal-prefs-dialog.h: use correctly the macros.
-
- * gui/dialogs/cancel-comp.c:
- * gui/dialogs/changed-comp.c:
- * gui/dialogs/comp-editor-page.c:
- * gui/gnome-cal.h: removed non-existent headers.
-
- * gui/dialogs/comp-editor.c: remove non-existent headers.
- (close_dialog): gtk_widget_destroy the widget.
- (setup_widgets, comp_editor_merge_ui): use BonoboWindow correctly.
- (comp_editor_set_cal_client, comp_editor_send_comp,
- comp_editor_edit_comp): use G_OBJECT_GET_CLASS for
- getting the class of an object.
-
- * gui/dialogs/comp-editor-page.c (comp_editor_page_class_init):
- use g_signal_* functions.
-
- * gui/dialogs/comp-editor-util.c: converted to BonoboActivation.
-
- * gui/dialogs/comp-editor.h: #include bonobo-window.h, not
- bonobo-win.h.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/alarm-notify/GNOME_Evolution_Calendar_AlarmNotify.server.in:
- * gui/GNOME_Evolution_Calendar.server.in: renmaed .oaf.in files.
-
- * gui/alarm-notify/Makefile.am:
- * gui/Makefile.am: fixed rules for .server files.
-
-2002-11-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/comp-editor-util.[ch]
- (comp_editor_connect_contacts_changed): don't return a
- Bonobo_EventSource_ListenerId, since it does not exist anymore,
- and was not even being used.
-
- * gui/e-timezone-entry.h: use GLib macros.
-
- * gui/dialogs/*.glade:
- * gui/alarm-notify/*.glade:
- * gui/*.glade: converted to Glade2 format.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * gui/dialogs/alarm-options.c (alarm_options_dialog_run): adapted to
- to new glade_xml_new signature.
-
- * gui/calendar-model.h:
- * gui/dialogs/comp-editor-page.h:
- * gui/dialogs/alarm-page.[ch]: removed non-existant header files.
-
- * gui/dialogs/comp-editor-util.h: added missing headers.
-
-2002-11-05 Rodrigo Moya <rodrigo@ximian.com>
-
- * pcs/cal-backend.c: use libxml2 headers.
-
- * gui/alarm-notify/Makefile.am:
- * gui/dialogs/Makefile.am:
- * gui/Makefile.am: s/XML_I18N/INTLTOOL. Fixed execution of
- $(ORBIT_IDL).
-
- * gui/alarm-notify/alarm-notify.[ch]: converted to BonoboObject.
-
- * gui/alarm-notify/alarm-notify-dialog.c: compilation fixes.
- (alarm_notify_dialog): adapted to new glade_xml_new signature.
-
- * gui/alarm-notify/alarm-queue.c: ported to BonoboActivation and
- GtkStock and GtkDialog.
-
- * gui/alarm-notify/notify-main.c: ported to BonoboActivation and
- use GObject functions instead of GtkObject ones.
-
- * gui/alarm-notify/save.h: removed BonoboConfig related functions.
-
- * gui/alarm-notify/config-data.c: use GObject functions instead of
- GtkObject ones.
-
- * TODO.port: added file for keeping track of disabled things while we
- port.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-util-marshal.list: added new marshallers.
-
- * cal-client/cal-client.c (get_objects_atomically): fixed calls to
- g_signal_handler_disconnect_by_func.
- (cal_client_class_init): fixed typos.
-
- * cal-client/cal-client-multi.[ch]:
- * cal-client/cal-client-types.c:
- * cal-client/cal-query.[ch]: ported to GObject.
-
- * cal-client/cal-listener.[ch]: converted to BonoboObject.
-
- * cal-client/Makefile.am:
- * pcs/Makefile.am: fixed flags for orbit-idl
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/Makefile.am:
- * cal-util/cal-util-marshal.list: added marshallers.
-
- * cal-client/cal-client.[ch]: ported to GObject.
-
-2002-11-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * cal-util/cal-component.[ch]: ported to GObject.
+ * cal-client/cal-client.c (cal_client_remove_object_with_mod):
+ send the mod parameter to the backend
+ (cal_client_remove_object): implement with above
+ (cal_client_update_object_with_mod): send the mod parameter to the
+ backend
+ (cal_client_update_object): implement with above
- * cal-util/cal-util.c (cal_util_generate_alarms_for_comp): use
- g_object_* instead of gtk_object_*.
+ * cal-client/cal-client.h: new protos
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
+2002-11-14 JP Rosevear <jpr@ximian.com>
- * cal-client/cal-client.c (get_default_uri): use EConfigListener
- instead of BonoboConfig.
+ * cal-client/cal-client.c (cal_client_is_read_only): return
+ booleans in the pre conditions
+ (cal_client_update_object): pass mod param
+ (cal_client_update_objects): ditto
+ (cal_client_remove_object): ditto
+ (cal_client_ensure_timezone_on_server): ditto
- * cal-client/cal-client.c:
- * cal-client/cal-listener.[ch]:
- * cal-client/query-listener.c: warning free.
+ * pcs/cal.c (impl_Cal_update_objects): take mod param
+ (impl_Cal_remove_object): ditto
-2002-11-03 Rodrigo Moya <rodrigo@ximian.com>
+ * pcs/cal-backend.h: fix protos
- * pcs/cal-backend-util.[ch]: don't use BonoboConfig, but
- EConfigListener.
+ * pcs/cal-backend.c (cal_backend_update_objects): take mod param
+ (cal_backend_remove_object): ditto
- * gui/calendar-config.c: use /apps/Evolution prefix for all
- configuration keys.
+ * pcs/cal-backend-file.c (cal_backend_file_update_objects): take
+ mod param
+ (cal_backend_file_remove_object): ditto
-2002-10-31 Rodrigo Moya <rodrigo@ximian.com>
+ * cal-util/cal-util.h: add mod enum
- * cal-util/cal-component.[ch]:
- * cal-util/cal-recur.h:
- * cal-util/cal-util.[ch]:
- * cal-client/cal-client.h:
- * cal-client/cal-client-multi.h:
- * cal-client/cal-client-types.[ch]:
- * cal-client/cal-listener.h
- * cal-client/cal-query.[ch]:
- * cal-client/query-listener.h:
- * pcs/cal.h:
- * pcs/cal-backend.[ch]:
- * pcs/cal-backend-file.h:
- * pcs/cal-backend-util.h:
- * pcs/cal-common.h:
- * pcs/cal-factory.h:
- * pcs/query.[ch]:
- * pcs/query-backend.[ch]: started GNOME 2 porting.
- cal-util, cal-client and pcs compiled ok.
+ * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): if
+ its an instance, just report the instance
- * cal-client/cal-client.c (cal_client_construct):
- * pcs/cal-factory.c: use b-a instead of OAF and bonobo-config
- instead of bonobo-conf.
+ * cal-util/cal-component.h: new protos
-2002-10-29 Rodrigo Moya <rodrigo@ximian.com>
+ * cal-util/cal-component.c (cal_component_is_instance): indicate
+ whether the component is an instance or not
+ (cal_component_free_range): free a range
- * gui/gnome-cal.c (backend_died_cb): cleaned up the status bar
- messages for all widgets.
+ * idl/evolution-calendar.idl: get remove and update to take mod
+ type
2002-10-24 JP Rosevear <jpr@ximian.com>
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 9921899636..f0730b2326 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -22,14 +22,14 @@
#include <config.h>
#endif
-#include <string.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <gtk/gtksignal.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-exception.h>
+#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <libgnome/gnome-util.h>
#include "e-util/e-component-listener.h"
-#include "e-util/e-config-listener.h"
-#include "cal-util/cal-util-marshal.h"
#include "cal-client-types.h"
#include "cal-client.h"
#include "cal-listener.h"
@@ -98,9 +98,9 @@ enum {
LAST_SIGNAL
};
-static void cal_client_class_init (CalClientClass *klass);
-static void cal_client_init (CalClient *client, CalClientClass *klass);
-static void cal_client_finalize (GObject *object);
+static void cal_client_class_init (CalClientClass *class);
+static void cal_client_init (CalClient *client);
+static void cal_client_destroy (GtkObject *object);
static char *client_get_password_cb (WombatClient *w_client,
const gchar *prompt,
@@ -114,7 +114,7 @@ static void cal_client_get_object_timezones_cb (icalparameter *param,
static guint cal_client_signals[LAST_SIGNAL];
-static GObjectClass *parent_class;
+static GtkObjectClass *parent_class;
@@ -126,185 +126,121 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalClient class.
**/
-GType
+GtkType
cal_client_get_type (void)
{
- static GType cal_client_type = 0;
+ static GtkType cal_client_type = 0;
if (!cal_client_type) {
- static GTypeInfo info = {
- sizeof (CalClientClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_client_class_init,
- NULL, NULL,
- sizeof (CalClient),
- 0,
- (GInstanceInitFunc) cal_client_init
- };
- cal_client_type = g_type_register_static (G_TYPE_OBJECT, "CalClient", &info, 0);
- }
-
- return cal_client_type;
-}
-
-GType
-cal_client_open_status_enum_get_type (void)
-{
- static GType cal_client_open_status_enum_type = 0;
-
- if (!cal_client_open_status_enum_type) {
- static GEnumValue values [] = {
- { CAL_CLIENT_OPEN_SUCCESS, "CalClientOpenSuccess", "success" },
- { CAL_CLIENT_OPEN_ERROR, "CalClientOpenError", "error" },
- { CAL_CLIENT_OPEN_NOT_FOUND, "CalClientOpenNotFound", "not-found" },
- { CAL_CLIENT_OPEN_PERMISSION_DENIED, "CalClientOpenPermissionDenied", "denied" },
- { CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED, "CalClientOpenMethodNotSupported", "unsupported" },
- { -1, NULL, NULL }
+ static const GtkTypeInfo cal_client_info = {
+ "CalClient",
+ sizeof (CalClient),
+ sizeof (CalClientClass),
+ (GtkClassInitFunc) cal_client_class_init,
+ (GtkObjectInitFunc) cal_client_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
};
- cal_client_open_status_enum_type = g_enum_register_static ("CalClientOpenStatusEnum", values);
+ cal_client_type = gtk_type_unique (GTK_TYPE_OBJECT, &cal_client_info);
}
- return cal_client_open_status_enum_type;
-}
-
-GType
-cal_client_set_mode_status_enum_get_type (void)
-{
- static GType cal_client_set_mode_status_enum_type = 0;
-
- if (!cal_client_set_mode_status_enum_type) {
- static GEnumValue values [] = {
- { CAL_CLIENT_SET_MODE_SUCCESS, "CalClientSetModeSuccess", "success" },
- { CAL_CLIENT_SET_MODE_ERROR, "CalClientSetModeError", "error" },
- { CAL_CLIENT_SET_MODE_NOT_SUPPORTED, "CalClientSetModeNotSupported", "unsupported" },
- { -1, NULL, NULL }
- };
-
- cal_client_set_mode_status_enum_type =
- g_enum_register_static ("CalClientSetModeStatusEnum", values);
- }
-
- return cal_client_set_mode_status_enum_type;
+ return cal_client_type;
}
-GType
-cal_mode_enum_get_type (void)
-{
- static GType cal_mode_enum_type = 0;
-
- if (!cal_mode_enum_type) {
- static GEnumValue values [] = {
- { CAL_MODE_INVALID, "CalModeInvalid", "invalid" },
- { CAL_MODE_LOCAL, "CalModeLocal", "local" },
- { CAL_MODE_REMOTE, "CalModeRemote", "remote" },
- { CAL_MODE_ANY, "CalModeAny", "any" },
- { -1, NULL, NULL }
- };
-
- cal_mode_enum_type = g_enum_register_static ("CalModeEnum", values);
- }
-
- return cal_mode_enum_type;
-}
+#define marshal_NONE__ENUM_ENUM gtk_marshal_NONE__INT_INT
/* Class initialization function for the calendar client */
static void
-cal_client_class_init (CalClientClass *klass)
+cal_client_class_init (CalClientClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
cal_client_signals[CAL_OPENED] =
- g_signal_new ("cal_opened",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, cal_opened),
- NULL, NULL,
- g_cclosure_marshal_VOID__ENUM,
- G_TYPE_NONE, 1,
- CAL_CLIENT_OPEN_STATUS_ENUM_TYPE);
+ gtk_signal_new ("cal_opened",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, cal_opened),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_ENUM);
cal_client_signals[CAL_SET_MODE] =
- g_signal_new ("cal_set_mode",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, cal_set_mode),
- NULL, NULL,
- cal_util_marshal_VOID__ENUM_ENUM,
- G_TYPE_NONE, 2,
- CAL_CLIENT_SET_MODE_STATUS_ENUM_TYPE,
- CAL_MODE_ENUM_TYPE);
+ gtk_signal_new ("cal_set_mode",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, cal_set_mode),
+ marshal_NONE__ENUM_ENUM,
+ GTK_TYPE_NONE, 2,
+ GTK_TYPE_ENUM,
+ GTK_TYPE_ENUM);
cal_client_signals[OBJ_UPDATED] =
- g_signal_new ("obj_updated",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, obj_updated),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_updated",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, obj_updated),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[OBJ_REMOVED] =
- g_signal_new ("obj_removed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, obj_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_removed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, obj_removed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[BACKEND_ERROR] =
- g_signal_new ("backend_error",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, backend_error),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("backend_error",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, backend_error),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[CATEGORIES_CHANGED] =
- g_signal_new ("categories_changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, categories_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ gtk_signal_new ("categories_changed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, categories_changed),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
cal_client_signals[FORGET_PASSWORD] =
- g_signal_new ("forget_password",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, forget_password),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("forget_password",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, forget_password),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_client_signals[BACKEND_DIED] =
- g_signal_new ("backend_died",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalClientClass, backend_died),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("backend_died",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalClientClass, backend_died),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
- klass->cal_opened = NULL;
- klass->obj_updated = NULL;
- klass->obj_removed = NULL;
- klass->categories_changed = NULL;
- klass->forget_password = NULL;
- klass->backend_died = NULL;
+ gtk_object_class_add_signals (object_class, cal_client_signals, LAST_SIGNAL);
- object_class->finalize = cal_client_finalize;
+ class->cal_opened = NULL;
+ class->obj_updated = NULL;
+ class->obj_removed = NULL;
+ class->categories_changed = NULL;
+ class->forget_password = NULL;
+ class->backend_died = NULL;
+
+ object_class->destroy = cal_client_destroy;
}
/* Object initialization function for the calendar client */
static void
-cal_client_init (CalClient *client, CalClientClass *klass)
+cal_client_init (CalClient *client)
{
CalClientPrivate *priv;
@@ -412,9 +348,9 @@ free_timezone (gpointer key, gpointer value, gpointer data)
icaltimezone_free (value, TRUE);
}
-/* Finalize handler for the calendar client */
+/* Destroy handler for the calendar client */
static void
-cal_client_finalize (GObject *object)
+cal_client_destroy (GtkObject *object)
{
CalClient *client;
CalClientPrivate *priv;
@@ -432,16 +368,13 @@ cal_client_finalize (GObject *object)
}
if (priv->comp_listener) {
- g_signal_handlers_disconnect_matched (G_OBJECT (priv->comp_listener),
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL,
- client);
- g_object_unref (G_OBJECT (priv->comp_listener));
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->comp_listener), client);
+ gtk_object_unref (GTK_OBJECT (priv->comp_listener));
priv->comp_listener = NULL;
}
priv->w_client = NULL;
- /* destroy_factories (client); */
+ destroy_factories (client);
destroy_cal (client);
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
@@ -475,8 +408,8 @@ cal_client_finalize (GObject *object)
g_free (priv);
client->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -491,7 +424,7 @@ backend_died_cb (EComponentListener *cl, gpointer user_data)
priv = client->priv;
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
- g_signal_emit (G_OBJECT (client), cal_client_signals[BACKEND_DIED], 0);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[BACKEND_DIED]);
}
/* Signal handlers for the listener's signals */
@@ -535,8 +468,8 @@ cal_opened_cb (CalListener *listener,
/* setup component listener */
priv->comp_listener = e_component_listener_new (priv->cal, 0);
- g_signal_connect (G_OBJECT (priv->comp_listener), "component_died",
- G_CALLBACK (backend_died_cb), client);
+ gtk_signal_connect (GTK_OBJECT (priv->comp_listener), "component_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), client);
goto out;
case GNOME_Evolution_Calendar_Listener_ERROR:
@@ -577,10 +510,10 @@ cal_opened_cb (CalListener *listener,
* signal and clean up.
*/
- g_object_ref (G_OBJECT (client));
+ gtk_object_ref (GTK_OBJECT (client));
- g_signal_emit (G_OBJECT (client), cal_client_signals[CAL_OPENED],
- 0, client_status);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CAL_OPENED],
+ client_status);
if (client_status != CAL_CLIENT_OPEN_SUCCESS) {
priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED;
@@ -590,7 +523,7 @@ cal_opened_cb (CalListener *listener,
g_assert (priv->load_state != CAL_CLIENT_LOAD_LOADING);
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
}
/* Handle the cal_set_mode notification from the listener */
@@ -629,32 +562,32 @@ cal_set_mode_cb (CalListener *listener,
* signal and clean up.
*/
- g_object_ref (G_OBJECT (client));
+ gtk_object_ref (GTK_OBJECT (client));
- g_signal_emit (G_OBJECT (client), cal_client_signals[CAL_SET_MODE],
- 0, client_status, mode);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CAL_SET_MODE],
+ client_status, mode);
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
}
/* Handle the obj_updated signal from the listener */
static void
-obj_updated_cb (CalListener *listener, const CORBA_char *uid, gpointer data)
+obj_updated_cb (CalListener *listener, const GNOME_Evolution_Calendar_CalObjUID uid, gpointer data)
{
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[OBJ_UPDATED], 0, uid);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[OBJ_UPDATED], uid);
}
/* Handle the obj_removed signal from the listener */
static void
-obj_removed_cb (CalListener *listener, const CORBA_char *uid, gpointer data)
+obj_removed_cb (CalListener *listener, const GNOME_Evolution_Calendar_CalObjUID uid, gpointer data)
{
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[OBJ_REMOVED], 0, uid);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[OBJ_REMOVED], uid);
}
/* Handle the error_occurred signal from the listener */
@@ -664,7 +597,7 @@ backend_error_cb (CalListener *listener, const char *message, gpointer data)
CalClient *client;
client = CAL_CLIENT (data);
- g_signal_emit (G_OBJECT (client), cal_client_signals[BACKEND_ERROR], 0, message);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[BACKEND_ERROR], message);
}
/* Handle the categories_changed signal from the listener */
@@ -684,7 +617,7 @@ categories_changed_cb (CalListener *listener, const GNOME_Evolution_Calendar_Str
for (i = 0; i < categories->_length; i++)
cats->pdata[i] = categories->_buffer[i];
- g_signal_emit (G_OBJECT (client), cal_client_signals[CATEGORIES_CHANGED], 0, cats);
+ gtk_signal_emit (GTK_OBJECT (client), cal_client_signals[CATEGORIES_CHANGED], cats);
g_ptr_array_free (cats, TRUE);
}
@@ -719,28 +652,40 @@ client_forget_password_cb (WombatClient *w_client,
client = CAL_CLIENT (user_data);
g_return_if_fail (IS_CAL_CLIENT (client));
- g_signal_emit (G_OBJECT (client),
- cal_client_signals [FORGET_PASSWORD],
- 0, key);
+ gtk_signal_emit (GTK_OBJECT (client),
+ cal_client_signals [FORGET_PASSWORD],
+ key);
}
-static GList *
-get_factories (void)
+/**
+ * cal_client_construct:
+ * @client: A calendar client.
+ *
+ * Constructs a calendar client object by contacting all available
+ * calendar factories.
+ *
+ * Return value: The same object as the @client argument, or NULL if the
+ * calendar factory could not be contacted.
+ **/
+CalClient *
+cal_client_construct (CalClient *client)
{
- static GList *factories = NULL;
+ CalClientPrivate *priv;
GNOME_Evolution_Calendar_CalFactory factory;
- Bonobo_ServerInfoList *servers;
+ OAF_ServerInfoList *servers;
CORBA_Environment ev;
int i;
- if (factories != NULL)
- return factories;
+ g_return_val_if_fail (client != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
+
+ priv = client->priv;
CORBA_exception_init (&ev);
- servers = bonobo_activation_query ("repo_ids.has ('IDL:GNOME/Evolution/Calendar/CalFactory:1.0')", NULL, &ev);
+ servers = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/Calendar/CalFactory:1.0')", NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("Cannot perform OAF query for Calendar servers.");
CORBA_exception_free (&ev);
@@ -751,50 +696,25 @@ get_factories (void)
g_warning ("No Calendar servers installed.");
for (i = 0; i < servers->_length; i++) {
- const Bonobo_ServerInfo *info;
+ const OAF_ServerInfo *info;
info = servers->_buffer + i;
factory = (GNOME_Evolution_Calendar_CalFactory)
- bonobo_activation_activate_from_id (info->iid, 0, NULL, &ev);
+ oaf_activate_from_id (info->iid, 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
-#if 0
g_warning ("cal_client_construct: Could not activate calendar server %s", info->iid);
CORBA_free (servers);
CORBA_exception_free (&ev);
return NULL;
-#endif
}
- else
- factories = g_list_prepend (factories, factory);
+
+ priv->factories = g_list_prepend (priv->factories, factory);
}
CORBA_free (servers);
- CORBA_exception_free (&ev);
- return factories;
-}
-
-/**
- * cal_client_construct:
- * @client: A calendar client.
- *
- * Constructs a calendar client object by contacting all available
- * calendar factories.
- *
- * Return value: The same object as the @client argument, or NULL if the
- * calendar factory could not be contacted.
- **/
-CalClient *
-cal_client_construct (CalClient *client)
-{
- CalClientPrivate *priv;
-
- g_return_val_if_fail (client != NULL, NULL);
- g_return_val_if_fail (IS_CAL_CLIENT (client), NULL);
-
- priv = client->priv;
- priv->factories = get_factories ();
+ CORBA_exception_free (&ev);
return client;
}
@@ -812,11 +732,11 @@ cal_client_new (void)
{
CalClient *client;
- client = g_object_new (CAL_CLIENT_TYPE, NULL);
+ client = gtk_type_new (CAL_CLIENT_TYPE);
if (!cal_client_construct (client)) {
g_message ("cal_client_new(): could not construct the calendar client");
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -964,21 +884,31 @@ get_fall_back_uri (gboolean tasks)
static char *
get_default_uri (gboolean tasks)
{
- EConfigListener *db;
+ Bonobo_ConfigDatabase db;
char *uri;
+ CORBA_Environment ev;
- db = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
if (tasks)
- uri = e_config_listener_get_string (db, "/apps/evolution/shell/default_folders/tasks_uri");
+ uri = bonobo_config_get_string (db, "/DefaultFolders/tasks_uri", &ev);
else
- uri = e_config_listener_get_string (db, "/apps/evolution/shell/default_folders/calendar_uri");
- g_object_unref (G_OBJECT (db));
+ uri = bonobo_config_get_string (db, "/DefaultFolders/calendar_uri", &ev);
+ bonobo_object_release_unref (db, NULL);
- if (!uri)
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
uri = get_fall_back_uri (tasks);
- else
+ } else {
uri = cal_util_expand_uri (uri, tasks);
+ }
return uri;
}
@@ -1075,10 +1005,8 @@ cal_client_uri_list (CalClient *client, CalMode mode)
uris = NULL;
break;
}
- else {
+ else
uris = g_list_concat (uris, build_uri_list (uri_seq));
- CORBA_free (uri_seq);
- }
CORBA_exception_free (&ev);
}
@@ -1101,8 +1029,8 @@ cal_client_get_load_state (CalClient *client)
{
CalClientPrivate *priv;
- g_return_val_if_fail (client != NULL, CAL_CLIENT_LOAD_NOT_LOADED);
- g_return_val_if_fail (IS_CAL_CLIENT (client), CAL_CLIENT_LOAD_NOT_LOADED);
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
priv = client->priv;
return priv->load_state;
@@ -1145,13 +1073,12 @@ cal_client_is_read_only (CalClient *client)
CORBA_Environment ev;
CORBA_boolean read_only;
- g_return_val_if_fail (client != NULL, FALSE);
- g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
+ g_return_val_if_fail (client != NULL, TRUE);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), TRUE);
priv = client->priv;
- if (priv->load_state != CAL_CLIENT_LOAD_LOADED)
- return FALSE;
+ g_return_val_if_fail (priv->load_state == CAL_CLIENT_LOAD_LOADED, FALSE);
CORBA_exception_init (&ev);
read_only = GNOME_Evolution_Calendar_Cal_isReadOnly (priv->cal, &ev);
@@ -1448,7 +1375,7 @@ cal_client_get_default_object (CalClient *client, CalObjType type, CalComponent
*comp = cal_component_new ();
if (!cal_component_set_icalcomponent (*comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (*comp);
+ gtk_object_unref (GTK_OBJECT (*comp));
*comp = NULL;
retval = CAL_CLIENT_GET_SYNTAX_ERROR;
@@ -1530,7 +1457,7 @@ cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
*comp = cal_component_new ();
if (!cal_component_set_icalcomponent (*comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (*comp));
+ gtk_object_unref (GTK_OBJECT (*comp));
*comp = NULL;
retval = CAL_CLIENT_GET_SYNTAX_ERROR;
@@ -1540,7 +1467,7 @@ cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
/* Now make sure we have all timezones needed for this object.
We do this to try to avoid any problems caused by getting a timezone
in the middle of other code. Any calls to ORBit result in a
- recursive call of the GLib main loop, which can cause problems for
+ recursive call of the GTK+ main loop, which can cause problems for
code that doesn't expect it. Currently GnomeCanvas has problems if
we try to get a timezone in the middle of a redraw, and there is a
resize pending, which leads to an assert failure and an abort. */
@@ -1645,7 +1572,7 @@ cal_client_get_timezone (CalClient *client,
tmp_zone = icaltimezone_new ();
if (!tmp_zone) {
/* FIXME: Needs better error code - out of memory. Or just
- abort like GLib does? */
+ abort like GTK+ does? */
retval = CAL_CLIENT_GET_NOT_FOUND;
goto out;
}
@@ -1771,7 +1698,7 @@ build_change_list (GNOME_Evolution_Calendar_CalObjChangeSeq *seq)
ccc->comp = cal_component_new ();
if (!cal_component_set_icalcomponent (ccc->comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (ccc->comp));
+ gtk_object_unref (GTK_OBJECT (ccc->comp));
continue;
}
ccc->type = corba_coc->type;
@@ -1966,7 +1893,7 @@ cal_client_get_free_busy (CalClient *client, GList *users,
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
continue;
}
@@ -2003,7 +1930,7 @@ generate_instances_obj_updated_cb (CalClient *client, const char *uid, gpointer
return;
g_hash_table_remove (uid_comp_hash, uid);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
status = cal_client_get_object (client, uid, &comp);
@@ -2040,7 +1967,7 @@ generate_instances_obj_removed_cb (CalClient *client, const char *uid, gpointer
return;
g_hash_table_remove (uid_comp_hash, uid);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Adds a component to the list; called from g_hash_table_foreach() */
@@ -2077,13 +2004,13 @@ get_objects_atomically (CalClient *client, CalObjType type, time_t start, time_t
/* While we are getting the actual object data, keep track of changes */
- obj_updated_id = g_signal_connect (G_OBJECT (client), "obj_updated",
- G_CALLBACK (generate_instances_obj_updated_cb),
- uid_comp_hash);
+ obj_updated_id = gtk_signal_connect (GTK_OBJECT (client), "obj_updated",
+ GTK_SIGNAL_FUNC (generate_instances_obj_updated_cb),
+ uid_comp_hash);
- obj_removed_id = g_signal_connect (G_OBJECT (client), "obj_removed",
- G_CALLBACK (generate_instances_obj_removed_cb),
- uid_comp_hash);
+ obj_removed_id = gtk_signal_connect (GTK_OBJECT (client), "obj_removed",
+ GTK_SIGNAL_FUNC (generate_instances_obj_removed_cb),
+ uid_comp_hash);
/* Get the objects */
@@ -2126,8 +2053,8 @@ get_objects_atomically (CalClient *client, CalObjType type, time_t start, time_t
* notification signals and generate the final list of components.
*/
- g_signal_handler_disconnect (client, obj_updated_id);
- g_signal_handler_disconnect (client, obj_removed_id);
+ gtk_signal_disconnect (GTK_OBJECT (client), obj_updated_id);
+ gtk_signal_disconnect (GTK_OBJECT (client), obj_removed_id);
objects = NULL;
g_hash_table_foreach (uid_comp_hash, add_component, &objects);
@@ -2154,7 +2081,7 @@ add_instance (CalComponent *comp, time_t start, time_t end, gpointer data)
ci = g_new (struct comp_instance, 1);
ci->comp = comp;
- g_object_ref (G_OBJECT (ci->comp));
+ gtk_object_ref (GTK_OBJECT (ci->comp));
ci->start = start;
ci->end = end;
@@ -2192,7 +2119,7 @@ compare_comp_instance (gconstpointer a, gconstpointer b)
* way so that the generated instances are actually in the server at the time
* the initial cal_client_get_objects_in_range() query ends.
*
- * The callback function should do a g_object_ref() of the calendar component
+ * The callback function should do a gtk_object_ref() of the calendar component
* it gets passed if it intends to keep it around.
**/
void
@@ -2227,7 +2154,7 @@ cal_client_generate_instances (CalClient *client, CalObjType type,
cal_recur_generate_instances (comp, start, end, add_instance, &instances,
cal_client_resolve_tzid_cb, client,
priv->default_zone);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (objects);
@@ -2254,7 +2181,7 @@ cal_client_generate_instances (CalClient *client, CalObjType type,
struct comp_instance *ci;
ci = l->data;
- g_object_unref (G_OBJECT (ci->comp));
+ gtk_object_unref (GTK_OBJECT (ci->comp));
g_free (ci);
}
@@ -2325,7 +2252,7 @@ build_component_alarms_list (GNOME_Evolution_Calendar_CalComponentAlarmsSeq *seq
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
continue;
}
@@ -2469,7 +2396,7 @@ cal_client_get_alarms_for_object (CalClient *client, const char *uid,
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
icalcomponent_free (icalcomp);
- g_object_unref (G_OBJECT (comp));
+ gtk_object_unref (GTK_OBJECT (comp));
goto out;
}
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index e44014b9be..867557ea08 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -21,24 +21,21 @@
#ifndef CAL_CLIENT_H
#define CAL_CLIENT_H
-#include <glib-object.h>
+#include <libgnome/gnome-defs.h>
+#include <gtk/gtkobject.h>
#include <cal-util/cal-recur.h>
#include <cal-util/cal-util.h>
#include <cal-client/cal-query.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_CLIENT_TYPE (cal_client_get_type ())
-#define CAL_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_CLIENT_TYPE, CalClient))
-#define CAL_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_CLIENT_TYPE, CalClientClass))
-#define IS_CAL_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_CLIENT_TYPE))
-#define IS_CAL_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_CLIENT_TYPE))
-
-#define CAL_CLIENT_OPEN_STATUS_ENUM_TYPE (cal_client_open_status_enum_get_type ())
-#define CAL_CLIENT_SET_MODE_STATUS_ENUM_TYPE (cal_client_set_mode_status_enum_get_type ())
-#define CAL_MODE_ENUM_TYPE (cal_mode_enum_get_type ())
+#define CAL_CLIENT(obj) (GTK_CHECK_CAST ((obj), CAL_CLIENT_TYPE, CalClient))
+#define CAL_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_CLIENT_TYPE, CalClientClass))
+#define IS_CAL_CLIENT(obj) (GTK_CHECK_TYPE ((obj), CAL_CLIENT_TYPE))
+#define IS_CAL_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_CLIENT_TYPE))
typedef struct _CalClient CalClient;
typedef struct _CalClientClass CalClientClass;
@@ -93,14 +90,14 @@ typedef enum {
} CalClientLoadState;
struct _CalClient {
- GObject object;
+ GtkObject object;
/* Private data */
CalClientPrivate *priv;
};
struct _CalClientClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
/* Notification signals */
@@ -124,11 +121,7 @@ typedef gchar * (* CalClientAuthFunc) (CalClient *client,
const gchar *key,
gpointer user_data);
-GType cal_client_get_type (void);
-
-GType cal_client_open_status_enum_get_type (void);
-GType cal_client_set_mode_status_enum_get_type (void);
-GType cal_mode_enum_get_type (void);
+GtkType cal_client_get_type (void);
CalClient *cal_client_construct (CalClient *client);
@@ -228,6 +221,6 @@ char* cal_client_get_component_as_string (CalClient *client,
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 671af4a9ec..2c9fce2f85 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include "cal-component.h"
#include "timeutil.h"
@@ -180,11 +181,11 @@ struct _CalComponentAlarm {
-static void cal_component_class_init (CalComponentClass *klass);
-static void cal_component_init (CalComponent *comp, CalComponentClass *klass);
-static void cal_component_finalize (GObject *object);
+static void cal_component_class_init (CalComponentClass *class);
+static void cal_component_init (CalComponent *comp);
+static void cal_component_destroy (GtkObject *object);
-static GObjectClass *parent_class;
+static GtkObjectClass *parent_class;
@@ -196,23 +197,24 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalComponent class.
**/
-GType
+GtkType
cal_component_get_type (void)
{
- static GType cal_component_type = 0;
+ static GtkType cal_component_type = 0;
if (!cal_component_type) {
- static GTypeInfo info = {
- sizeof (CalComponentClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_component_class_init,
- NULL, NULL,
- sizeof (CalComponent),
- 0,
- (GInstanceInitFunc) cal_component_init
- };
- cal_component_type = g_type_register_static (G_TYPE_OBJECT, "CalComponent", &info, 0);
+ static const GtkTypeInfo cal_component_info = {
+ "CalComponent",
+ sizeof (CalComponent),
+ sizeof (CalComponentClass),
+ (GtkClassInitFunc) cal_component_class_init,
+ (GtkObjectInitFunc) cal_component_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_component_type = gtk_type_unique (GTK_TYPE_OBJECT, &cal_component_info);
}
return cal_component_type;
@@ -220,20 +222,20 @@ cal_component_get_type (void)
/* Class initialization function for the calendar component object */
static void
-cal_component_class_init (CalComponentClass *klass)
+cal_component_class_init (CalComponentClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (GTK_TYPE_OBJECT);
- object_class->finalize = cal_component_finalize;
+ object_class->destroy = cal_component_destroy;
}
/* Object initialization function for the calendar component object */
static void
-cal_component_init (CalComponent *comp, CalComponentClass *klass)
+cal_component_init (CalComponent *comp)
{
CalComponentPrivate *priv;
@@ -356,9 +358,9 @@ free_icalcomponent (CalComponent *comp, gboolean free)
priv->need_sequence_inc = FALSE;
}
-/* Finalize handler for the calendar component object */
+/* Destroy handler for the calendar component object */
static void
-cal_component_finalize (GObject *object)
+cal_component_destroy (GtkObject *object)
{
CalComponent *comp;
CalComponentPrivate *priv;
@@ -376,8 +378,8 @@ cal_component_finalize (GObject *object)
g_free (priv);
comp->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -433,7 +435,7 @@ cal_component_gen_uid (void)
CalComponent *
cal_component_new (void)
{
- return CAL_COMPONENT (g_object_new (CAL_COMPONENT_TYPE, NULL));
+ return CAL_COMPONENT (gtk_type_new (CAL_COMPONENT_TYPE));
}
/**
@@ -4785,7 +4787,7 @@ cal_component_alarms_free (CalComponentAlarms *alarms)
g_return_if_fail (alarms != NULL);
g_assert (alarms->comp != NULL);
- g_object_unref (G_OBJECT (alarms->comp));
+ gtk_object_unref (GTK_OBJECT (alarms->comp));
for (l = alarms->alarms; l; l = l->next) {
CalAlarmInstance *instance;
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index f363099836..3117dcdf2e 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -22,21 +22,21 @@
#ifndef CAL_COMPONENT_H
#define CAL_COMPONENT_H
-#include <glib/gmacros.h>
+#include <libgnome/gnome-defs.h>
#include <time.h>
-#include <glib-object.h>
+#include <gtk/gtkobject.h>
#include <ical.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_COMPONENT_TYPE (cal_component_get_type ())
-#define CAL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_COMPONENT_TYPE, CalComponent))
-#define CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_COMPONENT_TYPE, \
+#define CAL_COMPONENT(obj) (GTK_CHECK_CAST ((obj), CAL_COMPONENT_TYPE, CalComponent))
+#define CAL_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_COMPONENT_TYPE, \
CalComponentClass))
-#define IS_CAL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_COMPONENT_TYPE))
-#define IS_CAL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_COMPONENT_TYPE))
+#define IS_CAL_COMPONENT(obj) (GTK_CHECK_TYPE ((obj), CAL_COMPONENT_TYPE))
+#define IS_CAL_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_COMPONENT_TYPE))
/* Types of calendar components to be stored by a CalComponent, as per RFC 2445.
* We don't put the alarm component type here since we store alarms as separate
@@ -184,19 +184,19 @@ typedef struct _CalComponentClass CalComponentClass;
typedef struct _CalComponentPrivate CalComponentPrivate;
struct _CalComponent {
- GObject object;
+ GtkObject object;
/* Private data */
CalComponentPrivate *priv;
};
struct _CalComponentClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
};
/* Calendar component */
-GType cal_component_get_type (void);
+GtkType cal_component_get_type (void);
char *cal_component_gen_uid (void);
@@ -444,6 +444,6 @@ icalcomponent *cal_component_alarm_get_icalcomponent (CalComponentAlarm *alarm);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index 123198676c..8ba1fc435d 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -23,7 +23,6 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
-#include <libgnome/gnome-i18n.h>
#include <cal-util/cal-recur.h>
#include <cal-util/timeutil.h>
@@ -3981,36 +3980,3 @@ cal_recur_set_rule_end_date (icalproperty *prop,
icalproperty_add_parameter (prop, param);
}
-const char *cal_recur_nth[31] = {
- N_("1st"),
- N_("2nd"),
- N_("3rd"),
- N_("4th"),
- N_("5th"),
- N_("6th"),
- N_("7th"),
- N_("8th"),
- N_("9th"),
- N_("10th"),
- N_("11th"),
- N_("12th"),
- N_("13th"),
- N_("14th"),
- N_("15th"),
- N_("16th"),
- N_("17th"),
- N_("18th"),
- N_("19th"),
- N_("20th"),
- N_("21st"),
- N_("22nd"),
- N_("23rd"),
- N_("24th"),
- N_("25th"),
- N_("26th"),
- N_("27th"),
- N_("28th"),
- N_("29th"),
- N_("30th"),
- N_("31st")
-};
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index ad495bca77..bb89c043b4 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include "cal-util.h"
@@ -102,33 +103,6 @@ cal_util_new_top_level (void)
return icalcomp;
}
-static char *
-get_line_fn (char *buf, size_t size, void *file)
-{
- return fgets (buf, size, file);
-}
-
-icalcomponent *
-cal_util_parse_ics_file (const char *filename)
-{
- icalparser *parser;
- icalcomponent *icalcomp;
- FILE *file;
-
- file = fopen (filename, "r");
- if (!file)
- return NULL;
-
- parser = icalparser_new ();
- icalparser_set_gen_data (parser, file);
-
- icalcomp = icalparser_parse (parser, get_line_fn);
- icalparser_free (parser);
- fclose (file);
-
- return icalcomp;
-}
-
/* Computes the range of time in which recurrences should be generated for a
* component in order to compute alarm trigger times.
*/
@@ -483,7 +457,7 @@ cal_util_generate_alarms_for_comp (CalComponent *comp,
alarms = g_new (CalComponentAlarms, 1);
alarms->comp = comp;
- g_object_ref (G_OBJECT (alarms->comp));
+ gtk_object_ref (GTK_OBJECT (alarms->comp));
alarms->alarms = g_slist_sort (aod.triggers, compare_alarm_instance);
return alarms;
diff --git a/calendar/cal-util/cal-util.h b/calendar/cal-util/cal-util.h
index 7b4f6c051e..e48fb2b80e 100644
--- a/calendar/cal-util/cal-util.h
+++ b/calendar/cal-util/cal-util.h
@@ -22,13 +22,14 @@
#ifndef CAL_UTIL_H
#define CAL_UTIL_H
+#include <libgnome/gnome-defs.h>
#include <ical.h>
#include <time.h>
#include <glib.h>
#include <cal-util/cal-component.h>
#include <cal-util/cal-recur.h>
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
@@ -71,8 +72,6 @@ void cal_obj_uid_list_free (GList *list);
icalcomponent *cal_util_new_top_level (void);
-icalcomponent *cal_util_parse_ics_file (const char *filename);
-
CalComponentAlarms *cal_util_generate_alarms_for_comp (CalComponent *comp,
time_t start,
time_t end,
@@ -99,7 +98,7 @@ char *cal_util_expand_uri (char *uri, gboolean tasks);
void cal_util_add_timezones_from_component (icalcomponent *vcal_comp,
CalComponent *comp);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 5358605826..4cb47e49ea 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -23,6 +23,8 @@
#include <config.h>
+#include <bonobo.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <cal-client/cal-client-types.h>
#include <cal-client/cal-client.h>
#include <cal-util/timeutil.h>
@@ -37,7 +39,6 @@
#include <e-pilot-map.h>
#include <e-pilot-settings.h>
#include <e-pilot-util.h>
-#include <e-config-listener.h>
GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
@@ -85,7 +86,7 @@ struct _ECalLocalRecord {
static void
calconduit_destroy_record (ECalLocalRecord *local)
{
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
free_Appointment (local->appt);
g_free (local->appt);
g_free (local);
@@ -118,11 +119,7 @@ calconduit_load_configuration (guint32 pilot_id)
/* Sync Type */
management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
c->sync_type = GnomePilotConduitSyncTypeNotSet;
gtk_object_unref (GTK_OBJECT (config));
@@ -310,9 +307,9 @@ e_calendar_context_destroy (ECalConduitContext *ctxt)
e_cal_gui_destroy (ctxt->gui);
if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
- if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
+ gtk_object_unref (GTK_OBJECT (ctxt->client));
+ if (ctxt->default_comp != NULL)
+ gtk_object_unref (GTK_OBJECT (ctxt->default_comp));
if (ctxt->uids != NULL)
cal_obj_uid_list_free (ctxt->uids);
@@ -412,8 +409,8 @@ start_calendar_server (ECalConduitContext *ctxt)
ctxt->client = cal_client_new ();
- g_signal_connect (ctxt->client, "cal_opened",
- G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
+ start_calendar_server_cb, &success);
if (!cal_client_open_default_calendar (ctxt->client, FALSE))
return -1;
@@ -444,14 +441,24 @@ get_timezone (CalClient *client, const char *tzid)
static icaltimezone *
get_default_timezone (void)
{
- EConfigListener *listener;
+ Bonobo_ConfigDatabase db;
icaltimezone *timezone = NULL;
char *location;
+ CORBA_Environment ev;
- listener = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
+ location = bonobo_config_get_string_with_default (db,
+ "/Calendar/Display/Timezone", "UTC", NULL);
if (!location || !location[0]) {
g_free (location);
location = g_strdup ("UTC");
@@ -460,7 +467,7 @@ get_default_timezone (void)
timezone = icaltimezone_get_builtin_timezone (location);
g_free (location);
- g_object_unref (listener);
+ bonobo_object_release_unref (db, NULL);
return timezone;
}
@@ -701,33 +708,6 @@ compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *ui
}
}
-static gboolean
-rrules_mostly_equal (struct icalrecurrencetype *a, struct icalrecurrencetype *b)
-{
- struct icalrecurrencetype acopy, bcopy;
-
- acopy = *a;
- bcopy = *b;
-
- acopy.until = bcopy.until = icaltime_null_time ();
- acopy.count = bcopy.count = 0;
-
- if (!memcmp (&acopy, &bcopy, sizeof (struct icalrecurrencetype)))
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-find_last_cb (CalComponent *comp, time_t start, time_t end, gpointer data)
-{
- time_t *last = data;
-
- *last = start;
-
- return TRUE;
-}
-
static GnomePilotRecord
local_record_to_pilot_record (ECalLocalRecord *local,
ECalConduitContext *ctxt)
@@ -770,7 +750,7 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
g_return_if_fail (comp != NULL);
local->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
cal_component_get_uid (local->comp, &uid);
local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
@@ -906,24 +886,14 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
local->appt->repeatFrequency = recur->interval;
}
- if (!icaltime_is_null_time (recur->until)) {
- local->appt->repeatForever = 0;
- local->appt->repeatEnd = icaltimetype_to_tm_with_zone (&recur->until,
- icaltimezone_get_utc_timezone (),
- default_tz);
- } else if (recur->count > 0) {
- time_t last = -1;
- struct icaltimetype itt;
-
- /* The palm does not support count recurrences */
- local->appt->repeatForever = 0;
- cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- cal_client_resolve_tzid_cb, ctxt->client,
- default_tz);
- itt = icaltime_from_timet_with_zone (last, TRUE, default_tz);
- local->appt->repeatEnd = icaltimetype_to_tm (&itt);
- } else {
+ if (icaltime_is_null_time (recur->until)) {
local->appt->repeatForever = 1;
+ } else {
+ local->appt->repeatForever = 0;
+ icaltimezone_convert_time (&recur->until,
+ icaltimezone_get_utc_timezone (),
+ default_tz);
+ local->appt->repeatEnd = icaltimetype_to_tm (&recur->until);
}
cal_component_free_recur_list (list);
@@ -1016,13 +986,13 @@ local_record_from_uid (ECalLocalRecord *local,
if (status == CAL_CLIENT_GET_SUCCESS) {
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else if (status == CAL_CLIENT_GET_NOT_FOUND) {
comp = cal_component_new ();
cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
cal_component_set_uid (comp, uid);
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
INFO ("Object did not exist");
}
@@ -1032,7 +1002,6 @@ static CalComponent *
comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
GnomePilotRecord *remote,
CalComponent *in_comp,
- CalClient *client,
icaltimezone *timezone)
{
CalComponent *comp;
@@ -1153,47 +1122,17 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
}
if (recur.freq != ICAL_NO_RECURRENCE) {
- GSList *list = NULL, *existing;
- struct icalrecurrencetype *erecur;
+ GSList *list = NULL;
/* recurrence start of week */
recur.week_start = get_ical_day (appt.repeatWeekstart);
if (!appt.repeatForever) {
- recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE);
+ recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE);
}
list = g_slist_append (list, &recur);
cal_component_set_rrule_list (comp, list);
-
- /* If the desktop uses count and rrules are
- * equivalent, use count still on the desktop */
- if (!appt.repeatForever && cal_component_has_rrules (in_comp)) {
- cal_component_get_rrule_list (in_comp, &existing);
- erecur = existing->data;
-
- /* If the rules are otherwise the same and the existing uses count,
- see if they end at the same point */
- if (rrules_mostly_equal (&recur, erecur) &&
- icaltime_is_null_time (erecur->until) && erecur->count > 0) {
- time_t last, elast;
-
- cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last,
- cal_client_resolve_tzid_cb, client,
- timezone);
- cal_recur_generate_instances (in_comp, -1, -1, find_last_cb, &elast,
- cal_client_resolve_tzid_cb, client,
- timezone);
-
-
- if (last == elast) {
- recur.until = icaltime_null_time ();
- recur.count = erecur->count;
- cal_component_set_rrule_list (comp, list);
- }
- }
- }
-
g_slist_free (list);
} else {
cal_component_set_rrule_list (comp, NULL);
@@ -1264,7 +1203,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
cal_component_set_transparency (comp, CAL_COMPONENT_TRANSP_NONE);
- if (remote->secret)
+ if (remote->attr & dlpRecAttrSecret)
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PRIVATE);
else
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PUBLIC);
@@ -1396,7 +1335,7 @@ pre_sync (GnomePilotConduit *conduit,
cal_component_get_uid (ccc->comp, &uid);
if (e_pilot_map_lookup_pid (ctxt->map, uid, FALSE) == 0) {
ctxt->changed = g_list_remove (ctxt->changed, ccc);
- g_object_unref (ccc->comp);
+ gtk_object_unref (GTK_OBJECT (ccc->comp));
g_free (ccc);
}
}
@@ -1662,7 +1601,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
LOG ("add_record: adding %s to desktop\n", print_remote (remote));
- comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->client, ctxt->timezone);
+ comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->timezone);
/* Give it a new UID otherwise it will be the uid of the default comp */
uid = cal_component_gen_uid ();
@@ -1673,7 +1612,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return retval;
}
@@ -1692,8 +1631,8 @@ replace_record (GnomePilotConduitSyncAbs *conduit,
LOG ("replace_record: replace %s with %s\n",
print_local (local), print_remote (remote));
- new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->client, ctxt->timezone);
- g_object_unref (local->comp);
+ new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone);
+ gtk_object_unref (GTK_OBJECT (local->comp));
local->comp = new_comp;
update_comp (conduit, local->comp, ctxt);
@@ -1851,6 +1790,16 @@ revert_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt)
ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg);
}
+static ORBit_MessageValidationResult
+accept_all_cookies (CORBA_unsigned_long request_id,
+ CORBA_Principal *principal,
+ CORBA_char *operation)
+{
+ /* allow ALL cookies */
+ return ORBIT_MESSAGE_ALLOW_ALL;
+}
+
+
GnomePilotConduit *
conduit_get_gpilot_conduit (guint32 pilot_id)
{
@@ -1859,6 +1808,21 @@ conduit_get_gpilot_conduit (guint32 pilot_id)
LOG ("in calendar's conduit_get_gpilot_conduit\n");
+ /* we need to find wombat with oaf, so make sure oaf
+ is initialized here. once the desktop is converted
+ to oaf and gpilotd is built with oaf, this can go away */
+ if (!oaf_is_initialized ()) {
+ char *argv[ 1 ] = {"hi"};
+ oaf_init (1, argv);
+
+ if (bonobo_init (CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ ORBit_set_request_validation_handler (accept_all_cookies);
+ }
+
retval = gnome_pilot_conduit_sync_abs_new ("DatebookDB", 0x64617465);
g_assert (retval != NULL);
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index a07ed35706..7f834921ca 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -23,6 +23,9 @@
#include <config.h>
+#include <liboaf/liboaf.h>
+#include <bonobo.h>
+#include <bonobo-conf/bonobo-config-database.h>
#include <cal-client/cal-client-types.h>
#include <cal-client/cal-client.h>
#include <cal-util/timeutil.h>
@@ -38,7 +41,6 @@
#include <e-pilot-map.h>
#include <e-pilot-settings.h>
#include <e-pilot-util.h>
-#include <e-config-listener.h>
GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
@@ -84,7 +86,7 @@ struct _EToDoLocalRecord {
static void
todoconduit_destroy_record (EToDoLocalRecord *local)
{
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
free_ToDo (local->todo);
g_free (local->todo);
g_free (local);
@@ -117,11 +119,7 @@ todoconduit_load_configuration (guint32 pilot_id)
c->pilot_id = pilot_id;
management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
c->sync_type = GnomePilotConduitSyncTypeNotSet;
gtk_object_unref (GTK_OBJECT (config));
@@ -309,10 +307,10 @@ e_todo_context_destroy (EToDoConduitContext *ctxt)
e_todo_gui_destroy (ctxt->gui);
if (ctxt->client != NULL)
- g_object_unref (ctxt->client);
+ gtk_object_unref (GTK_OBJECT (ctxt->client));
if (ctxt->default_comp != NULL)
- g_object_unref (ctxt->default_comp);
+ gtk_object_unref (GTK_OBJECT (ctxt->default_comp));
if (ctxt->uids != NULL)
cal_obj_uid_list_free (ctxt->uids);
@@ -419,8 +417,8 @@ start_calendar_server (EToDoConduitContext *ctxt)
ctxt->client = cal_client_new ();
- g_signal_connect (ctxt->client, "cal_opened",
- G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
+ start_calendar_server_cb, &success);
if (!cal_client_open_default_tasks (ctxt->client, FALSE))
return -1;
@@ -451,14 +449,24 @@ get_timezone (CalClient *client, const char *tzid)
static icaltimezone *
get_default_timezone (void)
{
- EConfigListener *listener;
+ Bonobo_ConfigDatabase db;
icaltimezone *timezone = NULL;
char *location;
+ CORBA_Environment ev;
- listener = e_config_listener_new ();
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
- location = e_config_listener_get_string_with_default (listener,
- "/apps/evolution/calendar/display/timezone", "UTC", NULL);
+ location = bonobo_config_get_string_with_default (db,
+ "/Calendar/Display/Timezone", "UTC", NULL);
if (!location || !location[0]) {
g_free (location);
location = g_strdup ("UTC");
@@ -467,7 +475,7 @@ get_default_timezone (void)
timezone = icaltimezone_get_builtin_timezone (location);
g_free (location);
- g_object_unref (listener);
+ bonobo_object_release_unref (db, NULL);
return timezone;
}
@@ -586,7 +594,7 @@ local_record_from_comp (EToDoLocalRecord *local, CalComponent *comp, EToDoCondui
g_return_if_fail (comp != NULL);
local->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
cal_component_get_uid (local->comp, &uid);
local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
@@ -685,13 +693,13 @@ local_record_from_uid (EToDoLocalRecord *local,
if (status == CAL_CLIENT_GET_SUCCESS) {
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else if (status == CAL_CLIENT_GET_NOT_FOUND) {
comp = cal_component_new ();
cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
cal_component_set_uid (comp, uid);
local_record_from_comp (local, comp, ctxt);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
INFO ("Object did not exist");
}
@@ -780,7 +788,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
}
if (!is_empty_time (todo.due)) {
- due = tm_to_icaltimetype (&todo.due, TRUE);
+ due = tm_to_icaltimetype (&todo.due, FALSE);
dt.value = &due;
cal_component_set_due (comp, &dt);
}
@@ -805,7 +813,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit,
cal_component_set_priority (comp, &priority);
cal_component_set_transparency (comp, CAL_COMPONENT_TRANSP_NONE);
- if (remote->secret)
+ if (remote->attr & dlpRecAttrSecret)
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PRIVATE);
else
cal_component_set_classification (comp, CAL_COMPONENT_CLASS_PUBLIC);
@@ -1185,7 +1193,7 @@ add_record (GnomePilotConduitSyncAbs *conduit,
update_comp (conduit, comp, ctxt);
e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return retval;
}
@@ -1205,7 +1213,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit,
print_local (local), print_remote (remote));
new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone);
- g_object_unref (local->comp);
+ gtk_object_unref (GTK_OBJECT (local->comp));
local->comp = new_comp;
update_comp (conduit, local->comp, ctxt);
@@ -1362,6 +1370,16 @@ revert_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt)
ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg);
}
+static ORBit_MessageValidationResult
+accept_all_cookies (CORBA_unsigned_long request_id,
+ CORBA_Principal *principal,
+ CORBA_char *operation)
+{
+ /* allow ALL cookies */
+ return ORBIT_MESSAGE_ALLOW_ALL;
+}
+
+
GnomePilotConduit *
conduit_get_gpilot_conduit (guint32 pilot_id)
{
@@ -1370,6 +1388,21 @@ conduit_get_gpilot_conduit (guint32 pilot_id)
LOG ("in todo's conduit_get_gpilot_conduit\n");
+ /* we need to find wombat with oaf, so make sure oaf
+ is initialized here. once the desktop is converted
+ to oaf and gpilotd is built with oaf, this can go away */
+ if (!oaf_is_initialized ()) {
+ char *argv[ 1 ] = {"hi"};
+ oaf_init (1, argv);
+
+ if (bonobo_init (CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL,
+ CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ ORBit_set_request_validation_handler (accept_all_cookies);
+ }
+
retval = gnome_pilot_conduit_sync_abs_new ("ToDoDB", 0x746F646F);
g_assert (retval != NULL);
diff --git a/calendar/gui/alarm-notify/.cvsignore b/calendar/gui/alarm-notify/.cvsignore
index 5d0cf13a94..f6892abafa 100644
--- a/calendar/gui/alarm-notify/.cvsignore
+++ b/calendar/gui/alarm-notify/.cvsignore
@@ -8,5 +8,8 @@ evolution-calendar-skels.c
evolution-calendar-common.c
evolution-calendar.h
evolution-alarm-notify
-GNOME_Evolution_Calendar_AlarmNotify.server
-GNOME_Evolution_Calendar_AlarmNotify.server.in
+Evolution-Composer-common.c
+Evolution-Composer-skels.c
+Evolution-Composer-stubs.c
+Evolution-Composer.h
+GNOME_Evolution_Calendar_AlarmNotify.oaf
diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/gui/alarm-notify/Makefile.am
index a85e99a9cf..eedfb95040 100644
--- a/calendar/gui/alarm-notify/Makefile.am
+++ b/calendar/gui/alarm-notify/Makefile.am
@@ -1,21 +1,30 @@
-CORBA_GENERATED_H = \
- evolution-calendar.h
-CORBA_GENERATED_C = \
+CORBA_GENERATED = \
+ Evolution-Composer.h \
+ Evolution-Composer-common.c \
+ Evolution-Composer-skels.c \
+ Evolution-Composer-stubs.c \
+ evolution-calendar.h \
evolution-calendar-common.c \
evolution-calendar-skels.c \
evolution-calendar-stubs.c
-CORBA_GENERATED = $(CORBA_GENERATED_C) $(CORBA_GENERATED_H)
-idls = $(top_srcdir)/calendar/idl/evolution-calendar.idl
-idl_flags = $(IDL_INCLUDES)
+idls = \
+ $(top_srcdir)/composer/Evolution-Composer.idl \
+ $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CORBA_GENERATED_H): $(idls)
+idl_flags = `$(GNOME_CONFIG) --cflags idl` -I $(datadir)/idl
+
+$(CORBA_GENERATED): $(idls)
+ $(ORBIT_IDL) $(idl_flags) $(srcdir)/../../../composer/Evolution-Composer.idl
$(ORBIT_IDL) $(idl_flags) $(top_srcdir)/calendar/idl/evolution-calendar.idl
-$(CORBA_GENERATED_C): $(CORBA_GENERATED_H)
+bin_PROGRAMS = evolution-alarm-notify
-privlibexec_PROGRAMS = evolution-alarm-notify
+noinst_LIBRARIES = libalarm.a
+libalarm_a_SOURCES = \
+ alarm.c \
+ alarm.h
INCLUDES = \
-DG_LOG_DOMAIN=\"evolution-alarm-notify\" \
@@ -25,18 +34,22 @@ INCLUDES = \
-I$(top_srcdir)/libical/src/libical \
-I$(top_builddir)/libical/src/libical \
-I$(top_srcdir)/widgets \
+ -I$(includedir) \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
$(EVOLUTION_CALENDAR_CFLAGS)
+iconsdir = $(datadir)/images/evolution
+
+gladedir = $(datadir)/evolution/glade
+
glade_DATA = \
alarm-notify.glade
evolution_alarm_notify_SOURCES = \
$(CORBA_GENERATED) \
- alarm.c \
- alarm.h \
alarm-notify.c \
alarm-notify.h \
alarm-notify-dialog.c \
@@ -50,22 +63,27 @@ evolution_alarm_notify_SOURCES = \
save.h
evolution_alarm_notify_LDADD = \
+ libalarm.a \
$(top_builddir)/calendar/cal-client/libcal-client.la \
$(top_builddir)/calendar/cal-util/libcal-util.la \
+ $(top_builddir)/libical/src/libical/libical-evolution.la \
+ $(top_builddir)/libwombat/libwombat.la \
+ $(top_builddir)/e-util/libeutil.la \
$(EVOLUTION_CALENDAR_LIBS)
-server_in_files = \
- GNOME_Evolution_Calendar_AlarmNotify.server.in.in
+evolution_alarm_notify_LDFLAGS = -export-dynamic
+
+oafdir = $(datadir)/oaf
+oaf_in_files = \
+ GNOME_Evolution_Calendar_AlarmNotify.oaf.in
-server_DATA = $(server_in_files:.server.in.in=.server)
-$(server_in_files:.server.in.in=.server.in): $(server_in_files)
- sed -e "s|\@LIBEXECDIR\@|$(privlibexecdir)|" $< > $@
+oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-@INTLTOOL_SERVER_RULE@
+@XML_I18N_MERGE_OAF_RULE@
EXTRA_DIST = \
- $(server_DATA) \
- $(server_in_files) \
+ $(oaf_DATA) \
+ $(oaf_in_files) \
$(glade_DATA)
BUILT_SOURCES = $(CORBA_GENERATED)
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index fc52172851..c24adc0ec3 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -22,20 +22,20 @@
#include <config.h>
#endif
-#include <string.h>
#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-object.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkbox.h>
-#include <gtk/gtkdialog.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkstock.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-sound.h>
+#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <cal-util/timeutil.h>
#include "alarm.h"
@@ -87,9 +87,6 @@ typedef struct {
/* List of QueuedAlarm structures */
GSList *queued_alarms;
-
- /* Flags */
- gboolean expecting_update;
} CompQueuedAlarms;
/* Pair of a queued alarm ID and the alarm trigger instance it refers to */
@@ -196,8 +193,7 @@ lookup_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id)
* the last one listed for the component, it removes the component itself.
*/
static void
-remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
- gboolean free_object, gboolean remove_alarm)
+remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id)
{
QueuedAlarm *qa;
const char *uid;
@@ -217,13 +213,6 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
cqa->queued_alarms = g_slist_remove_link (cqa->queued_alarms, l);
g_slist_free_1 (l);
- if (remove_alarm) {
- cal_component_remove_alarm (cqa->alarms->comp, qa->instance->auid);
- cqa->expecting_update = TRUE;
- cal_client_update_object (cqa->parent_client->client, cqa->alarms->comp);
- cqa->expecting_update = FALSE;
- }
-
g_free (qa);
/* If this was the last queued alarm for this component, remove the
@@ -233,16 +222,14 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gpointer alarm_id,
if (cqa->queued_alarms != NULL)
return;
- if (free_object) {
- cal_component_get_uid (cqa->alarms->comp, &uid);
- g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid);
- cqa->parent_client = NULL;
- cal_component_alarms_free (cqa->alarms);
- g_free (cqa);
- } else {
- cal_component_alarms_free (cqa->alarms);
- cqa->alarms = NULL;
- }
+ cal_component_get_uid (cqa->alarms->comp, &uid);
+ g_hash_table_remove (cqa->parent_client->uid_alarms_hash, uid);
+ cqa->parent_client = NULL;
+
+ cal_component_alarms_free (cqa->alarms);
+ cqa->alarms = NULL;
+
+ g_free (cqa);
}
/* Callback used when an alarm triggers */
@@ -319,7 +306,6 @@ add_component_alarms (ClientAlarms *ca, CalComponentAlarms *alarms)
cqa = g_new (CompQueuedAlarms, 1);
cqa->parent_client = ca;
cqa->alarms = alarms;
- cqa->expecting_update = FALSE;
cqa->queued_alarms = NULL;
@@ -438,11 +424,22 @@ lookup_comp_queued_alarms (ClientAlarms *ca, const char *uid)
return g_hash_table_lookup (ca->uid_alarms_hash, uid);
}
+/* Removes a component an its alarms */
static void
-remove_alarms (CompQueuedAlarms *cqa, gboolean free_object)
+remove_comp (ClientAlarms *ca, const char *uid)
{
+ CompQueuedAlarms *cqa;
GSList *l;
+ cqa = lookup_comp_queued_alarms (ca, uid);
+ if (!cqa)
+ return;
+
+ /* If a component is present, then it means we must have alarms queued
+ * for it.
+ */
+ g_assert (cqa->queued_alarms != NULL);
+
for (l = cqa->queued_alarms; l;) {
QueuedAlarm *qa;
@@ -455,28 +452,9 @@ remove_alarms (CompQueuedAlarms *cqa, gboolean free_object)
l = l->next;
alarm_remove (qa->alarm_id);
- remove_queued_alarm (cqa, qa->alarm_id, free_object, FALSE);
+ remove_queued_alarm (cqa, qa->alarm_id);
}
-}
-
-/* Removes a component an its alarms */
-static void
-remove_comp (ClientAlarms *ca, const char *uid)
-{
- CompQueuedAlarms *cqa;
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- return;
-
- /* If a component is present, then it means we must have alarms queued
- * for it.
- */
- g_assert (cqa->queued_alarms != NULL);
-
- remove_alarms (cqa, TRUE);
-
/* The list should be empty now, and thus the queued component alarms
* structure should have been freed and removed from the hash table.
*/
@@ -494,10 +472,11 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
CalComponentAlarms *alarms;
gboolean found;
icaltimezone *zone;
- CompQueuedAlarms *cqa;
ca = data;
+ remove_comp (ca, uid);
+
now = time (NULL);
zone = config_data_get_timezone ();
@@ -506,51 +485,10 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
found = cal_client_get_alarms_for_object (ca->client, uid, now, day_end, &alarms);
- if (!found) {
- remove_comp (ca, uid);
+ if (!found)
return;
- }
-
- cqa = lookup_comp_queued_alarms (ca, uid);
- if (!cqa)
- add_component_alarms (ca, alarms);
- else {
- GSList *l;
-
- /* if already in the list, just update it */
- remove_alarms (cqa, FALSE);
- cqa->alarms = alarms;
- cqa->queued_alarms = NULL;
-
- /* add the new alarms */
- for (l = cqa->alarms->alarms; l; l = l->next) {
- CalAlarmInstance *instance;
- gpointer alarm_id;
- QueuedAlarm *qa;
-
- instance = l->data;
-
- alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL);
- if (!alarm_id) {
- g_message ("obj_updated_cb(): Could not schedule a trigger for "
- "%ld, discarding...", (long) instance->trigger);
- continue;
- }
-
- qa = g_new (QueuedAlarm, 1);
- qa->alarm_id = alarm_id;
- qa->instance = instance;
- qa->snooze = FALSE;
-
- cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa);
- }
- if (cqa->queued_alarms == NULL) {
- if (!cqa->expecting_update)
- remove_comp (ca, uid);
- } else
- cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms);
- }
+ add_component_alarms (ca, alarms);
}
/* Called when a calendar component is removed; we must delete its corresponding
@@ -613,22 +551,24 @@ create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins)
/* Launches a component editor for a component */
static void
-edit_component (CalClient *client, CalComponent *comp)
+edit_component (CompQueuedAlarms *cqa)
{
+ CalComponent *comp;
const char *uid;
const char *uri;
CORBA_Environment ev;
GNOME_Evolution_Calendar_CompEditorFactory factory;
+ comp = cqa->alarms->comp;
cal_component_get_uid (comp, &uid);
- uri = cal_client_get_uri (client);
+ uri = cal_client_get_uri (cqa->parent_client->client);
/* Get the factory */
CORBA_exception_init (&ev);
- factory = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory",
- 0, NULL, &ev);
+ factory = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory",
+ 0, NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_message ("edit_component(): Could not activate the component editor factory");
@@ -660,33 +600,8 @@ edit_component (CalClient *client, CalComponent *comp)
struct notify_dialog_closure {
CompQueuedAlarms *cqa;
gpointer alarm_id;
- CalClient *client;
- CalComponent *comp;
- gpointer dialog;
};
-static void
-on_dialog_obj_updated_cb (CalClient *client, const char *uid, gpointer data)
-{
- struct notify_dialog_closure *c = data;
-}
-
-static void
-on_dialog_obj_removed_cb (CalClient *client, const char *uid, gpointer data)
-{
- const char *our_uid;
- struct notify_dialog_closure *c = data;
-
- cal_component_get_uid (c->comp, &our_uid);
- g_return_if_fail (our_uid && *our_uid);
-
- if (!strcmp (uid, our_uid)) {
- alarm_notify_dialog_disable_buttons (c->dialog);
- c->cqa = NULL;
- c->alarm_id = NULL;
- }
-}
-
/* Callback used from the alarm notify dialog */
static void
notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
@@ -695,18 +610,13 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
c = data;
- g_signal_handlers_disconnect_matched (c->client, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, on_dialog_obj_updated_cb, NULL);
- g_signal_handlers_disconnect_matched (c->client, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, on_dialog_obj_removed_cb, NULL);
-
switch (result) {
case ALARM_NOTIFY_SNOOZE:
create_snooze (c->cqa, c->alarm_id, snooze_mins);
break;
case ALARM_NOTIFY_EDIT:
- edit_component (c->client, c->comp);
+ edit_component (c->cqa);
break;
case ALARM_NOTIFY_CLOSE:
@@ -717,10 +627,7 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
g_assert_not_reached ();
}
- if (c->cqa != NULL)
- remove_queued_alarm (c->cqa, c->alarm_id, TRUE, TRUE);
- g_object_unref (c->comp);
- g_object_unref (c->client);
+ remove_queued_alarm (c->cqa, c->alarm_id);
g_free (c);
}
@@ -777,21 +684,12 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa,
c = g_new (struct notify_dialog_closure, 1);
c->cqa = cqa;
c->alarm_id = alarm_id;
- c->comp = cal_component_clone (comp);
- c->client = c->cqa->parent_client->client;
- g_object_ref (c->client);
-
- if (!(c->dialog = alarm_notify_dialog (trigger,
- qa->instance->occur_start, qa->instance->occur_end,
- vtype, message,
- notify_dialog_cb, c)))
+
+ if (!alarm_notify_dialog (trigger,
+ qa->instance->occur_start, qa->instance->occur_end,
+ vtype, message,
+ notify_dialog_cb, c))
g_message ("display_notification(): Could not create the alarm notify dialog");
- else {
- g_signal_connect (c->client, "obj_updated",
- G_CALLBACK (on_dialog_obj_updated_cb), c);
- g_signal_connect (c->client, "obj_removed",
- G_CALLBACK (on_dialog_obj_removed_cb), c);
- }
}
/* Performs notification of an audio alarm */
@@ -836,23 +734,16 @@ static void
mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id)
{
GtkWidget *dialog;
- GtkWidget *label;
/* FIXME */
display_notification (trigger, cqa, alarm_id, FALSE);
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_OK, GTK_RESPONSE_CANCEL,
- NULL);
- label = gtk_label_new (_("Evolution does not support calendar reminders with\n"
- "email notifications yet, but this reminder was\n"
- "configured to send an email. Evolution will display\n"
- "a normal reminder dialog box instead."));
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
+ dialog = gnome_warning_dialog (_("Evolution does not support calendar reminders with\n"
+ "email notifications yet, but this reminder was\n"
+ "configured to send an email. Evolution will display\n"
+ "a normal reminder dialog box instead."));
+ gnome_dialog_run (GNOME_DIALOG (dialog));
}
/* Performs notification of a procedure alarm */
@@ -866,11 +757,10 @@ procedure_notification_dialog (const char *cmd, const char *url)
if (is_blessed_program (url))
return TRUE;
- dialog = gtk_dialog_new_with_buttons (_("Warning"),
- NULL, 0,
- GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
- GTK_STOCK_YES, GTK_RESPONSE_OK,
- NULL);
+ dialog = gnome_dialog_new (_("Warning"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
str = g_strdup_printf (_("An Evolution Calendar reminder is about to trigger. "
"This reminder is configured to run the following program:\n\n"
@@ -881,21 +771,21 @@ procedure_notification_dialog (const char *cmd, const char *url)
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
label, TRUE, TRUE, 4);
g_free (str);
checkbox = gtk_check_button_new_with_label
(_("Do not ask me about this program again."));
gtk_widget_show (checkbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
checkbox, TRUE, TRUE, 4);
/* Run the dialog */
- btn = gtk_dialog_run (GTK_DIALOG (dialog));
- if (btn == GTK_RESPONSE_OK && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
+ btn = gnome_dialog_run (GNOME_DIALOG (dialog));
+ if (btn == GNOME_YES && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox)))
save_blessed_program (url);
- gtk_widget_destroy (dialog);
+ gnome_dialog_close (GNOME_DIALOG (dialog));
return (btn == GNOME_YES);
}
@@ -955,7 +845,7 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id
if (result < 0)
goto fallback;
- remove_queued_alarm (cqa, alarm_id, TRUE, TRUE);
+ remove_queued_alarm (cqa, alarm_id);
return;
fallback:
@@ -1045,7 +935,7 @@ alarm_queue_add_client (CalClient *client)
ca = g_new (ClientAlarms, 1);
ca->client = client;
- g_object_ref (ca->client);
+ gtk_object_ref (GTK_OBJECT (ca->client));
ca->refcount = 1;
g_hash_table_insert (client_alarms_hash, client, ca);
@@ -1053,16 +943,13 @@ alarm_queue_add_client (CalClient *client)
ca->uid_alarms_hash = g_hash_table_new (g_str_hash, g_str_equal);
if (cal_client_get_load_state (client) != CAL_CLIENT_LOAD_LOADED)
- g_signal_connect (client, "cal_opened",
- G_CALLBACK (cal_opened_cb),
- ca);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), ca);
- g_signal_connect (client, "obj_updated",
- G_CALLBACK (obj_updated_cb),
- ca);
- g_signal_connect (client, "obj_removed",
- G_CALLBACK (obj_removed_cb),
- ca);
+ gtk_signal_connect (GTK_OBJECT (client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), ca);
+ gtk_signal_connect (GTK_OBJECT (client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), ca);
if (cal_client_get_load_state (client) == CAL_CLIENT_LOAD_LOADED) {
load_alarms_for_today (ca);
@@ -1138,10 +1025,9 @@ alarm_queue_remove_client (CalClient *client)
/* Clean up */
- g_signal_handlers_disconnect_matched (ca->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (ca->client), ca);
- g_object_unref (ca->client);
+ gtk_object_unref (GTK_OBJECT (ca->client));
ca->client = NULL;
g_hash_table_destroy (ca->uid_alarms_hash);
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index d4b5185351..910d72fa17 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -29,7 +29,7 @@
#include <ctype.h>
#include <libgnomeui/gnome-messagebox.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnome/gnome-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <e-util/e-time-utils.h>
@@ -97,7 +97,7 @@ struct _CalendarModelPrivate {
gchar *default_category;
/* Addresses for determining icons */
- EAccountList *accounts;
+ GList *addresses;
/* The current timezone. */
icaltimezone *zone;
@@ -113,7 +113,7 @@ struct _CalendarModelPrivate {
static void calendar_model_class_init (CalendarModelClass *class);
static void calendar_model_init (CalendarModel *model);
-static void calendar_model_finalize (GObject *object);
+static void calendar_model_destroy (GtkObject *object);
static int calendar_model_column_count (ETableModel *etm);
static int calendar_model_row_count (ETableModel *etm);
@@ -144,23 +144,42 @@ static ETableModelClass *parent_class;
*
* Return value: The type ID of the #CalendarModel class.
**/
+GtkType
+calendar_model_get_type (void)
+{
+ static GtkType calendar_model_type = 0;
+
+ if (!calendar_model_type) {
+ static GtkTypeInfo calendar_model_info = {
+ "CalendarModel",
+ sizeof (CalendarModel),
+ sizeof (CalendarModelClass),
+ (GtkClassInitFunc) calendar_model_class_init,
+ (GtkObjectInitFunc) calendar_model_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ calendar_model_type = gtk_type_unique (E_TABLE_MODEL_TYPE, &calendar_model_info);
+ }
-E_MAKE_TYPE (calendar_model, "CalendarModel", CalendarModel, calendar_model_class_init,
- calendar_model_init, E_TABLE_MODEL_TYPE);
+ return calendar_model_type;
+}
/* Class initialization function for the calendar table model */
static void
calendar_model_class_init (CalendarModelClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
ETableModelClass *etm_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
etm_class = (ETableModelClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (E_TABLE_MODEL_TYPE);
- object_class->finalize = calendar_model_finalize;
+ object_class->destroy = calendar_model_destroy;
etm_class->column_count = calendar_model_column_count;
etm_class->row_count = calendar_model_row_count;
@@ -215,7 +234,7 @@ calendar_model_init (CalendarModel *model)
priv->timeout_id = g_timeout_add (CALENDAR_MODEL_REFRESH_TIMEOUT,
calendar_model_timeout_cb, model);
- priv->accounts = itip_addresses_get ();
+ priv->addresses = itip_addresses_get ();
priv->zone = NULL;
@@ -276,7 +295,7 @@ free_objects (CalendarModel *model)
comp = g_array_index (priv->objects, CalComponent *, i);
g_assert (comp != NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
object_data = &g_array_index (priv->objects_data,
CalendarModelObjectData, i);
@@ -289,7 +308,7 @@ free_objects (CalendarModel *model)
/* Destroy handler for the calendar table model */
static void
-calendar_model_finalize (GObject *object)
+calendar_model_destroy (GtkObject *object)
{
CalendarModel *model;
CalendarModelPrivate *priv;
@@ -308,8 +327,8 @@ calendar_model_finalize (GObject *object)
/* Free the calendar client interface object */
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
@@ -319,9 +338,8 @@ calendar_model_finalize (GObject *object)
}
if (priv->query) {
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), model);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
@@ -340,8 +358,10 @@ calendar_model_finalize (GObject *object)
g_free (priv->default_category);
+ itip_addresses_free (priv->addresses);
+
if (priv->activity) {
- g_object_unref (priv->activity);
+ gtk_object_unref (GTK_OBJECT (priv->activity));
priv->activity = NULL;
}
@@ -350,8 +370,8 @@ calendar_model_finalize (GObject *object)
g_free (priv);
model->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -826,6 +846,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row)
case CAL_COMPONENT_FIELD_ICON:
{
+ ItipAddress *ia;
GSList *attendees = NULL, *sl;
gint retval = 0;
@@ -839,17 +860,23 @@ calendar_model_value_at (ETableModel *etm, int col, int row)
for (sl = attendees; sl != NULL; sl = sl->next) {
CalComponentAttendee *ca = sl->data;
const char *text;
+ GList *l;
text = itip_strip_mailto (ca->value);
- if (e_account_list_find(priv->accounts, E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL) {
- if (ca->delto != NULL)
- retval = 3;
- else
- retval = 2;
- break;
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ia = l->data;
+
+ if (!strcmp (text, ia->address)) {
+ if (ca->delto != NULL)
+ retval = 3;
+ else
+ retval = 2;
+ goto cleanup;
+ }
}
}
+ cleanup:
cal_component_free_attendee_list (attendees);
return GINT_TO_POINTER (retval);
break;
@@ -1394,7 +1421,7 @@ calendar_model_append_row (ETableModel *etm, ETableModel *source, gint row)
g_message ("calendar_model_append_row(): Could not add new object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Duplicates a string value */
@@ -1460,7 +1487,7 @@ calendar_model_duplicate_value (ETableModel *etm, int col, const void *value)
CalComponent *comp;
comp = CAL_COMPONENT (value);
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
return comp;
}
@@ -1516,7 +1543,7 @@ calendar_model_free_value (ETableModel *etm, int col, void *value)
case CAL_COMPONENT_FIELD_COMPONENT:
if (value)
- g_object_unref (value);
+ gtk_object_unref (GTK_OBJECT (value));
break;
default:
@@ -1670,7 +1697,7 @@ date_value_to_string (ETableModel *etm, const void *value)
e_time_format_date_and_time (&tmp_tm, priv->use_24_hour_format,
TRUE, FALSE,
buffer, sizeof (buffer));
- return g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (buffer);
}
@@ -1698,17 +1725,17 @@ calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
case CAL_COMPONENT_FIELD_ICON:
if (GPOINTER_TO_INT (value) == 0)
- return g_locale_to_utf8 (_("Normal"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Normal"));
else if (GPOINTER_TO_INT (value) == 1)
- return g_locale_to_utf8 (_("Recurring"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Recurring"));
else
- return g_locale_to_utf8 (_("Assigned"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (_("Assigned"));
case CAL_COMPONENT_FIELD_HAS_ALARMS:
case CAL_COMPONENT_FIELD_COMPLETE:
case CAL_COMPONENT_FIELD_RECURRING:
case CAL_COMPONENT_FIELD_OVERDUE:
- return g_locale_to_utf8 (value ? _("Yes") : _("No"), -1, NULL, NULL, NULL);
+ return e_utf8_from_locale_string (value ? _("Yes") : _("No"));
case CAL_COMPONENT_FIELD_COLOR:
return NULL;
@@ -1741,7 +1768,7 @@ calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
CalendarModel *
calendar_model_new (void)
{
- return CALENDAR_MODEL (g_object_new (TYPE_CALENDAR_MODEL, NULL));
+ return CALENDAR_MODEL (gtk_type_new (TYPE_CALENDAR_MODEL));
}
@@ -1964,9 +1991,8 @@ update_query (CalendarModel *model)
priv->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, model);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), model);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (priv->sexp != NULL);
@@ -1982,14 +2008,14 @@ update_query (CalendarModel *model)
return;
}
- g_signal_connect (priv->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), model);
- g_signal_connect (priv->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), model);
- g_signal_connect (priv->query, "query_done",
- G_CALLBACK (query_query_done_cb), model);
- g_signal_connect (priv->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), model);
}
/* Callback used when a calendar is opened into the server */
@@ -2061,7 +2087,7 @@ remove_object (CalendarModel *model, const char *uid)
calendar_model_free_object_data (model, object_data);
g_array_remove_index (priv->objects_data, *idx);
- g_object_unref (orig_comp);
+ gtk_object_unref (GTK_OBJECT (orig_comp));
n = *idx;
g_free (idx);
@@ -2085,7 +2111,7 @@ calendar_model_set_status_message (CalendarModel *model, const char *message)
if (!message || !*message) {
if (priv->activity) {
- g_object_unref (priv->activity);
+ gtk_object_unref (GTK_OBJECT (priv->activity));
priv->activity = NULL;
}
}
@@ -2094,7 +2120,7 @@ calendar_model_set_status_message (CalendarModel *model, const char *message)
char *client_id = g_strdup_printf ("%p", model);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE);
priv->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
@@ -2153,11 +2179,11 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy
return;
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model);
+ gtk_object_unref (GTK_OBJECT (priv->client));
}
priv->client = client;
@@ -2167,7 +2193,8 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy
if (cal_client_get_load_state (priv->client) == CAL_CLIENT_LOAD_LOADED)
update_query (model);
else
- g_signal_connect (priv->client, "cal_opened", G_CALLBACK (cal_opened_cb), model);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), model);
}
}
@@ -2276,7 +2303,7 @@ calendar_model_mark_task_complete (CalendarModel *model,
**/
CalComponent *
calendar_model_get_component (CalendarModel *model,
- gint row)
+ gint row)
{
CalendarModelPrivate *priv;
diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c
index c5b742d614..f7e4615b2d 100644
--- a/calendar/gui/calendar-offline-handler.c
+++ b/calendar/gui/calendar-offline-handler.c
@@ -34,8 +34,8 @@
#include <cal-client/cal-client.h>
#include "calendar-offline-handler.h"
-#define PARENT_TYPE bonobo_object_get_type ()
-static BonoboObjectClass *parent_class = NULL;
+#define PARENT_TYPE bonobo_x_object_get_type ()
+static BonoboXObjectClass *parent_class = NULL;
struct _CalendarOfflineHandlerPrivate {
CalClient *client;
@@ -152,11 +152,12 @@ backend_cal_opened_offline (CalClient *client, CalClientOpenStatus status, gpoin
if (status != CAL_CLIENT_OPEN_SUCCESS) {
update_offline (offline_handler);
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
- g_signal_connect (client, "cal_set_mode", G_CALLBACK (backend_cal_set_mode), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_set_mode",
+ backend_cal_set_mode, offline_handler);
cal_client_set_mode (client, CAL_MODE_LOCAL);
}
@@ -166,7 +167,7 @@ backend_cal_opened_online (CalClient *client, CalClientOpenStatus status, gpoint
CalendarOfflineHandler *offline_handler = data;
if (status != CAL_CLIENT_OPEN_SUCCESS) {
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
@@ -182,11 +183,12 @@ backend_go_offline (gpointer data, gpointer user_data)
gboolean success;
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (backend_cal_opened_offline), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ backend_cal_opened_offline, offline_handler);
success = cal_client_open_calendar (client, uri, TRUE);
if (!success) {
update_offline (offline_handler);
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
}
@@ -200,11 +202,11 @@ backend_go_online (gpointer data, gpointer user_data)
gboolean success;
client = cal_client_new ();
- g_signal_connect (G_OBJECT (client), "cal_opened",
- G_CALLBACK (backend_cal_opened_online), offline_handler);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ backend_cal_opened_online, offline_handler);
success = cal_client_open_calendar (client, uri, TRUE);
if (!success) {
- g_object_unref (G_OBJECT (client));
+ gtk_object_unref (GTK_OBJECT (client));
return;
}
}
@@ -245,10 +247,10 @@ impl_goOnline (PortableServer_Servant servant,
g_list_foreach (uris, backend_go_online, offline_handler);
}
-/* GObject methods. */
+/* GtkObject methods. */
static void
-impl_dispose (GObject *object)
+impl_destroy (GtkObject *object)
{
CalendarOfflineHandler *offline_handler;
CalendarOfflineHandlerPrivate *priv;
@@ -262,22 +264,12 @@ impl_dispose (GObject *object)
CORBA_exception_init (&ev);
CORBA_Object_release (priv->listener_interface, &ev);
CORBA_exception_free (&ev);
-
- priv->listener_interface = CORBA_OBJECT_NIL;
}
-}
-
-static void
-impl_finalize (GObject *object)
-{
- CalendarOfflineHandler *offline_handler;
- CalendarOfflineHandlerPrivate *priv;
-
- offline_handler = CALENDAR_OFFLINE_HANDLER (object);
- priv = offline_handler->priv;
-
g_free (priv);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/* GTK+ type initialization. */
@@ -285,12 +277,11 @@ impl_finalize (GObject *object)
static void
calendar_offline_handler_class_init (CalendarOfflineHandlerClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
POA_GNOME_Evolution_Offline__epv *epv;
- object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = impl_dispose;
- object_class->finalize = impl_finalize;
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = impl_destroy;
epv = & klass->epv;
epv->_get_isOffline = impl__get_isOffline;
@@ -319,9 +310,9 @@ calendar_offline_handler_new (void)
{
CalendarOfflineHandler *new;
- new = g_object_new (calendar_offline_handler_get_type (), NULL);
+ new = gtk_type_new (calendar_offline_handler_get_type ());
return new;
}
-BONOBO_TYPE_FUNC_FULL (CalendarOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, calendar_offline_handler);
+BONOBO_X_TYPE_FUNC_FULL (CalendarOfflineHandler, GNOME_Evolution_Offline, PARENT_TYPE, calendar_offline_handler);
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 6c40a0d644..cef7ce29c9 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -22,9 +22,10 @@
#include <config.h>
#endif
-#include <gtk/gtkmessagedialog.h>
#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnome/gnome-i18n.h>
#include <evolution-calendar.h>
#include <e-util/e-url.h>
#include <cal-client/cal-client.h>
@@ -91,7 +92,7 @@ struct CompEditorFactoryPrivate {
static void comp_editor_factory_class_init (CompEditorFactoryClass *class);
static void comp_editor_factory_init (CompEditorFactory *factory);
-static void comp_editor_factory_finalize (GObject *object);
+static void comp_editor_factory_destroy (GtkObject *object);
static void impl_editExisting (PortableServer_Servant servant,
const CORBA_char *str_uri,
@@ -102,29 +103,29 @@ static void impl_editNew (PortableServer_Servant servant,
const GNOME_Evolution_Calendar_CalObjType type,
CORBA_Environment *ev);
-static BonoboObjectClass *parent_class = NULL;
+static BonoboXObjectClass *parent_class = NULL;
-BONOBO_TYPE_FUNC_FULL (CompEditorFactory,
- GNOME_Evolution_Calendar_CompEditorFactory,
- BONOBO_OBJECT_TYPE,
- comp_editor_factory);
+BONOBO_X_TYPE_FUNC_FULL (CompEditorFactory,
+ GNOME_Evolution_Calendar_CompEditorFactory,
+ BONOBO_X_OBJECT_TYPE,
+ comp_editor_factory);
/* Class initialization function for the component editor factory */
static void
comp_editor_factory_class_init (CompEditorFactoryClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (BONOBO_X_OBJECT_TYPE);
class->epv.editExisting = impl_editExisting;
class->epv.editNew = impl_editNew;
- object_class->finalize = comp_editor_factory_finalize;
+ object_class->destroy = comp_editor_factory_destroy;
}
/* Object initialization function for the component editor factory */
@@ -160,7 +161,7 @@ free_client (OpenClient *oc)
g_free (oc->uri);
oc->uri = NULL;
- g_object_unref (oc->client);
+ gtk_object_unref (GTK_OBJECT (oc->client));
oc->client = NULL;
for (l = oc->pending; l; l = l->next) {
@@ -187,7 +188,7 @@ free_client_cb (gpointer key, gpointer value, gpointer data)
/* Destroy handler for the component editor factory */
static void
-comp_editor_factory_finalize (GObject *object)
+comp_editor_factory_destroy (GtkObject *object)
{
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
@@ -205,8 +206,8 @@ comp_editor_factory_finalize (GObject *object)
g_free (priv);
factory->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -283,7 +284,7 @@ edit_existing (OpenClient *oc, const char *uid)
default:
g_message ("edit_exiting(): Unsupported object type %d", (int) vtype);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -292,7 +293,8 @@ edit_existing (OpenClient *oc, const char *uid)
comp_editor_focus (editor);
oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
+ gtk_signal_connect (GTK_OBJECT (editor), "destroy",
+ GTK_SIGNAL_FUNC (editor_destroy_cb), oc);
e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
}
@@ -381,7 +383,8 @@ edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompE
comp_editor_focus (editor);
oc->editor_count++;
- g_signal_connect (editor, "destroy", G_CALLBACK (editor_destroy_cb), oc);
+ gtk_signal_connect (GTK_OBJECT (editor), "destroy",
+ GTK_SIGNAL_FUNC (editor_destroy_cb), oc);
e_comp_editor_registry_add (comp_editor_registry, editor, TRUE);
}
@@ -438,7 +441,6 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
OpenClient *oc;
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
- GtkWidget *dialog = NULL;
oc = data;
factory = oc->factory;
@@ -451,9 +453,7 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
return;
case CAL_CLIENT_OPEN_ERROR:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Error while opening the calendar"));
+ gnome_error_dialog (_("Error while opening the calendar"));
break;
case CAL_CLIENT_OPEN_NOT_FOUND:
@@ -462,25 +462,18 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data)
return;
case CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED:
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Method not supported when opening the calendar"));
+ gnome_error_dialog (_("Method not supported when opening the calendar"));
break;
case CAL_CLIENT_OPEN_PERMISSION_DENIED :
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
- _("Permission denied to open the calendar"));
+ gnome_error_dialog (_("Permission denied to open calendar"));
break;
-
+
default:
g_assert_not_reached ();
return;
}
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
g_hash_table_remove (priv->uri_client_hash, oc->uri);
free_client (oc);
}
@@ -512,18 +505,19 @@ open_client (CompEditorFactory *factory, const char *uristr)
oc->pending = NULL;
oc->open = FALSE;
- g_signal_connect (oc->client, "cal_opened", G_CALLBACK (cal_opened_cb), oc);
-
- g_hash_table_insert (priv->uri_client_hash, oc->uri, oc);
+ gtk_signal_connect (GTK_OBJECT (oc->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), oc);
if (!cal_client_open_calendar (oc->client, uristr, FALSE)) {
g_free (oc->uri);
- g_object_unref (oc->client);
+ gtk_object_unref (GTK_OBJECT (oc->client));
g_free (oc);
return NULL;
}
+ g_hash_table_insert (priv->uri_client_hash, oc->uri, oc);
+
return oc;
}
@@ -659,7 +653,7 @@ impl_editNew (PortableServer_Servant servant,
CompEditorFactory *
comp_editor_factory_new (void)
{
- return g_object_new (TYPE_COMP_EDITOR_FACTORY, NULL);
+ return gtk_type_new (TYPE_COMP_EDITOR_FACTORY);
}
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index fc3496be67..951fff204e 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#include <string.h>
#include "calendar-config.h"
#include "comp-util.h"
#include "dialogs/delete-comp.h"
@@ -230,7 +229,7 @@ cal_comp_is_on_server (CalComponent *comp, CalClient *client)
switch (status) {
case CAL_CLIENT_GET_SUCCESS:
- g_object_unref (server_comp);
+ gtk_object_unref (GTK_OBJECT (server_comp));
return TRUE;
case CAL_CLIENT_GET_SYNTAX_ERROR:
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index 53ea88a9dc..bcba6c22fe 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -1,12 +1,13 @@
IDLS = $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED = $(IDL_GENERATED_H)
+IDL_GENERATED = \
+ Evolution-Addressbook-SelectNames.h \
+ Evolution-Addressbook-SelectNames-common.c \
+ Evolution-Addressbook-SelectNames-skels.c \
+ Evolution-Addressbook-SelectNames-stubs.c
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- --nostubs --noskels --nocommon \
+$(IDL_GENERATED): $(IDLS)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
$(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
BUILT_SOURCES = $(IDL_GENERATED)
@@ -23,16 +24,17 @@ INCLUDES = \
-I$(top_srcdir)/shell \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
+ -I$(includedir) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
+ -DGNOMELOCALEDIR=\""$(localedir)"\" \
$(EVOLUTION_CALENDAR_CFLAGS)
-noinst_LTLIBRARIES = libcal-dialogs.la
+noinst_LIBRARIES = libcal-dialogs.a
-libcal_dialogs_la_SOURCES = \
+libcal_dialogs_a_SOURCES = \
$(IDL_GENERATED) \
alarm-options.c \
alarm-options.h \
@@ -77,6 +79,9 @@ libcal_dialogs_la_SOURCES = \
task-page.c \
task-page.h
+iconsdir = $(datadir)/images/evolution
+
+gladedir = $(datadir)/evolution/glade
glade_DATA = \
alarm-options.glade \
alarm-page.glade \
@@ -89,6 +94,7 @@ glade_DATA = \
task-details-page.glade \
task-page.glade
+etspecdir = $(datadir)/evolution/etspec/
etspec_DATA = meeting-page.etspec
CLEANFILES = $(BUILT_SOURCES)
diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c
index 2261bb0bd7..cf64bff9a8 100644
--- a/calendar/gui/dialogs/alarm-options.c
+++ b/calendar/gui/dialogs/alarm-options.c
@@ -24,12 +24,14 @@
#include <string.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkhbox.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-widget.h>
@@ -166,7 +168,7 @@ setup_select_names (Dialog *dialog)
CORBA_exception_init (&ev);
- dialog->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+ dialog->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
if (BONOBO_EX (&ev))
return FALSE;
@@ -256,19 +258,19 @@ init_widgets (Dialog *dialog)
dialog->canceled = TRUE;
- g_signal_connect((dialog->toplevel), "delete_event",
- G_CALLBACK (toplevel_delete_event_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->toplevel), "delete_event",
+ GTK_SIGNAL_FUNC (toplevel_delete_event_cb), dialog);
- g_signal_connect((dialog->button_ok), "clicked",
- G_CALLBACK (button_ok_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_ok), "clicked",
+ GTK_SIGNAL_FUNC (button_ok_clicked_cb), dialog);
- g_signal_connect((dialog->button_cancel), "clicked",
- G_CALLBACK (button_cancel_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_cancel), "clicked",
+ GTK_SIGNAL_FUNC (button_cancel_clicked_cb), dialog);
/* Alarm repeat */
- g_signal_connect((dialog->repeat_toggle), "toggled",
- G_CALLBACK (repeat_toggle_toggled_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->repeat_toggle), "toggled",
+ GTK_SIGNAL_FUNC (repeat_toggle_toggled_cb), dialog);
}
/* Fills the audio alarm widgets with the values from the alarm component */
@@ -350,7 +352,7 @@ alarm_to_malarm_widgets (Dialog *dialog, CalComponentAlarm *alarm)
"destinations", e_destination_exportv (destv), NULL);
for (i = 0; i < len; i++)
- g_object_unref (GTK_OBJECT (destv[i]));
+ gtk_object_unref (GTK_OBJECT (destv[i]));
g_free (destv);
cal_component_free_attendee_list (attendee_list);
@@ -616,7 +618,7 @@ malarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
/* Attendees */
bonobo_widget_get_property (BONOBO_WIDGET (dialog->malarm_addresses), "destinations",
- TC_CORBA_string, &str, NULL);
+ &str, NULL);
destv = e_destination_importv (str);
g_free (str);
@@ -761,23 +763,23 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
g_return_val_if_fail (alarm != NULL, FALSE);
- dialog.repeat = repeat;
- dialog.email = email;
- dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL, NULL);
+ dialog.repeat = repeat;
+ dialog.email = email;
+ dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL);
if (!dialog.xml) {
g_message ("alarm_options_dialog_new(): Could not load the Glade XML file!");
return FALSE;
}
if (!get_widgets (&dialog)) {
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return FALSE;
}
-
+
if (!setup_select_names (&dialog)) {
- g_object_unref (dialog.xml);
- return FALSE;
- }
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
+ return FALSE;
+ }
init_widgets (&dialog);
@@ -790,7 +792,7 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
dialog_to_alarm (&dialog, alarm);
gtk_widget_destroy (dialog.toplevel);
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return TRUE;
}
diff --git a/calendar/gui/dialogs/alarm-options.glade b/calendar/gui/dialogs/alarm-options.glade
index 83f0af1f80..ef36167157 100644
--- a/calendar/gui/dialogs/alarm-options.glade
+++ b/calendar/gui/dialogs/alarm-options.glade
@@ -1,556 +1,463 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="alarm-options-toplevel">
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>Dialogs</name>
+ <program_name>dialogs</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>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-options-toplevel</name>
+ <visible>False</visible>
+ <title></title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>True</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame1</name>
+ <label>Alarm Repeat</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkCheckButton" id="repeat-toggle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="label" translatable="yes">Repeat the alarm</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="repeat-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-quantity">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">extra times every</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="repeat-unit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>repeat-toggle</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <label>Repeat the alarm</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alarm Repeat</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="dalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkHBox</class>
+ <name>repeat-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Display</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="dalarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-quantity</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>1</value>
+ <lower>1</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label1</name>
+ <label>extra times every</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-value</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>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>repeat-unit</name>
+ <can_focus>True</can_focus>
+ <items>minutes
+hours
+days
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>dalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="aalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play sound:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GnomeFileEntry" id="file-entry1">
- <property name="visible">True</property>
- <property name="max_saved">10</property>
- <property name="directory_entry">False</property>
- <property name="modal">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="aalarm-attach">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label2</name>
+ <label>Message to Display</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow1</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</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>dalarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>aalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="malarm-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="malarm-address-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="malarm-addressbook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Send To:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Send</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="malarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label3</name>
+ <label>Play sound:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>file-entry1</name>
+ <max_saved>10</max_saved>
+ <directory>False</directory>
+ <modal>False</modal>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>aalarm-attach</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>malarm-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="palarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run program:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="palarm-program">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow2</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>malarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label7</name>
+ <label>Message to Send</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>malarm-address-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>malarm-addressbook</name>
+ <can_focus>True</can_focus>
+ <label>Send To:</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">With these arguments:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="palarm-args">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Placeholder</class>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>palarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">30</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="button-ok">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label5</name>
+ <label>Run program:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-program</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>GtkLabel</class>
+ <name>label6</name>
+ <label>With these arguments:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-args</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>
- <child>
- <widget class="GtkButton" id="button-cancel">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-ok</name>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-cancel</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index 2008881ff3..78322eaf52 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -1,14 +1,12 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* Evolution calendar - Alarm page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -29,11 +27,8 @@
#endif
#include <string.h>
-#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtkoptionmenu.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -44,7 +39,6 @@
#include "../calendar-config.h"
#include "comp-editor-util.h"
#include "alarm-options.h"
-#include "../e-alarm-list.h"
#include "alarm-page.h"
@@ -76,9 +70,6 @@ struct _AlarmPagePrivate {
/* Alarm options dialog and the alarm we maintain */
CalComponentAlarm *alarm;
- /* Alarm store for the GtkTreeView list widget */
- EAlarmList *list_store;
-
gboolean updating;
};
@@ -134,7 +125,7 @@ static const int time_map[] = {
static void alarm_page_class_init (AlarmPageClass *class);
static void alarm_page_init (AlarmPage *apage);
-static void alarm_page_finalize (GObject *object);
+static void alarm_page_destroy (GtkObject *object);
static GtkWidget *alarm_page_get_widget (CompEditorPage *page);
static void alarm_page_focus_main_widget (CompEditorPage *page);
@@ -155,21 +146,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #AlarmPage class.
**/
+GtkType
+alarm_page_get_type (void)
+{
+ static GtkType alarm_page_type;
+
+ if (!alarm_page_type) {
+ static const GtkTypeInfo alarm_page_info = {
+ "AlarmPage",
+ sizeof (AlarmPage),
+ sizeof (AlarmPageClass),
+ (GtkClassInitFunc) alarm_page_class_init,
+ (GtkObjectInitFunc) alarm_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ alarm_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &alarm_page_info);
+ }
-E_MAKE_TYPE (alarm_page, "AlarmPage", AlarmPage, alarm_page_class_init,
- alarm_page_init, TYPE_COMP_EDITOR_PAGE);
+ return alarm_page_type;
+}
/* Class initialization function for the alarm page */
static void
alarm_page_class_init (AlarmPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- gobject_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = alarm_page_get_widget;
editor_page_class->focus_main_widget = alarm_page_focus_main_widget;
@@ -178,7 +189,7 @@ alarm_page_class_init (AlarmPageClass *class)
editor_page_class->set_summary = alarm_page_set_summary;
editor_page_class->set_dates = alarm_page_set_dates;
- gobject_class->finalize = alarm_page_finalize;
+ object_class->destroy = alarm_page_destroy;
}
/* Object initialization function for the alarm page */
@@ -209,7 +220,7 @@ alarm_page_init (AlarmPage *apage)
/* create the default alarm, which will contain the
* X-EVOLUTION-NEEDS-DESCRIPTION property, so that we
- * set a correct description if none is set */
+ * set a correct description if none is ser */
priv->alarm = cal_component_alarm_new ();
icalcomp = cal_component_alarm_get_icalcomponent (priv->alarm);
@@ -222,7 +233,7 @@ alarm_page_init (AlarmPage *apage)
/* Destroy handler for the alarm page */
static void
-alarm_page_finalize (GObject *object)
+alarm_page_destroy (GtkObject *object)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
@@ -234,7 +245,7 @@ alarm_page_finalize (GObject *object)
priv = apage->priv;
if (priv->xml) {
- g_object_unref (priv->xml);
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
@@ -243,16 +254,11 @@ alarm_page_finalize (GObject *object)
priv->alarm = NULL;
}
- if (priv->list_store) {
- g_object_unref (priv->list_store);
- priv->list_store = NULL;
- }
-
g_free (priv);
apage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -305,7 +311,174 @@ clear_widgets (AlarmPage *apage)
e_dialog_option_menu_set (priv->time, CAL_ALARM_TRIGGER_RELATIVE_START, time_map);
/* List data */
- e_alarm_list_clear (priv->list_store);
+ gtk_clist_clear (GTK_CLIST (priv->list));
+}
+
+/* Builds a string for the duration of the alarm. If the duration is zero, returns NULL. */
+static char *
+get_alarm_duration_string (struct icaldurationtype *duration)
+{
+ GString *string = g_string_new (NULL);
+ char *ret;
+ gboolean have_something;
+
+ have_something = FALSE;
+
+ if (duration->days > 1) {
+ g_string_sprintf (string, _("%d days"), duration->days);
+ have_something = TRUE;
+ } else if (duration->days == 1) {
+ g_string_append (string, _("1 day"));
+ have_something = TRUE;
+ }
+
+ if (duration->weeks > 1) {
+ g_string_sprintf (string, _("%d weeks"), duration->weeks);
+ have_something = TRUE;
+ } else if (duration->weeks == 1) {
+ g_string_append (string, _("1 week"));
+ have_something = TRUE;
+ }
+
+ if (duration->hours > 1) {
+ g_string_sprintf (string, _("%d hours"), duration->hours);
+ have_something = TRUE;
+ } else if (duration->hours == 1) {
+ g_string_append (string, _("1 hour"));
+ have_something = TRUE;
+ }
+
+ if (duration->minutes > 1) {
+ g_string_sprintf (string, _("%d minutes"), duration->minutes);
+ have_something = TRUE;
+ } else if (duration->minutes == 1) {
+ g_string_append (string, _("1 minute"));
+ have_something = TRUE;
+ }
+
+ if (duration->seconds > 1) {
+ g_string_sprintf (string, _("%d seconds"), duration->seconds);
+ have_something = TRUE;
+ } else if (duration->seconds == 1) {
+ g_string_append (string, _("1 second"));
+ have_something = TRUE;
+ }
+
+ if (have_something) {
+ ret = string->str;
+ g_string_free (string, FALSE);
+ return ret;
+ } else {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+}
+
+static char *
+get_alarm_string (CalComponentAlarm *alarm)
+{
+ CalAlarmAction action;
+ CalAlarmTrigger trigger;
+ char string[256];
+ char *base, *str = NULL, *dur;
+
+ string [0] = '\0';
+
+ cal_component_alarm_get_action (alarm, &action);
+ cal_component_alarm_get_trigger (alarm, &trigger);
+
+ switch (action) {
+ case CAL_ALARM_AUDIO:
+ base = _("Play a sound");
+ break;
+
+ case CAL_ALARM_DISPLAY:
+ base = _("Display a message");
+ break;
+
+ case CAL_ALARM_EMAIL:
+ base = _("Send an email");
+ break;
+
+ case CAL_ALARM_PROCEDURE:
+ base = _("Run a program");
+ break;
+
+ case CAL_ALARM_NONE:
+ case CAL_ALARM_UNKNOWN:
+ default:
+ base = _("Unknown action to be performed");
+ break;
+ }
+
+ /* FIXME: This does not look like it will localize correctly. */
+
+ switch (trigger.type) {
+ case CAL_ALARM_TRIGGER_RELATIVE_START:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the start of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the start of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the start of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_RELATIVE_END:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the end of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the end of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the end of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_ABSOLUTE: {
+ struct icaltimetype itt;
+ icaltimezone *utc_zone, *current_zone;
+ char *location;
+ struct tm tm;
+ char buf[256];
+
+ /* Absolute triggers come in UTC, so convert them to the local timezone */
+
+ itt = trigger.u.abs_time;
+
+ utc_zone = icaltimezone_get_utc_timezone ();
+ location = calendar_config_get_timezone ();
+ current_zone = icaltimezone_get_builtin_timezone (location);
+
+ tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
+
+ e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
+ FALSE, FALSE, buf, sizeof (buf));
+
+ str = g_strdup_printf (_("%s at %s"), base, buf);
+
+ break; }
+
+ case CAL_ALARM_TRIGGER_NONE:
+ default:
+ str = g_strdup_printf (_("%s for an unknown trigger type"), base);
+ break;
+ }
+
+ return str;
}
static void
@@ -313,19 +486,15 @@ sensitize_buttons (AlarmPage *apage)
{
AlarmPagePrivate *priv;
CalClient *client;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- gboolean have_selected;
-
+ GtkCList *clist;
+
priv = apage->priv;
-
+
client = COMP_EDITOR_PAGE (apage)->client;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
+ clist = GTK_CLIST (priv->list);
- gtk_widget_set_sensitive (priv->add,
- cal_client_get_one_alarm_only (client) && have_selected ? FALSE : TRUE);
- gtk_widget_set_sensitive (priv->delete, have_selected);
+ gtk_widget_set_sensitive (priv->add, cal_client_get_one_alarm_only (client) && clist->rows > 0 ? FALSE : TRUE);
+ gtk_widget_set_sensitive (priv->delete, clist->rows > 0 ? TRUE : FALSE);
}
/* Appends an alarm to the list */
@@ -333,14 +502,20 @@ static void
append_reminder (AlarmPage *apage, CalComponentAlarm *alarm)
{
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ GtkCList *clist;
+ char *c[1];
+ int i;
priv = apage->priv;
- view = GTK_TREE_VIEW (priv->list);
- e_alarm_list_append (priv->list_store, &iter, alarm);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ clist = GTK_CLIST (priv->list);
+
+ c[0] = get_alarm_string (alarm);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, alarm, (GtkDestroyNotify) cal_component_alarm_free);
+ gtk_clist_select_row (clist, i, 0);
+ g_free (c[0]);
sensitize_buttons (apage);
}
@@ -351,9 +526,10 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkWidget *menu;
CalComponentText text;
GList *alarms, *l;
+ GtkCList *clist;
+ GtkWidget *menu;
CompEditorPageDates dates;
int i;
@@ -381,6 +557,7 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
alarms = cal_component_get_alarm_uids (comp);
+ clist = GTK_CLIST (priv->list);
for (l = alarms; l != NULL; l = l->next) {
CalComponentAlarm *ca, *ca_copy;
const char *auid;
@@ -417,11 +594,9 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
GList *list, *l;
+ GtkCList *clist;
+ int i;
apage = ALARM_PAGE (page);
priv = apage->priv;
@@ -439,16 +614,13 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Add the new alarms */
- view = GTK_TREE_VIEW (priv->list);
- model = GTK_TREE_MODEL (priv->list_store);
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
+ clist = GTK_CLIST (priv->list);
+ for (i = 0; i < clist->rows; i++) {
CalComponentAlarm *alarm, *alarm_copy;
icalcomponent *icalcomp;
icalproperty *icalprop;
- alarm = (CalComponentAlarm *) e_alarm_list_get_alarm (priv->list_store, &iter);
+ alarm = gtk_clist_get_row_data (clist, i);
g_assert (alarm != NULL);
/* We set the description of the alarm if it's got
@@ -490,11 +662,14 @@ alarm_page_set_summary (CompEditorPage *page, const char *summary)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
+ gchar *s;
apage = ALARM_PAGE (page);
priv = apage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the alarm page */
@@ -512,7 +687,7 @@ alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-/* Gets the widgets from the XML file and returns TRUE if they are all available. */
+/* Gets the widgets from the XML file and returns if they are all available. */
static gboolean
get_widgets (AlarmPage *apage)
{
@@ -532,14 +707,14 @@ get_widgets (AlarmPage *apage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -656,36 +831,23 @@ delete_clicked_cb (GtkButton *button, gpointer data)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
apage = ALARM_PAGE (data);
priv = apage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->list);
+ if (!clist->selection)
return;
- }
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store), &iter);
- e_alarm_list_remove (priv->list_store, &iter);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- }
+ sel = GPOINTER_TO_INT (clist->selection->data);
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
sensitize_buttons (apage);
-
- gtk_tree_path_free (path);
}
/* Callback used when the alarm options button is clicked */
@@ -714,51 +876,26 @@ static void
init_widgets (AlarmPage *apage)
{
AlarmPagePrivate *priv;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = apage->priv;
/* Reminder buttons */
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (add_clicked_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (delete_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (add_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (delete_clicked_cb), apage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (field_changed_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
/* Options button */
- g_signal_connect ((priv->button_options), "clicked",
- G_CALLBACK (button_options_clicked_cb), apage);
-
- /* Alarm list */
-
- /* Model */
- priv->list_store = e_alarm_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->list),
- GTK_TREE_MODEL (priv->list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Action/Trigger"); /* Not shown */
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->list), column);
-
- sensitize_buttons (apage);
-#if 0
- /* If we want the alarm setup widgets to reflect the currently selected alarm, we
- * need to do something like this */
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)), "changed",
- G_CALLBACK (alarm_selection_changed_cb), apage);
-#endif
+ gtk_signal_connect (GTK_OBJECT (priv->button_options), "clicked",
+ GTK_SIGNAL_FUNC (button_options_clicked_cb), apage);
}
@@ -780,7 +917,7 @@ alarm_page_construct (AlarmPage *apage)
priv = apage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("alarm_page_construct(): "
"Could not load the Glade XML file!");
@@ -811,9 +948,9 @@ alarm_page_new (void)
{
AlarmPage *apage;
- apage = g_object_new (TYPE_ALARM_PAGE, NULL);
+ apage = gtk_type_new (TYPE_ALARM_PAGE);
if (!alarm_page_construct (apage)) {
- g_object_unref ((apage));
+ gtk_object_unref (GTK_OBJECT (apage));
return NULL;
}
diff --git a/calendar/gui/dialogs/alarm-page.glade b/calendar/gui/dialogs/alarm-page.glade
index cb4509abe2..494b5edd64 100644
--- a/calendar/gui/dialogs/alarm-page.glade
+++ b/calendar/gui/dialogs/alarm-page.glade
@@ -1,490 +1,385 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="alarm-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="alarm-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>alarm-page</name>
+ <program_name>alarm-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <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>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>alarm-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame33</name>
+ <label>Basics</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame33">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table13</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>2</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label62</name>
+ <label>Summary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkTable" id="table13">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">2</property>
-
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Summary:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date/Time:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </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>
- <child>
- <widget class="GtkLabel" id="summary">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label63</name>
+ <label>Date/Time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0</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>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="date-time">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>summary</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</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>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>date-time</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Basics</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <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>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame34</name>
+ <label>Reminders</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame34">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox53</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="vbox53">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkOptionMenu" id="action">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Display a message</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play a sound</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run a program</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="send_an_email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Send an Email</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="interval-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="value-units">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minute(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hour(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">day(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="relative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget9">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">before</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">after</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">start of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">end of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-options">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Options...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow13">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">10</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>action</name>
+ <can_focus>True</can_focus>
+ <items>Display a message
+Play a sound
+Run a program
+Send an Email
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>interval-value</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>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>value-units</name>
+ <can_focus>True</can_focus>
+ <items>minute(s)
+hour(s)
+day(s)
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>relative</name>
+ <can_focus>True</can_focus>
+ <items>before
+after
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>time</name>
+ <can_focus>True</can_focus>
+ <items>start of appointment
+end of appointment
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-options</name>
+ <can_focus>True</can_focus>
+ <label>_Options...</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="add">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="delete">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow13</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</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>GtkCList</class>
+ <name>list</name>
+ <can_focus>True</can_focus>
+ <columns>1</columns>
+ <column_widths>80</column_widths>
+ <selection_mode>GTK_SELECTION_BROWSE</selection_mode>
+ <show_titles>False</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label64</name>
+ <label>label55</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>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox2</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>10</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>add</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reminders</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>delete</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Delete</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
index 0e48dd3763..19d593182c 100644
--- a/calendar/gui/dialogs/cancel-comp.c
+++ b/calendar/gui/dialogs/cancel-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "cancel-comp.h"
@@ -45,7 +47,6 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (deleting && cal_client_get_save_schedules (client))
return TRUE;
@@ -86,14 +87,9 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index 2df5f94fa7..35910eeb24 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -26,11 +26,12 @@
#include <string.h>
#include <ical.h>
#include <glib.h>
-#include <gtk/gtklabel.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
+#include <gal/unicode/gunicode.h>
#include <ebook/e-destination.h>
#include <e-util/e-time-utils.h>
#include <cal-util/timeutil.h>
@@ -282,11 +283,11 @@ comp_editor_create_contacts_component (void)
CORBA_Environment ev;
CORBA_exception_init (&ev);
- corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0,
- NULL, &ev);
+ corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0,
+ NULL, &ev);
/* OAF seems to be broken -- it can return a CORBA_OBJECT_NIL without
- raising an exception in `ev'. Is this true with BonoboActivation? */
+ raising an exception in `ev'. */
if (ev._major != CORBA_NO_EXCEPTION
|| corba_select_names == CORBA_OBJECT_NIL) {
g_warning ("Cannot activate -- %s", SELECT_NAMES_OAFID);
@@ -337,7 +338,7 @@ comp_editor_create_contacts_control (GNOME_Evolution_Addressbook_SelectNames cor
}
-void
+Bonobo_EventSource_ListenerId
comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
BonoboListenerCallbackFn changed_cb,
gpointer changed_cb_data)
@@ -348,7 +349,7 @@ comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (contacts_entry));
pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
- bonobo_event_source_client_add_listener (
+ return bonobo_event_source_client_add_listener (
pb, changed_cb,
"Bonobo/Property:change:entry_changed",
NULL, changed_cb_data);
@@ -380,8 +381,8 @@ parse_contact_string (const char *value, char **name, char **email)
return;
}
- lbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '<');
- rbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '>');
+ lbracket = g_utf8_strchr (value, '<');
+ rbracket = g_utf8_strchr (value, '>');
if (!lbracket || !rbracket || rbracket < lbracket) {
*name = g_strdup (value);
@@ -421,9 +422,6 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
int i;
cal_component_get_contact_list (comp, &contact_list);
- if (!contact_list)
- return;
-
dest_array = g_ptr_array_new ();
for (elem = contact_list; elem; elem = elem->next) {
CalComponentText *t = elem->data;
@@ -449,14 +447,14 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
#endif
bonobo_widget_set_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, contacts_string, NULL);
+ "destinations", contacts_string, NULL);
g_free (contacts_string);
/* We free all dest_array except the last NULL we added. */
for (i = 0; i < dest_array->len - 1; i++) {
dest = g_ptr_array_index (dest_array, i);
- g_object_unref((dest));
+ gtk_object_unref (GTK_OBJECT (dest));
}
g_ptr_array_free (dest_array, TRUE);
}
@@ -474,7 +472,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
int i;
bonobo_widget_get_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, &contacts_string, NULL);
+ "destinations", &contacts_string, NULL);
#if 0
g_print ("Contacts string: %s\n", contacts_string ? contacts_string : "");
#endif
@@ -506,7 +504,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
contact_list = g_slist_prepend (contact_list, t);
- g_object_unref((contact_destv[i]));
+ gtk_object_unref (GTK_OBJECT (contact_destv[i]));
}
}
g_free (contact_destv);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index c8d89eae7e..13d582e757 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -28,16 +28,18 @@
#include <unistd.h>
#include <glib.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkstock.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
#include <libgnomeui/gnome-messagebox.h>
#include <bonobo/bonobo-ui-container.h>
#include <bonobo/bonobo-ui-util.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-gui-utils.h>
#include <e-util/e-dialog-utils.h>
#include <evolution-shell-component-utils.h>
#include "../print.h"
@@ -88,7 +90,7 @@ struct _CompEditorPrivate {
static void comp_editor_class_init (CompEditorClass *class);
static void comp_editor_init (CompEditor *editor);
static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e);
-static void comp_editor_finalize (GObject *object);
+static void comp_editor_destroy (GtkObject *object);
static void real_set_cal_client (CompEditor *editor, CalClient *client);
static void real_edit_comp (CompEditor *editor, CalComponent *comp);
@@ -150,27 +152,48 @@ static GtkObjectClass *parent_class;
-E_MAKE_TYPE (comp_editor, "CompEditor", CompEditor, comp_editor_class_init, comp_editor_init,
- BONOBO_TYPE_WINDOW);
+GtkType
+comp_editor_get_type (void)
+{
+ static GtkType comp_editor_type = 0;
+
+ if (!comp_editor_type) {
+ static const GtkTypeInfo comp_editor_info = {
+ "CompEditor",
+ sizeof (CompEditor),
+ sizeof (CompEditorClass),
+ (GtkClassInitFunc) comp_editor_class_init,
+ (GtkObjectInitFunc) comp_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ comp_editor_type = gtk_type_unique (BONOBO_TYPE_WINDOW,
+ &comp_editor_info);
+ }
+
+ return comp_editor_type;
+}
/* Class initialization function for the calendar component editor */
static void
comp_editor_class_init (CompEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_ref(BONOBO_TYPE_WINDOW);
+ parent_class = gtk_type_class (BONOBO_TYPE_WINDOW);
klass->set_cal_client = real_set_cal_client;
klass->edit_comp = real_edit_comp;
klass->send_comp = real_send_comp;
widget_class->key_press_event = comp_editor_key_press_event;
- object_class->finalize = comp_editor_finalize;
+ object_class->destroy = comp_editor_destroy;
}
/* Creates the basic in the editor */
@@ -184,23 +207,22 @@ setup_widgets (CompEditor *editor)
priv = editor->priv;
/* Window and basic vbox */
- container = bonobo_ui_container_new ();
- editor = (CompEditor *) bonobo_window_construct (BONOBO_WINDOW (editor), container,
- "event-editor", "iCalendar Editor");
- g_signal_connect((editor), "delete_event",
- G_CALLBACK (delete_event_cb), editor);
+ bonobo_window_construct (BONOBO_WINDOW (editor),
+ "event-editor", "iCalendar Editor");
+ gtk_signal_connect (GTK_OBJECT (editor), "delete_event",
+ GTK_SIGNAL_FUNC (delete_event_cb), editor);
priv->uic = bonobo_ui_component_new_default ();
- bonobo_ui_component_set_container (priv->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WINDOW (editor));
+ bonobo_ui_component_set_container (priv->uic, BONOBO_OBJREF (container));
bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (BONOBO_WINDOW (editor)),
"/evolution/UIConf/kvps");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR,
- EVOLUTION_UIDIR "/evolution-comp-editor.xml",
- "evolution-calendar", NULL);
+ "evolution-comp-editor.xml",
+ "evolution-calendar");
e_pixmaps_update (priv->uic, pixmaps);
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
@@ -253,7 +275,7 @@ comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e)
/* Destroy handler for the calendar component editor */
static void
-comp_editor_finalize (GObject *object)
+comp_editor_destroy (GtkObject *object)
{
CompEditor *editor;
CompEditorPrivate *priv;
@@ -262,24 +284,24 @@ comp_editor_finalize (GObject *object)
editor = COMP_EDITOR (object);
priv = editor->priv;
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), editor);
/* We want to destroy the pages after the widgets get destroyed,
since they have lots of signal handlers connected to the widgets
with the pages as the data. */
for (l = priv->pages; l != NULL; l = l->next)
- g_object_unref((l->data));
+ gtk_object_unref (GTK_OBJECT (l->data));
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
g_free (priv);
editor->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static gboolean
@@ -298,7 +320,7 @@ save_comp (CompEditor *editor)
clone = cal_component_clone (priv->comp);
for (l = priv->pages; l != NULL; l = l->next) {
if (!comp_editor_page_fill_component (l->data, clone)) {
- g_object_unref((clone));
+ gtk_object_unref (GTK_OBJECT (clone));
comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data));
return FALSE;
}
@@ -310,7 +332,7 @@ save_comp (CompEditor *editor)
else
cal_component_abort_sequence (clone);
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = clone;
priv->updating = TRUE;
@@ -401,7 +423,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
switch (save_component_dialog (GTK_WINDOW (editor))) {
- case GTK_RESPONSE_YES: /* Save */
+ case 0: /* Save */
if (cal_component_is_instance (priv->comp))
if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
return FALSE;
@@ -412,9 +434,9 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
else
return FALSE;
- case GTK_RESPONSE_NO: /* Discard */
+ case 1: /* Discard */
return TRUE;
- case GTK_RESPONSE_CANCEL: /* Cancel */
+ case 2: /* Cancel */
default:
return FALSE;
}
@@ -441,7 +463,7 @@ close_dialog (CompEditor *editor)
priv = editor->priv;
- gtk_widget_destroy (GTK_WIDGET (editor));
+ gtk_object_destroy (GTK_OBJECT (editor));
}
@@ -627,7 +649,7 @@ comp_editor_append_page (CompEditor *editor,
priv = editor->priv;
- g_object_ref((page));
+ gtk_object_ref (GTK_OBJECT (page));
/* If we are editing something, fill the widgets with current info */
if (priv->comp != NULL) {
@@ -635,7 +657,7 @@ comp_editor_append_page (CompEditor *editor,
comp = comp_editor_get_current_comp (editor);
comp_editor_page_fill_widgets (page, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
page_widget = comp_editor_page_get_widget (page);
@@ -649,19 +671,19 @@ comp_editor_append_page (CompEditor *editor,
gtk_notebook_append_page (priv->notebook, page_widget, label_widget);
/* Listen for things happening on the page */
- g_signal_connect(page, "changed",
- G_CALLBACK (page_changed_cb), editor);
- g_signal_connect(page, "summary_changed",
- G_CALLBACK (page_summary_changed_cb), editor);
- g_signal_connect(page, "dates_changed",
- G_CALLBACK (page_dates_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "changed",
+ GTK_SIGNAL_FUNC (page_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "summary_changed",
+ GTK_SIGNAL_FUNC (page_summary_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "dates_changed",
+ GTK_SIGNAL_FUNC (page_dates_changed_cb), editor);
/* Listen for when the page is mapped/unmapped so we can
install/uninstall the appropriate GtkAccelGroup. */
- g_signal_connect((page_widget), "map",
- G_CALLBACK (page_mapped_cb), page);
- g_signal_connect((page_widget), "unmap",
- G_CALLBACK (page_unmapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "map",
+ GTK_SIGNAL_FUNC (page_mapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "unmap",
+ GTK_SIGNAL_FUNC (page_unmapped_cb), page);
/* The first page is the main page of the editor, so we ask it to focus
* its main widget.
@@ -697,13 +719,13 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page)
return;
/* Disconnect all the signals added in append_page(). */
- g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
- g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page), editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page_widget), page);
gtk_notebook_remove_page (priv->notebook, page_num);
priv->pages = g_list_remove (priv->pages, page);
- g_object_unref((page));
+ gtk_object_unref (GTK_OBJECT (page));
}
/**
@@ -747,7 +769,7 @@ comp_editor_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->set_cal_client)
klass->set_cal_client (editor, client);
@@ -778,7 +800,7 @@ comp_editor_get_cal_client (CompEditor *editor)
static char *
make_title_from_comp (CalComponent *comp)
{
- char *title, *title_utf8;
+ char *title;
const char *type_string;
CalComponentVType type;
CalComponentText text;
@@ -804,15 +826,14 @@ make_title_from_comp (CalComponent *comp)
cal_component_get_summary (comp, &text);
if (text.value) {
- title = g_strdup_printf (type_string, text.value);
- } else {
+ char *summary;
+ summary = e_utf8_to_locale_string (text.value);
+ title = g_strdup_printf (type_string, summary);
+ g_free (summary);
+ } else
title = g_strdup_printf (type_string, _("No summary"));
- }
-
- title_utf8 = g_locale_to_utf8 (title, -1, NULL, NULL, NULL);
- g_free (title);
- return title_utf8;
+ return title;
}
static const char *
@@ -821,18 +842,18 @@ make_icon_from_comp (CalComponent *comp)
CalComponentVType type;
if (!comp)
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
type = cal_component_get_vtype (comp);
switch (type) {
case CAL_COMPONENT_EVENT:
- return EVOLUTION_IMAGESDIR "/buttons/new_appointment.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_appointment.png";
break;
case CAL_COMPONENT_TODO:
- return EVOLUTION_IMAGESDIR "/buttons/new_task.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_task.png";
break;
default:
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
}
}
@@ -890,13 +911,13 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (IS_CAL_CLIENT (client));
g_return_if_fail (cal_client_get_load_state (client) ==
CAL_CLIENT_LOAD_LOADED);
- g_object_ref((client));
+ gtk_object_ref (GTK_OBJECT (client));
}
if (priv->client) {
gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
editor);
- g_object_unref((priv->client));
+ gtk_object_unref (GTK_OBJECT (priv->client));
}
priv->client = client;
@@ -905,11 +926,11 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
for (elem = priv->pages; elem; elem = elem->next)
comp_editor_page_set_cal_client (elem->data, client);
- g_signal_connect((priv->client), "obj_updated",
- G_CALLBACK (obj_updated_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), editor);
- g_signal_connect((priv->client), "obj_removed",
- G_CALLBACK (obj_removed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), editor);
}
static void
@@ -923,7 +944,7 @@ real_edit_comp (CompEditor *editor, CalComponent *comp)
priv = editor->priv;
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
@@ -953,9 +974,9 @@ real_send_comp (CompEditor *editor, CalComponentItipMethod method)
if (itip_send_comp (method, priv->comp, priv->client, NULL)) {
tmp_comp = priv->comp;
- g_object_ref((tmp_comp));
+ gtk_object_ref (GTK_OBJECT (tmp_comp));
comp_editor_edit_comp (editor, tmp_comp);
- g_object_unref((tmp_comp));
+ gtk_object_unref (GTK_OBJECT (tmp_comp));
comp_editor_set_changed (editor, TRUE);
save_comp (editor);
@@ -986,7 +1007,7 @@ comp_editor_edit_comp (CompEditor *editor, CalComponent *comp)
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->edit_comp)
klass->edit_comp (editor, comp);
@@ -1065,7 +1086,7 @@ comp_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
g_return_val_if_fail (editor != NULL, FALSE);
g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->send_comp)
return klass->send_comp (editor, method);
@@ -1105,20 +1126,15 @@ comp_editor_merge_ui (CompEditor *editor,
EPixmap *component_pixmaps)
{
CompEditorPrivate *priv;
- char *path;
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
priv = editor->priv;
- path = g_strconcat (EVOLUTION_UIDIR "/", filename, NULL);
-
- bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, path, "evolution-calendar", NULL);
+ bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, filename, "evolution-calendar");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
- g_free (path);
-
if (component_pixmaps != NULL)
e_pixmaps_update (priv->uic, component_pixmaps);
}
@@ -1278,7 +1294,7 @@ print_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, FALSE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1291,7 +1307,7 @@ print_preview_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, TRUE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1327,7 +1343,7 @@ page_changed_cb (GtkObject *obj, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1351,7 +1367,7 @@ page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1375,7 +1391,7 @@ page_dates_changed_cb (GtkObject *obj,
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1399,7 +1415,7 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
status = cal_client_get_object (priv->client, uid, &comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
comp_editor_edit_comp (editor, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
GtkWidget *dlg;
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 9004d96e89..9bef6c6c13 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -58,7 +58,7 @@ static void event_editor_init (EventEditor *ee);
static void event_editor_set_cal_client (CompEditor *editor, CalClient *client);
static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void event_editor_finalize (GObject *object);
+static void event_editor_destroy (GtkObject *object);
static void schedule_meeting_cmd (GtkWidget *widget, gpointer data);
static void refresh_meeting_cmd (GtkWidget *widget, gpointer data);
@@ -94,27 +94,47 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #EventEditor class.
**/
+GtkType
+event_editor_get_type (void)
+{
+ static GtkType event_editor_type = 0;
+
+ if (!event_editor_type) {
+ static const GtkTypeInfo event_editor_info = {
+ "EventEditor",
+ sizeof (EventEditor),
+ sizeof (EventEditorClass),
+ (GtkClassInitFunc) event_editor_class_init,
+ (GtkObjectInitFunc) event_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &event_editor_info);
+ }
-E_MAKE_TYPE (event_editor, "EventEditor", EventEditor, event_editor_class_init,
- event_editor_init, TYPE_COMP_EDITOR);
+ return event_editor_type;
+}
/* Class initialization function for the event editor */
static void
event_editor_class_init (EventEditorClass *klass)
{
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- gobject_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->set_cal_client = event_editor_set_cal_client;
editor_class->edit_comp = event_editor_edit_comp;
editor_class->send_comp = event_editor_send_comp;
- gobject_class->finalize = event_editor_finalize;
+ object_class->destroy = event_editor_destroy;
}
static void
@@ -162,12 +182,12 @@ init_widgets (EventEditor *ee)
priv = ee->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
}
/* Object initialization function for the event editor */
@@ -192,36 +212,26 @@ event_editor_construct (EventEditor *ee, CalClient *client)
priv = ee->priv;
priv->event_page = event_page_new ();
- g_object_ref (priv->event_page);
- gtk_object_sink (GTK_OBJECT (priv->event_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->event_page),
_("Appointment"));
priv->alarm_page = alarm_page_new ();
- g_object_ref (priv->alarm_page);
- gtk_object_sink (GTK_OBJECT (priv->alarm_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->alarm_page),
_("Reminder"));
priv->recur_page = recurrence_page_new ();
- g_object_ref (priv->recur_page);
- gtk_object_sink (GTK_OBJECT (priv->recur_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->recur_page),
_("Recurrence"));
priv->sched_page = schedule_page_new (priv->model);
- g_object_ref (priv->sched_page);
- gtk_object_sink (GTK_OBJECT (priv->sched_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->sched_page),
_("Scheduling"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->meet_page),
_("Meeting"));
@@ -284,6 +294,7 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->meeting_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
if (!priv->meeting_shown) {
@@ -303,27 +314,22 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (!comp_editor_get_user_org (editor))
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
e_meeting_model_add_attendee (priv->model, ia);
-
- g_object_unref(ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
}
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -363,7 +369,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -378,7 +384,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-event_editor_finalize (GObject *object)
+event_editor_destroy (GtkObject *object)
{
EventEditor *ee;
EventEditorPrivate *priv;
@@ -389,18 +395,19 @@ event_editor_finalize (GObject *object)
ee = EVENT_EDITOR (object);
priv = ee->priv;
- g_object_unref((priv->event_page));
- g_object_unref((priv->alarm_page));
- g_object_unref((priv->recur_page));
- g_object_unref((priv->meet_page));
- g_object_unref((priv->sched_page));
+ gtk_object_unref (GTK_OBJECT (priv->event_page));
+ gtk_object_unref (GTK_OBJECT (priv->alarm_page));
+ gtk_object_unref (GTK_OBJECT (priv->recur_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->sched_page));
- g_object_unref((priv->model));
+ gtk_object_destroy (GTK_OBJECT (priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -417,7 +424,7 @@ event_editor_new (CalClient *client)
{
EventEditor *ee;
- ee = EVENT_EDITOR (g_object_new (TYPE_EVENT_EDITOR, NULL));
+ ee = EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR));
return event_editor_construct (ee, client);
}
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 384a39c419..c7ed201e1f 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -25,10 +25,9 @@
#include <config.h>
#endif
-#include <string.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktextview.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -95,7 +94,7 @@ struct _EventPagePrivate {
static void event_page_class_init (EventPageClass *class);
static void event_page_init (EventPage *epage);
-static void event_page_finalize (GObject *object);
+static void event_page_destroy (GtkObject *object);
static GtkWidget *event_page_get_widget (CompEditorPage *page);
static void event_page_focus_main_widget (CompEditorPage *page);
@@ -116,21 +115,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #EventPage class.
**/
+GtkType
+event_page_get_type (void)
+{
+ static GtkType event_page_type;
+
+ if (!event_page_type) {
+ static const GtkTypeInfo event_page_info = {
+ "EventPage",
+ sizeof (EventPage),
+ sizeof (EventPageClass),
+ (GtkClassInitFunc) event_page_class_init,
+ (GtkObjectInitFunc) event_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &event_page_info);
+ }
-E_MAKE_TYPE (event_page, "EventPage", EventPage, event_page_class_init, event_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return event_page_type;
+}
/* Class initialization function for the event page */
static void
event_page_class_init (EventPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = event_page_get_widget;
editor_page_class->focus_main_widget = event_page_focus_main_widget;
@@ -139,7 +158,7 @@ event_page_class_init (EventPageClass *class)
editor_page_class->set_summary = event_page_set_summary;
editor_page_class->set_dates = event_page_set_dates;
- object_class->finalize = event_page_finalize;
+ object_class->destroy = event_page_destroy;
}
/* Object initialization function for the event page */
@@ -182,7 +201,7 @@ event_page_init (EventPage *epage)
/* Destroy handler for the event page */
static void
-event_page_finalize (GObject *object)
+event_page_destroy (GtkObject *object)
{
EventPage *epage;
EventPagePrivate *priv;
@@ -202,15 +221,15 @@ event_page_finalize (GObject *object)
}
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
epage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -349,7 +368,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt->year,
start_tt->month, start_tt->day);
@@ -370,7 +389,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
are the same. */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_timezone),
epage);
- g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_timezone), epage);
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
start_zone);
@@ -397,12 +416,12 @@ clear_widgets (EventPage *epage)
/* Summary, description */
e_dialog_editable_set (priv->summary, NULL);
e_dialog_editable_set (priv->location, NULL);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
+ e_dialog_editable_set (priv->description, NULL);
/* Start and end times */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_time (E_DATE_EDIT (priv->start_time), 0);
e_date_edit_set_time (E_DATE_EDIT (priv->end_time), 0);
@@ -429,8 +448,8 @@ clear_widgets (EventPage *epage)
static void
contacts_changed_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data)
{
@@ -485,8 +504,7 @@ event_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_description_list (comp, &l);
if (l) {
text = *(CalComponentText *)l->data;
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- text.value, -1);
+ e_dialog_editable_set (priv->description, text.value);
}
cal_component_free_text_list (l);
@@ -582,12 +600,9 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
char *cat, *str;
CalComponentClassification classif;
CalComponentTransparency transparency;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
epage = EVENT_PAGE (page);
priv = epage->priv;
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
/* Summary */
@@ -619,10 +634,7 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Description */
- gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
- gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
- str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
-
+ str = e_dialog_editable_get (priv->description);
if (!str || strlen (str) == 0)
cal_component_set_description_list (comp, NULL);
else {
@@ -773,24 +785,20 @@ get_widgets (EventPage *epage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("general-summary");
priv->location = GW ("location");
- /* Glade's visibility flag doesn't seem to work for custom widgets */
priv->start_time = GW ("start-time");
- gtk_widget_show (priv->start_time);
priv->end_time = GW ("end-time");
- gtk_widget_show (priv->end_time);
-
priv->start_timezone = GW ("start-timezone");
priv->end_timezone = GW ("end-timezone");
priv->all_day_event = GW ("all-day-event");
@@ -1015,22 +1023,22 @@ times_updated (EventPage *epage, gboolean adjust_end_time)
if (set_start_date) {
- g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time),
start_tt.year, start_tt.month,
start_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
start_tt.hour, start_tt.minute);
- g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time), epage);
}
if (set_end_date) {
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->end_time),
end_tt.year, end_tt.month, end_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
end_tt.hour, end_tt.minute);
- g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time), epage);
}
/* Notify upstream */
@@ -1279,7 +1287,6 @@ static gboolean
init_widgets (EventPage *epage)
{
EventPagePrivate *priv;
- GtkTextBuffer *text_buffer;
char *location;
icaltimezone *zone;
@@ -1295,77 +1302,71 @@ init_widgets (EventPage *epage)
epage, NULL);
/* Summary */
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), epage);
-
- /* Description */
- text_buffer = gtk_text_buffer_new (NULL);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->description), text_buffer);
- g_object_unref (text_buffer);
+ gtk_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (summary_changed_cb), epage);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
+ /* Description - turn on word wrap. */
+ gtk_text_set_word_wrap (GTK_TEXT (priv->description), TRUE);
/* Start and end times */
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (start_timezone_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (end_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (start_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (end_timezone_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (all_day_event_toggled_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (all_day_event_toggled_cb), epage);
/* Contacts button */
- g_signal_connect((priv->contacts_btn), "clicked",
- G_CALLBACK (contacts_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->contacts_btn), "clicked",
+ GTK_SIGNAL_FUNC (contacts_clicked_cb), epage);
/* Categories button */
- g_signal_connect((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories_btn), "clicked",
+ GTK_SIGNAL_FUNC (categories_clicked_cb), epage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- /* Belongs to priv->description */
- g_signal_connect((text_buffer), "changed",
- G_CALLBACK (field_changed_cb), epage);
-
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->location), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->classification_public),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->location), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->description), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->classification_public),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_private),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_private),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_confidential),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_confidential),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_free),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_free),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_busy),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_busy),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->categories), "changed",
- G_CALLBACK (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
/* Create the contacts entry, a corba control from the address book. */
priv->corba_select_names = comp_editor_create_contacts_component ();
@@ -1407,7 +1408,7 @@ event_page_construct (EventPage *epage)
priv = epage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/event-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("event_page_construct(): "
"Could not load the Glade XML file!");
@@ -1442,9 +1443,9 @@ event_page_new (void)
{
EventPage *epage;
- epage = g_object_new (TYPE_EVENT_PAGE, NULL);
+ epage = gtk_type_new (TYPE_EVENT_PAGE);
if (!event_page_construct (epage)) {
- g_object_unref ((epage));
+ gtk_object_unref (GTK_OBJECT (epage));
return NULL;
}
@@ -1464,9 +1465,5 @@ GtkWidget *make_timezone_entry (void);
GtkWidget *
make_timezone_entry (void)
{
- GtkWidget *w;
-
- w = e_timezone_entry_new ();
- gtk_widget_show (w);
- return w;
+ return e_timezone_entry_new ();
}
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index 6693c8af65..5f6fbfe14c 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -1,662 +1,601 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="event-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="event-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>event-page</name>
+ <program_name>event-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>event-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <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>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>event-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>6</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table11</name>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table11">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label56">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Su_mmary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">general-summary</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label56</name>
+ <label>Su_mmary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>general-summary</default_focus_target>
+ <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>GtkEntry</class>
+ <name>general-summary</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>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>label61</name>
+ <label>L_ocation:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>location</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>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>location</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>
- <child>
- <widget class="GtkEntry" id="general-summary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame31</name>
+ <label>Date &amp; Time</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table12</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>4</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label57</name>
+ <label>_Start time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>start-time</focus_target>
<child>
- <widget class="GtkLabel" id="label61">
- <property name="visible">True</property>
- <property name="label" translatable="yes">L_ocation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">location</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <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>label58</name>
+ <label>_End time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>end-time</focus_target>
<child>
- <widget class="GtkEntry" id="location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
+ <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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame31">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <string1></string1>
+ <string2></string2>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:05 GMT</last_modification_time>
<child>
- <widget class="GtkTable" id="table12">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label57">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Start time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">start-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label58">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_End time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">end-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="string1"></property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:05 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:10 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:40 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:34 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="all-day-event">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ll day event</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <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>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>Custom</class>
+ <name>end-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:10 GMT</last_modification_time>
<child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date &amp; Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <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>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <widget>
+ <class>Custom</class>
+ <name>end-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:40 GMT</last_modification_time>
<child>
- <widget class="GtkTextView" id="description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
+ <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>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:34 GMT</last_modification_time>
<child>
- <widget class="GtkFrame" id="frame32">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox52">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="classification-public">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pu_blic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-private">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pri_vate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-confidential">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Con_fidential</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Classification</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <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>True</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment1</name>
+ <xalign>1</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xscale>0</xscale>
+ <yscale>0</yscale>
<child>
- <widget class="GtkFrame" id="show-time-frame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-free">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">F_ree</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-busy">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">B_usy</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">show-time-as-free</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Time As</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>0</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>True</yfill>
</child>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>all-day-event</name>
+ <can_focus>True</can_focus>
+ <label>A_ll day event</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow12</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
- <widget class="GtkHBox" id="hbox53">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkButton" id="contacts-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label59">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkEventBox" id="contacts-box">
- <property name="visible">True</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkText</class>
+ <name>description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="categories-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label60">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkEntry" id="categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame32</name>
+ <label>Classification</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox52</name>
+ <border_width>2</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-public</name>
+ <can_focus>True</can_focus>
+ <label>Pu_blic</label>
+ <active>True</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-private</name>
+ <can_focus>True</can_focus>
+ <label>Pri_vate</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-confidential</name>
+ <can_focus>True</can_focus>
+ <label>Con_fidential</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ </widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>show-time-frame</name>
+ <label>Show Time As</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-free</name>
+ <can_focus>True</can_focus>
+ <label>F_ree</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-busy</name>
+ <can_focus>True</can_focus>
+ <label>B_usy</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox53</name>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>contacts-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label59</name>
+ <label>_Contacts...</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEventBox</class>
+ <name>contacts-box</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>categories-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label60</name>
+ <label>Ca_tegories...</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>categories</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>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index c4f1ec84cb..f337390429 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -31,9 +31,10 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/e-table/e-cell-combo.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-table-simple.h>
@@ -42,10 +43,8 @@
#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <e-util/e-dialog-utils.h>
#include <e-util/e-dialog-widgets.h>
-
-#include "../calendar-component.h"
+#include "../component-factory.h"
#include "../e-meeting-attendee.h"
#include "../e-meeting-model.h"
#include "../itip-utils.h"
@@ -78,9 +77,9 @@ struct _MeetingPagePrivate {
CalComponent *comp;
/* List of identities */
- EAccountList *accounts;
- EMeetingAttendee *ia;
- char *default_address;
+ GList *addresses;
+ GList *address_strings;
+ gchar *default_address;
/* Glade XML data */
GladeXML *xml;
@@ -109,7 +108,7 @@ struct _MeetingPagePrivate {
static void meeting_page_class_init (MeetingPageClass *class);
static void meeting_page_init (MeetingPage *mpage);
-static void meeting_page_finalize (GObject *object);
+static void meeting_page_destroy (GtkObject *object);
static GtkWidget *meeting_page_get_widget (CompEditorPage *page);
static void meeting_page_focus_main_widget (CompEditorPage *page);
@@ -130,21 +129,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #MeetingPage class.
**/
+GtkType
+meeting_page_get_type (void)
+{
+ static GtkType meeting_page_type;
+
+ if (!meeting_page_type) {
+ static const GtkTypeInfo meeting_page_info = {
+ "MeetingPage",
+ sizeof (MeetingPage),
+ sizeof (MeetingPageClass),
+ (GtkClassInitFunc) meeting_page_class_init,
+ (GtkObjectInitFunc) meeting_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ meeting_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &meeting_page_info);
+ }
-E_MAKE_TYPE (meeting_page, "MeetingPage", MeetingPage, meeting_page_class_init, meeting_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return meeting_page_type;
+}
/* Class initialization function for the task page */
static void
meeting_page_class_init (MeetingPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = meeting_page_get_widget;
editor_page_class->focus_main_widget = meeting_page_focus_main_widget;
@@ -153,7 +173,7 @@ meeting_page_class_init (MeetingPageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = NULL;
- object_class->finalize = meeting_page_finalize;
+ object_class->destroy = meeting_page_destroy;
}
/* Object initialization function for the task page */
@@ -169,9 +189,8 @@ meeting_page_init (MeetingPage *mpage)
priv->comp = NULL;
- priv->accounts = NULL;
- priv->ia = NULL;
- priv->default_address = NULL;
+ priv->addresses = NULL;
+ priv->address_strings = NULL;
priv->xml = NULL;
priv->main = NULL;
@@ -183,37 +202,6 @@ meeting_page_init (MeetingPage *mpage)
priv->updating = FALSE;
}
-static EAccount *
-get_current_account (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
- EIterator *it;
- const char *str;
-
- priv = mpage->priv;
-
- str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry));
- if (!str)
- return NULL;
-
- for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- if (!strcmp (full, str)) {
- g_free (full);
- g_object_unref (it);
-
- return a;
- }
-
- g_free (full);
- }
- g_object_unref (it);
-
- return NULL;
-}
-
static void
set_attendees (CalComponent *comp, const GPtrArray *attendees)
{
@@ -243,12 +231,12 @@ cleanup_attendees (GPtrArray *attendees)
int i;
for (i = 0; i < attendees->len; i++)
- g_object_unref((g_ptr_array_index (attendees, i)));
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (attendees, i)));
}
/* Destroy handler for the task page */
static void
-meeting_page_finalize (GObject *object)
+meeting_page_destroy (GtkObject *object)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
@@ -260,26 +248,25 @@ meeting_page_finalize (GObject *object)
priv = mpage->priv;
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
cleanup_attendees (priv->deleted_attendees);
g_ptr_array_free (priv->deleted_attendees, TRUE);
-
- if (priv->ia != NULL)
- g_object_unref (priv->ia);
- g_object_unref((priv->model));
+ itip_addresses_free (priv->addresses);
+
+ gtk_object_unref (GTK_OBJECT (priv->model));
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
mpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -318,7 +305,7 @@ clear_widgets (MeetingPage *mpage)
priv = mpage->priv;
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), "");
gtk_label_set_text (GTK_LABEL (priv->existing_organizer), _("None"));
gtk_widget_show (priv->organizer_table);
@@ -342,7 +329,7 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Clean out old data */
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
cleanup_attendees (priv->deleted_attendees);
@@ -354,12 +341,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Component for cancellation */
priv->comp = cal_component_clone (comp);
+ /* List the user identities for default organizers */
+ gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings);
+
/* If there is an existing organizer show it properly */
if (cal_component_has_organizer (comp)) {
cal_component_get_organizer (comp, &organizer);
if (organizer.value != NULL) {
const gchar *strip = itip_strip_mailto (organizer.value);
- gchar *string;
+ gchar *s, *string;
gtk_widget_hide (priv->organizer_table);
gtk_widget_show (priv->existing_organizer_table);
@@ -379,23 +369,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
string = g_strdup_printf ("%s <%s>", organizer.cn, strip);
else
string = g_strdup (strip);
- gtk_label_set_text (GTK_LABEL (priv->existing_organizer), string);
+ s = e_utf8_to_gtk_string (priv->existing_organizer, string);
+ gtk_label_set_text (GTK_LABEL (priv->existing_organizer), s);
+ g_free (s);
g_free (string);
priv->existing = TRUE;
}
} else {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- priv->ia = e_meeting_model_add_attendee_with_defaults (priv->model);
- g_object_ref (priv->ia);
-
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
- e_meeting_attendee_set_status (priv->ia, ICAL_PARTSTAT_ACCEPTED);
- }
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
}
priv->updating = FALSE;
@@ -413,36 +395,50 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp)
priv = mpage->priv;
if (!priv->existing) {
- EAccount *a;
- gchar *addr = NULL;
+ gchar *addr = NULL, *cn = NULL, *sentby = NULL, *str;
+ GList *l;
- /* Find the identity for the organizer or sentby field */
- a = get_current_account (mpage);
+ str = e_dialog_editable_get (GTK_COMBO (priv->organizer)->entry);
- /* Sanity Check */
- if (a == NULL) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("The organizer selected no longer has an account."));
- return FALSE;
+ /* Find the identity for the organizer or sentby field */
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!strcmp (a->full, str)) {
+ addr = g_strdup (a->address);
+ cn = g_strdup (a->name);
+ }
}
+
+ g_free (str);
- if (a->id->address == NULL || strlen (a->id->address) == 0) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ /* Sanity Check */
+ if (addr == NULL || strlen (addr) == 0) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer is required."));
+ g_free (addr);
+ g_free (cn);
return FALSE;
- }
-
- addr = g_strdup_printf ("MAILTO:%s", a->id->address);
+ } else {
+ gchar *tmp;
+
+ tmp = addr;
+ addr = g_strdup_printf ("MAILTO:%s", addr);
+ g_free (tmp);
+ }
organizer.value = addr;
- organizer.cn = a->id->name;
+ organizer.cn = cn;
+ organizer.sentby = sentby;
cal_component_set_organizer (comp, &organizer);
g_free (addr);
+ g_free (cn);
+ g_free (sentby);
}
if (e_meeting_model_count_actual_attendees (priv->model) < 1) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("At least one attendee is required."));
return FALSE;
}
@@ -473,14 +469,14 @@ get_widgets (MeetingPage *mpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
/* For making the user the organizer */
priv->organizer_table = GW ("organizer-table");
@@ -503,34 +499,18 @@ get_widgets (MeetingPage *mpage)
&& priv->existing_organizer_btn);
}
+/* This is called when any field is changed; it notifies upstream. */
static void
-org_changed_cb (GtkWidget *widget, gpointer data)
+field_changed_cb (GtkWidget *widget, gpointer data)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
mpage = MEETING_PAGE (data);
priv = mpage->priv;
-
- if (priv->updating)
- return;
- if (!priv->existing && priv->ia != NULL) {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
-
- if (!e_meeting_model_find_attendee (priv->model, e_meeting_attendee_get_address (priv->ia), NULL))
- e_meeting_model_add_attendee (priv->model, priv->ia);
- } else {
- e_meeting_model_remove_attendee (priv->model, priv->ia);
- }
- }
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
+ if (!priv->updating)
+ comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
}
/* Function called to change the organizer */
@@ -548,6 +528,7 @@ change_clicked_cb (GtkWidget *widget, gpointer data)
gtk_widget_show (priv->invite);
e_meeting_model_etable_click_to_add (priv->model, TRUE);
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (mpage));
priv->existing = FALSE;
@@ -575,17 +556,18 @@ init_widgets (MeetingPage *mpage)
priv = mpage->priv;
/* Organizer */
- g_signal_connect((GTK_COMBO (priv->organizer)->entry), "changed",
- G_CALLBACK (org_changed_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (GTK_COMBO (priv->organizer)->entry), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), mpage);
- g_signal_connect((priv->existing_organizer_btn), "clicked",
- G_CALLBACK (change_clicked_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->existing_organizer_btn), "clicked",
+ GTK_SIGNAL_FUNC (change_clicked_cb), mpage);
/* Invite button */
- g_signal_connect((priv->invite), "clicked",
- G_CALLBACK (invite_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->invite), "clicked",
+ GTK_SIGNAL_FUNC (invite_cb), mpage);
}
+#if 0
static void
popup_delegate_cb (GtkWidget *widget, gpointer data)
{
@@ -604,7 +586,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
edd = e_delegate_dialog_new (NULL, itip_strip_mailto (e_meeting_attendee_get_delto (ia)));
dialog = e_delegate_dialog_get_toplevel (edd);
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK){
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0){
EMeetingAttendee *ic;
name = e_delegate_dialog_get_delegate_name (edd);
@@ -612,7 +594,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
/* Make sure we can add the new delegatee person */
if (e_meeting_model_find_attendee (priv->model, address, NULL) != NULL) {
- e_notice (mpage, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("That person is already attending the meeting!"));
goto cleanup;
}
@@ -623,7 +605,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
ib = e_meeting_model_find_attendee (priv->model, itip_strip_mailto (e_meeting_attendee_get_delto (ia)), NULL);
if (ib != NULL) {
- g_object_ref((ib));
+ gtk_object_ref (GTK_OBJECT (ib));
g_ptr_array_add (priv->deleted_attendees, ib);
e_meeting_model_remove_attendee (priv->model, ib);
@@ -642,8 +624,9 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
cleanup:
g_free (name);
g_free (address);
- g_object_unref((edd));
+ gtk_object_unref (GTK_OBJECT (edd));
}
+#endif
static void
popup_delete_cb (GtkWidget *widget, gpointer data)
@@ -657,13 +640,6 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- /* If the user deletes the attendee explicitly, assume they no
- longer want the organizer showing up */
- if (ia == priv->ia) {
- g_object_unref (priv->ia);
- priv->ia = NULL;
- }
-
/* If this was a delegatee, no longer delegate */
if (e_meeting_attendee_is_set_delfrom (ia)) {
EMeetingAttendee *ib;
@@ -677,7 +653,7 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
while (ia != NULL) {
EMeetingAttendee *ib = NULL;
- g_object_ref((ia));
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->deleted_attendees, ia);
e_meeting_model_remove_attendee (priv->model, ia);
@@ -693,11 +669,13 @@ enum {
};
static EPopupMenu context_menu[] = {
- E_POPUP_ITEM (N_("_Delegate To..."), G_CALLBACK (popup_delegate_cb), CAN_DELEGATE),
+#if 0
+ E_POPUP_ITEM (N_("_Delegate To..."), GTK_SIGNAL_FUNC (popup_delegate_cb), CAN_DELEGATE),
E_POPUP_SEPARATOR,
+#endif
- E_POPUP_ITEM (N_("_Delete"), G_CALLBACK (popup_delete_cb), CAN_DELETE),
+ E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (popup_delete_cb), CAN_DELETE),
E_POPUP_TERMINATOR
};
@@ -717,18 +695,15 @@ right_click_cb (ETable *etable, gint row, gint col, GdkEvent *event, gpointer da
view_row = e_table_model_to_view_row (etable, row);
priv->row = e_meeting_model_etable_view_to_model_row (etable, priv->model, view_row);
- ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
- disable_mask = CAN_DELETE;
-
- /* FIXME: if you enable Delegate, then change index to '1'.
- * (This has now been enabled). */
- /* context_menu[1].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH); */
- context_menu[1].pixmap_widget =
- gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
+ ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
+ if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
+ disable_mask = CAN_DELETE;
+ /* FIXME: if you enable Delegate, then change index to '1' */
+ context_menu[0].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH);
+
menu = e_popup_menu_create (context_menu, disable_mask, hide_mask, data);
- e_auto_kill_popup_menu_on_selection_done (menu);
+ e_auto_kill_popup_menu_on_hide (menu);
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event->button.button, event->button.time);
@@ -774,14 +749,12 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
ETable *real_table;
gchar *filename;
const char *backend_address;
- EIterator *it;
- EAccount *def_account;
- GList *address_strings = NULL, *l;
+ GList *l;
priv = mpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/meeting-page.glade", NULL, NULL);
+ "/meeting-page.glade", NULL);
if (!priv->xml) {
g_message ("meeting_page_construct(): "
"Could not load the Glade XML file!");
@@ -797,43 +770,25 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
/* Address information */
backend_address = cal_client_get_cal_address (client);
- priv->accounts = itip_addresses_get ();
- def_account = itip_addresses_get_default();
- for (it = e_list_get_iterator((EList *)priv->accounts);
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full;
+ priv->addresses = itip_addresses_get ();
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+ char *s;
- full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- address_strings = g_list_append(address_strings, full);
+ s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full);
+ priv->address_strings = g_list_append (priv->address_strings, s);
/* Note that the address specified by the backend gets
* precedence over the default mail address.
*/
- if (backend_address && !strcmp (backend_address, a->id->address)) {
- if (priv->default_address)
- g_free (priv->default_address);
-
- priv->default_address = g_strdup (full);
- } else if (a == def_account && !priv->default_address) {
- priv->default_address = g_strdup (full);
- }
+ if (backend_address && !strcmp (backend_address, a->address))
+ priv->default_address = a->full;
+ else if (a->default_address && !priv->default_address)
+ priv->default_address = a->full;
}
- g_object_unref(it);
-
- if (address_strings)
- gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), address_strings);
- else
- g_warning ("No potential organizers!");
-
- for (l = address_strings; l != NULL; l = l->next)
- g_free (l->data);
- g_list_free (address_strings);
/* The etable displaying attendees and their status */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
filename = g_strdup_printf ("%s/config/et-header-meeting-page", evolution_dir);
@@ -843,11 +798,11 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
g_free (filename);
real_table = e_table_scrolled_get_table (priv->etable);
- g_signal_connect((real_table),
- "right_click", G_CALLBACK (right_click_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table),
+ "right_click", GTK_SIGNAL_FUNC (right_click_cb), mpage);
- g_signal_connect((real_table->table_canvas), "focus_out_event",
- G_CALLBACK (table_canvas_focus_out_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_out_cb), mpage);
gtk_widget_show (GTK_WIDGET (priv->etable));
gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->etable), TRUE, TRUE, 2);
@@ -871,9 +826,9 @@ meeting_page_new (EMeetingModel *emm, CalClient *client)
{
MeetingPage *mpage;
- mpage = g_object_new (TYPE_MEETING_PAGE, NULL);
+ mpage = gtk_type_new (TYPE_MEETING_PAGE);
if (!meeting_page_construct (mpage, emm, client)) {
- g_object_unref((mpage));
+ gtk_object_unref (GTK_OBJECT (mpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/meeting-page.h b/calendar/gui/dialogs/meeting-page.h
index 2a209b586b..8d25dd1806 100644
--- a/calendar/gui/dialogs/meeting-page.h
+++ b/calendar/gui/dialogs/meeting-page.h
@@ -28,15 +28,15 @@
#include "../itip-utils.h"
#include "comp-editor-page.h"
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define TYPE_MEETING_PAGE (meeting_page_get_type ())
-#define MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
-#define MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
-#define IS_MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEETING_PAGE))
-#define IS_MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
+#define MEETING_PAGE(obj) (GTK_CHECK_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
+#define MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
+#define IS_MEETING_PAGE(obj) (GTK_CHECK_TYPE ((obj), TYPE_MEETING_PAGE))
+#define IS_MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
typedef struct _MeetingPagePrivate MeetingPagePrivate;
@@ -62,6 +62,6 @@ CalComponent *meeting_page_get_cancel_comp (MeetingPage *mpage);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index 81db34733c..3c9152ccc5 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -24,9 +24,11 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/widgets/e-unicode.h>
+#include "widgets/misc/e-messagebox.h"
#include "recur-comp.h"
@@ -39,7 +41,7 @@ recur_component_dialog (CalComponent *comp,
char *str;
GtkWidget *dialog, *rb1, *rb2, *rb3, *hbox;
CalComponentVType vtype;
- gboolean ret;
+ int btn;
g_return_val_if_fail (IS_CAL_COMPONENT (comp), CALOBJ_MOD_THIS);
@@ -63,12 +65,15 @@ recur_component_dialog (CalComponent *comp,
return CALOBJ_MOD_THIS;
}
+ dialog = e_message_box_new (str, E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
- dialog = gtk_message_dialog_new(parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str);
g_free (str);
hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), hbox);
rb1 = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
gtk_container_add (GTK_CONTAINER (hbox), rb1);
@@ -78,8 +83,13 @@ recur_component_dialog (CalComponent *comp,
gtk_container_add (GTK_CONTAINER (hbox), rb3);
gtk_widget_show_all (hbox);
-
- ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK;
+
+ gtk_widget_hide (e_message_box_get_checkbox (E_MESSAGE_BOX (dialog)));
+ gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
+ if (parent != NULL)
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent);
+
+ btn = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb1)))
*mod = CALOBJ_MOD_THIS;
@@ -90,5 +100,5 @@ recur_component_dialog (CalComponent *comp,
gtk_widget_destroy (dialog);
- return ret;
+ return btn == 0 ? TRUE : FALSE;
}
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index aa77ee3990..ff31bb3878 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -1,14 +1,11 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
/* Evolution calendar - Recurrence page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximiman.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -28,27 +25,21 @@
#include <config.h>
#endif
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkmenuitem.h>
#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtktogglebutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkspinbutton.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-time-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <cal-util/cal-recur.h>
#include <cal-util/timeutil.h>
#include "../calendar-config.h"
#include "../tag-calendar.h"
#include "../weekday-picker.h"
#include "comp-editor-util.h"
-#include "../e-date-time-list.h"
#include "recurrence-page.h"
@@ -131,6 +122,40 @@ static const int ending_types_map[] = {
-1
};
+static const char *date_suffix[] = {
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st")
+};
+
/* Private part of the RecurrencePage structure */
struct _RecurrencePagePrivate {
/* Component we use to expand the recurrence rules for the preview */
@@ -140,6 +165,7 @@ struct _RecurrencePagePrivate {
GladeXML *xml;
/* Widgets from the Glade file */
+
GtkWidget *main;
GtkWidget *summary;
@@ -180,17 +206,15 @@ struct _RecurrencePagePrivate {
int ending_count;
/* More widgets from the Glade file */
+
GtkWidget *exception_date;
- GtkWidget *exception_list; /* This is a GtkTreeView now */
+ GtkWidget *exception_list;
GtkWidget *exception_add;
GtkWidget *exception_modify;
GtkWidget *exception_delete;
GtkWidget *preview_bin;
- /* Store for exception_list */
- EDateTimeList *exception_list_store;
-
/* For the recurrence preview, the actual widget */
GtkWidget *preview_calendar;
@@ -201,7 +225,7 @@ struct _RecurrencePagePrivate {
static void recurrence_page_class_init (RecurrencePageClass *class);
static void recurrence_page_init (RecurrencePage *rpage);
-static void recurrence_page_finalize (GObject *object);
+static void recurrence_page_destroy (GtkObject *object);
static GtkWidget *recurrence_page_get_widget (CompEditorPage *page);
static void recurrence_page_focus_main_widget (CompEditorPage *page);
@@ -224,21 +248,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #RecurrencePage class.
**/
+GtkType
+recurrence_page_get_type (void)
+{
+ static GtkType recurrence_page_type;
+
+ if (!recurrence_page_type) {
+ static const GtkTypeInfo recurrence_page_info = {
+ "RecurrencePage",
+ sizeof (RecurrencePage),
+ sizeof (RecurrencePageClass),
+ (GtkClassInitFunc) recurrence_page_class_init,
+ (GtkObjectInitFunc) recurrence_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ recurrence_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &recurrence_page_info);
+ }
-E_MAKE_TYPE (recurrence_page, "RecurrencePage", RecurrencePage, recurrence_page_class_init,
- recurrence_page_init, TYPE_COMP_EDITOR_PAGE);
+ return recurrence_page_type;
+}
/* Class initialization function for the recurrence page */
static void
recurrence_page_class_init (RecurrencePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = recurrence_page_get_widget;
editor_page_class->focus_main_widget = recurrence_page_focus_main_widget;
@@ -247,7 +291,7 @@ recurrence_page_class_init (RecurrencePageClass *class)
editor_page_class->set_summary = recurrence_page_set_summary;
editor_page_class->set_dates = recurrence_page_set_dates;
- object_class->finalize = recurrence_page_finalize;
+ object_class->destroy = recurrence_page_destroy;
}
/* Object initialization function for the recurrence page */
@@ -290,9 +334,18 @@ recurrence_page_init (RecurrencePage *rpage)
priv->comp = NULL;
}
+/* Frees the CalComponentDateTime stored in the GtkCList */
+static void
+free_exception_date_time (CalComponentDateTime *dt)
+{
+ g_free (dt->value);
+ g_free ((char*)dt->tzid);
+ g_free (dt);
+}
+
/* Destroy handler for the recurrence page */
static void
-recurrence_page_finalize (GObject *object)
+recurrence_page_destroy (GtkObject *object)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
@@ -304,25 +357,20 @@ recurrence_page_finalize (GObject *object)
priv = rpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
- if (priv->exception_list_store) {
- g_object_unref (priv->exception_list_store);
- priv->exception_list_store = NULL;
- }
-
g_free (priv);
rpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -376,38 +424,62 @@ clear_widgets (RecurrencePage *rpage)
priv->month_num = MONTH_NUM_DAY;
priv->month_day = MONTH_DAY_NTH;
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->none, RECUR_NONE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, 1);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
priv->ending_date_tt = icaltime_today ();
priv->ending_count = 1;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->ending_menu,
ENDING_FOREVER,
ending_types_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
/* Exceptions list */
- e_date_time_list_clear (priv->exception_list_store);
+ gtk_clist_clear (GTK_CLIST (priv->exception_list));
+}
+
+/* Builds a static string out of an exception date */
+static char *
+get_exception_string (CalComponentDateTime *dt)
+{
+ static char buf[256];
+ struct tm tmp_tm;
+
+ tmp_tm.tm_year = dt->value->year - 1900;
+ tmp_tm.tm_mon = dt->value->month - 1;
+ tmp_tm.tm_mday = dt->value->day;
+ tmp_tm.tm_hour = dt->value->hour;
+ tmp_tm.tm_min = dt->value->minute;
+ tmp_tm.tm_sec = dt->value->second;
+ tmp_tm.tm_isdst = -1;
+
+ tmp_tm.tm_wday = time_day_of_week (dt->value->day,
+ dt->value->month - 1,
+ dt->value->year);
+
+ e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format(), FALSE, FALSE, buf, sizeof (buf));
+
+ return buf;
}
/* Appends an exception date to the list */
@@ -415,14 +487,39 @@ static void
append_exception (RecurrencePage *rpage, CalComponentDateTime *datetime)
{
RecurrencePagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ CalComponentDateTime *dt;
+ char *c[1];
+ int i;
+ GtkCList *clist;
+ struct icaltimetype *tt;
priv = rpage->priv;
- view = GTK_TREE_VIEW (priv->exception_list);
- e_date_time_list_append (priv->exception_list_store, &iter, datetime);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ dt = g_new (CalComponentDateTime, 1);
+ dt->value = g_new (struct icaltimetype, 1);
+ *dt->value = *datetime->value;
+ dt->tzid = g_strdup (datetime->tzid);
+
+ clist = GTK_CLIST (priv->exception_list);
+
+ gtk_signal_handler_block_by_data (GTK_OBJECT (clist), rpage);
+
+ c[0] = get_exception_string (dt);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, dt, (GtkDestroyNotify) free_exception_date_time);
+
+ gtk_clist_select_row (clist, i, 0);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), rpage);
+
+ tt = dt->value;
+ e_date_edit_set_date (E_DATE_EDIT (priv->exception_date),
+ tt->year, tt->month, tt->day);
+ e_date_edit_set_time_of_day (E_DATE_EDIT (priv->exception_date),
+ tt->hour, tt->minute);
+
+ gtk_widget_set_sensitive (priv->exception_modify, TRUE);
+ gtk_widget_set_sensitive (priv->exception_delete, TRUE);
}
/* Fills in the exception widgets with the data from the calendar component */
@@ -431,11 +528,14 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
GSList *list, *l;
- gboolean added = FALSE;
+ gboolean added;
priv = rpage->priv;
+
cal_component_get_exdate_list (comp, &list);
+ added = FALSE;
+
for (l = list; l; l = l->next) {
CalComponentDateTime *cdt;
@@ -446,6 +546,9 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
}
cal_component_free_exdate_list (list);
+
+ if (added)
+ gtk_clist_select_row (GTK_CLIST (priv->exception_list), 0, 0);
}
/* Computes a weekday mask for the start day of a calendar component,
@@ -755,13 +858,11 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
enum recur_type recur_type;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
+ GtkCList *exception_list;
GSList *list;
+ int i;
priv = rpage->priv;
- model = GTK_TREE_MODEL (priv->exception_list_store);
recur_type = e_dialog_radio_get (priv->none, type_map);
@@ -789,18 +890,15 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
/* Set exceptions */
list = NULL;
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- const CalComponentDateTime *dt;
- CalComponentDateTime *cdt;
+ exception_list = GTK_CLIST (priv->exception_list);
+ for (i = 0; i < exception_list->rows; i++) {
+ CalComponentDateTime *cdt, *dt;
cdt = g_new (CalComponentDateTime, 1);
cdt->value = g_new (struct icaltimetype, 1);
- dt = e_date_time_list_get_date_time (E_DATE_TIME_LIST (model), &iter);
+ dt = gtk_clist_get_row_data (exception_list, i);
g_assert (dt != NULL);
-
if (!icaltime_is_valid_time (*dt->value)) {
comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage),
_("Recurrence date is invalid"),
@@ -811,6 +909,10 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
*cdt->value = *dt->value;
cdt->tzid = g_strdup (dt->tzid);
+#if 0
+ g_print ("Adding exception is_date: %i\n", cdt->value->is_date);
+#endif
+
list = g_slist_prepend (list, cdt);
}
@@ -879,7 +981,7 @@ preview_recur (RecurrencePage *rpage)
tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp,
COMP_EDITOR_PAGE (rpage)->client, zone, TRUE, FALSE);
- g_object_unref(comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Callback used when the recurrence weekday picker changes */
@@ -929,8 +1031,8 @@ make_weekly_special (RecurrencePage *rpage)
weekday_picker_set_days (wp, priv->weekday_day_mask);
weekday_picker_set_blocked_days (wp, priv->weekday_blocked_day_mask);
- g_signal_connect((wp), "changed",
- G_CALLBACK (weekday_picker_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (wp), "changed",
+ GTK_SIGNAL_FUNC (weekday_picker_changed_cb),
rpage);
}
@@ -942,7 +1044,7 @@ month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
int month_index;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
- item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item))));
+ item = gtk_menu_get_active (GTK_MENU (GTK_MENU_ITEM (item)->submenu));
month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
gtk_object_set_user_data (GTK_OBJECT (data), GINT_TO_POINTER (month_index));
@@ -957,8 +1059,12 @@ make_recur_month_num_submenu (const char *title, int start, int end)
submenu = gtk_menu_new ();
for (i = start; i < end; i++) {
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ char *date;
+
+ date = g_strdup_printf ("%d%s", i + 1, _(date_suffix[i]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_object_set_user_data (GTK_OBJECT (item), GINT_TO_POINTER (i + 1));
gtk_widget_show (item);
}
@@ -983,6 +1089,7 @@ make_recur_month_num_menu (int month_index)
GtkWidget *menu, *submenu, *item, *submenu_item;
GtkWidget *omenu;
+ char *date;
int i;
menu = gtk_menu_new ();
@@ -990,32 +1097,34 @@ make_recur_month_num_menu (int month_index)
/* Relation */
for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) {
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
/* Current date */
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[month_index - 1]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ date = g_strdup_printf ("%d%s", month_index, _(date_suffix[month_index - 1]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
/* Other Submenu */
submenu = gtk_menu_new ();
submenu_item = gtk_menu_item_new_with_label (_("Other Date"));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item);
+ gtk_menu_append (GTK_MENU (menu), submenu_item);
gtk_widget_show (submenu_item);
item = make_recur_month_num_submenu ("1st to 10th", 0, 10);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("11th to 20th", 10, 20);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("21st to 31st", 20, 31);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), submenu);
gtk_object_set_user_data (GTK_OBJECT (submenu_item), GINT_TO_POINTER (month_index));
- g_signal_connect((submenu), "selection_done",
- G_CALLBACK (month_num_submenu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (submenu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_submenu_selection_done_cb),
submenu_item);
omenu = gtk_option_menu_new ();
@@ -1049,7 +1158,7 @@ make_recur_month_menu (void)
GtkWidget *item;
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
@@ -1077,6 +1186,7 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
if (month_num == MONTH_NUM_OTHER) {
GtkWidget *label, *item;
+ char *date;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
priv->month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
@@ -1085,7 +1195,9 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
label = GTK_BIN (priv->month_num_menu)->child;
- gtk_label_set_text (GTK_LABEL (label), _(cal_recur_nth[priv->month_index - 1]));
+ date = g_strdup_printf ("%d%s", priv->month_index, _(date_suffix[priv->month_index - 1]));
+ gtk_label_set_text (GTK_LABEL (label), date);
+ g_free (date);
e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map);
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
@@ -1189,16 +1301,16 @@ make_monthly_special (RecurrencePage *rpage)
priv->month_day,
month_day_options_map);
- g_signal_connect((adj), "value_changed", G_CALLBACK (month_index_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (month_index_value_changed_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_num_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_num_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_menu_selection_done_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_day_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_day_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_day_menu_selection_done_cb),
rpage);
}
@@ -1217,16 +1329,16 @@ make_recurrence_special (RecurrencePage *rpage)
priv = rpage->priv;
- if (priv->month_num_menu != NULL) {
- gtk_widget_destroy (priv->month_num_menu);
- priv->month_num_menu = NULL;
- }
if (GTK_BIN (priv->special)->child != NULL) {
gtk_widget_destroy (GTK_BIN (priv->special)->child);
priv->weekday_picker = NULL;
priv->month_day_menu = NULL;
}
+ if (priv->month_num_menu != NULL) {
+ gtk_widget_destroy (priv->month_num_menu);
+ priv->month_num_menu = NULL;
+ }
frequency = e_dialog_option_menu_get (priv->interval_unit, freq_map);
@@ -1306,8 +1418,8 @@ make_ending_until_special (RecurrencePage *rpage)
priv->ending_date_tt.month,
priv->ending_date_tt.day);
- g_signal_connect((de), "changed",
- G_CALLBACK (ending_until_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (de), "changed",
+ GTK_SIGNAL_FUNC (ending_until_changed_cb), rpage);
/* Make sure the EDateEdit widget uses our timezones to get the
current time. */
@@ -1360,8 +1472,8 @@ make_ending_count_special (RecurrencePage *rpage)
e_dialog_spin_set (priv->ending_count_spin, priv->ending_count);
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (ending_count_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (ending_count_value_changed_cb),
rpage);
}
@@ -1421,7 +1533,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
priv = rpage->priv;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
if (r->count == 0) {
if (r->until.year == 0) {
@@ -1471,7 +1583,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
ending_types_map);
}
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
make_ending_special (rpage);
}
@@ -1505,7 +1617,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
*/
if (priv->comp)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = cal_component_clone (comp);
@@ -1613,11 +1725,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_WEEKLY_RECURRENCE: {
@@ -1680,11 +1792,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
priv->weekday_day_mask = day_mask;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_WEEKLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
}
@@ -1779,11 +1891,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_MONTHLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_YEARLY_RECURRENCE:
@@ -1796,11 +1908,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_YEARLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
default:
@@ -1809,13 +1921,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* If we got here it means it is a simple recurrence */
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->simple, RECUR_SIMPLE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, FALSE);
@@ -1823,9 +1935,9 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
make_recurrence_special (rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, r->interval);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
fill_ending_date (rpage, r);
@@ -1833,13 +1945,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
custom:
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->custom, RECUR_CUSTOM, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, TRUE);
sensitize_recur_widgets (rpage);
@@ -1868,11 +1980,14 @@ recurrence_page_set_summary (CompEditorPage *page, const char *summary)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
+ gchar *s;
rpage = RECURRENCE_PAGE (page);
priv = rpage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the recurrence page */
@@ -1949,14 +2064,14 @@ get_widgets (RecurrencePage *rpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -1974,7 +2089,6 @@ get_widgets (RecurrencePage *rpage)
priv->custom_warning_bin = GW ("custom-warning-bin");
priv->exception_date = GW ("exception-date");
- gtk_widget_show (priv->exception_date);
priv->exception_list = GW ("exception-list");
priv->exception_add = GW ("exception-add");
priv->exception_modify = GW ("exception-modify");
@@ -2113,24 +2227,24 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- CalComponentDateTime dt;
- struct icaltimetype icaltime = icaltime_null_time ();
+ GtkCList *clist;
+ CalComponentDateTime *dt;
struct icaltimetype *tt;
- GtkTreeIter iter;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to modify.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
+
field_changed (rpage);
- dt.value = &icaltime;
- tt = dt.value;
+ sel = GPOINTER_TO_INT (clist->selection->data);
+
+ dt = gtk_clist_get_row_data (clist, sel);
+ tt = dt->value;
e_date_edit_get_date (E_DATE_EDIT (priv->exception_date),
&tt->year, &tt->month, &tt->day);
tt->hour = 0;
@@ -2138,10 +2252,12 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
tt->second = 0;
tt->is_date = 1;
- /* No TZID, since we are using a DATE value now. */
- dt.tzid = NULL;
+ /* We get rid of any old TZID, since we are using a DATE value now. */
+ g_free ((char*)dt->tzid);
+ dt->tzid = NULL;
+
+ gtk_clist_set_text (clist, sel, 0, get_exception_string (dt));
- e_date_time_list_set_date_time (priv->exception_list_store, &iter, &dt);
preview_recur (rpage);
}
@@ -2151,36 +2267,31 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
field_changed (rpage);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->exception_list_store), &iter);
- e_date_time_list_remove (priv->exception_list_store, &iter);
+ sel = GPOINTER_TO_INT (clist->selection->data);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- }
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ if (clist->rows > 0)
+ gtk_clist_select_row (clist, sel, 0);
+ else {
+ gtk_widget_set_sensitive (priv->exception_modify, FALSE);
+ gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ }
- gtk_tree_path_free (path);
preview_recur (rpage);
}
@@ -2189,27 +2300,24 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
* exception's value.
*/
static void
-exception_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
+exception_select_row_cb (GtkCList *clist, gint row, gint col,
+ GdkEvent *event, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- const CalComponentDateTime *dt;
+ CalComponentDateTime *dt;
struct icaltimetype *t;
- GtkTreeIter iter;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ /* Sometimes GtkCList emits a 'row-selected' signal for row 0 when
+ there are 0 rows in the list (after you delete the last row).
+ So we check that the row is valid here. */
+ if (row >= clist->rows)
return;
- }
- gtk_widget_set_sensitive (priv->exception_modify, TRUE);
- gtk_widget_set_sensitive (priv->exception_delete, TRUE);
-
- dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter);
+ dt = gtk_clist_get_row_data (clist, row);
g_assert (dt != NULL);
t = dt->value;
@@ -2240,8 +2348,6 @@ init_widgets (RecurrencePage *rpage)
ECalendar *ecal;
GtkAdjustment *adj;
GtkWidget *menu;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = rpage->priv;
@@ -2249,8 +2355,8 @@ init_widgets (RecurrencePage *rpage)
priv->preview_calendar = e_calendar_new ();
ecal = E_CALENDAR (priv->preview_calendar);
- g_signal_connect((ecal->calitem), "date_range_changed",
- G_CALLBACK (preview_date_range_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (ecal->calitem), "date_range_changed",
+ GTK_SIGNAL_FUNC (preview_date_range_changed_cb),
rpage);
calendar_config_configure_e_calendar (ecal);
e_calendar_item_set_max_days_sel (ecal->calitem, 0);
@@ -2270,62 +2376,46 @@ init_widgets (RecurrencePage *rpage)
/* Recurrence types */
- g_signal_connect((priv->none), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->simple), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->custom), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->none), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->simple), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->custom), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
/* Recurrence interval */
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (interval_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (interval_value_changed_cb),
rpage);
/* Recurrence units */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (interval_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (interval_selection_done_cb),
rpage);
/* Recurrence ending */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (ending_selection_done_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (ending_selection_done_cb), rpage);
/* Exception buttons */
- g_signal_connect((priv->exception_add), "clicked",
- G_CALLBACK (exception_add_cb), rpage);
- g_signal_connect((priv->exception_modify), "clicked",
- G_CALLBACK (exception_modify_cb), rpage);
- g_signal_connect((priv->exception_delete), "clicked",
- G_CALLBACK (exception_delete_cb), rpage);
-
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
-
- /* Exception list */
-
- /* Model */
- priv->exception_list_store = e_date_time_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list),
- GTK_TREE_MODEL (priv->exception_list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Date/Time");
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_DATE_TIME_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->exception_list), column);
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)), "changed",
- G_CALLBACK (exception_selection_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_add), "clicked",
+ GTK_SIGNAL_FUNC (exception_add_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_modify), "clicked",
+ GTK_SIGNAL_FUNC (exception_modify_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_delete), "clicked",
+ GTK_SIGNAL_FUNC (exception_delete_cb), rpage);
+
+ /* Selections in the exceptions list */
+
+ gtk_signal_connect (GTK_OBJECT (priv->exception_list), "select_row",
+ GTK_SIGNAL_FUNC (exception_select_row_cb), rpage);
}
@@ -2347,7 +2437,7 @@ recurrence_page_construct (RecurrencePage *rpage)
priv = rpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/recurrence-page.glade", NULL, NULL);
+ "/recurrence-page.glade", NULL);
if (!priv->xml) {
g_message ("recurrence_page_construct(): "
"Could not load the Glade XML file!");
@@ -2378,9 +2468,9 @@ recurrence_page_new (void)
{
RecurrencePage *rpage;
- rpage = g_object_new (TYPE_RECURRENCE_PAGE, NULL);
+ rpage = gtk_type_new (TYPE_RECURRENCE_PAGE);
if (!recurrence_page_construct (rpage)) {
- g_object_unref((rpage));
+ gtk_object_unref (GTK_OBJECT (rpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index 97029704a2..c0a3f5f8f9 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -30,7 +30,9 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <glade/glade.h>
#include <gal/e-table/e-cell-combo.h>
@@ -77,7 +79,7 @@ struct _SchedulePagePrivate {
static void schedule_page_class_init (SchedulePageClass *class);
static void schedule_page_init (SchedulePage *spage);
-static void schedule_page_finalize (GObject *object);
+static void schedule_page_destroy (GtkObject *object);
static GtkWidget *schedule_page_get_widget (CompEditorPage *page);
static void schedule_page_focus_main_widget (CompEditorPage *page);
@@ -99,21 +101,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #SchedulePage class.
**/
+GtkType
+schedule_page_get_type (void)
+{
+ static GtkType schedule_page_type;
+
+ if (!schedule_page_type) {
+ static const GtkTypeInfo schedule_page_info = {
+ "SchedulePage",
+ sizeof (SchedulePage),
+ sizeof (SchedulePageClass),
+ (GtkClassInitFunc) schedule_page_class_init,
+ (GtkObjectInitFunc) schedule_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ schedule_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &schedule_page_info);
+ }
-E_MAKE_TYPE (schedule_page, "SchedulePage", SchedulePage, schedule_page_class_init,
- schedule_page_init, TYPE_COMP_EDITOR_PAGE);
+ return schedule_page_type;
+}
/* Class initialization function for the schedule page */
static void
schedule_page_class_init (SchedulePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = schedule_page_get_widget;
editor_page_class->focus_main_widget = schedule_page_focus_main_widget;
@@ -122,7 +145,7 @@ schedule_page_class_init (SchedulePageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = schedule_page_set_dates;
- object_class->finalize = schedule_page_finalize;
+ object_class->destroy = schedule_page_destroy;
}
/* Object initialization function for the schedule page */
@@ -145,7 +168,7 @@ schedule_page_init (SchedulePage *spage)
/* Destroy handler for the schedule page */
static void
-schedule_page_finalize (GObject *object)
+schedule_page_destroy (GtkObject *object)
{
SchedulePage *spage;
SchedulePagePrivate *priv;
@@ -157,17 +180,17 @@ schedule_page_finalize (GObject *object)
priv = spage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
spage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -362,14 +385,14 @@ get_widgets (SchedulePage *spage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
#undef GW
@@ -383,8 +406,8 @@ init_widgets (SchedulePage *spage)
priv = spage->priv;
- g_signal_connect((priv->sel),
- "changed", G_CALLBACK (times_changed_cb), spage);
+ gtk_signal_connect (GTK_OBJECT (priv->sel),
+ "changed", times_changed_cb, spage);
return TRUE;
@@ -409,7 +432,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
priv = spage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/schedule-page.glade", NULL, NULL);
+ "/schedule-page.glade", NULL);
if (!priv->xml) {
g_message ("schedule_page_construct(): "
"Could not load the Glade XML file!");
@@ -423,7 +446,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
}
/* Model */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
/* Selector */
@@ -458,9 +481,9 @@ schedule_page_new (EMeetingModel *emm)
{
SchedulePage *spage;
- spage = g_object_new (TYPE_SCHEDULE_PAGE, NULL);
+ spage = gtk_type_new (TYPE_SCHEDULE_PAGE);
if (!schedule_page_construct (spage, emm)) {
- g_object_unref((spage));
+ gtk_object_unref (GTK_OBJECT (spage));
return NULL;
}
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
index de89d607c2..7d9875133c 100644
--- a/calendar/gui/dialogs/send-comp.c
+++ b/calendar/gui/dialogs/send-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "send-comp.h"
@@ -45,7 +47,6 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (cal_client_get_save_schedules (client))
return FALSE;
@@ -80,14 +81,9 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 629443dba2..66cfc35c2c 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -27,6 +27,7 @@
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -88,7 +89,7 @@ static const int priority_map[] = {
static void task_details_page_class_init (TaskDetailsPageClass *class);
static void task_details_page_init (TaskDetailsPage *tdpage);
-static void task_details_page_finalize (GObject *object);
+static void task_details_page_destroy (GtkObject *object);
static GtkWidget *task_details_page_get_widget (CompEditorPage *page);
static void task_details_page_focus_main_widget (CompEditorPage *page);
@@ -107,28 +108,49 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #TaskDetailsPage class.
**/
+GtkType
+task_details_page_get_type (void)
+{
+ static GtkType task_details_page_type;
+
+ if (!task_details_page_type) {
+ static const GtkTypeInfo task_details_page_info = {
+ "TaskDetailsPage",
+ sizeof (TaskDetailsPage),
+ sizeof (TaskDetailsPageClass),
+ (GtkClassInitFunc) task_details_page_class_init,
+ (GtkObjectInitFunc) task_details_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_details_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &task_details_page_info);
+ }
-E_MAKE_TYPE (task_details_page, "TaskDetailsPage", TaskDetailsPage, task_details_page_class_init,
- task_details_page_init, TYPE_COMP_EDITOR_PAGE);
+ return task_details_page_type;
+}
/* Class initialization function for the task page */
static void
task_details_page_class_init (TaskDetailsPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = task_details_page_get_widget;
editor_page_class->focus_main_widget = task_details_page_focus_main_widget;
editor_page_class->fill_widgets = task_details_page_fill_widgets;
editor_page_class->fill_component = task_details_page_fill_component;
- object_class->finalize = task_details_page_finalize;
+ object_class->destroy = task_details_page_destroy;
}
/* Object initialization function for the task page */
@@ -158,7 +180,7 @@ task_details_page_init (TaskDetailsPage *tdpage)
/* Destroy handler for the task page */
static void
-task_details_page_finalize (GObject *object)
+task_details_page_destroy (GtkObject *object)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
@@ -170,15 +192,15 @@ task_details_page_finalize (GObject *object)
priv = tdpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
tdpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -452,24 +474,22 @@ get_widgets (TaskDetailsPage *tdpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->status = GW ("status");
priv->priority = GW ("priority");
priv->percent_complete = GW ("percent-complete");
priv->completed_date = GW ("completed-date");
- gtk_widget_show (priv->completed_date);
priv->url_entry = GW ("url_entry");
- gtk_widget_show (priv->url_entry);
priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
#undef GW
@@ -643,7 +663,7 @@ field_changed_cb (GtkWidget *widget, gpointer data)
tdpage = TASK_DETAILS_PAGE (data);
priv = tdpage->priv;
-
+
if (!priv->updating)
comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
}
@@ -665,26 +685,26 @@ init_widgets (TaskDetailsPage *tdpage)
/* Connect signals. The Status, Percent Complete & Date Completed
properties are closely related so whenever one changes we may need
to update the other 2. */
- g_signal_connect((GTK_OPTION_MENU (priv->status)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->status)->menu),
"deactivate",
- G_CALLBACK (status_changed), tdpage);
+ GTK_SIGNAL_FUNC (status_changed), tdpage);
- g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
"value_changed",
- G_CALLBACK (percent_complete_changed), tdpage);
+ GTK_SIGNAL_FUNC (percent_complete_changed), tdpage);
/* Priority */
- g_signal_connect((GTK_OPTION_MENU (priv->priority)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->priority)->menu),
"deactivate",
- G_CALLBACK (field_changed_cb), tdpage);
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
/* Completed Date */
- g_signal_connect((priv->completed_date), "changed",
- G_CALLBACK (date_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->completed_date), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), tdpage);
/* URL */
- g_signal_connect((priv->url), "changed",
- G_CALLBACK (field_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->url), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
}
@@ -706,7 +726,7 @@ task_details_page_construct (TaskDetailsPage *tdpage)
priv = tdpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/task-details-page.glade", NULL, NULL);
+ "/task-details-page.glade", NULL);
if (!priv->xml) {
g_message ("task_details_page_construct(): "
"Could not load the Glade XML file!");
@@ -737,9 +757,9 @@ task_details_page_new (void)
{
TaskDetailsPage *tdpage;
- tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, NULL);
+ tdpage = gtk_type_new (TYPE_TASK_DETAILS_PAGE);
if (!task_details_page_construct (tdpage)) {
- g_object_unref ((tdpage));
+ gtk_object_unref (GTK_OBJECT (tdpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index fba510499d..28bf6a3bcc 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -1,382 +1,309 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
+<project>
+ <name>task-details-page</name>
+ <program_name>task-details-page</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>
+</project>
-<widget class="GtkWindow" id="task-details-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+<widget>
+ <class>GtkWindow</class>
+ <name>task-details-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <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>
- <child>
- <widget class="GtkVBox" id="task-details-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkVBox</class>
+ <name>task-details-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame2</name>
+ <label>Progress</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Status:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">status</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="status">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Started</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">In Progress</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Completed</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cancelled</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">priority</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="priority">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">High</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Normal</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Low</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Undefined</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label17</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>status</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">% Complete</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>status</name>
+ <can_focus>True</can_focus>
+ <items>Not Started
+In Progress
+Completed
+Cancelled
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkSpinButton" id="percent-complete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label18</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>priority</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>priority</name>
+ <can_focus>True</can_focus>
+ <items>High
+Normal
+Low
+Undefined
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date Completed:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label19</name>
+ <label>% Complete</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="Custom" id="completed-date">
- <property name="visible">True</property>
- <property name="creation_function">task_details_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>percent-complete</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>1</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table1</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Progress</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+
+ <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>Custom</class>
+ <name>completed-date</name>
+ <creation_function>task_details_page_create_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 01 Jun 2001 18:58:51 GMT</last_modification_time>
+ <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>True</yfill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table2</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">URL:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <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>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>
- <child>
- <widget class="Custom" id="url_entry">
- <property name="visible">True</property>
- <property name="creation_function">e_url_entry_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Feb 2002 21:02:37 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>url_entry</name>
+ <creation_function>e_url_entry_new</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 08 Feb 2002 21:02:37 GMT</last_modification_time>
+ <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>True</yfill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 0b2aee9827..051fe1c9b7 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -52,7 +52,7 @@ static void task_editor_class_init (TaskEditorClass *class);
static void task_editor_init (TaskEditor *te);
static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void task_editor_finalize (GObject *object);
+static void task_editor_destroy (GtkObject *object);
static void assign_task_cmd (GtkWidget *widget, gpointer data);
static void refresh_task_cmd (GtkWidget *widget, gpointer data);
@@ -83,26 +83,46 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #TaskEditor class.
**/
+GtkType
+task_editor_get_type (void)
+{
+ static GtkType task_editor_type = 0;
+
+ if (!task_editor_type) {
+ static const GtkTypeInfo task_editor_info = {
+ "TaskEditor",
+ sizeof (TaskEditor),
+ sizeof (TaskEditorClass),
+ (GtkClassInitFunc) task_editor_class_init,
+ (GtkObjectInitFunc) task_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &task_editor_info);
+ }
-E_MAKE_TYPE (task_editor, "TaskEditor", TaskEditor, task_editor_class_init, task_editor_init,
- TYPE_COMP_EDITOR);
+ return task_editor_type;
+}
/* Class initialization function for the event editor */
static void
task_editor_class_init (TaskEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->edit_comp = task_editor_edit_comp;
editor_class->send_comp = task_editor_send_comp;
- object_class->finalize = task_editor_finalize;
+ object_class->destroy = task_editor_destroy;
}
static void
@@ -151,12 +171,12 @@ init_widgets (TaskEditor *te)
priv = te->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
}
/* Object initialization function for the task editor */
@@ -182,22 +202,16 @@ task_editor_construct (TaskEditor *te, CalClient *client)
priv = te->priv;
priv->task_page = task_page_new ();
- g_object_ref (priv->task_page);
- gtk_object_sink (GTK_OBJECT (priv->task_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_page),
_("Basic"));
priv->task_details_page = task_details_page_new ();
- g_object_ref (priv->task_details_page);
- gtk_object_sink (GTK_OBJECT (priv->task_details_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_details_page),
_("Details"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
@@ -243,42 +257,50 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->assignment_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
-
- if (!priv->assignment_shown)
+
+ if (!priv->assignment_shown) {
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
-
+ }
+
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *ca = l->data;
EMeetingAttendee *ia;
ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca));
- if (!comp_editor_get_user_org (editor))
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- e_meeting_model_add_attendee (priv->model, ia);
+ if (!comp_editor_get_user_org (editor))
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ e_meeting_model_add_attendee (priv->model, ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
+ }
- g_object_unref(ia);
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
+ EMeetingAttendee *ia;
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
+ itip_addresses_free (addresses);
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -286,8 +308,8 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
}
-
- priv->assignment_shown = TRUE;
+
+ priv->assignment_shown = TRUE;
}
cal_component_free_attendee_list (attendees);
@@ -318,7 +340,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -333,7 +355,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-task_editor_finalize (GObject *object)
+task_editor_destroy (GtkObject *object)
{
TaskEditor *te;
TaskEditorPrivate *priv;
@@ -344,14 +366,14 @@ task_editor_finalize (GObject *object)
te = TASK_EDITOR (object);
priv = te->priv;
- g_object_unref((priv->task_page));
- g_object_unref((priv->task_details_page));
- g_object_unref((priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_details_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -368,7 +390,7 @@ task_editor_new (CalClient *client)
{
TaskEditor *te;
- te = g_object_new (TYPE_TASK_EDITOR, NULL);
+ te = TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
return task_editor_construct (te, client);
}
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 0cf38eedd1..4fff976ed1 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -37,6 +37,7 @@
#include <gal/e-table/e-cell-toggle.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-combo.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/widgets/e-popup-menu.h>
#include <e-util/e-dialog-utils.h>
#include <widgets/misc/e-cell-date-edit.h>
@@ -125,8 +126,32 @@ static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 };
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_calendar_table, "ECalendarTable", ECalendarTable, e_calendar_table_class_init,
- e_calendar_table_init, GTK_TYPE_TABLE);
+
+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)
@@ -320,11 +345,11 @@ e_calendar_table_init (ECalendarTable *cal_table)
* Normal string fields.
*/
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
e_table_extras_add_cell (extras, "calstring", cell);
@@ -333,15 +358,15 @@ e_calendar_table_init (ECalendarTable *cal_table)
* Date fields.
*/
cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
popup_cell = e_cell_date_edit_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
e_table_extras_add_cell (extras, "dateedit", popup_cell);
cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
@@ -356,21 +381,21 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Classification field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Public"));
- strings = g_list_append (strings, (char*) _("Private"));
- strings = g_list_append (strings, (char*) _("Confidential"));
+ strings = g_list_append (strings, (char*) U_("Public"));
+ strings = g_list_append (strings, (char*) U_("Private"));
+ strings = g_list_append (strings, (char*) U_("Confidential"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -378,22 +403,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Priority field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("High"));
- strings = g_list_append (strings, (char*) _("Normal"));
- strings = g_list_append (strings, (char*) _("Low"));
- strings = g_list_append (strings, (char*) _("Undefined"));
+ strings = g_list_append (strings, (char*) U_("High"));
+ strings = g_list_append (strings, (char*) U_("Normal"));
+ strings = g_list_append (strings, (char*) U_("Low"));
+ strings = g_list_append (strings, (char*) U_("Undefined"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -401,28 +426,28 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Percent field. */
cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("0%"));
- strings = g_list_append (strings, (char*) _("10%"));
- strings = g_list_append (strings, (char*) _("20%"));
- strings = g_list_append (strings, (char*) _("30%"));
- strings = g_list_append (strings, (char*) _("40%"));
- strings = g_list_append (strings, (char*) _("50%"));
- strings = g_list_append (strings, (char*) _("60%"));
- strings = g_list_append (strings, (char*) _("70%"));
- strings = g_list_append (strings, (char*) _("80%"));
- strings = g_list_append (strings, (char*) _("90%"));
- strings = g_list_append (strings, (char*) _("100%"));
+ strings = g_list_append (strings, (char*) U_("0%"));
+ strings = g_list_append (strings, (char*) U_("10%"));
+ strings = g_list_append (strings, (char*) U_("20%"));
+ strings = g_list_append (strings, (char*) U_("30%"));
+ strings = g_list_append (strings, (char*) U_("40%"));
+ strings = g_list_append (strings, (char*) U_("50%"));
+ strings = g_list_append (strings, (char*) U_("60%"));
+ strings = g_list_append (strings, (char*) U_("70%"));
+ strings = g_list_append (strings, (char*) U_("80%"));
+ strings = g_list_append (strings, (char*) U_("90%"));
+ strings = g_list_append (strings, (char*) U_("100%"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -430,20 +455,20 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Transparency field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Free"));
- strings = g_list_append (strings, (char*) _("Busy"));
+ strings = g_list_append (strings, (char*) U_("Free"));
+ strings = g_list_append (strings, (char*) U_("Busy"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -451,22 +476,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
/* Status field. */
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
- g_object_set (G_OBJECT (cell),
- "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
- "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
- "color_column", CAL_COMPONENT_FIELD_COLOR,
- "editable", FALSE,
- NULL);
+ gtk_object_set (GTK_OBJECT (cell),
+ "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
+ "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
+ "color_column", CAL_COMPONENT_FIELD_COLOR,
+ "editable", FALSE,
+ NULL);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Not Started"));
- strings = g_list_append (strings, (char*) _("In Progress"));
- strings = g_list_append (strings, (char*) _("Completed"));
- strings = g_list_append (strings, (char*) _("Cancelled"));
+ strings = g_list_append (strings, (char*) U_("Not Started"));
+ strings = g_list_append (strings, (char*) U_("In Progress"));
+ strings = g_list_append (strings, (char*) U_("Completed"));
+ strings = g_list_append (strings, (char*) U_("Cancelled"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell),
strings);
@@ -507,7 +532,7 @@ e_calendar_table_init (ECalendarTable *cal_table)
extras,
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec",
NULL);
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
cal_table->etable = table;
gtk_table_attach (GTK_TABLE (cal_table), table, 0, 1, 0, 1,
@@ -516,9 +541,15 @@ e_calendar_table_init (ECalendarTable *cal_table)
e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (table));
- g_signal_connect (e_table, "double_click", G_CALLBACK (e_calendar_table_on_double_click), cal_table);
- g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table);
- g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "double_click",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_double_click),
+ cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "right_click",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_right_click),
+ cal_table);
+ gtk_signal_connect (GTK_OBJECT (e_table), "key_press",
+ GTK_SIGNAL_FUNC (e_calendar_table_on_key_press),
+ cal_table);
/* Set up the invisible widget for the clipboard selections */
cal_table->invisible = gtk_invisible_new ();
@@ -526,15 +557,22 @@ e_calendar_table_init (ECalendarTable *cal_table)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
- g_signal_connect (cal_table->invisible, "selection_get",
- G_CALLBACK (selection_get), cal_table);
- g_signal_connect (cal_table->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), cal_table);
- g_signal_connect (cal_table->invisible, "selection_received",
- G_CALLBACK (selection_received), cal_table);
- g_signal_connect (cal_table->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), cal_table);
-
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) cal_table);
+ gtk_signal_connect (GTK_OBJECT (cal_table->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) cal_table);
cal_table->clipboard_selection = NULL;
}
@@ -550,7 +588,7 @@ e_calendar_table_new (void)
{
GtkWidget *cal_table;
- cal_table = GTK_WIDGET (g_object_new (e_calendar_table_get_type (), NULL));
+ cal_table = GTK_WIDGET (gtk_type_new (e_calendar_table_get_type ()));
return cal_table;
}
@@ -581,7 +619,7 @@ e_calendar_table_destroy (GtkObject *object)
cal_table = E_CALENDAR_TABLE (object);
- g_object_unref (cal_table->model);
+ gtk_object_unref (GTK_OBJECT (cal_table->model));
cal_table->model = NULL;
if (cal_table->invisible)
@@ -947,27 +985,27 @@ enum {
static EPopupMenu tasks_popup_menu [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_calendar_table_on_open_task), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Save as..."), GTK_SIGNAL_FUNC (e_calendar_table_on_save_as), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_calendar_table_on_print_task), MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Open"), e_calendar_table_on_open_task, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Save as..."), e_calendar_table_on_save_as, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Print..."), e_calendar_table_on_print_task, MASK_SINGLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_calendar_table_on_cut), MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_calendar_table_on_copy), 0),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_calendar_table_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_calendar_table_on_cut, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Copy"), e_calendar_table_on_copy, 0),
+ E_POPUP_ITEM (N_("_Paste"), e_calendar_table_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Assign Task"), GTK_SIGNAL_FUNC (e_calendar_table_on_assign), MASK_SINGLE | MASK_EDITABLE | MASK_ASSIGNABLE),
- E_POPUP_ITEM (N_("_Forward as iCalendar"), GTK_SIGNAL_FUNC (e_calendar_table_on_forward), MASK_SINGLE),
- E_POPUP_ITEM (N_("_Mark as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Mark Selected Tasks as Complete"), GTK_SIGNAL_FUNC (mark_as_complete_cb), MASK_MULTIPLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Assign Task"), e_calendar_table_on_assign, MASK_SINGLE | MASK_EDITABLE | MASK_ASSIGNABLE),
+ E_POPUP_ITEM (N_("_Forward as iCalendar"), e_calendar_table_on_forward, MASK_SINGLE),
+ E_POPUP_ITEM (N_("_Mark as Complete"), mark_as_complete_cb, MASK_SINGLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Mark Selected Tasks as Complete"), mark_as_complete_cb, MASK_MULTIPLE | MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (delete_cb), MASK_SINGLE | MASK_EDITABLE),
- E_POPUP_ITEM (N_("_Delete Selected Tasks"), GTK_SIGNAL_FUNC (delete_cb), MASK_MULTIPLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete"), delete_cb, MASK_SINGLE | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete Selected Tasks"), delete_cb, MASK_MULTIPLE | MASK_EDITABLE),
E_POPUP_TERMINATOR
};
@@ -1176,7 +1214,7 @@ e_calendar_table_save_state (ECalendarTable *cal_table,
static void
invisible_destroyed (GtkWidget *invisible, ECalendarTable *cal_table)
{
- g_object_unref (cal_table->invisible);
+ gtk_object_unref (GTK_OBJECT (cal_table->invisible));
cal_table->invisible = NULL;
}
@@ -1268,7 +1306,7 @@ selection_received (GtkWidget *invisible,
calendar_model_get_cal_client (cal_table->model),
tmp_comp);
free (uid);
- g_object_unref (tmp_comp);
+ gtk_object_unref (GTK_OBJECT (tmp_comp));
}
subcomp = icalcomponent_get_next_component (
vcal_comp, ICAL_ANY_COMPONENT);
@@ -1284,7 +1322,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (
calendar_model_get_cal_client (cal_table->model),
comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
calendar_model_set_status_message (e_calendar_table_get_model (cal_table), NULL);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index d557b43c5c..2292a87790 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -42,10 +42,9 @@
#include <gtk/gtkwindow.h>
#include <gal/e-text/e-text.h>
#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-unicode.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
+#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-util.h>
@@ -78,7 +77,10 @@
/* The minimum amount of space wanted on each side of the date string. */
#define E_DAY_VIEW_DATE_X_PAD 4
-#define E_DAY_VIEW_LARGE_FONT_PTSIZE 18
+#define E_DAY_VIEW_LARGE_FONT \
+ "-adobe-utopia-regular-r-normal-*-*-240-*-*-p-*-iso8859-*"
+#define E_DAY_VIEW_LARGE_FONT_FALLBACK \
+ "-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-iso8859-*"
/* The offset from the top/bottom of the canvas before auto-scrolling starts.*/
#define E_DAY_VIEW_AUTO_SCROLL_OFFSET 16
@@ -474,8 +476,32 @@ static gboolean e_day_view_layout_timeout_cb (gpointer data);
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_day_view, "EDayView", EDayView, e_day_view_class_init,
- e_day_view_init, GTK_TYPE_TABLE);
+
+GtkType
+e_day_view_get_type (void)
+{
+ static GtkType e_day_view_type = 0;
+
+ if (!e_day_view_type){
+ GtkTypeInfo e_day_view_info = {
+ "EDayView",
+ sizeof (EDayView),
+ sizeof (EDayViewClass),
+ (GtkClassInitFunc) e_day_view_class_init,
+ (GtkObjectInitFunc) e_day_view_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ parent_class = gtk_type_class (GTK_TYPE_TABLE);
+ e_day_view_type = gtk_type_unique (GTK_TYPE_TABLE,
+ &e_day_view_info);
+ }
+
+ return e_day_view_type;
+}
+
static void
e_day_view_class_init (EDayViewClass *class)
@@ -483,18 +509,18 @@ e_day_view_class_init (EDayViewClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
e_day_view_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EDayViewClass, selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, e_day_view_signals, LAST_SIGNAL);
/* Method override */
object_class->destroy = e_day_view_destroy;
@@ -605,7 +631,7 @@ e_day_view_init (EDayView *day_view)
day_view->default_category = NULL;
- day_view->large_font_desc = NULL;
+ day_view->large_font = NULL;
/* String to use in 12-hour time format for times in the morning. */
day_view->am_string = _("am");
@@ -621,25 +647,39 @@ e_day_view_init (EDayView *day_view)
gtk_table_attach (GTK_TABLE (day_view), day_view->top_canvas,
1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (day_view->top_canvas);
- g_signal_connect_after (day_view->top_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_press), day_view);
- g_signal_connect_after (day_view->top_canvas, "button_release_event",
- G_CALLBACK (e_day_view_on_top_canvas_button_release), day_view);
- g_signal_connect_after (day_view->top_canvas, "motion_notify_event",
- G_CALLBACK (e_day_view_on_top_canvas_motion), day_view);
- g_signal_connect_after (day_view->top_canvas, "drag_motion",
- G_CALLBACK (e_day_view_on_top_canvas_drag_motion), day_view);
- g_signal_connect_after (day_view->top_canvas, "drag_leave",
- G_CALLBACK (e_day_view_on_top_canvas_drag_leave), day_view);
-
- g_signal_connect (day_view->top_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->top_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->top_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_top_canvas_drag_data_received), day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "button_press_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_button_press),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "button_release_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_button_release),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas), "motion_notify_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_motion),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas),
+ "drag_motion",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_motion),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->top_canvas),
+ "drag_leave",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_leave),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_begin",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_begin),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_end",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_end),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_data_get",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_data_get),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->top_canvas),
+ "drag_data_received",
+ GTK_SIGNAL_FUNC (e_day_view_on_top_canvas_drag_data_received),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root);
@@ -652,7 +692,6 @@ e_day_view_init (EDayView *day_view)
day_view->resize_long_event_rect_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
@@ -684,38 +723,45 @@ e_day_view_init (EDayView *day_view)
1, 2, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->main_canvas);
- g_signal_connect (day_view->main_canvas, "realize",
- G_CALLBACK (e_day_view_on_canvas_realized), day_view);
-
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas), "realize",
+ GTK_SIGNAL_FUNC (e_day_view_on_canvas_realized),
+ day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"button_press_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_press),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_button_press),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"button_release_event",
- G_CALLBACK (e_day_view_on_main_canvas_button_release),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_button_release),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"motion_notify_event",
- G_CALLBACK (e_day_view_on_main_canvas_motion),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_motion),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"drag_motion",
- G_CALLBACK (e_day_view_on_main_canvas_drag_motion),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_motion),
day_view);
- g_signal_connect_after (day_view->main_canvas,
+ gtk_signal_connect_after (GTK_OBJECT (day_view->main_canvas),
"drag_leave",
- G_CALLBACK (e_day_view_on_main_canvas_drag_leave),
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_leave),
day_view);
-
- g_signal_connect (day_view->main_canvas, "drag_begin",
- G_CALLBACK (e_day_view_on_drag_begin), day_view);
- g_signal_connect (day_view->main_canvas, "drag_end",
- G_CALLBACK (e_day_view_on_drag_end), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_get",
- G_CALLBACK (e_day_view_on_drag_data_get), day_view);
- g_signal_connect (day_view->main_canvas, "drag_data_received",
- G_CALLBACK (e_day_view_on_main_canvas_drag_data_received), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_begin",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_begin),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_end",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_end),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_data_get",
+ GTK_SIGNAL_FUNC (e_day_view_on_drag_data_get),
+ day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->main_canvas),
+ "drag_data_received",
+ GTK_SIGNAL_FUNC (e_day_view_on_main_canvas_drag_data_received),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root);
@@ -728,14 +774,12 @@ e_day_view_init (EDayView *day_view)
day_view->resize_rect_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_rect_item);
day_view->resize_bar_item =
gnome_canvas_item_new (canvas_group,
gnome_canvas_rect_get_type(),
- "width_pixels", 1,
NULL);
gnome_canvas_item_hide (day_view->resize_bar_item);
@@ -791,8 +835,10 @@ e_day_view_init (EDayView *day_view)
0, 1, 1, 2,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (day_view->time_canvas);
- g_signal_connect_after (day_view->time_canvas, "button_press_event",
- G_CALLBACK (e_day_view_on_time_canvas_button_press), day_view);
+ gtk_signal_connect_after (GTK_OBJECT (day_view->time_canvas),
+ "button_press_event",
+ GTK_SIGNAL_FUNC (e_day_view_on_time_canvas_button_press),
+ day_view);
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root);
@@ -836,15 +882,22 @@ e_day_view_init (EDayView *day_view)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
- g_signal_connect (day_view->invisible, "selection_get",
- G_CALLBACK (selection_get), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "selection_received",
- G_CALLBACK (selection_received), (gpointer) day_view);
- g_signal_connect (day_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) day_view);
-
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) day_view);
day_view->clipboard_selection = NULL;
day_view->activity = NULL;
@@ -873,7 +926,7 @@ e_day_view_new (void)
{
GtkWidget *day_view;
- day_view = GTK_WIDGET (g_object_new (e_day_view_get_type (), NULL));
+ day_view = GTK_WIDGET (gtk_type_new (e_day_view_get_type ()));
return day_view;
}
@@ -892,8 +945,8 @@ e_day_view_destroy (GtkObject *object)
e_day_view_stop_auto_scroll (day_view);
if (day_view->client) {
- g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->client));
day_view->client = NULL;
}
@@ -903,15 +956,14 @@ e_day_view_destroy (GtkObject *object)
}
if (day_view->query) {
- g_signal_handlers_disconnect_matched (day_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->query), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->query));
day_view->query = NULL;
}
- if (day_view->large_font_desc) {
- pango_font_description_free (day_view->large_font_desc);
- day_view->large_font_desc = NULL;
+ if (day_view->large_font) {
+ gdk_font_unref (day_view->large_font);
+ day_view->large_font = NULL;
}
if (day_view->default_category) {
@@ -940,7 +992,7 @@ e_day_view_destroy (GtkObject *object)
}
if (day_view->activity) {
- g_object_unref (day_view->activity);
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
day_view->activity = NULL;
}
@@ -977,10 +1029,6 @@ e_day_view_realize (GtkWidget *widget)
day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].green = 0 * 257;
day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED].blue = 156 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].red = 16 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].green = 78 * 257;
- day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED].blue = 139 * 257;
-
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].red = 0x8000;
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].green = 0x8000;
day_view->colors[E_DAY_VIEW_COLOR_BG_GRID].blue = 0x8000;
@@ -1082,6 +1130,7 @@ e_day_view_unrealize (GtkWidget *widget)
{
EDayView *day_view;
GdkColormap *colormap;
+ gint i;
day_view = E_DAY_VIEW (widget);
@@ -1089,7 +1138,8 @@ e_day_view_unrealize (GtkWidget *widget)
day_view->main_gc = NULL;
colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, day_view->colors, E_DAY_VIEW_COLOR_LAST);
+ for (i = 0; i < E_DAY_VIEW_COLOR_LAST; i++)
+ gdk_colors_free (colormap, &day_view->colors[i].pixel, 1, 0);
gdk_pixmap_unref (day_view->reminder_icon);
day_view->reminder_icon = NULL;
@@ -1121,16 +1171,17 @@ e_day_view_style_set (GtkWidget *widget,
(*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
day_view = E_DAY_VIEW (widget);
- font = gtk_style_get_font (gtk_widget_get_style (widget));
+ font = widget->style->font;
/* Create the large font. */
- if (day_view->large_font_desc != NULL)
- pango_font_description_free (day_view->large_font_desc);
+ if (day_view->large_font != NULL)
+ gdk_font_unref (day_view->large_font);
- day_view->large_font_desc =
- pango_font_description_copy (gtk_widget_get_style (widget)->font_desc);
- pango_font_description_set_size (day_view->large_font_desc,
- E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE);
+ day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT);
+ if (!day_view->large_font)
+ day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT_FALLBACK);
+ if (!day_view->large_font)
+ day_view->large_font = font;
/* Recalculate the height of each row based on the font size. */
day_view->row_height = font->ascent + font->descent + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */;
@@ -1234,16 +1285,14 @@ e_day_view_style_set (GtkWidget *widget,
e_day_view_foreach_event (day_view, e_day_view_set_event_font_cb,
font);
-#if 0
- /* FIXME: Port. */
-
/* Set the fonts for the text items used when dragging. */
gnome_canvas_item_set (day_view->drag_long_event_item,
- "font_gdk", font, NULL);
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
+ NULL);
gnome_canvas_item_set (day_view->drag_item,
- "font_gdk", font, NULL);
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
+ NULL);
}
@@ -1254,9 +1303,7 @@ e_day_view_set_event_font_cb (EDayView *day_view,
gpointer data)
{
EDayViewEvent *event;
-#if 0
GdkFont *font = data;
-#endif
if (day == E_DAY_VIEW_LONG_EVENT)
event = &g_array_index (day_view->long_events,
@@ -1265,12 +1312,10 @@ e_day_view_set_event_font_cb (EDayView *day_view,
event = &g_array_index (day_view->events[day],
EDayViewEvent, event_num);
-#if 0
if (event->canvas_item)
gnome_canvas_item_set (event->canvas_item,
"font_gdk", font,
NULL);
-#endif
return TRUE;
}
@@ -1340,7 +1385,7 @@ e_day_view_recalc_cell_sizes (EDayView *day_view)
char buffer[128];
g_return_if_fail (((GtkWidget*)day_view)->style != NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
/* Calculate the column sizes, using floating point so that pixels
get divided evenly. Note that we use one more element than the
@@ -1427,12 +1472,9 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event)
gtk_widget_queue_draw (day_view->main_canvas);
g_assert (GTK_WIDGET_REALIZED (day_view->main_canvas));
-#if 0
- /* FIXME when gal is fixed */
if (E_CANVAS (day_view->main_canvas)->ic)
gdk_im_begin (E_CANVAS (day_view->main_canvas)->ic,
GTK_LAYOUT (day_view->main_canvas)->bin_window);
-#endif
return FALSE;
}
@@ -1455,12 +1497,8 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event)
gtk_widget_queue_draw (day_view->main_canvas);
g_assert (GTK_WIDGET_REALIZED (day_view->main_canvas));
-
-#if 0
- /* FIXME when gal is fixed */
if (E_CANVAS (day_view->main_canvas)->ic)
gdk_im_end ();
-#endif
return FALSE;
}
@@ -1533,7 +1571,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
g_print ("updated object's dates unchanged\n");
#endif
e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_update_event_cb, comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gtk_widget_queue_draw (day_view->top_canvas);
gtk_widget_queue_draw (day_view->main_canvas);
return;
@@ -1555,7 +1593,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
e_day_view_add_event, day_view,
cal_client_resolve_tzid_cb, day_view->client,
day_view->zone);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
e_day_view_queue_layout (day_view);
}
@@ -1660,9 +1698,8 @@ update_query (EDayView *day_view)
day_view->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, day_view);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), day_view);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (day_view->sexp != NULL);
@@ -1680,14 +1717,14 @@ update_query (EDayView *day_view)
return;
}
- g_signal_connect (day_view->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), day_view);
- g_signal_connect (day_view->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), day_view);
- g_signal_connect (day_view->query, "query_done",
- G_CALLBACK (query_query_done_cb), day_view);
- g_signal_connect (day_view->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), day_view);
}
/* Callback used when the calendar client finishes opening */
@@ -1725,11 +1762,11 @@ e_day_view_set_cal_client (EDayView *day_view,
g_return_if_fail (IS_CAL_CLIENT (client));
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (day_view->client) {
- g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view);
- g_object_unref (day_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view);
+ gtk_object_unref (GTK_OBJECT (day_view->client));
}
day_view->client = client;
@@ -1738,8 +1775,8 @@ e_day_view_set_cal_client (EDayView *day_view,
if (cal_client_get_load_state (day_view->client) == CAL_CLIENT_LOAD_LOADED)
update_query (day_view);
else
- g_signal_connect (day_view->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), day_view);
+ gtk_signal_connect (GTK_OBJECT (day_view->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), day_view);
}
}
@@ -1809,9 +1846,9 @@ e_day_view_update_event_cb (EDayView *day_view,
event_num);
}
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
event->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
if (day == E_DAY_VIEW_LONG_EVENT) {
e_day_view_update_long_event_label (day_view, event_num);
@@ -1935,7 +1972,7 @@ e_day_view_remove_event_cb (EDayView *day_view,
if (event->canvas_item)
gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
if (day == E_DAY_VIEW_LONG_EVENT) {
g_array_remove_index (day_view->long_events, event_num);
@@ -2996,7 +3033,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
GdkEventButton *event,
EDayView *day_view)
{
- gint event_x, event_y, day, event_num;
+ gint event_x, event_y, scroll_x, scroll_y, day, event_num;
EDayViewPosition pos;
/* Convert the coords to the main canvas window, or return if the
@@ -3006,6 +3043,12 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
+ /* The top canvas doesn't scroll, but just in case. */
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ event_x += scroll_x;
+ event_y += scroll_y;
+
pos = e_day_view_convert_position_in_top_canvas (day_view,
event_x, event_y,
&day, &event_num);
@@ -3113,7 +3156,7 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
GdkEventButton *event,
EDayView *day_view)
{
- gint event_x, event_y, row, day, event_num;
+ gint event_x, event_y, scroll_x, scroll_y, row, day, event_num;
EDayViewPosition pos;
#if 0
@@ -3139,6 +3182,11 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ event_x += scroll_x;
+ event_y += scroll_y;
+
/* Find out where the mouse is. */
pos = e_day_view_convert_position_in_main_canvas (day_view,
event_x, event_y,
@@ -3223,7 +3271,7 @@ e_day_view_on_time_canvas_button_press (GtkWidget *widget,
* a pointer to a boolean; will set it to TRUE.
*/
static void
-comp_destroy_cb (gpointer data, GObject *deadbeef)
+comp_destroy_cb (GtkObject *object, gpointer data)
{
gboolean *destroyed;
@@ -3256,16 +3304,18 @@ e_day_view_on_long_event_button_press (EDayView *day_view,
} else if (event->button == 3) {
EDayViewEvent *e;
gboolean destroyed;
+ guint id;
e = &g_array_index (day_view->long_events, EDayViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_day_view_set_selected_time_range_in_top_visible (day_view, e->start, e->end);
@@ -3305,17 +3355,19 @@ e_day_view_on_event_button_press (EDayView *day_view,
} else if (event->button == 3) {
EDayViewEvent *e;
gboolean destroyed;
+ guint id;
e = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (day_view))
gtk_widget_grab_focus (GTK_WIDGET (day_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_day_view_set_selected_time_range_visible (day_view, e->start, e->end);
@@ -3353,6 +3405,7 @@ e_day_view_on_long_event_click (EDayView *day_view,
&& (pos == E_DAY_VIEW_POS_LEFT_EDGE
|| pos == E_DAY_VIEW_POS_RIGHT_EDGE)) {
gboolean destroyed;
+ guint id;
if (!e_day_view_find_long_event_days (event,
day_view->days_shown,
@@ -3361,7 +3414,8 @@ e_day_view_on_long_event_click (EDayView *day_view,
return;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
/* Grab the keyboard focus, so the event being edited is saved
and we can use the Escape key to abort the resize. */
@@ -3371,7 +3425,7 @@ e_day_view_on_long_event_click (EDayView *day_view,
if (destroyed)
return;
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (gdk_pointer_grab (GTK_LAYOUT (day_view->top_canvas)->bin_window, FALSE,
GDK_POINTER_MOTION_MASK
@@ -3437,9 +3491,11 @@ e_day_view_on_event_click (EDayView *day_view,
&& (pos == E_DAY_VIEW_POS_TOP_EDGE
|| pos == E_DAY_VIEW_POS_BOTTOM_EDGE)) {
gboolean destroyed;
+ guint id;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
/* Grab the keyboard focus, so the event being edited is saved
and we can use the Escape key to abort the resize. */
@@ -3449,7 +3505,7 @@ e_day_view_on_event_click (EDayView *day_view,
if (destroyed)
return;
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (gdk_pointer_grab (GTK_LAYOUT (day_view->main_canvas)->bin_window, FALSE,
GDK_POINTER_MOTION_MASK
@@ -3585,6 +3641,7 @@ e_day_view_on_event_double_click (EDayView *day_view,
{
EDayViewEvent *event;
gboolean destroyed;
+ guint id;
if (day == -1)
event = &g_array_index (day_view->long_events, EDayViewEvent,
@@ -3594,12 +3651,13 @@ e_day_view_on_event_double_click (EDayView *day_view,
event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
e_day_view_stop_editing_event (day_view);
if (!destroyed) {
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
if (day_view->calendar)
gnome_calendar_edit_object (day_view->calendar, event->comp, FALSE);
@@ -3651,70 +3709,70 @@ enum {
static EPopupMenu main_items [] = {
E_POPUP_ITEM (N_("New _Appointment"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_appointment), MASK_EDITABLE),
+ e_day_view_on_new_appointment, MASK_EDITABLE),
E_POPUP_ITEM (N_("New All Day _Event"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_event), MASK_EDITABLE),
+ e_day_view_on_new_event, MASK_EDITABLE),
E_POPUP_ITEM (N_("New Meeting"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_meeting), MASK_EDITABLE),
+ e_day_view_on_new_meeting, MASK_EDITABLE),
E_POPUP_ITEM (N_("New Task"),
- GTK_SIGNAL_FUNC (e_day_view_on_new_task), MASK_EDITABLE),
+ e_day_view_on_new_task, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("Print..."),
- GTK_SIGNAL_FUNC (e_day_view_on_print), 0),
+ e_day_view_on_print, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Paste"),
- GTK_SIGNAL_FUNC (e_day_view_on_paste), MASK_EDITABLE),
+ e_day_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
E_POPUP_ITEM (N_("Go to _Today"),
- GTK_SIGNAL_FUNC (e_day_view_on_goto_today), 0),
+ e_day_view_on_goto_today, 0),
E_POPUP_ITEM (N_("_Go to Date..."),
- GTK_SIGNAL_FUNC (e_day_view_on_goto_date), 0),
+ e_day_view_on_goto_date, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Publish Free/Busy Information"),
- GTK_SIGNAL_FUNC (e_day_view_on_publish), 0),
+ e_day_view_on_publish, 0),
E_POPUP_SEPARATOR,
E_POPUP_ITEM (N_("_Settings..."),
- GTK_SIGNAL_FUNC (e_day_view_on_settings), 0),
+ e_day_view_on_settings, 0),
E_POPUP_TERMINATOR
};
static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_day_view_on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (e_day_view_on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_day_view_on_print_event), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Open"), e_day_view_on_edit_appointment, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Save As..."), e_day_view_on_save_as, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Print..."), e_day_view_on_print_event, MASK_EDITING),
/* Only show this separator if one of the above is shown. */
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_day_view_on_cut), MASK_EDITABLE | MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_day_view_on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_day_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_day_view_on_cut, MASK_EDITABLE | MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Copy"), e_day_view_on_copy, MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Paste"), e_day_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (e_day_view_on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (e_day_view_on_forward), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Schedule Meeting..."), e_day_view_on_meeting, MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
+ E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_day_view_on_forward, MASK_EDITING),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (e_day_view_on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Make this Occurrence _Movable"), GTK_SIGNAL_FUNC (e_day_view_on_unrecur_appointment), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING | MASK_INSTANCE),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (e_day_view_on_delete_occurrence), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (e_day_view_on_delete_appointment), MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
+ E_POPUP_ITEM (N_("_Delete"), e_day_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("Make this Occurrence _Movable"), e_day_view_on_unrecur_appointment, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING | MASK_INSTANCE),
+ E_POPUP_ITEM (N_("Delete this _Occurrence"), e_day_view_on_delete_occurrence, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
+ E_POPUP_ITEM (N_("Delete _All Occurrences"), e_day_view_on_delete_appointment, MASK_EDITABLE | MASK_RECURRING | MASK_EDITING),
E_POPUP_TERMINATOR
};
@@ -3797,7 +3855,8 @@ e_day_view_on_event_right_click (EDayView *day_view,
day_view->popup_event_num = event_num;
popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, day_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), day_view);
+ gtk_signal_connect (GTK_OBJECT (popup), "selection-done",
+ GTK_SIGNAL_FUNC (free_view_popup), day_view);
e_popup_menu (popup, (GdkEvent *) bevent);
}
@@ -4052,7 +4111,7 @@ e_day_view_on_publish (GtkWidget *widget, gpointer data)
itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp,
day_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (comp_list);
@@ -4100,7 +4159,7 @@ e_day_view_on_delete_occurrence (GtkWidget *widget, gpointer data)
if (cal_client_update_object (day_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_delete_occurrence(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -4133,6 +4192,7 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data)
EDayView *day_view;
EDayViewEvent *event;
gboolean destroyed;
+ guint id;
day_view = E_DAY_VIEW (data);
@@ -4141,13 +4201,14 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data)
return;
destroyed = FALSE;
- g_object_weak_ref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (event->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (day_view->editing_event_day >= 0)
e_day_view_stop_editing_event (day_view);
if (!destroyed) {
- g_object_weak_unref ((GObject *) event->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (event->comp), id);
e_day_view_delete_event_internal (day_view, event);
}
@@ -4294,12 +4355,12 @@ e_day_view_on_unrecur_appointment (GtkWidget *widget, gpointer data)
if (cal_client_update_object (day_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (cal_client_update_object (day_view->client, new_comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_day_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (new_comp);
+ gtk_object_unref (GTK_OBJECT (new_comp));
}
@@ -4399,7 +4460,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
{
EDayViewEvent *event = NULL;
EDayViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
+ gint event_x, event_y, scroll_x, scroll_y, canvas_x, canvas_y;
gint day, event_num;
GdkCursor *cursor;
@@ -4414,8 +4475,11 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
- canvas_x = event_x;
- canvas_y = event_y;
+ /* The top canvas doesn't scroll, but just in case. */
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ canvas_x = event_x + scroll_x;
+ canvas_y = event_y + scroll_y;
pos = e_day_view_convert_position_in_top_canvas (day_view,
canvas_x, canvas_y,
@@ -4496,7 +4560,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
{
EDayViewEvent *event = NULL;
EDayViewPosition pos;
- gint event_x, event_y, canvas_x, canvas_y;
+ gint event_x, event_y, scroll_x, scroll_y, canvas_x, canvas_y;
gint row, day, event_num;
GdkCursor *cursor;
@@ -4511,8 +4575,10 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
&event_x, &event_y))
return FALSE;
- canvas_x = event_x;
- canvas_y = event_y;
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
+ &scroll_x, &scroll_y);
+ canvas_x = event_x + scroll_x;
+ canvas_y = event_y + scroll_y;
pos = e_day_view_convert_position_in_main_canvas (day_view,
canvas_x, canvas_y,
@@ -4821,31 +4887,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view)
cal_component_set_dtend (comp, &date);
}
- if (cal_component_is_instance (comp)) {
- CalObjModType mod;
-
- if (recur_component_dialog (comp, &mod, NULL)) {
- if (cal_client_update_object_with_mod (day_view->client, comp, mod) == CAL_CLIENT_RESULT_SUCCESS) {
- if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, FALSE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- } else {
- g_message ("e_day_view_finish_resize(): Could not update the object!");
- }
- } else {
- gtk_widget_queue_draw (day_view->top_canvas);
- }
- } else if (cal_client_update_object (day_view->client, comp) == CAL_CLIENT_RESULT_SUCCESS) {
- if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- } else {
- g_message ("e_day_view_finish_long_event_resize(): Could not update the object!");
- }
-
- gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
-
- day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
-
- g_object_unref (comp);
+ if (cal_component_is_instance (comp)) {
+ CalObjModType mod;
+
+ if (recur_component_dialog (comp, &mod, NULL)) {
+ if (cal_client_update_object_with_mod (day_view->client, comp, mod) == CAL_CLIENT_RESULT_SUCCESS) {
+ if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, FALSE))
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
+ } else {
+ g_message ("e_day_view_finish_resize(): Could not update the object!");
+ }
+ } else {
+ gtk_widget_queue_draw (day_view->top_canvas);
+ }
+ } else if (cal_client_update_object (day_view->client, comp) == CAL_CLIENT_RESULT_SUCCESS) {
+ if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
+ } else {
+ g_message ("e_day_view_finish_long_event_resize(): Could not update the object!");
+ }
+
+ gnome_canvas_item_hide (day_view->resize_long_event_rect_item);
+
+ day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4918,8 +4984,8 @@ e_day_view_finish_resize (EDayView *day_view)
gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE;
-
- g_object_unref (comp);
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4991,7 +5057,7 @@ e_day_view_free_event_array (EDayView *day_view,
event = &g_array_index (array, EDayViewEvent, event_num);
if (event->canvas_item)
gtk_object_destroy (GTK_OBJECT (event->canvas_item));
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
}
g_array_set_size (array, 0);
@@ -5031,7 +5097,7 @@ e_day_view_add_event (CalComponent *comp,
day_view->zone);
event.comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
event.start = start;
event.end = end;
event.canvas_item = NULL;
@@ -5207,7 +5273,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
draw them on top of the resize rect. Nor when editing. */
num_icons = 0;
comp = event->comp;
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
&& day_view->resize_event_day == E_DAY_VIEW_LONG_EVENT
@@ -5249,9 +5315,7 @@ e_day_view_reshape_long_event (EDayView *day_view,
event->canvas_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"clip", TRUE,
"max_lines", 1,
@@ -5260,8 +5324,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
"draw_background", FALSE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
+ gtk_signal_connect (GTK_OBJECT (event->canvas_item), "event",
+ GTK_SIGNAL_FUNC (e_day_view_on_text_item_event),
+ day_view);
e_day_view_update_long_event_label (day_view, event_num);
}
@@ -5278,7 +5343,9 @@ e_day_view_reshape_long_event (EDayView *day_view,
text_w = item_w;
} else {
/* Get the requested size of the label. */
- g_object_get (G_OBJECT (event->canvas_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "text", &text,
+ NULL);
text_width = 0;
if (text) {
end_of_line = strchr (text, '\n');
@@ -5403,15 +5470,10 @@ e_day_view_reshape_day_event (EDayView *day_view,
}
if (!event->canvas_item) {
- GdkFont *font;
-
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
event->canvas_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (day_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"line_wrap", TRUE,
"editable", TRUE,
@@ -5420,9 +5482,12 @@ e_day_view_reshape_day_event (EDayView *day_view,
"draw_background", FALSE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (event->canvas_item, "event",
- G_CALLBACK (e_day_view_on_text_item_event), day_view);
- e_day_view_update_event_label (day_view, day, event_num);
+ gtk_signal_connect (GTK_OBJECT (event->canvas_item),
+ "event",
+ GTK_SIGNAL_FUNC (e_day_view_on_text_item_event),
+ day_view);
+ e_day_view_update_event_label (day_view, day,
+ event_num);
}
item_w = MAX (item_w, 0);
@@ -5452,12 +5517,12 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view)
hide the resize bars. */
if (day != -1 && day == day_view->drag_event_day
&& event_num == day_view->drag_event_num) {
- g_object_get (G_OBJECT (day_view->drag_rect_item),
- "x1", &x,
- "y1", &y,
- "x2", &w,
- "y2", &h,
- NULL);
+ gtk_object_get (GTK_OBJECT (day_view->drag_rect_item),
+ "x1", &x,
+ "y1", &y,
+ "x2", &w,
+ "y2", &h,
+ NULL);
w -= x;
x++;
h -= y;
@@ -5691,7 +5756,7 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (initial_text)
g_free (initial_text);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
}
@@ -6024,19 +6089,19 @@ e_day_view_start_editing_event (EDayView *day_view,
}
/* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (event->canvas_item),
- "event_processor", &event_processor,
- NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "event_processor", &event_processor,
+ NULL);
if (event_processor) {
command.action = E_TEP_MOVE;
command.position = E_TEP_END_OF_BUFFER;
- g_signal_emit_by_name (event_processor,
- "command", &command);
+ gtk_signal_emit_by_name (GTK_OBJECT (event_processor),
+ "command", &command);
}
}
-/* This stops the current edit. If accept is TRUE the event summary is updated,
+/* This stops the current edit. If accept is TRUE the event summary is update,
else the edit is cancelled. */
static void
e_day_view_stop_editing_event (EDayView *day_view)
@@ -6075,9 +6140,9 @@ cancel_editing (EDayView *day_view)
/* Reset the text to what was in the component */
cal_component_get_summary (event->comp, &summary);
- g_object_set (G_OBJECT (event->canvas_item),
- "text", summary.value ? summary.value : "",
- NULL);
+ gtk_object_set (GTK_OBJECT (event->canvas_item),
+ "text", summary.value ? summary.value : "",
+ NULL);
/* Stop editing */
e_day_view_stop_editing_event (day_view);
@@ -6219,9 +6284,9 @@ e_day_view_on_editing_stopped (EDayView *day_view,
day_view->resize_bars_event_day = -1;
day_view->resize_bars_event_num = -1;
- g_object_get (G_OBJECT (event->canvas_item),
- "text", &text,
- NULL);
+ gtk_object_get (GTK_OBJECT (event->canvas_item),
+ "text", &text,
+ NULL);
g_assert (text != NULL);
if (string_is_empty (text) && !cal_comp_is_on_server (event->comp, day_view->client)) {
@@ -6361,14 +6426,6 @@ e_day_view_check_auto_scroll (EDayView *day_view,
gint event_x,
gint event_y)
{
- gint scroll_x, scroll_y;
-
- gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
- &scroll_x, &scroll_y);
-
- event_x -= scroll_x;
- event_y -= scroll_y;
-
day_view->last_mouse_x = event_x;
day_view->last_mouse_y = event_y;
@@ -6438,19 +6495,12 @@ e_day_view_auto_scroll_handler (gpointer data)
if (new_scroll_y != scroll_y) {
/* NOTE: This reduces flicker, but only works if we don't use
canvas items which have X windows. */
-
- /* FIXME: Since GNOME 2.0 we can't do this, since the canvas
- * won't update when its's thawed. Is this a bug or should we
- * really be doing something else? Investigate. */
-#if 0
gtk_layout_freeze (GTK_LAYOUT (day_view->main_canvas));
-#endif
gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas),
scroll_x, new_scroll_y);
-#if 0
+
gtk_layout_thaw (GTK_LAYOUT (day_view->main_canvas));
-#endif
}
canvas_x = day_view->last_mouse_x + scroll_x;
@@ -6681,10 +6731,6 @@ e_day_view_convert_position_in_main_canvas (EDayView *day_view,
gint day, row, col, event_num;
gint item_x, item_y, item_w, item_h;
-#if 0
- g_print ("e_day_view_convert_position_in_main_canvas: (%d, %d)\n", x, y);
-#endif
-
*day_return = -1;
*row_return = -1;
if (event_num_return)
@@ -6875,11 +6921,9 @@ e_day_view_update_top_canvas_drag (EDayView *day_view,
"y2", item_y + item_h - 1,
NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
gnome_canvas_item_set (day_view->drag_long_event_item,
-#if 0
"font_gdk", font,
-#endif
"clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2,
"clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2,
NULL);
@@ -6929,14 +6973,13 @@ e_day_view_on_main_canvas_drag_motion (GtkWidget *widget,
gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget),
&scroll_x, &scroll_y);
-
day_view->drag_event_x = x + scroll_x;
day_view->drag_event_y = y + scroll_y;
e_day_view_reshape_main_canvas_drag_item (day_view);
e_day_view_reshape_main_canvas_resize_bars (day_view);
- e_day_view_check_auto_scroll (day_view, day_view->drag_event_x, day_view->drag_event_y);
+ e_day_view_check_auto_scroll (day_view, x, y);
return TRUE;
}
@@ -7038,11 +7081,9 @@ e_day_view_update_main_canvas_drag (EDayView *day_view,
"y2", item_y + item_h - 1,
NULL);
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (day_view)));
+ font = GTK_WIDGET (day_view)->style->font;
gnome_canvas_item_set (day_view->drag_item,
-#if 0
"font_gdk", font,
-#endif
"clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2,
"clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2,
NULL);
@@ -7376,7 +7417,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget,
"not update the object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -7504,7 +7545,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget,
"Could not update the object!");
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return;
}
@@ -7563,7 +7604,7 @@ e_day_view_get_time_string_width (EDayView *day_view)
static void
invisible_destroyed (GtkWidget *invisible, EDayView *day_view)
{
- g_object_unref (day_view->invisible);
+ gtk_object_unref (GTK_OBJECT (day_view->invisible));
day_view->invisible = NULL;
}
@@ -7663,7 +7704,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (day_view->client, comp);
free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
subcomp = icalcomponent_get_next_component (
@@ -7692,7 +7733,7 @@ selection_received (GtkWidget *invisible,
if (itip_organizer_is_user (comp, day_view->client) && send_component_dialog (day_view->client, comp, TRUE))
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, day_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
e_day_view_set_status_message (day_view, NULL);
@@ -7770,7 +7811,7 @@ e_day_view_set_status_message (EDayView *day_view, const char *message)
if (!message || !*message) {
if (day_view->activity) {
- g_object_unref (day_view->activity);
+ gtk_object_unref (GTK_OBJECT (day_view->activity));
day_view->activity = NULL;
}
}
@@ -7779,7 +7820,7 @@ e_day_view_set_status_message (EDayView *day_view, const char *message)
char *client_id = g_strdup_printf ("%p", day_view);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE);
day_view->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 48eeae1672..ff2d8079e2 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -28,17 +28,17 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
#include <glib.h>
#include <gtk/gtkmisc.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
-#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-exception.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
@@ -47,18 +47,17 @@
#include <cal-util/timeutil.h>
#include <cal-client/cal-client.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-html-utils.h>
#include <e-util/e-dialog-widgets.h>
#include <evolution-shell-client.h>
#include <evolution-folder-selector-button.h>
-#include <camel/camel-mime-filter-tohtml.h>
#include "calendar-config.h"
#include "itip-utils.h"
#include "e-itip-control.h"
struct _EItipControlPrivate {
GtkWidget *html;
- gboolean html_destroyed;
-
+
GPtrArray *event_clients;
CalClient *event_client;
GPtrArray *task_clients;
@@ -77,15 +76,12 @@ struct _EItipControlPrivate {
gchar *calendar_uri;
- EAccountList *accounts;
-
+ GList *addresses;
gchar *from_address;
gchar *delegator_address;
gchar *delegator_name;
gchar *my_address;
gboolean view_only;
-
- gboolean destroyed;
};
/* HTML Strings */
@@ -104,8 +100,7 @@ static const char *tasks_types[] = { "tasks", NULL };
static void class_init (EItipControlClass *klass);
static void init (EItipControl *itip);
-static void destroy (GtkObject *obj);
-static void finalize (GObject *obj);
+static void finalize (GtkObject *obj);
static void url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpointer data);
static gboolean object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data);
@@ -113,21 +108,39 @@ static void ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url,
static GtkVBoxClass *parent_class = NULL;
-E_MAKE_TYPE (e_itip_control, "EItipControl", EItipControl, class_init, init,
- GTK_TYPE_VBOX);
+
+GtkType
+e_itip_control_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0) {
+ static const GtkTypeInfo info =
+ {
+ "EItipControl",
+ sizeof (EItipControl),
+ sizeof (EItipControlClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (gtk_vbox_get_type (), &info);
+ }
+
+ return type;
+}
static void
class_init (EItipControlClass *klass)
{
- GObjectClass *object_class;
- GtkObjectClass *gtkobject_class;
-
- object_class = G_OBJECT_CLASS (klass);
- gtkobject_class = GTK_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
- gtkobject_class->destroy = destroy;
+ parent_class = gtk_type_class (gtk_vbox_get_type ());
object_class->finalize = finalize;
}
@@ -157,28 +170,29 @@ start_calendar_server (EItipControl *itip, char *uri)
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ start_calendar_server_cb, &success);
- if (!cal_client_open_calendar (client, uri, TRUE))
- goto error;
+ if (!cal_client_open_calendar (client, uri, TRUE))
+ goto error;
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
- if (!itip->priv->destroyed) {
- gtk_signal_connect (GTK_OBJECT (itip), "destroy",
- gtk_main_quit, NULL);
-
+ if (!GTK_OBJECT_DESTROYED (itip)) {
+ gtk_signal_connect (GTK_OBJECT (itip), "destroy",
+ gtk_main_quit, NULL);
+
gtk_main ();
+
+ gtk_signal_disconnect_by_func (GTK_OBJECT (itip),
+ gtk_main_quit, NULL);
+ }
- gtk_signal_disconnect_by_func (GTK_OBJECT (itip),
- gtk_main_quit, NULL);
- }
-
if (success)
return client;
-error:
- g_object_unref (client);
+ error:
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -191,7 +205,8 @@ start_default_server (EItipControl *itip, gboolean tasks)
client = cal_client_new ();
- g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success);
+ gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
+ start_calendar_server_cb, &success);
if (tasks) {
if (!cal_client_open_default_tasks (client, FALSE))
@@ -203,7 +218,7 @@ start_default_server (EItipControl *itip, gboolean tasks)
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
- if (!itip->priv->destroyed) {
+ if (!GTK_OBJECT_DESTROYED (itip)) {
gtk_signal_connect (GTK_OBJECT (itip), "destroy",
gtk_main_quit, NULL);
@@ -217,7 +232,7 @@ start_default_server (EItipControl *itip, gboolean tasks)
return client;
error:
- g_object_unref (client);
+ gtk_object_unref (GTK_OBJECT (client));
return NULL;
}
@@ -233,7 +248,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
servers = g_ptr_array_new ();
- g_object_ref (shell_client);
+ bonobo_object_ref (BONOBO_OBJECT (shell_client));
registry = evolution_shell_client_get_storage_registry_interface (shell_client);
CORBA_exception_init (&ev);
@@ -266,7 +281,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
CalClient *client;
char *uri;
- if (itip->priv->destroyed)
+ if (GTK_OBJECT_DESTROYED (itip))
continue;
if (strcmp (possible_types[k], folder.type))
@@ -285,7 +300,7 @@ get_servers (EItipControl *itip, EvolutionShellClient *shell_client, const char
CORBA_free (folder_list);
}
- g_object_unref (shell_client);
+ bonobo_object_unref (BONOBO_OBJECT (shell_client));
return servers;
}
@@ -305,8 +320,8 @@ find_server (GPtrArray *servers, CalComponent *comp)
client = g_ptr_array_index (servers, i);
status = cal_client_get_object (client, uid, &found_comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
- g_object_unref (found_comp);
- g_object_ref (client);
+ gtk_object_unref (GTK_OBJECT (found_comp));
+ gtk_object_ref (GTK_OBJECT (client));
return client;
}
@@ -316,17 +331,6 @@ find_server (GPtrArray *servers, CalComponent *comp)
}
static void
-html_destroyed (gpointer data)
-{
- EItipControl *itip = data;
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->html_destroyed = TRUE;
-}
-
-static void
init (EItipControl *itip)
{
EItipControlPrivate *priv;
@@ -337,7 +341,7 @@ init (EItipControl *itip)
itip->priv = priv;
/* Addresses */
- priv->accounts = itip_addresses_get ();
+ priv->addresses = itip_addresses_get ();
/* Initialize the cal clients */
priv->event_clients = NULL;
@@ -355,7 +359,6 @@ init (EItipControl *itip)
/* Html Widget */
priv->html = gtk_html_new ();
- priv->html_destroyed = FALSE;
gtk_html_set_default_content_type (GTK_HTML (priv->html),
"text/html; charset=utf-8");
gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1);
@@ -368,15 +371,18 @@ init (EItipControl *itip)
gtk_widget_show (scrolled_window);
gtk_container_add (GTK_CONTAINER (scrolled_window), priv->html);
- gtk_object_weakref (GTK_OBJECT (priv->html), html_destroyed, itip);
+ gtk_object_ref (GTK_OBJECT (priv->html));
gtk_widget_set_usize (scrolled_window, 600, 400);
gtk_box_pack_start (GTK_BOX (itip), scrolled_window, FALSE, FALSE, 4);
- g_signal_connect (priv->html, "url_requested", G_CALLBACK (url_requested_cb), itip);
- g_signal_connect (priv->html, "object_requested", G_CALLBACK (object_requested_cb), itip);
- g_signal_connect (priv->html, "submit", G_CALLBACK (ok_clicked_cb), itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "url_requested",
+ url_requested_cb, itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "object_requested",
+ GTK_SIGNAL_FUNC (object_requested_cb),
+ itip);
+ gtk_signal_connect (GTK_OBJECT (priv->html), "submit",
+ ok_clicked_cb, itip);
- priv->destroyed = FALSE;
}
static void
@@ -385,26 +391,18 @@ clean_up (EItipControl *itip)
EItipControlPrivate *priv;
priv = itip->priv;
- if (!priv)
- return;
g_free (priv->vcalendar);
priv->vcalendar = NULL;
- if (priv->comp) {
- g_object_unref (priv->comp);
- priv->comp = NULL;
- }
-
- if (priv->top_level) {
- icalcomponent_free (priv->top_level);
- priv->top_level = NULL;
- }
+ if (priv->comp)
+ gtk_object_unref (GTK_OBJECT (priv->comp));
+ priv->comp = NULL;
- if (priv->main_comp) {
- icalcomponent_free (priv->main_comp);
- priv->main_comp = NULL;
- }
+ icalcomponent_free (priv->top_level);
+ priv->top_level = NULL;
+ icalcomponent_free (priv->main_comp);
+ priv->main_comp = NULL;
priv->ical_comp = NULL;
priv->current = 0;
@@ -424,18 +422,7 @@ clean_up (EItipControl *itip)
}
static void
-destroy (GtkObject *obj)
-{
- EItipControl *itip = E_ITIP_CONTROL (obj);
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->destroyed = TRUE;
-}
-
-static void
-finalize (GObject *obj)
+finalize (GtkObject *obj)
{
EItipControl *itip = E_ITIP_CONTROL (obj);
EItipControlPrivate *priv;
@@ -445,38 +432,34 @@ finalize (GObject *obj)
clean_up (itip);
- if (priv->html)
- gtk_object_weakunref (GTK_OBJECT (priv->html), html_destroyed, itip);
-
- priv->accounts = NULL;
+ if (priv->html)
+ gtk_object_unref (GTK_OBJECT (priv->html));
+ itip_addresses_free (priv->addresses);
+ priv->addresses = NULL;
+
if (priv->event_clients) {
- for (i = 0; i < priv->event_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->event_clients, i));
+ for (i = 0; i < priv->event_clients->len; i++)
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->event_clients, i)));
g_ptr_array_free (priv->event_clients, TRUE);
- priv->event_client = NULL;
- priv->event_clients = NULL;
}
-
if (priv->task_clients) {
- for (i = 0; i < priv->task_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->task_clients, i));
+ for (i = 0; i < priv->task_clients->len; i++)
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->task_clients, i)));
g_ptr_array_free (priv->task_clients, TRUE);
- priv->task_client = NULL;
- priv->task_clients = NULL;
}
g_free (priv);
itip->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
+
+ if (GTK_OBJECT_CLASS (parent_class)->finalize)
+ (* GTK_OBJECT_CLASS (parent_class)->finalize) (obj);
}
GtkWidget *
e_itip_control_new (void)
{
- return g_object_new (E_TYPE_ITIP_CONTROL, NULL);
+ return gtk_type_new (E_TYPE_ITIP_CONTROL);
}
static void
@@ -503,7 +486,7 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp)
icalparameter *param;
const char *attendee, *name;
char *attendee_clean, *name_clean;
- EIterator *it;
+ GList *l;
value = icalproperty_get_value (prop);
if (value != NULL) {
@@ -524,32 +507,26 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp)
name = NULL;
name_clean = NULL;
}
-
- it = e_list_get_iterator((EList *)priv->accounts);
- while (e_iterator_is_valid(it)) {
- const EAccount *account = e_iterator_get(it);
-
+
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
/* Check for a matching address */
if (attendee_clean != NULL
- && !g_ascii_strcasecmp (account->id->address, attendee_clean)) {
- priv->my_address = g_strdup (account->id->address);
+ && !g_strcasecmp (a->address, attendee_clean)) {
+ priv->my_address = g_strdup (a->address);
g_free (attendee_clean);
g_free (name_clean);
- g_free (my_alt_address);
- g_object_unref(it);
return;
}
/* Check for a matching cname to fall back on */
if (name_clean != NULL
- && !g_ascii_strcasecmp (account->id->name, name_clean))
+ && !g_strcasecmp (a->name, name_clean))
my_alt_address = g_strdup (attendee_clean);
-
- e_iterator_next(it);
}
g_free (attendee_clean);
g_free (name_clean);
- g_object_unref(it);
}
priv->my_address = my_alt_address;
@@ -624,7 +601,7 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
FALSE, FALSE,
time_buf, sizeof (time_buf));
- time_utf8 = g_locale_to_utf8 (time_buf, -1, NULL, NULL, NULL);
+ time_utf8 = e_utf8_from_locale_string (time_buf);
strcat (buffer, time_utf8);
g_free (time_utf8);
@@ -641,9 +618,12 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
strcat (buffer, " <font size=-1>[");
/* We check if it is one of our builtin timezone names,
- in which case we call gettext to translate it. */
+ in which case we call gettext to translate it, and
+ we need to convert to UTF-8. If it isn't a builtin
+ timezone name, we use it as-is, as it is already
+ UTF-8. */
if (icaltimezone_get_builtin_timezone (display_name)) {
- strcat (buffer, _(display_name));
+ strcat (buffer, U_(display_name));
} else {
strcat (buffer, display_name);
}
@@ -655,15 +635,52 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
strcat (buffer, etext);
}
+/* copied from recurrence-page.c, so it should be pre-translated */
+static const char *date_suffix[] = {
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st")
+};
+
static const char *
nth (int n)
{
+ static char buffer[10];
+
if (n == -1)
return "last";
- else if (n < 1 || n > 31)
+ if (n < 1 || n >= (sizeof (date_suffix) / sizeof (const char *)))
return "?";
- else
- return cal_recur_nth[n];
+ sprintf (buffer, "%d%s", n, date_suffix[n - 1]);
+ return buffer;
}
static const char *dayname[] = {
@@ -818,7 +835,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
cal_component_get_dtstart (comp, &datetime);
if (datetime.value) {
write_label_piece (itip, &datetime, buffer, 1024,
- _("<b>Starts:</b> "),
+ U_("<b>Starts:</b> "),
"<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen(buffer));
wrote = TRUE;
@@ -828,7 +845,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
buffer[0] = '\0';
cal_component_get_dtend (comp, &datetime);
if (datetime.value){
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Ends:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Ends:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
}
@@ -848,7 +865,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
/* Pass TRUE as is_utc, so it gets converted to the current
timezone. */
datetime.value->is_utc = TRUE;
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Completed:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
task_completed = TRUE;
@@ -858,7 +875,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream,
buffer[0] = '\0';
cal_component_get_due (comp, &datetime);
if (type == CAL_COMPONENT_TODO && !task_completed && datetime.value) {
- write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>", FALSE);
+ write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Due:</b> "), "<br>", FALSE);
gtk_html_write (html, html_stream, buffer, strlen (buffer));
wrote = TRUE;
}
@@ -895,7 +912,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err)
html_stream = gtk_html_begin (GTK_HTML (priv->html));
gtk_html_stream_printf (html_stream,
"<html><head><title>%s</title></head>",
- _("iCalendar Information"));
+ U_("iCalendar Information"));
gtk_html_write (GTK_HTML (priv->html), html_stream,
HTML_BODY_START, strlen(HTML_BODY_START));
@@ -910,7 +927,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err)
gtk_html_stream_printf (html_stream, "<td align=\"left\" valign=\"top\">");
/* Title */
- set_message (GTK_HTML (priv->html), html_stream, _("iCalendar Error"), TRUE);
+ set_message (GTK_HTML (priv->html), html_stream, U_("iCalendar Error"), TRUE);
/* Error */
gtk_html_write (GTK_HTML (priv->html), html_stream, itip_err, strlen(itip_err));
@@ -941,14 +958,14 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
priv = itip->priv;
- if (priv->html_destroyed)
+ if (GTK_OBJECT_DESTROYED (priv->html))
return;
/* Html widget */
html_stream = gtk_html_begin (GTK_HTML (priv->html));
gtk_html_stream_printf (html_stream,
"<html><head><title>%s</title></head>",
- _("iCalendar Information"));
+ U_("iCalendar Information"));
gtk_html_write (GTK_HTML (priv->html), html_stream,
HTML_BODY_START, strlen(HTML_BODY_START));
@@ -979,7 +996,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
attendee->cn :
itip_strip_mailto (attendee->value));
} else {
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
}
break;
case ICAL_METHOD_REQUEST:
@@ -995,7 +1012,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
priv->delegator_name :
priv->delegator_address);
else
- html = g_strdup_printf (itip_desc, _("An unknown person"),
+ html = g_strdup_printf (itip_desc, U_("An unknown person"),
priv->delegator_name ?
priv->delegator_name :
priv->delegator_address);
@@ -1006,7 +1023,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
organizer.cn :
itip_strip_mailto (organizer.value));
else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
}
break;
@@ -1023,14 +1040,14 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
organizer.cn :
itip_strip_mailto (organizer.value));
else
- html = g_strdup_printf (itip_desc, _("An unknown person"));
+ html = g_strdup_printf (itip_desc, U_("An unknown person"));
break;
}
gtk_html_write (GTK_HTML (priv->html), html_stream, html, strlen(html));
g_free (html);
/* Describe what the user can do */
- const_html = _("<br> Please review the following information, "
+ const_html = U_("<br> Please review the following information, "
"and then select an action from the menu below.");
gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html));
@@ -1045,17 +1062,17 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
/* Summary */
cal_component_get_summary (priv->comp, &text);
- html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>");
+ html = e_text_to_html (text.value ? text.value : U_("<i>None</i>"), E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Summary:"), html);
+ U_("Summary:"), html);
g_free (html);
/* Location */
cal_component_get_location (priv->comp, &string);
if (string != NULL) {
- html = camel_text_to_html (string, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
+ html = e_text_to_html (string, E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>",
- _("Location:"), html);
+ U_("Location:"), html);
g_free (html);
}
@@ -1069,24 +1086,24 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
CalComponentAttendee *a = alist->data;
gtk_html_stream_printf (html_stream, "<b>%s</b><br>",
- _("Status:"));
+ U_("Status:"));
switch (a->status) {
case ICAL_PARTSTAT_ACCEPTED:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Accepted"));
+ U_("Accepted"));
break;
case ICAL_PARTSTAT_TENTATIVE:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Tentatively Accepted"));
+ U_("Tentatively Accepted"));
break;
case ICAL_PARTSTAT_DECLINED:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Declined"));
+ U_("Declined"));
break;
default:
gtk_html_stream_printf (html_stream, "%s<br><br>",
- _("Unknown"));
+ U_("Unknown"));
}
}
@@ -1099,9 +1116,9 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title,
text = *((CalComponentText *)l->data);
if (l && text.value) {
- html = camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0);
+ html = e_text_to_html (text.value, E_TEXT_TO_HTML_CONVERT_NL);
gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s",
- _("Description:"), html);
+ U_("Description:"), html);
g_free (html);
}
cal_component_free_text_list (l);
@@ -1141,9 +1158,9 @@ get_publish_options (gboolean selector)
"</select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Update"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Update"),
+ U_("OK"));
if (selector) {
char *sel;
@@ -1169,12 +1186,12 @@ get_request_options (gboolean selector)
"<input TYPE=\"checkbox\" name=\"rsvp\" value=\"1\" checked>%s&nbsp&nbsp"
"<input TYPE=\"submit\" name=\"ok\" value=\"%s\"><br> "
"</form>",
- _("Choose an action:"),
- _("Accept"),
- _("Tentatively accept"),
- _("Decline"),
- _("RSVP"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Accept"),
+ U_("Tentatively accept"),
+ U_("Decline"),
+ U_("RSVP"),
+ U_("OK"));
if (selector) {
char *sel;
@@ -1195,9 +1212,9 @@ get_request_fb_options ()
"<option VALUE=\"F\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Send Free/Busy Information"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Send Free/Busy Information"),
+ U_("OK"));
}
static char*
@@ -1208,9 +1225,9 @@ get_reply_options ()
"<option VALUE=\"R\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Update respondent status"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Update respondent status"),
+ U_("OK"));
}
static char*
@@ -1221,9 +1238,9 @@ get_refresh_options ()
"<option VALUE=\"S\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Send Latest Information"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Send Latest Information"),
+ U_("OK"));
}
static char*
@@ -1234,9 +1251,9 @@ get_cancel_options ()
"<option VALUE=\"C\">%s</option></select>&nbsp &nbsp "
"<input TYPE=Submit name=\"ok\" value=\"%s\">"
"</form>",
- _("Choose an action:"),
- _("Cancel"),
- _("OK"));
+ U_("Choose an action:"),
+ U_("Cancel"),
+ U_("OK"));
}
@@ -1292,7 +1309,7 @@ adjust_item (EItipControl *itip, CalComponent *comp)
cal_component_set_description_list (comp, l);
cal_component_free_text_list (l);
- g_object_unref (real_comp);
+ gtk_object_unref (GTK_OBJECT (real_comp));
} else {
CalComponentText text = {_("Unknown"), NULL};
@@ -1316,50 +1333,50 @@ show_current_event (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published meeting information.");
- itip_title = _("Meeting Information");
+ itip_desc = U_("<b>%s</b> has published meeting information.");
+ itip_title = U_("Meeting Information");
options = get_publish_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REQUEST:
if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests the presence of %s at a meeting.");
+ itip_desc = U_("<b>%s</b> requests the presence of %s at a meeting.");
else
- itip_desc = _("<b>%s</b> requests your presence at a meeting.");
- itip_title = _("Meeting Proposal");
+ itip_desc = U_("<b>%s</b> requests your presence at a meeting.");
+ itip_title = U_("Meeting Proposal");
options = get_request_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing meeting.");
- itip_title = _("Meeting Update");
+ itip_desc = U_("<b>%s</b> wishes to add to an existing meeting.");
+ itip_title = U_("Meeting Update");
options = get_publish_options (priv->event_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest meeting information.");
- itip_title = _("Meeting Update Request");
+ itip_desc = U_("<b>%s</b> wishes to receive the latest meeting information.");
+ itip_title = U_("Meeting Update Request");
options = get_refresh_options ();
/* Provide extra info, since its not in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a meeting request.");
- itip_title = _("Meeting Reply");
+ itip_desc = U_("<b>%s</b> has replied to a meeting request.");
+ itip_title = U_("Meeting Reply");
options = get_reply_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a meeting.");
- itip_title = _("Meeting Cancellation");
+ itip_desc = U_("<b>%s</b> has cancelled a meeting.");
+ itip_title = U_("Meeting Cancellation");
options = get_cancel_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Meeting Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Meeting Message");
options = NULL;
}
@@ -1383,50 +1400,50 @@ show_current_todo (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published task information.");
- itip_title = _("Task Information");
+ itip_desc = U_("<b>%s</b> has published task information.");
+ itip_title = U_("Task Information");
options = get_publish_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REQUEST:
if (priv->delegator_address != NULL)
- itip_desc = _("<b>%s</b> requests %s to perform a task.");
+ itip_desc = U_("<b>%s</b> requests %s to perform a task.");
else
- itip_desc = _("<b>%s</b> requests you perform a task.");
- itip_title = _("Task Proposal");
+ itip_desc = U_("<b>%s</b> requests you perform a task.");
+ itip_title = U_("Task Proposal");
options = get_request_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_ADD:
- itip_desc = _("<b>%s</b> wishes to add to an existing task.");
- itip_title = _("Task Update");
+ itip_desc = U_("<b>%s</b> wishes to add to an existing task.");
+ itip_title = U_("Task Update");
options = get_publish_options (priv->task_client ? FALSE : TRUE);
break;
case ICAL_METHOD_REFRESH:
- itip_desc = _("<b>%s</b> wishes to receive the latest task information.");
- itip_title = _("Task Update Request");
+ itip_desc = U_("<b>%s</b> wishes to receive the latest task information.");
+ itip_title = U_("Task Update Request");
options = get_refresh_options ();
/* Provide extra info, since its not in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a task assignment.");
- itip_title = _("Task Reply");
+ itip_desc = U_("<b>%s</b> has replied to a task assignment.");
+ itip_title = U_("Task Reply");
options = get_reply_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
case ICAL_METHOD_CANCEL:
- itip_desc = _("<b>%s</b> has cancelled a task.");
- itip_title = _("Task Cancellation");
+ itip_desc = U_("<b>%s</b> has cancelled a task.");
+ itip_title = U_("Task Cancellation");
options = get_cancel_options ();
/* Provide extra info, since might not be in the component */
adjust_item (itip, priv->comp);
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Task Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Task Message");
options = NULL;
}
@@ -1445,23 +1462,23 @@ show_current_freebusy (EItipControl *itip)
switch (priv->method) {
case ICAL_METHOD_PUBLISH:
- itip_desc = _("<b>%s</b> has published free/busy information.");
- itip_title = _("Free/Busy Information");
+ itip_desc = U_("<b>%s</b> has published free/busy information.");
+ itip_title = U_("Free/Busy Information");
options = NULL;
break;
case ICAL_METHOD_REQUEST:
- itip_desc = _("<b>%s</b> requests your free/busy information.");
- itip_title = _("Free/Busy Request");
+ itip_desc = U_("<b>%s</b> requests your free/busy information.");
+ itip_title = U_("Free/Busy Request");
options = get_request_fb_options ();
break;
case ICAL_METHOD_REPLY:
- itip_desc = _("<b>%s</b> has replied to a free/busy request.");
- itip_title = _("Free/Busy Reply");
+ itip_desc = U_("<b>%s</b> has replied to a free/busy request.");
+ itip_title = U_("Free/Busy Reply");
options = NULL;
break;
default:
- itip_desc = _("<b>%s</b> has sent an unintelligible message.");
- itip_title = _("Bad Free/Busy Message");
+ itip_desc = U_("<b>%s</b> has sent an unintelligible message.");
+ itip_title = U_("Bad Free/Busy Message");
options = NULL;
}
@@ -1498,15 +1515,15 @@ show_current (EItipControl *itip)
priv = itip->priv;
- g_object_ref (itip);
+ gtk_object_ref (GTK_OBJECT (itip));
if (priv->comp)
- g_object_unref (priv->comp);
+ gtk_object_unref (GTK_OBJECT (priv->comp));
if (priv->event_client != NULL)
- g_object_unref (priv->event_client);
+ gtk_object_unref (GTK_OBJECT (priv->event_client));
priv->event_client = NULL;
if (priv->task_client != NULL)
- g_object_unref (priv->task_client);
+ gtk_object_unref (GTK_OBJECT (priv->task_client));
priv->task_client = NULL;
/* Determine any delegate sections */
@@ -1537,10 +1554,10 @@ show_current (EItipControl *itip)
priv->comp = cal_component_new ();
if (!cal_component_set_icalcomponent (priv->comp, priv->ical_comp)) {
- write_error_html (itip, _("The message does not appear to be properly formed"));
- g_object_unref (priv->comp);
+ write_error_html (itip, U_("The message does not appear to be properly formed"));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
- g_object_unref (itip);
+ gtk_object_unref (GTK_OBJECT (itip));
return;
};
@@ -1600,12 +1617,12 @@ show_current (EItipControl *itip)
show_current_freebusy (itip);
break;
default:
- write_error_html (itip, _("The message contains only unsupported requests."));
+ write_error_html (itip, U_("The message contains only unsupported requests."));
}
find_my_address (itip, priv->ical_comp);
- g_object_unref (itip);
+ gtk_object_unref (GTK_OBJECT (itip));
}
void
@@ -1631,13 +1648,13 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text)
priv->main_comp = icalparser_parse_string (priv->vcalendar);
if (priv->main_comp == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
+ write_error_html (itip, U_("The attachment does not contain a valid calendar message"));
return;
}
prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY);
if (prop == NULL) {
- write_error_html (itip, _("The attachment does not contain a valid calendar message"));
+ write_error_html (itip, U_("The attachment does not contain a valid calendar message"));
return;
}
@@ -1662,7 +1679,7 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text)
priv->ical_comp = get_next (&priv->iter);
if (priv->ical_comp == NULL) {
- write_error_html (itip, _("The attachment has no viewable calendar items"));
+ write_error_html (itip, U_("The attachment has no viewable calendar items"));
return;
}
@@ -1841,14 +1858,14 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part
param = icalparameter_new_partstat (status);
icalproperty_add_parameter (prop, param);
} else {
- EAccount *a;
+ ItipAddress *a;
a = itip_addresses_get_default ();
- prop = icalproperty_new_attendee (a->id->address);
+ prop = icalproperty_new_attendee (a->address);
icalcomponent_add_property (ical_comp, prop);
- param = icalparameter_new_cn (a->id->name);
+ param = icalparameter_new_cn (a->name);
icalproperty_add_parameter (prop, param);
param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
@@ -1856,6 +1873,8 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part
param = icalparameter_new_partstat (status);
icalproperty_add_parameter (prop, param);
+
+ itip_address_free (a);
}
}
@@ -2019,7 +2038,7 @@ update_attendee_status (EItipControl *itip)
cleanup:
if (comp != NULL)
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
@@ -2074,7 +2093,7 @@ send_item (EItipControl *itip)
default:
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, NULL, NULL);
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
dialog = gnome_ok_dialog (_("Item sent!\n"));
} else {
dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
@@ -2123,7 +2142,7 @@ send_freebusy (EItipControl *itip)
CalComponent *comp = CAL_COMPONENT (l->data);
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, priv->event_client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
dialog = gnome_ok_dialog (_("Item sent!\n"));
@@ -2150,7 +2169,7 @@ button_selected_cb (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folde
else
uri = cal_util_expand_uri (folder->physicalUri, FALSE);
- g_object_unref (priv->event_client);
+ gtk_object_unref (GTK_OBJECT (priv->event_client));
priv->event_client = start_calendar_server (itip, uri);
g_free (uri);
@@ -2162,7 +2181,7 @@ url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpoint
int len, fd;
char *path;
- path = g_strdup_printf ("%s/%s", EVOLUTION_IMAGESDIR, url);
+ path = g_strdup_printf ("%s/%s", EVOLUTION_ICONSDIR, url);
if ((fd = open (path, O_RDONLY)) == -1) {
g_warning ("%s", g_strerror (errno));
@@ -2218,7 +2237,8 @@ object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data)
button = NULL;
}
- g_signal_connect (button, "selected", G_CALLBACK (button_selected_cb), itip);
+ gtk_signal_connect (GTK_OBJECT (button), "selected",
+ button_selected_cb, itip);
gtk_container_add (GTK_CONTAINER (eb), button);
gtk_widget_show (button);
@@ -2358,6 +2378,6 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar
default:
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, NULL, NULL);
}
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
}
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index fd34147aef..decab74016 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
-#include <gal/util/e-util.h>
#include "e-meeting-attendee.h"
struct _EMeetingAttendeePrivate {
@@ -75,8 +74,31 @@ static void destroy (GtkObject *obj);
static GtkObjectClass *parent_class = NULL;
-E_MAKE_TYPE (e_meeting_attendee, "EMeetingAttendee", EMeetingAttendee,
- class_init, init, GTK_TYPE_OBJECT);
+
+GtkType
+e_meeting_attendee_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0)
+ {
+ static const GtkTypeInfo info =
+ {
+ "EMeetingAttendee",
+ sizeof (EMeetingAttendee),
+ sizeof (EMeetingAttendeeClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (gtk_object_get_type (), &info);
+ }
+
+ return type;
+}
static void
class_init (EMeetingAttendeeClass *klass)
@@ -85,17 +107,19 @@ class_init (EMeetingAttendeeClass *klass)
object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (gtk_object_get_type ());
signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EMeetingAttendeeClass, changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
- object_class->destroy = destroy;
+ gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
+
+ object_class->destroy = destroy;
}
static gchar *
@@ -192,7 +216,7 @@ destroy (GtkObject *obj)
GtkObject *
e_meeting_attendee_new (void)
{
- return g_object_new (E_TYPE_MEETING_ATTENDEE, NULL);
+ return gtk_type_new (E_TYPE_MEETING_ATTENDEE);
}
GtkObject *
@@ -200,7 +224,7 @@ e_meeting_attendee_new_from_cal_component_attendee (CalComponentAttendee *ca)
{
EMeetingAttendee *ia;
- ia = E_MEETING_ATTENDEE (g_object_new (E_TYPE_MEETING_ATTENDEE, NULL));
+ ia = E_MEETING_ATTENDEE (gtk_type_new (E_TYPE_MEETING_ATTENDEE));
e_meeting_attendee_set_address (ia, g_strdup (ca->value));
e_meeting_attendee_set_member (ia, g_strdup (ca->member));
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
index 4c0dfaf2fc..e3a9108ae3 100644
--- a/calendar/gui/e-meeting-model.c
+++ b/calendar/gui/e-meeting-model.c
@@ -25,9 +25,11 @@
#endif
#include <glib.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
#include <bonobo/bonobo-exception.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomevfs/gnome-vfs.h>
@@ -35,6 +37,7 @@
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-cell-popup.h>
#include <gal/e-table/e-cell-combo.h>
+#include <gal/util/e-unicode-i18n.h>
#include <ebook/e-book.h>
#include <ebook/e-card-types.h>
#include <ebook/e-card-cursor.h>
@@ -108,7 +111,7 @@ struct _EMeetingModelQueueData {
static void class_init (EMeetingModelClass *klass);
static void init (EMeetingModel *model);
-static void finalize (GObject *obj);
+static void destroy (GtkObject *obj);
static void refresh_queue_add (EMeetingModel *im, int row,
EMeetingTime *start,
@@ -121,8 +124,8 @@ static gboolean refresh_busy_periods (gpointer data);
static void attendee_changed_cb (EMeetingAttendee *ia, gpointer data);
static void select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data);
@@ -131,8 +134,30 @@ static void table_destroy_list_cb (ETableScrolled *etable, gpointer data);
static ETableModelClass *parent_class = NULL;
-E_MAKE_TYPE (e_meeting_model, "EMeetingModel", EMeetingModel,
- class_init, init, E_TABLE_MODEL_TYPE);
+GtkType
+e_meeting_model_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (type == 0)
+ {
+ static const GtkTypeInfo info =
+ {
+ "EMeetingModel",
+ sizeof (EMeetingModel),
+ sizeof (EMeetingModelClass),
+ (GtkClassInitFunc) class_init,
+ (GtkObjectInitFunc) init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ type = gtk_type_unique (e_table_model_get_type (), &info);
+ }
+
+ return type;
+}
static void
book_open_cb (EBook *book, EBookStatus status, gpointer data)
@@ -383,7 +408,7 @@ append_row (ETableModel *etm, ETableModel *source, int row)
e_meeting_attendee_set_language (ia, g_strdup (e_table_model_value_at (source, E_MEETING_MODEL_LANGUAGE_COL, row)));
e_meeting_model_add_attendee (E_MEETING_MODEL (etm), ia);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
static void *
@@ -498,8 +523,6 @@ is_cell_editable (ETableModel *etm, int col, int row)
if (row == -1)
return TRUE;
- if (row >= priv->attendees->len)
- return TRUE;
ia = g_ptr_array_index (priv->attendees, row);
level = e_meeting_attendee_get_edit_level (ia);
@@ -622,15 +645,15 @@ free_duplicated_key (void *key, gpointer data)
static void
class_init (EMeetingModelClass *klass)
{
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
ETableModelClass *etm_class;
- gobject_class = G_OBJECT_CLASS (klass);
+ object_class = GTK_OBJECT_CLASS (klass);
etm_class = E_TABLE_MODEL_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (E_TABLE_MODEL_TYPE);
- gobject_class->finalize = finalize;
+ object_class->destroy = destroy;
etm_class->column_count = column_count;
etm_class->row_count = row_count;
@@ -685,7 +708,7 @@ init (EMeetingModel *im)
}
static void
-finalize (GObject *obj)
+destroy (GtkObject *obj)
{
EMeetingModel *im = E_MEETING_MODEL (obj);
EMeetingModelPrivate *priv;
@@ -695,19 +718,18 @@ finalize (GObject *obj)
priv = im->priv;
for (i = 0; i < priv->attendees->len; i++)
- g_object_unref (g_ptr_array_index (priv->attendees, i));
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->attendees, i)));
g_ptr_array_free (priv->attendees, TRUE);
for (l = priv->tables; l != NULL; l = l->next)
- g_signal_handlers_disconnect_matched (G_OBJECT (l->data), G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, im);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (l->data), im);
g_list_free (priv->tables);
if (priv->client != NULL)
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
if (priv->ebook != NULL)
- g_object_unref (priv->ebook);
+ gtk_object_unref (GTK_OBJECT (priv->ebook));
if (priv->corba_select_names != CORBA_OBJECT_NIL) {
CORBA_Environment ev;
@@ -730,7 +752,7 @@ finalize (GObject *obj)
GtkObject *
e_meeting_model_new (void)
{
- return g_object_new (E_TYPE_MEETING_MODEL, NULL);
+ return gtk_type_new (E_TYPE_MEETING_MODEL);
}
@@ -752,10 +774,10 @@ e_meeting_model_set_cal_client (EMeetingModel *im, CalClient *client)
priv = im->priv;
if (priv->client != NULL)
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
if (client != NULL)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
priv->client = client;
}
@@ -800,14 +822,14 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Individual"));
- strings = g_list_append (strings, (char*) _("Group"));
- strings = g_list_append (strings, (char*) _("Resource"));
- strings = g_list_append (strings, (char*) _("Room"));
- strings = g_list_append (strings, (char*) _("Unknown"));
+ strings = g_list_append (strings, (char*) U_("Individual"));
+ strings = g_list_append (strings, (char*) U_("Group"));
+ strings = g_list_append (strings, (char*) U_("Resource"));
+ strings = g_list_append (strings, (char*) U_("Room"));
+ strings = g_list_append (strings, (char*) U_("Unknown"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "typeedit", popup_cell);
@@ -816,14 +838,14 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Chair"));
- strings = g_list_append (strings, (char*) _("Required Participant"));
- strings = g_list_append (strings, (char*) _("Optional Participant"));
- strings = g_list_append (strings, (char*) _("Non-Participant"));
- strings = g_list_append (strings, (char*) _("Unknown"));
+ strings = g_list_append (strings, (char*) U_("Chair"));
+ strings = g_list_append (strings, (char*) U_("Required Participant"));
+ strings = g_list_append (strings, (char*) U_("Optional Participant"));
+ strings = g_list_append (strings, (char*) U_("Non-Participant"));
+ strings = g_list_append (strings, (char*) U_("Unknown"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "roleedit", popup_cell);
@@ -832,11 +854,11 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Yes"));
- strings = g_list_append (strings, (char*) _("No"));
+ strings = g_list_append (strings, (char*) U_("Yes"));
+ strings = g_list_append (strings, (char*) U_("No"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "rsvpedit", popup_cell);
@@ -845,30 +867,32 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil
cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT);
popup_cell = e_cell_combo_new ();
e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell);
- g_object_unref (cell);
+ gtk_object_unref (GTK_OBJECT (cell));
strings = NULL;
- strings = g_list_append (strings, (char*) _("Needs Action"));
- strings = g_list_append (strings, (char*) _("Accepted"));
- strings = g_list_append (strings, (char*) _("Declined"));
- strings = g_list_append (strings, (char*) _("Tentative"));
- strings = g_list_append (strings, (char*) _("Delegated"));
+ strings = g_list_append (strings, (char*) U_("Needs Action"));
+ strings = g_list_append (strings, (char*) U_("Accepted"));
+ strings = g_list_append (strings, (char*) U_("Declined"));
+ strings = g_list_append (strings, (char*) U_("Tentative"));
+ strings = g_list_append (strings, (char*) U_("Delegated"));
e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings);
e_table_extras_add_cell (extras, "statusedit", popup_cell);
etable = e_table_scrolled_new_from_spec_file (model, extras, spec_file, NULL);
real_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (etable));
- g_object_set (G_OBJECT (real_table), "uniform_row_height", TRUE, NULL);
+ gtk_object_set (GTK_OBJECT (real_table), "uniform_row_height", TRUE, NULL);
e_table_load_state (real_table, state_file);
#if 0
- g_signal_connect (real_table, "right_click", G_CALLBACK (right_click_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table),
+ "right_click", GTK_SIGNAL_FUNC (right_click_cb), mpage);
#endif
- g_signal_connect (etable, "destroy", G_CALLBACK (table_destroy_state_cb), g_strdup (state_file));
+ gtk_signal_connect (GTK_OBJECT (etable), "destroy",
+ GTK_SIGNAL_FUNC (table_destroy_state_cb), g_strdup (state_file));
- g_object_unref (extras);
+ gtk_object_unref (GTK_OBJECT (extras));
return E_TABLE_SCROLLED (etable);
}
@@ -882,10 +906,11 @@ e_meeting_model_add_attendee (EMeetingModel *im, EMeetingAttendee *ia)
e_table_model_pre_change (E_TABLE_MODEL (im));
- g_object_ref (ia);
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->attendees, ia);
- g_signal_connect (ia, "changed", G_CALLBACK (attendee_changed_cb), im);
+ gtk_signal_connect (GTK_OBJECT (ia), "changed",
+ GTK_SIGNAL_FUNC (attendee_changed_cb), im);
e_table_model_row_inserted (E_TABLE_MODEL (im), row_count (E_TABLE_MODEL (im)) - 1);
}
@@ -945,7 +970,7 @@ e_meeting_model_remove_attendee (EMeetingModel *im, EMeetingAttendee *ia)
e_table_model_pre_change (E_TABLE_MODEL (im));
g_ptr_array_remove_index (priv->attendees, row);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
e_table_model_row_deleted (E_TABLE_MODEL (im), row);
}
@@ -965,7 +990,7 @@ e_meeting_model_remove_all_attendees (EMeetingModel *im)
for (i = 0; i < len; i++) {
EMeetingAttendee *ia = g_ptr_array_index (priv->attendees, i);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
g_ptr_array_set_size (priv->attendees, 0);
@@ -1119,7 +1144,7 @@ refresh_queue_add (EMeetingModel *im, int row,
g_ptr_array_add (qdata->data, data);
}
- g_object_ref (ia);
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->refresh_queue, ia);
if (priv->refresh_idle_id == -1)
@@ -1145,7 +1170,7 @@ refresh_queue_remove (EMeetingModel *im, EMeetingAttendee *ia)
/* Unref the attendee */
g_ptr_array_remove (priv->refresh_queue, ia);
- g_object_unref (ia);
+ gtk_object_unref (GTK_OBJECT (ia));
}
static void
@@ -1337,7 +1362,7 @@ async_read (GnomeVFSAsyncHandle *handle,
EMeetingModelQueueData *qdata = data;
GnomeVFSFileSize buf_size = BUF_SIZE - 1;
- if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
+ if (result != GNOME_VFS_OK) {
gnome_vfs_async_close (handle, async_close, qdata);
return;
}
@@ -1345,7 +1370,7 @@ async_read (GnomeVFSAsyncHandle *handle,
((char *)buffer)[read] = '\0';
qdata->string = g_string_append (qdata->string, buffer);
- if (result == GNOME_VFS_ERROR_EOF) {
+ if (read < requested) {
gnome_vfs_async_close (handle, async_close, qdata);
return;
}
@@ -1362,7 +1387,7 @@ async_open (GnomeVFSAsyncHandle *handle,
GnomeVFSFileSize buf_size = BUF_SIZE - 1;
if (result != GNOME_VFS_OK) {
- gnome_vfs_async_close (handle, async_close, qdata);
+ process_callbacks (qdata);
return;
}
@@ -1392,8 +1417,7 @@ cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer data)
continue;
/* Read in free/busy data from the url */
- gnome_vfs_async_open (&handle, card->fburl, GNOME_VFS_OPEN_READ,
- GNOME_VFS_PRIORITY_DEFAULT, async_open, qdata);
+ gnome_vfs_async_open (&handle, card->fburl, GNOME_VFS_OPEN_READ, async_open, qdata);
return;
}
@@ -1545,7 +1569,8 @@ e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, co
priv->tables = g_list_prepend (priv->tables, ets);
- g_signal_connect (ets, "destroy", G_CALLBACK (table_destroy_list_cb), im);
+ gtk_signal_connect (GTK_OBJECT (ets), "destroy",
+ GTK_SIGNAL_FUNC (table_destroy_list_cb), im);
return ets;
}
@@ -1568,7 +1593,7 @@ e_meeting_model_etable_click_to_add (EMeetingModel *im, gboolean click_to_add)
ets = l->data;
real_table = e_table_scrolled_get_table (ets);
- g_object_set (G_OBJECT (real_table), "use_click_to_add", click_to_add, NULL);
+ gtk_object_set (GTK_OBJECT (real_table), "use_click_to_add", click_to_add, NULL);
}
}
@@ -1649,7 +1674,7 @@ get_select_name_dialog (EMeetingModel *im)
control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
- bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", TC_CORBA_string, "", NULL);
+ bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", "", NULL);
}
CORBA_exception_free (&ev);
@@ -1658,13 +1683,13 @@ get_select_name_dialog (EMeetingModel *im)
CORBA_exception_init (&ev);
- priv->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+ priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
for (i = 0; sections[i] != NULL; i++)
add_section (priv->corba_select_names, sections[i]);
bonobo_event_source_client_add_listener (priv->corba_select_names,
- (BonoboListenerCallbackFn) select_names_ok_cb,
+ select_names_ok_cb,
"GNOME/Evolution:ok:dialog",
NULL, im);
@@ -1759,8 +1784,8 @@ process_section (EMeetingModel *im, GNOME_Evolution_Addressbook_SimpleCardList *
static void
select_names_ok_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data)
{
@@ -1782,14 +1807,14 @@ select_names_ok_cb (BonoboListener *listener,
control_widget = bonobo_widget_new_control_from_objref
(corba_control, CORBA_OBJECT_NIL);
- control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
- pb = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
- card_arg = bonobo_property_bag_client_get_value_any (pb, "simple_card_list", NULL);
- if (card_arg != NULL) {
- cards = BONOBO_ARG_GET_GENERAL (card_arg, TC_GNOME_Evolution_Addressbook_SimpleCardList, GNOME_Evolution_Addressbook_SimpleCardList, NULL);
- process_section (im, &cards, roles[i]);
- bonobo_arg_release (card_arg);
- }
+ control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (control_widget));
+ pb = bonobo_control_frame_get_control_property_bag (control_frame, NULL);
+ card_arg = bonobo_property_bag_client_get_value_any (pb, "simple_card_list", NULL);
+ if (card_arg != NULL) {
+ cards = BONOBO_ARG_GET_GENERAL (card_arg, TC_GNOME_Evolution_Addressbook_SimpleCardList, GNOME_Evolution_Addressbook_SimpleCardList, NULL);
+ process_section (im, &cards, roles[i]);
+ bonobo_arg_release (card_arg);
+ }
}
}
@@ -1804,7 +1829,7 @@ attendee_changed_cb (EMeetingAttendee *ia, gpointer data)
for (i = 0; i < priv->attendees->len; i++) {
if (ia == g_ptr_array_index (priv->attendees, i)) {
- row = i;
+ row = 1;
break;
}
}
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index cc247c2d85..1108dfdf2b 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -29,14 +29,12 @@
#include <gal/menus/gal-view-instance.h>
#include <gal/menus/gal-view-factory-etable.h>
#include <gal/menus/gal-view-etable.h>
-
#include "e-util/e-url.h"
#include "widgets/menus/gal-view-menus.h"
#include "dialogs/task-editor.h"
#include "cal-search-bar.h"
#include "calendar-config.h"
-#include "calendar-component.h"
-#include "comp-util.h"
+#include "component-factory.h"
#include "misc.h"
#include "e-tasks.h"
@@ -88,7 +86,7 @@ E_MAKE_TYPE (e_tasks, "ETasks", ETasks,
/* Class initialization function for the gnome calendar */
- static void
+static void
e_tasks_class_init (ETasksClass *class)
{
GtkObjectClass *object_class;
@@ -100,12 +98,14 @@ e_tasks_class_init (ETasksClass *class)
e_tasks_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (ETasksClass, selection_changed),
gtk_marshal_NONE__INT,
GTK_TYPE_NONE, 1,
GTK_TYPE_INT);
+ gtk_object_class_add_signals (object_class, e_tasks_signals, LAST_SIGNAL);
+
object_class->destroy = e_tasks_destroy;
class->selection_changed = NULL;
@@ -192,10 +192,10 @@ setup_widgets (ETasks *tasks)
priv = tasks->priv;
priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), tasks);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "sexp_changed",
+ GTK_SIGNAL_FUNC (search_bar_sexp_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "category_changed",
+ GTK_SIGNAL_FUNC (search_bar_category_changed_cb), tasks);
gtk_table_attach (GTK_TABLE (tasks), priv->search_bar, 0, 1, 0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
@@ -214,7 +214,8 @@ setup_widgets (ETasks *tasks)
calendar_config_configure_e_calendar_table (E_CALENDAR_TABLE (priv->tasks_view));
- g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (etable), "selection_change",
+ GTK_SIGNAL_FUNC (table_selection_change_cb), tasks);
}
/* Callback used when the set of categories changes in the calendar client */
@@ -247,12 +248,12 @@ e_tasks_construct (ETasks *tasks)
if (!priv->client)
return NULL;
- g_signal_connect (priv->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), tasks);
- g_signal_connect (priv->client, "backend_error",
- G_CALLBACK (backend_error_cb), tasks);
- g_signal_connect (priv->client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), tasks);
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
g_assert (model != NULL);
@@ -268,11 +269,11 @@ e_tasks_new (void)
{
ETasks *tasks;
- tasks = g_object_new (e_tasks_get_type (), NULL);
+ tasks = gtk_type_new (e_tasks_get_type ());
if (!e_tasks_construct (tasks)) {
g_message ("e_tasks_new(): Could not construct the tasks GUI");
- g_object_unref (tasks);
+ gtk_object_unref (GTK_OBJECT (tasks));
return NULL;
}
@@ -306,7 +307,7 @@ e_tasks_destroy (GtkObject *object)
priv = tasks->priv;
if (priv->client) {
- g_object_unref (priv->client);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
@@ -527,7 +528,7 @@ e_tasks_new_task (ETasks *tasks)
cal_component_set_categories (comp, category);
comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
comp_editor_focus (COMP_EDITOR (tedit));
}
@@ -621,9 +622,8 @@ query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data)
set_status_message (tasks, NULL);
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
@@ -641,9 +641,8 @@ query_query_done_cb (CalQuery *query, CalQueryDoneStatus status, const char *err
set_status_message (tasks, NULL);
- g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
- g_object_unref (priv->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks);
+ gtk_object_unref (GTK_OBJECT (priv->query));
priv->query = NULL;
}
/**
@@ -679,9 +678,12 @@ e_tasks_delete_completed (ETasks *tasks)
return;
}
- g_signal_connect (priv->query, "obj_updated", G_CALLBACK (query_obj_updated_cb), tasks);
- g_signal_connect (priv->query, "query_done", G_CALLBACK (query_query_done_cb), tasks);
- g_signal_connect (priv->query, "eval_error", G_CALLBACK (query_eval_error_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), tasks);
}
/* Callback used from the view collection when we need to display a new view */
@@ -736,7 +738,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
dir = gnome_util_prepend_user_home ("/evolution/views/tasks/");
gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/tasks/",
+ EVOLUTION_DATADIR "/evolution/views/tasks/",
dir);
g_free (dir);
@@ -747,9 +749,9 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
EVOLUTION_ETSPECDIR "/e-calendar-table.etspec");
factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
+ gtk_object_unref (GTK_OBJECT (spec));
gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
/* Load the collection and create the menus */
@@ -760,7 +762,8 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
priv->view_menus = gal_view_menus_new (priv->view_instance);
gal_view_menus_apply (priv->view_menus, uic, NULL);
- g_signal_connect (priv->view_instance, "display_view", G_CALLBACK (display_view_cb), tasks);
+ gtk_signal_connect (GTK_OBJECT (priv->view_instance), "display_view",
+ GTK_SIGNAL_FUNC (display_view_cb), tasks);
display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), tasks);
}
@@ -787,10 +790,10 @@ e_tasks_discard_view_menus (ETasks *tasks)
g_assert (priv->view_instance != NULL);
g_assert (priv->view_menus != NULL);
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 06d3dfb906..b526e8b9a1 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -39,11 +39,13 @@
#include <gtk/gtkvscrollbar.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkmain.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-util.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include <gal/e-text/e-text.h>
#include <gal/widgets/e-canvas-utils.h>
#include <gal/widgets/e-gui-utils.h>
@@ -73,7 +75,10 @@
#include "art/timezone-16.xpm"
#include "art/jump.xpm"
-#define E_WEEK_VIEW_SMALL_FONT_PTSIZE 7
+#define E_WEEK_VIEW_SMALL_FONT \
+ "-adobe-utopia-regular-r-normal-*-*-100-*-*-p-*-iso8859-*"
+#define E_WEEK_VIEW_SMALL_FONT_FALLBACK \
+ "-adobe-helvetica-medium-r-normal-*-*-80-*-*-p-*-iso8859-*"
#define E_WEEK_VIEW_JUMP_BUTTON_WIDTH 16
#define E_WEEK_VIEW_JUMP_BUTTON_HEIGHT 8
@@ -113,6 +118,8 @@ static gint e_week_view_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static gint e_week_view_expose_event (GtkWidget *widget,
GdkEventExpose *event);
+static void e_week_view_draw (GtkWidget *widget,
+ GdkRectangle *area);
static void e_week_view_draw_shadow (EWeekView *week_view);
static gboolean e_week_view_on_button_press (GtkWidget *widget,
@@ -239,8 +246,32 @@ static gboolean e_week_view_layout_timeout_cb (gpointer data);
static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_week_view, "EWeekView", EWeekView, e_week_view_class_init,
- e_week_view_init, GTK_TYPE_TABLE);
+
+GtkType
+e_week_view_get_type (void)
+{
+ static GtkType e_week_view_type = 0;
+
+ if (!e_week_view_type){
+ GtkTypeInfo e_week_view_info = {
+ "EWeekView",
+ sizeof (EWeekView),
+ sizeof (EWeekViewClass),
+ (GtkClassInitFunc) e_week_view_class_init,
+ (GtkObjectInitFunc) e_week_view_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ parent_class = gtk_type_class (GTK_TYPE_TABLE);
+ e_week_view_type = gtk_type_unique (GTK_TYPE_TABLE,
+ &e_week_view_info);
+ }
+
+ return e_week_view_type;
+}
+
static void
e_week_view_class_init (EWeekViewClass *class)
@@ -248,18 +279,19 @@ e_week_view_class_init (EWeekViewClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
e_week_view_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (EWeekViewClass, selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, e_week_view_signals, LAST_SIGNAL);
+
/* Method override */
object_class->destroy = e_week_view_destroy;
@@ -271,6 +303,7 @@ e_week_view_class_init (EWeekViewClass *class)
widget_class->focus_out_event = e_week_view_focus_out;
widget_class->key_press_event = e_week_view_key_press;
widget_class->expose_event = e_week_view_expose_event;
+ widget_class->draw = e_week_view_draw;
class->selection_changed = NULL;
@@ -333,11 +366,11 @@ e_week_view_init (EWeekView *week_view)
/* Create the small font. */
week_view->use_small_font = TRUE;
-
- week_view->small_font_desc =
- pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc);
- pango_font_description_set_size (week_view->small_font_desc,
- E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE);
+ week_view->small_font = gdk_font_load (E_WEEK_VIEW_SMALL_FONT);
+ if (!week_view->small_font)
+ week_view->small_font = gdk_font_load (E_WEEK_VIEW_SMALL_FONT_FALLBACK);
+ if (!week_view->small_font)
+ week_view->use_small_font = FALSE;
/* String to use in 12-hour time format for times in the morning. */
week_view->am_string = _("am");
@@ -379,12 +412,18 @@ e_week_view_init (EWeekView *week_view)
"EWeekViewMainItem::week_view", week_view,
NULL);
- g_signal_connect_after (week_view->main_canvas, "button_press_event",
- G_CALLBACK (e_week_view_on_button_press), week_view);
- g_signal_connect_after (week_view->main_canvas, "button_release_event",
- G_CALLBACK (e_week_view_on_button_release), week_view);
- g_signal_connect_after (week_view->main_canvas, "motion_notify_event",
- G_CALLBACK (e_week_view_on_motion), week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "button_press_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_button_press),
+ week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "button_release_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_button_release),
+ week_view);
+ gtk_signal_connect_after (GTK_OBJECT (week_view->main_canvas),
+ "motion_notify_event",
+ GTK_SIGNAL_FUNC (e_week_view_on_motion),
+ week_view);
/* Create the buttons to jump to each days. */
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**) jump_xpm);
@@ -396,8 +435,10 @@ e_week_view_init (EWeekView *week_view)
"GnomeCanvasPixbuf::pixbuf", pixbuf,
NULL);
- g_signal_connect (week_view->jump_buttons[i], "event",
- G_CALLBACK (e_week_view_on_jump_button_event), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->jump_buttons[i]),
+ "event",
+ GTK_SIGNAL_FUNC (e_week_view_on_jump_button_event),
+ week_view);
}
gdk_pixbuf_unref (pixbuf);
@@ -406,7 +447,7 @@ e_week_view_init (EWeekView *week_view)
*/
adjustment = gtk_adjustment_new (0, -52, 52, 1, 1, 1);
gtk_signal_connect (adjustment, "value_changed",
- G_CALLBACK (e_week_view_on_adjustment_changed),
+ GTK_SIGNAL_FUNC (e_week_view_on_adjustment_changed),
week_view);
week_view->vscrollbar = gtk_vscrollbar_new (GTK_ADJUSTMENT (adjustment));
@@ -426,16 +467,22 @@ e_week_view_init (EWeekView *week_view)
clipboard_atom,
GDK_SELECTION_TYPE_STRING,
0);
-
- g_signal_connect (week_view->invisible, "selection_get",
- G_CALLBACK (selection_get), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "selection_received",
- G_CALLBACK (selection_received), (gpointer) week_view);
- g_signal_connect (week_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) week_view);
-
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_get",
+ GTK_SIGNAL_FUNC (selection_get),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_clear_event",
+ GTK_SIGNAL_FUNC (selection_clear_event),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "selection_received",
+ GTK_SIGNAL_FUNC (selection_received),
+ (gpointer) week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->invisible),
+ "destroy",
+ GTK_SIGNAL_FUNC (invisible_destroyed),
+ (gpointer) week_view);
week_view->clipboard_selection = NULL;
week_view->activity = NULL;
@@ -453,7 +500,7 @@ e_week_view_new (void)
{
GtkWidget *week_view;
- week_view = GTK_WIDGET (g_object_new (e_week_view_get_type (), NULL));
+ week_view = GTK_WIDGET (gtk_type_new (e_week_view_get_type ()));
return week_view;
}
@@ -473,8 +520,8 @@ e_week_view_destroy (GtkObject *object)
week_view->events = NULL;
if (week_view->client) {
- g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->client));
week_view->client = NULL;
}
@@ -484,15 +531,14 @@ e_week_view_destroy (GtkObject *object)
}
if (week_view->query) {
- g_signal_handlers_disconnect_matched (week_view->query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->query), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->query));
week_view->query = NULL;
}
- if (week_view->small_font_desc) {
- pango_font_description_free (week_view->small_font_desc);
- week_view->small_font_desc = NULL;
+ if (week_view->small_font) {
+ gdk_font_unref (week_view->small_font);
+ week_view->small_font = NULL;
}
if (week_view->default_category) {
@@ -512,7 +558,7 @@ e_week_view_destroy (GtkObject *object)
}
if (week_view->activity) {
- g_object_unref (week_view->activity);
+ gtk_object_unref (GTK_OBJECT (week_view->activity));
week_view->activity = NULL;
}
@@ -596,6 +642,7 @@ e_week_view_unrealize (GtkWidget *widget)
{
EWeekView *week_view;
GdkColormap *colormap;
+ gint i;
week_view = E_WEEK_VIEW (widget);
@@ -603,7 +650,8 @@ e_week_view_unrealize (GtkWidget *widget)
week_view->main_gc = NULL;
colormap = gtk_widget_get_colormap (widget);
- gdk_colormap_free_colors (colormap, week_view->colors, E_WEEK_VIEW_COLOR_LAST);
+ for (i = 0; i < E_WEEK_VIEW_COLOR_LAST; i++)
+ gdk_colors_free (colormap, &week_view->colors[i].pixel, 1, 0);
gdk_pixmap_unref (week_view->reminder_icon);
week_view->reminder_icon = NULL;
@@ -614,60 +662,25 @@ e_week_view_unrealize (GtkWidget *widget)
(*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
}
-static gint
-get_string_width (PangoLayout *layout, const gchar *string)
-{
- gint width;
-
- pango_layout_set_text (layout, string, -1);
- pango_layout_get_pixel_size (layout, &width, NULL);
- return width;
-}
-
-/* FIXME: This is also needed in e-day-view-time-item.c. We should probably use
- * pango's approximation function, but it needs a language tag. Find out how to
- * get one of those properly. */
-static gint
-get_digit_width (PangoLayout *layout)
-{
- gint digit;
- gint max_digit_width = 1;
-
- for (digit = '0'; digit <= '9'; digit++) {
- gchar digit_char;
- gint digit_width;
-
- digit_char = digit;
-
- pango_layout_set_text (layout, &digit_char, 1);
- pango_layout_get_pixel_size (layout, &digit_width, NULL);
-
- max_digit_width = MAX (max_digit_width, digit_width);
- }
-
- return max_digit_width;
-}
static void
e_week_view_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
+ GtkStyle *previous_style)
{
EWeekView *week_view;
+ EWeekViewEventSpan *span;
GdkFont *font;
- GtkStyle *style;
gint day, day_width, max_day_width, max_abbr_day_width;
gint month, month_width, max_month_width, max_abbr_month_width;
+ gint span_num;
GDate date;
gchar buffer[128];
- PangoLayout *layout;
if (GTK_WIDGET_CLASS (parent_class)->style_set)
(*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
week_view = E_WEEK_VIEW (widget);
- style = gtk_widget_get_style (widget);
- font = gtk_style_get_font (style);
- layout = gtk_widget_create_pango_layout (widget, NULL);
+ font = widget->style->font;
/* Recalculate the height of each row based on the font size. */
week_view->row_height = font->ascent + font->descent + E_WEEK_VIEW_EVENT_BORDER_HEIGHT * 2 + E_WEEK_VIEW_EVENT_TEXT_Y_PAD * 2;
@@ -675,8 +688,8 @@ e_week_view_style_set (GtkWidget *widget,
/* Check that the small font is smaller than the default font.
If it isn't, we won't use it. */
- if (week_view->small_font_desc) {
- if (font->ascent + font->descent <= E_WEEK_VIEW_SMALL_FONT_PTSIZE)
+ if (week_view->small_font) {
+ if (font->ascent + font->descent <= week_view->small_font->ascent + week_view->small_font->descent)
week_view->use_small_font = FALSE;
}
@@ -693,12 +706,12 @@ e_week_view_style_set (GtkWidget *widget,
max_abbr_day_width = 0;
for (day = 0; day < 7; day++) {
g_date_strftime (buffer, 128, "%A", &date);
- day_width = get_string_width (layout, buffer);
+ day_width = gdk_string_width (font, buffer);
week_view->day_widths[day] = day_width;
max_day_width = MAX (max_day_width, day_width);
g_date_strftime (buffer, 128, "%a", &date);
- day_width = get_string_width (layout, buffer);
+ day_width = gdk_string_width (font, buffer);
week_view->abbr_day_widths[day] = day_width;
max_abbr_day_width = MAX (max_abbr_day_width, day_width);
@@ -711,36 +724,32 @@ e_week_view_style_set (GtkWidget *widget,
g_date_set_month (&date, month + 1);
g_date_strftime (buffer, 128, "%B", &date);
- month_width = get_string_width (layout, buffer);
+ month_width = gdk_string_width (font, buffer);
week_view->month_widths[month] = month_width;
max_month_width = MAX (max_month_width, month_width);
g_date_strftime (buffer, 128, "%b", &date);
- month_width = get_string_width (layout, buffer);
+ month_width = gdk_string_width (font, buffer);
week_view->abbr_month_widths[month] = month_width;
max_abbr_month_width = MAX (max_abbr_month_width, month_width);
}
- week_view->space_width = get_string_width (layout, " ");
- week_view->colon_width = get_string_width (layout, ":");
- week_view->slash_width = get_string_width (layout, "/");
- week_view->digit_width = get_digit_width (layout);
- if (week_view->small_font_desc) {
- pango_layout_set_font_description (layout, week_view->small_font_desc);
- week_view->small_digit_width = get_digit_width (layout);
- pango_layout_set_font_description (layout, style->font_desc);
- }
+ week_view->space_width = gdk_string_width (font, " ");
+ week_view->colon_width = gdk_string_width (font, ":");
+ week_view->slash_width = gdk_string_width (font, "/");
+ week_view->digit_width = gdk_string_width (font, "5");
+ if (week_view->small_font)
+ week_view->small_digit_width = gdk_string_width (week_view->small_font, "5");
week_view->max_day_width = max_day_width;
week_view->max_abbr_day_width = max_abbr_day_width;
week_view->max_month_width = max_month_width;
week_view->max_abbr_month_width = max_abbr_month_width;
- week_view->am_string_width = get_string_width (layout,
+ week_view->am_string_width = gdk_string_width (font,
week_view->am_string);
- week_view->pm_string_width = get_string_width (layout,
+ week_view->pm_string_width = gdk_string_width (font,
week_view->pm_string);
-#if 0
/* Set the font of all the EText items. */
if (week_view->spans) {
for (span_num = 0; span_num < week_view->spans->len;
@@ -753,9 +762,6 @@ e_week_view_style_set (GtkWidget *widget,
NULL);
}
}
-#endif
-
- g_object_unref (layout);
}
@@ -806,7 +812,6 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
gfloat canvas_width, canvas_height, offset;
gint row, col;
GtkWidget *widget;
- GtkStyle *style;
GdkFont *font;
gint width, height, time_width;
@@ -855,13 +860,11 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
/* If the font hasn't been set yet just return. */
widget = GTK_WIDGET (week_view);
- style = gtk_widget_get_style (widget);
- if (!style)
- return;
- font = gtk_style_get_font (style);
- if (!font)
+ if (!widget->style || ! widget->style->font)
return;
+ font = widget->style->font;
+
/* Calculate the number of rows of events in each cell, for the large
cells and the compressed weekend cells. */
if (week_view->multi_week_view) {
@@ -894,7 +897,7 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
time_width = e_week_view_get_time_string_width (week_view);
week_view->time_format = E_WEEK_VIEW_TIME_NONE;
- if (week_view->use_small_font && week_view->small_font_desc) {
+ if (week_view->use_small_font && week_view->small_font) {
if (week_view->show_event_end_times
&& width / 2 > time_width * 2 + E_WEEK_VIEW_EVENT_TIME_SPACING)
week_view->time_format = E_WEEK_VIEW_TIME_BOTH_SMALL_MIN;
@@ -965,6 +968,22 @@ e_week_view_expose_event (GtkWidget *widget,
return FALSE;
}
+
+static void
+e_week_view_draw (GtkWidget *widget,
+ GdkRectangle *area)
+{
+ EWeekView *week_view;
+
+ week_view = E_WEEK_VIEW (widget);
+
+ e_week_view_draw_shadow (week_view);
+
+ if (GTK_WIDGET_CLASS (parent_class)->draw)
+ (*GTK_WIDGET_CLASS (parent_class)->draw)(widget, area);
+}
+
+
static void
e_week_view_draw_shadow (EWeekView *week_view)
{
@@ -1077,7 +1096,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
g_print ("updated object's dates unchanged\n");
#endif
e_week_view_foreach_event_with_uid (week_view, uid, e_week_view_update_event_cb, comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
gtk_widget_queue_draw (week_view->main_canvas);
return;
}
@@ -1102,7 +1121,7 @@ query_obj_updated_cb (CalQuery *query, const char *uid,
cal_client_resolve_tzid_cb, week_view->client,
week_view->zone);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
e_week_view_queue_layout (week_view);
}
@@ -1208,9 +1227,8 @@ update_query (EWeekView *week_view)
week_view->query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, week_view);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), week_view);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (week_view->sexp != NULL);
@@ -1229,14 +1247,14 @@ update_query (EWeekView *week_view)
return;
}
- g_signal_connect (week_view->query, "obj_updated",
- G_CALLBACK (query_obj_updated_cb), week_view);
- g_signal_connect (week_view->query, "obj_removed",
- G_CALLBACK (query_obj_removed_cb), week_view);
- g_signal_connect (week_view->query, "query_done",
- G_CALLBACK (query_query_done_cb), week_view);
- g_signal_connect (week_view->query, "eval_error",
- G_CALLBACK (query_eval_error_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "obj_updated",
+ GTK_SIGNAL_FUNC (query_obj_updated_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "obj_removed",
+ GTK_SIGNAL_FUNC (query_obj_removed_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "query_done",
+ GTK_SIGNAL_FUNC (query_query_done_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->query), "eval_error",
+ GTK_SIGNAL_FUNC (query_eval_error_cb), week_view);
}
/* Callback used when the calendar client finishes opening */
@@ -1274,11 +1292,11 @@ e_week_view_set_cal_client (EWeekView *week_view,
g_return_if_fail (IS_CAL_CLIENT (client));
if (client)
- g_object_ref (client);
+ gtk_object_ref (GTK_OBJECT (client));
if (week_view->client) {
- g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view);
- g_object_unref (week_view->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view);
+ gtk_object_unref (GTK_OBJECT (week_view->client));
}
week_view->client = client;
@@ -1287,8 +1305,8 @@ e_week_view_set_cal_client (EWeekView *week_view,
if (cal_client_get_load_state (week_view->client) == CAL_CLIENT_LOAD_LOADED)
update_query (week_view);
else
- g_signal_connect (week_view->client, "cal_opened",
- G_CALLBACK (cal_opened_cb), week_view);
+ gtk_signal_connect (GTK_OBJECT (week_view->client), "cal_opened",
+ GTK_SIGNAL_FUNC (cal_opened_cb), week_view);
}
}
@@ -1988,9 +2006,9 @@ e_week_view_update_event_cb (EWeekView *week_view,
event = &g_array_index (week_view->events, EWeekViewEvent, event_num);
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
event->comp = comp;
- g_object_ref (comp);
+ gtk_object_ref (GTK_OBJECT (comp));
for (span_num = 0; span_num < event->num_spans; span_num++) {
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
@@ -2075,7 +2093,7 @@ e_week_view_remove_event_cb (EWeekView *week_view,
}
}
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
g_array_remove_index (week_view->events, event_num);
week_view->events_need_layout = TRUE;
@@ -2420,7 +2438,7 @@ e_week_view_free_events (EWeekView *week_view)
for (event_num = 0; event_num < week_view->events->len; event_num++) {
event = &g_array_index (week_view->events, EWeekViewEvent,
event_num);
- g_object_unref (event->comp);
+ gtk_object_unref (GTK_OBJECT (event->comp));
}
g_array_set_size (week_view->events, 0);
@@ -2487,7 +2505,7 @@ e_week_view_add_event (CalComponent *comp,
week_view->zone);
event.comp = comp;
- g_object_ref (event.comp);
+ gtk_object_ref (GTK_OBJECT (event.comp));
event.start = start;
event.end = end;
event.spans_index = 0;
@@ -2649,7 +2667,7 @@ e_week_view_reshape_event_span (EWeekView *week_view,
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
comp = event->comp;
- font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (week_view)));
+ font = GTK_WIDGET (week_view)->style->font;
one_day_event = e_week_view_is_one_day_event (week_view, event_num);
@@ -2721,20 +2739,20 @@ e_week_view_reshape_event_span (EWeekView *week_view,
span->text_item =
gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root),
e_text_get_type (),
-#if 0
- "font_gdk", font,
-#endif
+ "font_gdk", GTK_WIDGET (week_view)->style->font,
"anchor", GTK_ANCHOR_NW,
"clip", TRUE,
+#if 0
"max_lines", 1,
+#endif
"editable", TRUE,
"text", text.value ? text.value : "",
"use_ellipsis", TRUE,
"fill_color_rgba", GNOME_CANVAS_COLOR(0, 0, 0),
NULL);
- g_signal_connect (span->text_item, "event",
- G_CALLBACK (e_week_view_on_text_item_event),
- week_view);
+ gtk_signal_connect (GTK_OBJECT (span->text_item), "event",
+ GTK_SIGNAL_FUNC (e_week_view_on_text_item_event),
+ week_view);
}
/* Calculate the position of the text item.
@@ -2805,7 +2823,9 @@ e_week_view_reshape_event_span (EWeekView *week_view,
/* Get the width of the text of the event. This is a
bit of a hack. It would be better if EText could
tell us this. */
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "text", &text,
+ NULL);
text_width = 0;
if (text) {
/* It should only have one line of text in it.
@@ -2957,12 +2977,14 @@ e_week_view_start_editing_event (EWeekView *week_view,
e_canvas_item_grab_focus (span->text_item, TRUE);
/* Try to move the cursor to the end of the text. */
- g_object_get (G_OBJECT (span->text_item), "event_processor", &event_processor, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "event_processor", &event_processor,
+ NULL);
if (event_processor) {
command.action = E_TEP_MOVE;
command.position = E_TEP_END_OF_BUFFER;
- g_signal_emit_by_name (event_processor,
- "command", &command);
+ gtk_signal_emit_by_name (GTK_OBJECT (event_processor),
+ "command", &command);
}
}
@@ -3004,7 +3026,9 @@ cancel_editing (EWeekView *week_view)
/* Reset the text to what was in the component */
cal_component_get_summary (event->comp, &summary);
- g_object_set (G_OBJECT (span->text_item), "text", summary.value ? summary.value : "", NULL);
+ gtk_object_set (GTK_OBJECT (span->text_item),
+ "text", summary.value ? summary.value : "",
+ NULL);
/* Stop editing */
e_week_view_stop_editing_event (week_view);
@@ -3014,7 +3038,7 @@ cancel_editing (EWeekView *week_view)
* a pointer to a boolean; will set it to TRUE.
*/
static void
-comp_destroy_cb (gpointer data, GObject *deadbeef)
+comp_destroy_cb (GtkObject *object, gpointer data)
{
gboolean *destroyed;
@@ -3077,17 +3101,19 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
if (gdkevent->button.button == 3) {
EWeekViewEvent *e;
gboolean destroyed;
+ int id;
e = &g_array_index (week_view->events, EWeekViewEvent, event_num);
destroyed = FALSE;
- g_object_weak_ref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ id = gtk_signal_connect (GTK_OBJECT (e->comp), "destroy",
+ GTK_SIGNAL_FUNC (comp_destroy_cb), &destroyed);
if (!GTK_WIDGET_HAS_FOCUS (week_view))
gtk_widget_grab_focus (GTK_WIDGET (week_view));
if (!destroyed) {
- g_object_weak_unref ((GObject *) e->comp, comp_destroy_cb, &destroyed);
+ gtk_signal_disconnect (GTK_OBJECT (e->comp), id);
e_week_view_set_selected_time_range_visible (week_view, e->start, e->end);
@@ -3226,7 +3252,9 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
if (!uid)
return;
- g_object_get (G_OBJECT (span->text_item), "text", &text, NULL);
+ gtk_object_get (GTK_OBJECT (span->text_item),
+ "text", &text,
+ NULL);
g_assert (text != NULL);
if (string_is_empty (text) && !cal_comp_is_on_server (event->comp, week_view->client)) {
@@ -3457,7 +3485,7 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (initial_text)
g_free (initial_text);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
}
@@ -3504,60 +3532,60 @@ enum {
};
static EPopupMenu main_items [] = {
- E_POPUP_ITEM (N_("New _Appointment..."), GTK_SIGNAL_FUNC (e_week_view_on_new_appointment), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New All Day _Event"), GTK_SIGNAL_FUNC (e_week_view_on_new_event), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Meeting"), GTK_SIGNAL_FUNC (e_week_view_on_new_meeting), MASK_EDITABLE),
- E_POPUP_ITEM (N_("New Task"), GTK_SIGNAL_FUNC (e_week_view_on_new_task), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New _Appointment..."), e_week_view_on_new_appointment, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New All Day _Event"), e_week_view_on_new_event, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New Meeting"), e_week_view_on_new_meeting, MASK_EDITABLE),
+ E_POPUP_ITEM (N_("New Task"), e_week_view_on_new_task, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_week_view_on_print), 0),
+ E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_week_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
E_POPUP_SUBMENU (N_("Current View"), NULL, 0),
- E_POPUP_ITEM (N_("Go to _Today"), GTK_SIGNAL_FUNC (e_week_view_on_goto_today), 0),
- E_POPUP_ITEM (N_("_Go to Date..."), GTK_SIGNAL_FUNC (e_week_view_on_goto_date), 0),
+ E_POPUP_ITEM (N_("Go to _Today"), e_week_view_on_goto_today, 0),
+ E_POPUP_ITEM (N_("_Go to Date..."), e_week_view_on_goto_date, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Publish Free/Busy Information"), GTK_SIGNAL_FUNC (e_week_view_on_publish), 0),
+ E_POPUP_ITEM (N_("_Publish Free/Busy Information"), e_week_view_on_publish, 0),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Settings..."), GTK_SIGNAL_FUNC (e_week_view_on_settings), 0),
+ E_POPUP_ITEM (N_("_Settings..."), e_week_view_on_settings, 0),
E_POPUP_TERMINATOR
};
static EPopupMenu child_items [] = {
- E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_week_view_on_edit_appointment), MASK_EDITING),
- E_POPUP_ITEM (N_("_Save As..."), GTK_SIGNAL_FUNC (e_week_view_on_save_as), MASK_EDITING),
- E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_week_view_on_print_event), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Open"), e_week_view_on_edit_appointment, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Save As..."), e_week_view_on_save_as, MASK_EDITING),
+ E_POPUP_ITEM (N_("_Print..."), e_week_view_on_print_event, MASK_EDITING),
/* Only show this separator if one of the above is shown. */
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("C_ut"), GTK_SIGNAL_FUNC (e_week_view_on_cut), MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Copy"), GTK_SIGNAL_FUNC (e_week_view_on_copy), MASK_EDITING | MASK_MEETING_ORGANIZER),
- E_POPUP_ITEM (N_("_Paste"), GTK_SIGNAL_FUNC (e_week_view_on_paste), MASK_EDITABLE),
+ E_POPUP_ITEM (N_("C_ut"), e_week_view_on_cut, MASK_EDITING | MASK_EDITABLE | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Copy"), e_week_view_on_copy, MASK_EDITING | MASK_MEETING_ORGANIZER),
+ E_POPUP_ITEM (N_("_Paste"), e_week_view_on_paste, MASK_EDITABLE),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Schedule Meeting..."), GTK_SIGNAL_FUNC (e_week_view_on_meeting), MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
- E_POPUP_ITEM (N_("_Forward as iCalendar..."), GTK_SIGNAL_FUNC (e_week_view_on_forward), MASK_EDITING),
+ E_POPUP_ITEM (N_("_Schedule Meeting..."), e_week_view_on_meeting, MASK_EDITABLE | MASK_EDITING | MASK_MEETING),
+ E_POPUP_ITEM (N_("_Forward as iCalendar..."), e_week_view_on_forward, MASK_EDITING),
E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (e_week_view_on_delete_appointment), MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
- E_POPUP_ITEM (N_("Make this Occurrence _Movable"), GTK_SIGNAL_FUNC (e_week_view_on_unrecur_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE | MASK_INSTANCE),
- E_POPUP_ITEM (N_("Delete this _Occurrence"), GTK_SIGNAL_FUNC (e_week_view_on_delete_occurrence), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
- E_POPUP_ITEM (N_("Delete _All Occurrences"), GTK_SIGNAL_FUNC (e_week_view_on_delete_appointment), MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("_Delete"), e_week_view_on_delete_appointment, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING),
+ E_POPUP_ITEM (N_("Make this Occurrence _Movable"), e_week_view_on_unrecur_appointment, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE | MASK_INSTANCE),
+ E_POPUP_ITEM (N_("Delete this _Occurrence"), e_week_view_on_delete_occurrence, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
+ E_POPUP_ITEM (N_("Delete _All Occurrences"), e_week_view_on_delete_appointment, MASK_RECURRING | MASK_EDITING | MASK_EDITABLE),
E_POPUP_TERMINATOR
};
@@ -3629,7 +3657,8 @@ e_week_view_show_popup_menu (EWeekView *week_view,
week_view->popup_event_num = event_num;
popup = e_popup_menu_create (context_menu, disable_mask, hide_mask, week_view);
- g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), week_view);
+ gtk_signal_connect (GTK_OBJECT (popup), "selection-done",
+ GTK_SIGNAL_FUNC (free_view_popup), week_view);
e_popup_menu (popup, (GdkEvent *) bevent);
}
@@ -3854,7 +3883,7 @@ e_week_view_on_publish (GtkWidget *widget, gpointer data)
itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp,
week_view->client, NULL);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
g_list_free (comp_list);
@@ -3905,7 +3934,7 @@ e_week_view_on_delete_occurrence (GtkWidget *widget, gpointer data)
if (cal_client_update_object (week_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_delete_occurrence(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
@@ -4085,12 +4114,12 @@ e_week_view_on_unrecur_appointment (GtkWidget *widget, gpointer data)
if (cal_client_update_object (week_view->client, comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (cal_client_update_object (week_view->client, new_comp) != CAL_CLIENT_RESULT_SUCCESS)
g_message ("e_week_view_on_unrecur_appointment(): Could not update the object!");
- g_object_unref (new_comp);
+ gtk_object_unref (GTK_OBJECT (new_comp));
}
@@ -4157,7 +4186,7 @@ e_week_view_get_time_string_width (EWeekView *week_view)
{
gint time_width;
- if (week_view->use_small_font && week_view->small_font_desc)
+ if (week_view->use_small_font && week_view->small_font)
time_width = week_view->digit_width * 2
+ week_view->small_digit_width * 2;
else
@@ -4292,7 +4321,7 @@ selection_received (GtkWidget *invisible,
cal_client_update_object (week_view->client, comp);
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
subcomp = icalcomponent_get_next_component (
icalcomp, ICAL_ANY_COMPONENT);
@@ -4334,7 +4363,7 @@ selection_received (GtkWidget *invisible,
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, week_view->client, NULL);
g_free (uid);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
e_week_view_set_status_message (week_view, NULL);
@@ -4414,7 +4443,7 @@ e_week_view_set_status_message (EWeekView *week_view, const char *message)
if (!message || !*message) {
if (week_view->activity) {
- g_object_unref (week_view->activity);
+ gtk_object_unref (GTK_OBJECT (week_view->activity));
week_view->activity = NULL;
}
}
@@ -4423,7 +4452,7 @@ e_week_view_set_status_message (EWeekView *week_view, const char *message)
char *client_id = g_strdup_printf ("%p", week_view);
if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE, NULL);
+ progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CALENDAR_PROGRESS_IMAGE);
week_view->activity = evolution_activity_client_new (
global_shell_client, client_id,
progress_icon, message, TRUE, &display);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index da2dde2948..a0bed50fc3 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -29,11 +29,15 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-exception.h>
+#include <gal/e-paned/e-hpaned.h>
+#include <gal/e-paned/e-vpaned.h>
#include "e-util/e-url.h"
#include <cal-util/timeutil.h>
#include "widgets/menus/gal-view-menus.h"
@@ -45,7 +49,7 @@
#include "e-week-view.h"
#include "evolution-calendar.h"
#include "gnome-cal.h"
-#include "calendar-component.h"
+#include "component-factory.h"
#include "cal-search-bar.h"
#include "calendar-commands.h"
#include "calendar-config.h"
@@ -194,8 +198,28 @@ static GtkVBoxClass *parent_class;
-E_MAKE_TYPE (gnome_calendar, "GnomeCalendar", GnomeCalendar, gnome_calendar_class_init,
- gnome_calendar_init, GTK_TYPE_VBOX);
+GtkType
+gnome_calendar_get_type (void)
+{
+ static GtkType gnome_calendar_type = 0;
+
+ if (!gnome_calendar_type) {
+ static const GtkTypeInfo gnome_calendar_info = {
+ "GnomeCalendar",
+ sizeof (GnomeCalendar),
+ sizeof (GnomeCalendarClass),
+ (GtkClassInitFunc) gnome_calendar_class_init,
+ (GtkObjectInitFunc) gnome_calendar_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ gnome_calendar_type = gtk_type_unique (GTK_TYPE_VBOX, &gnome_calendar_info);
+ }
+
+ return gnome_calendar_type;
+}
/* Class initialization function for the gnome calendar */
static void
@@ -205,12 +229,12 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (GTK_TYPE_VBOX);
gnome_calendar_signals[DATES_SHOWN_CHANGED] =
gtk_signal_new ("dates_shown_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass,
dates_shown_changed),
gtk_marshal_NONE__NONE,
@@ -219,7 +243,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[CALENDAR_SELECTION_CHANGED] =
gtk_signal_new ("calendar_selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
@@ -227,7 +251,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[TASKPAD_SELECTION_CHANGED] =
gtk_signal_new ("taskpad_selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_selection_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
@@ -235,7 +259,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[CALENDAR_FOCUS_CHANGE] =
gtk_signal_new ("calendar_focus_change",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, calendar_focus_change),
gtk_marshal_NONE__BOOL,
GTK_TYPE_NONE, 1,
@@ -244,12 +268,16 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
gnome_calendar_signals[TASKPAD_FOCUS_CHANGE] =
gtk_signal_new ("taskpad_focus_change",
GTK_RUN_FIRST,
- G_TYPE_FROM_CLASS (object_class),
+ object_class->type,
GTK_SIGNAL_OFFSET (GnomeCalendarClass, taskpad_focus_change),
gtk_marshal_NONE__BOOL,
GTK_TYPE_NONE, 1,
GTK_TYPE_BOOL);
+ gtk_object_class_add_signals (object_class,
+ gnome_calendar_signals,
+ LAST_SIGNAL);
+
object_class->destroy = gnome_calendar_destroy;
class->dates_shown_changed = NULL;
@@ -303,9 +331,9 @@ dn_query_obj_updated_cb (CalQuery *query, const char *uid,
return;
}
- tag_calendar_by_comp (priv->date_navigator, comp, priv->client, NULL,
+ tag_calendar_by_comp (priv->date_navigator, comp, priv->client, NULL,
FALSE, TRUE);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Callback used when the calendar query reports of a removed object */
@@ -511,9 +539,8 @@ update_query (GnomeCalendar *gcal)
priv->dn_query = NULL;
if (old_query) {
- g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (old_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), gcal);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (priv->sexp != NULL);
@@ -530,14 +557,14 @@ update_query (GnomeCalendar *gcal)
return;
}
- g_signal_connect (priv->dn_query, "obj_updated",
- G_CALLBACK (dn_query_obj_updated_cb), gcal);
- g_signal_connect (priv->dn_query, "obj_removed",
- G_CALLBACK (dn_query_obj_removed_cb), gcal);
- g_signal_connect (priv->dn_query, "query_done",
- G_CALLBACK (dn_query_query_done_cb), gcal);
- g_signal_connect (priv->dn_query, "eval_error",
- G_CALLBACK (dn_query_eval_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "obj_updated",
+ GTK_SIGNAL_FUNC (dn_query_obj_updated_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "obj_removed",
+ GTK_SIGNAL_FUNC (dn_query_obj_removed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "query_done",
+ GTK_SIGNAL_FUNC (dn_query_query_done_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->dn_query), "eval_error",
+ GTK_SIGNAL_FUNC (dn_query_eval_error_cb), gcal);
}
/**
@@ -689,25 +716,25 @@ calendar_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data
static void
connect_day_view_focus (GnomeCalendar *gcal, EDayView *dv)
{
- g_signal_connect (dv->top_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->top_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->top_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->top_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (dv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->main_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (dv->main_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
}
/* Connects to the focus change signals of a week view widget */
static void
connect_week_view_focus (GnomeCalendar *gcal, EWeekView *wv)
{
- g_signal_connect (wv->main_canvas, "focus_in_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (wv->main_canvas, "focus_out_event",
- G_CALLBACK (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (wv->main_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (wv->main_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (calendar_focus_change_cb), gcal);
}
/* Callback used when the selection in the taskpad table changes. We just proxy
@@ -737,17 +764,17 @@ setup_widgets (GnomeCalendar *gcal)
priv = gcal->priv;
priv->search_bar = cal_search_bar_new ();
- g_signal_connect (priv->search_bar, "sexp_changed",
- G_CALLBACK (search_bar_sexp_changed_cb), gcal);
- g_signal_connect (priv->search_bar, "category_changed",
- G_CALLBACK (search_bar_category_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "sexp_changed",
+ GTK_SIGNAL_FUNC (search_bar_sexp_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->search_bar), "category_changed",
+ GTK_SIGNAL_FUNC (search_bar_category_changed_cb), gcal);
gtk_widget_show (priv->search_bar);
gtk_box_pack_start (GTK_BOX (gcal), priv->search_bar, FALSE, FALSE, 0);
/* The main HPaned, with the notebook of calendar views on the left
and the ECalendar and ToDo list on the right. */
- priv->hpane = gtk_hpaned_new ();
+ priv->hpane = e_hpaned_new ();
gtk_widget_show (priv->hpane);
gtk_box_pack_start (GTK_BOX (gcal), priv->hpane, TRUE, TRUE, 0);
@@ -756,12 +783,12 @@ setup_widgets (GnomeCalendar *gcal)
gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
gtk_widget_show (priv->notebook);
- gtk_paned_pack1 (GTK_PANED (priv->hpane), priv->notebook, TRUE, TRUE);
+ e_paned_pack1 (E_PANED (priv->hpane), priv->notebook, TRUE, TRUE);
/* The VPaned widget, to contain the GtkCalendar & ToDo list. */
- priv->vpane = gtk_vpaned_new ();
+ priv->vpane = e_vpaned_new ();
gtk_widget_show (priv->vpane);
- gtk_paned_pack2 (GTK_PANED (priv->hpane), priv->vpane, FALSE, TRUE);
+ e_paned_pack2 (E_PANED (priv->hpane), priv->vpane, FALSE, TRUE);
/* The ECalendar. */
w = e_calendar_new ();
@@ -773,22 +800,30 @@ setup_widgets (GnomeCalendar *gcal)
(ECalendarItemGetTimeCallback) get_current_time,
gcal, NULL);
- gtk_paned_pack1 (GTK_PANED (priv->vpane), w, FALSE, TRUE);
- g_signal_connect (priv->date_navigator, "style_set",
- G_CALLBACK (gnome_calendar_on_date_navigator_style_set), gcal);
- g_signal_connect_after (priv->date_navigator, "size_allocate",
- G_CALLBACK (gnome_calendar_on_date_navigator_size_allocate), gcal);
- g_signal_connect (priv->date_navigator->calitem, "selection_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_selection_changed), gcal);
- g_signal_connect (priv->date_navigator->calitem, "date_range_changed",
- G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal);
+ e_paned_pack1 (E_PANED (priv->vpane), w, FALSE, TRUE);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator),
+ "style_set",
+ GTK_SIGNAL_FUNC (gnome_calendar_on_date_navigator_style_set),
+ gcal);
+ gtk_signal_connect_after (GTK_OBJECT (priv->date_navigator),
+ "size_allocate",
+ (GtkSignalFunc) gnome_calendar_on_date_navigator_size_allocate,
+ gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator->calitem),
+ "selection_changed",
+ (GtkSignalFunc) gnome_calendar_on_date_navigator_selection_changed,
+ gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->date_navigator->calitem),
+ "date_range_changed",
+ GTK_SIGNAL_FUNC (gnome_calendar_on_date_navigator_date_range_changed),
+ gcal);
/* The ToDo list. */
priv->todo = e_calendar_table_new ();
calendar_config_configure_e_calendar_table (E_CALENDAR_TABLE (priv->todo));
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
calendar_model_set_new_comp_vtype (model, CAL_COMPONENT_TODO);
- gtk_paned_pack2 (GTK_PANED (priv->vpane), priv->todo, TRUE, TRUE);
+ e_paned_pack2 (E_PANED (priv->vpane), priv->todo, TRUE, TRUE);
gtk_widget_show (priv->todo);
filename = g_strdup_printf ("%s/config/TaskPad", evolution_dir);
@@ -796,13 +831,13 @@ setup_widgets (GnomeCalendar *gcal)
g_free (filename);
etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
- g_signal_connect (etable->table_canvas, "focus_in_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable->table_canvas, "focus_out_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable->table_canvas), "focus_in_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable, "selection_change",
- G_CALLBACK (table_selection_change_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (etable), "selection_change",
+ GTK_SIGNAL_FUNC (table_selection_change_cb), gcal);
/* The Day View. */
priv->day_view = e_day_view_new ();
@@ -810,8 +845,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->day_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->day_view, gtk_label_new (""));
- g_signal_connect (priv->day_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->day_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_day_view_focus (gcal, E_DAY_VIEW (priv->day_view));
@@ -824,8 +859,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->work_week_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->work_week_view, gtk_label_new (""));
- g_signal_connect (priv->work_week_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->work_week_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_day_view_focus (gcal, E_DAY_VIEW (priv->work_week_view));
@@ -835,8 +870,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->week_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->week_view, gtk_label_new (""));
- g_signal_connect (priv->week_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->week_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_week_view_focus (gcal, E_WEEK_VIEW (priv->week_view));
@@ -847,8 +882,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->month_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->month_view, gtk_label_new (""));
- g_signal_connect (priv->month_view, "selection_changed",
- G_CALLBACK (view_selection_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->month_view), "selection_changed",
+ GTK_SIGNAL_FUNC (view_selection_changed_cb), gcal);
connect_week_view_focus (gcal, E_WEEK_VIEW (priv->month_view));
@@ -925,9 +960,8 @@ gnome_calendar_destroy (GtkObject *object)
g_free (filename);
if (priv->dn_query) {
- g_signal_handlers_disconnect_matched (priv->dn_query, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->dn_query);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->dn_query), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->dn_query));
priv->dn_query = NULL;
}
@@ -937,26 +971,24 @@ gnome_calendar_destroy (GtkObject *object)
}
if (priv->client) {
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->client));
priv->client = NULL;
}
if (priv->task_pad_client) {
- g_signal_handlers_disconnect_matched (priv->task_pad_client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, gcal);
- g_object_unref (priv->task_pad_client);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->task_pad_client), gcal);
+ gtk_object_unref (GTK_OBJECT (priv->task_pad_client));
priv->task_pad_client = NULL;
}
if (priv->view_instance) {
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
}
if (priv->view_menus) {
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
@@ -1244,8 +1276,7 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
updating = TRUE;
gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), (int) view_type);
- if (priv->view_instance)
- gal_view_instance_set_current_view_id (priv->view_instance, view_id);
+ gal_view_instance_set_current_view_id (priv->view_instance, view_id);
updating = FALSE;
if (grab_focus)
@@ -1256,9 +1287,9 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type,
/* For the week & month views we want the selection in the date
navigator to be rounded to the nearest week when the arrow buttons
are pressed to move to the previous/next month. */
- g_object_set (G_OBJECT (priv->date_navigator->calitem),
- "round_selection_when_moving", round_selection,
- NULL);
+ gtk_object_set (GTK_OBJECT (priv->date_navigator->calitem),
+ "round_selection_when_moving", round_selection,
+ NULL);
}
/**
@@ -1340,9 +1371,9 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
gal_view_collection_set_title (collection, _("Calendar"));
- path = gnome_util_prepend_user_home ("/evolution/views/calendar/");
+ path = gnome_util_prepend_user_home ("/evolution/views/calendar/");
gal_view_collection_set_storage_directories (collection,
- EVOLUTION_GALVIEWSDIR "/calendar/",
+ EVOLUTION_DATADIR "/evolution/views/calendar/",
path);
g_free (path);
@@ -1350,26 +1381,25 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
factory = calendar_view_factory_new (GNOME_CAL_DAY_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_WORK_WEEK_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_WEEK_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
factory = calendar_view_factory_new (GNOME_CAL_MONTH_VIEW);
gal_view_collection_add_factory (collection, GAL_VIEW_FACTORY (factory));
- g_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
/* Load the collection and create the menus */
gal_view_collection_load (collection);
}
- g_print ("Making GAL view instance.\n");
priv->view_instance = gal_view_instance_new (collection, cal_client_get_uri (priv->client));
priv->view_menus = gal_view_menus_new (priv->view_instance);
@@ -1377,8 +1407,8 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic)
gal_view_menus_apply (priv->view_menus, uic, NULL);
gnome_calendar_set_view (gcal, priv->current_view_type, TRUE, FALSE);
- g_signal_connect (priv->view_instance, "display_view",
- G_CALLBACK (display_view_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->view_instance), "display_view",
+ GTK_SIGNAL_FUNC (display_view_cb), gcal);
display_view_cb (priv->view_instance, gal_view_instance_get_current_view (priv->view_instance), gcal);
}
@@ -1404,10 +1434,10 @@ gnome_calendar_discard_view_menus (GnomeCalendar *gcal)
g_assert (priv->view_instance != NULL);
g_assert (priv->view_menus != NULL);
- g_object_unref (priv->view_instance);
+ gtk_object_unref (GTK_OBJECT (priv->view_instance));
priv->view_instance = NULL;
- g_object_unref (priv->view_menus);
+ gtk_object_unref (GTK_OBJECT (priv->view_menus));
priv->view_menus = NULL;
}
@@ -1457,10 +1487,10 @@ gnome_calendar_set_pane_positions (GnomeCalendar *gcal)
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
if (priv->current_view_type == GNOME_CAL_MONTH_VIEW && !priv->range_selected) {
right_pane_width = priv->hpane_pos_month_view;
@@ -1483,8 +1513,8 @@ gnome_calendar_set_pane_positions (GnomeCalendar *gcal)
top_pane_height = (top_pane_height * (row_height + top_border + bottom_border)
+ 0.5);
- gtk_paned_set_position (GTK_PANED (priv->hpane), -1);
- gtk_paned_set_position (GTK_PANED (priv->vpane), -1);
+ e_paned_set_position (E_PANED (priv->hpane), -1);
+ e_paned_set_position (E_PANED (priv->vpane), -1);
/* We add one to each dimension since we can't use 0. */
@@ -1751,26 +1781,19 @@ backend_died_cb (CalClient *client, gpointer data)
priv = gcal->priv;
uristr = get_uri_without_password (cal_client_get_uri (priv->client));
+
if (client == priv->client) {
message = g_strdup_printf (_("The calendar backend for\n%s\n has crashed. "
"You will have to restart Evolution in order "
"to use it again"),
uristr);
- e_day_view_set_status_message (E_DAY_VIEW (priv->day_view), NULL);
- e_day_view_set_status_message (E_DAY_VIEW (priv->work_week_view), NULL);
- e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), NULL);
- e_week_view_set_status_message (E_WEEK_VIEW (priv->month_view), NULL);
} else if (client == priv->task_pad_client) {
message = g_strdup_printf (_("The task backend for\n%s\n has crashed. "
"You will have to restart Evolution in order "
"to use it again"),
uristr);
- calendar_model_set_status_message (
- e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), NULL);
- } else {
- message = NULL;
+ } else
g_assert_not_reached ();
- }
gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
g_free (message);
@@ -1796,14 +1819,14 @@ gnome_calendar_construct (GnomeCalendar *gcal)
if (!priv->client)
return NULL;
- g_signal_connect (priv->client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "cal_opened",
+ GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "backend_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), gcal);
e_day_view_set_cal_client (E_DAY_VIEW (priv->day_view),
priv->client);
@@ -1821,14 +1844,14 @@ gnome_calendar_construct (GnomeCalendar *gcal)
if (!priv->task_pad_client)
return NULL;
- g_signal_connect (priv->task_pad_client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->task_pad_client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "cal_opened",
+ GTK_SIGNAL_FUNC (client_cal_opened_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "backend_error",
+ GTK_SIGNAL_FUNC (backend_error_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "categories_changed",
+ GTK_SIGNAL_FUNC (client_categories_changed_cb), gcal);
+ gtk_signal_connect (GTK_OBJECT (priv->task_pad_client), "backend_died",
+ GTK_SIGNAL_FUNC (backend_died_cb), gcal);
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
g_assert (model != NULL);
@@ -1850,11 +1873,11 @@ gnome_calendar_new (void)
{
GnomeCalendar *gcal;
- gcal = g_object_new (gnome_calendar_get_type (), NULL);
+ gcal = gtk_type_new (gnome_calendar_get_type ());
if (!gnome_calendar_construct (gcal)) {
g_message ("gnome_calendar_new(): Could not construct the calendar GUI");
- g_object_unref (gcal);
+ gtk_object_unref (GTK_OBJECT (gcal));
return NULL;
}
@@ -1924,7 +1947,7 @@ add_alarms (const char *uri)
/* Activate the alarm notification service */
CORBA_exception_init (&ev);
- an = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
+ an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
if (BONOBO_EX (&ev)) {
g_warning ("add_alarms(): Could not activate the alarm notification service: %s",
@@ -1969,7 +1992,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
EUri *uri;
char *message;
char *real_uri;
- char *urinopwd;
+ char *uri_nopwd;
g_return_val_if_fail (gcal != NULL, FALSE);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
@@ -1991,14 +2014,14 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
else
real_uri = g_strdup (str_uri);
- urinopwd = get_uri_without_password (real_uri);
- message = g_strdup_printf (_("Opening calendar at %s"), urinopwd);
- g_free (urinopwd);
+ uri_nopwd = get_uri_without_password (real_uri);
+ message = g_strdup_printf (_("Opening calendar at %s"), uri_nopwd);
+ g_free (uri_nopwd);
e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), message);
g_free (message);
if (!cal_client_open_calendar (priv->client, real_uri, FALSE)) {
- g_message ("gnome_calendar_open(): Could not issue the request to open the calendar folder");
+ g_message ("gnome_calendar_open(): Could not issue the request");
g_free (real_uri);
e_uri_free (uri);
e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), NULL);
@@ -2041,7 +2064,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri)
e_uri_free (uri);
if (!success) {
- g_message ("gnome_calendar_open(): Could not issue the request to open the tasks folder");
+ g_message ("gnome_calendar_open(): Could not issue the request");
calendar_model_set_status_message (
e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), NULL);
return FALSE;
@@ -2084,9 +2107,9 @@ gnome_calendar_update_config_settings (GnomeCalendar *gcal,
week_start_day = (week_start_day + 6) % 7;
e_day_view_set_week_start_day (E_DAY_VIEW (priv->day_view),
- week_start_day);
+ week_start_day);
e_day_view_set_week_start_day (E_DAY_VIEW (priv->work_week_view),
- week_start_day);
+ week_start_day);
e_week_view_set_week_start_day (E_WEEK_VIEW (priv->week_view),
week_start_day);
e_week_view_set_week_start_day (E_WEEK_VIEW (priv->month_view),
@@ -2324,7 +2347,7 @@ gnome_calendar_new_appointment_for (GnomeCalendar *cal,
cal_component_commit_sequence (comp);
gnome_calendar_edit_object (cal, comp, meeting);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/**
@@ -2374,7 +2397,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal)
cal_component_set_categories (comp, category);
comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
comp_editor_focus (COMP_EDITOR (tedit));
}
@@ -2650,10 +2673,10 @@ gnome_calendar_update_paned_quanta (GnomeCalendar *gcal)
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
/* The EPaned quantum feature works better if we add on the calendar
borders to the quantum size. Otherwise if you shrink the date
@@ -2667,9 +2690,13 @@ gnome_calendar_update_paned_quanta (GnomeCalendar *gcal)
months as will fit. But for that to work nicely the EPaned should
resize the widgets as the bar is dragged. Otherwise the user has
to mess around to get the number of months that they want. */
-#if 0
- g_object_set (G_OBJECT (priv->hpane), "quantum", (guint) col_width, NULL);
- g_object_set (G_OBJECT (priv->vpane), "quantum", (guint) row_height, NULL);
+#if 1
+ gtk_object_set (GTK_OBJECT (priv->hpane),
+ "quantum", (guint) col_width,
+ NULL);
+ gtk_object_set (GTK_OBJECT (priv->vpane),
+ "quantum", (guint) row_height,
+ NULL);
#endif
gnome_calendar_set_pane_positions (gcal);
@@ -2693,10 +2720,10 @@ gnome_calendar_on_date_navigator_size_allocate (GtkWidget *widget,
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- g_object_get (G_OBJECT (priv->date_navigator->calitem),
- "row_height", &row_height,
- "column_width", &col_width,
- NULL);
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
+ "row_height", &row_height,
+ "column_width", &col_width,
+ NULL);
/* We subtract one from each dimension since we added 1 in
set_view(). */
diff --git a/calendar/gui/itip-control-factory.c b/calendar/gui/itip-control-factory.c
new file mode 100644
index 0000000000..a6fb081b47
--- /dev/null
+++ b/calendar/gui/itip-control-factory.c
@@ -0,0 +1,282 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* Evolution calendar - Control for displaying iTIP mail messages
+ *
+ * Copyright (C) 2000 Ximian, Inc.
+ * Copyright (C) 2000 Ximian, Inc.
+ *
+ * Author: Jesse Pavel <jpavel@ximian.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <gtk/gtkobject.h>
+#include <gtk/gtkwidget.h>
+#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-property-bag.h>
+#include <bonobo/bonobo-persist-stream.h>
+#include <bonobo/bonobo-stream-client.h>
+#include <bonobo/bonobo-context.h>
+#include <bonobo/bonobo-exception.h>
+#include <ical.h>
+
+#include "e-itip-control.h"
+#include "itip-control-factory.h"
+
+extern gchar *evolution_dir;
+
+enum E_ITIP_BONOBO_ARGS {
+ FROM_ADDRESS_ARG_ID,
+ VIEW_ONLY_ARG_ID
+};
+
+/*
+ * Bonobo::PersistStream
+ *
+ * These two functions implement the Bonobo::PersistStream load and
+ * save methods which allow data to be loaded into and out of the
+ * BonoboObject.
+ */
+
+static char *
+stream_read (Bonobo_Stream stream)
+{
+ Bonobo_Stream_iobuf *buffer;
+ CORBA_Environment ev;
+ gchar *data = NULL;
+ gint length = 0;
+
+ CORBA_exception_init (&ev);
+ do {
+#define READ_CHUNK_SIZE 65536
+ Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
+ &buffer, &ev);
+
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ if (buffer->_length <= 0)
+ break;
+
+ data = g_realloc (data, length + buffer->_length + 1);
+ memcpy (data + length, buffer->_buffer, buffer->_length);
+ length += buffer->_length;
+ data[length] = '\0';
+
+ CORBA_free (buffer);
+#undef READ_CHUNK_SIZE
+ } while (1);
+
+ CORBA_free (buffer);
+ CORBA_exception_free (&ev);
+
+ if (data == NULL)
+ data = g_strdup("");
+
+ return data;
+} /* stream_read */
+
+/*
+ * This function implements the Bonobo::PersistStream:load method.
+ */
+typedef struct {
+ EItipControl *itip;
+ char *text;
+} idle_data;
+
+static gboolean
+set_data_idle_cb (gpointer data)
+{
+ idle_data *id = data;
+
+ e_itip_control_set_data (id->itip, id->text);
+ gtk_object_unref (GTK_OBJECT (id->itip));
+ g_free (id->text);
+ g_free (id);
+
+ return FALSE;
+}
+
+static void
+pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
+ Bonobo_Persist_ContentType type, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ idle_data *id;
+
+ if (type && g_strcasecmp (type, "text/calendar") != 0 &&
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
+ return;
+ }
+
+ id = g_new0 (idle_data, 1);
+ if ((id->text = stream_read (stream)) == NULL) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
+ g_free (id);
+ return;
+ }
+ gtk_object_ref (GTK_OBJECT (itip));
+ id->itip = itip;
+
+ g_idle_add (set_data_idle_cb, id);
+}
+/*
+ * This function implements the Bonobo::PersistStream:save method.
+ */
+static void
+pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
+ Bonobo_Persist_ContentType type, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ gchar *text;
+ gint len;
+
+ if (type && g_strcasecmp (type, "text/calendar") != 0 &&
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
+ return;
+ }
+
+ text = e_itip_control_get_data (itip);
+ len = e_itip_control_get_data_size (itip);
+
+ bonobo_stream_client_write (stream, text, len, ev);
+ g_free (text);
+} /* pstream_save */
+
+static CORBA_long
+pstream_get_max_size (BonoboPersistStream *ps, void *data,
+ CORBA_Environment *ev)
+{
+ EItipControl *itip = data;
+ gint len;
+
+ len = e_itip_control_get_data_size (itip);
+
+ if (len > 0)
+ return len;
+
+ return 0L;
+}
+
+static Bonobo_Persist_ContentTypeList *
+pstream_get_content_types (BonoboPersistStream *ps, void *closure,
+ CORBA_Environment *ev)
+{
+ return bonobo_persist_generate_content_types (2, "text/calendar", "text/x-calendar");
+}
+
+static void
+get_prop (BonoboPropertyBag *bag,
+ BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EItipControl *itip = user_data;
+
+ switch (arg_id) {
+ case FROM_ADDRESS_ARG_ID:
+ BONOBO_ARG_SET_STRING (arg, e_itip_control_get_from_address (itip));
+ break;
+ case VIEW_ONLY_ARG_ID:
+ BONOBO_ARG_SET_BOOLEAN (arg, e_itip_control_get_view_only (itip));
+ break;
+ }
+}
+
+static void
+set_prop ( BonoboPropertyBag *bag,
+ const BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ EItipControl *itip = user_data;
+
+ switch (arg_id) {
+ case FROM_ADDRESS_ARG_ID:
+ e_itip_control_set_from_address (itip, BONOBO_ARG_GET_STRING (arg));
+ break;
+ case VIEW_ONLY_ARG_ID:
+ e_itip_control_set_view_only (itip, BONOBO_ARG_GET_BOOLEAN (arg));
+ break;
+ }
+}
+
+
+static BonoboObject *
+itip_control_factory (BonoboGenericFactory *Factory, void *closure)
+{
+ BonoboControl *control;
+ BonoboPropertyBag *prop_bag;
+ BonoboPersistStream *stream;
+ GtkWidget *itip;
+
+ itip = e_itip_control_new ();
+ gtk_widget_show (itip);
+ control = bonobo_control_new (itip);
+
+ /* create a property bag */
+ prop_bag = bonobo_property_bag_new (get_prop, set_prop, itip);
+ bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL,
+ "from_address", 0 );
+ bonobo_property_bag_add (prop_bag, "view_only", VIEW_ONLY_ARG_ID, BONOBO_ARG_BOOLEAN, NULL,
+ "view_only", 0 );
+
+ bonobo_control_set_properties (control, prop_bag);
+ bonobo_object_unref (BONOBO_OBJECT (prop_bag));
+
+ bonobo_control_set_automerge (control, TRUE);
+
+ stream = bonobo_persist_stream_new (pstream_load, pstream_save,
+ pstream_get_max_size,
+ pstream_get_content_types,
+ itip);
+
+ if (stream == NULL) {
+ bonobo_object_unref (BONOBO_OBJECT (control));
+ return NULL;
+ }
+
+ bonobo_object_add_interface (BONOBO_OBJECT (control),
+ BONOBO_OBJECT (stream));
+
+ return BONOBO_OBJECT (control);
+}
+
+void
+itip_control_factory_init (void)
+{
+ static BonoboGenericFactory *factory = NULL;
+
+ if (factory != NULL)
+ return;
+
+ factory = bonobo_generic_factory_new (
+ "OAFIID:GNOME_Evolution_Calendar_iTip_ControlFactory",
+ itip_control_factory, NULL);
+ bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));;
+
+ if (factory == NULL)
+ g_error ("I could not register an iTip control factory.");
+}
+
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index be94e9fe87..7deb5568f5 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -26,15 +26,20 @@
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-object.h>
+#include <bonobo/bonobo-object-client.h>
#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo-conf/bonobo-config-database.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtkwidget.h>
+#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include <gal/util/e-util.h>
#include <ical.h>
#include <Evolution-Composer.h>
-#include <e-util/e-dialog-utils.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-config-listener.h>
#include <cal-util/timeutil.h>
#include <cal-util/cal-util.h>
#include "calendar-config.h"
@@ -64,49 +69,130 @@ static icalproperty_method itip_methods_enum[] = {
ICAL_METHOD_DECLINECOUNTER,
};
-static EAccountList *accounts = NULL;
+static EConfigListener *config = NULL;
-EAccountList *
+static ItipAddress *
+get_address (long num)
+{
+ ItipAddress *a;
+ gchar *path;
+
+ a = g_new0 (ItipAddress, 1);
+
+ /* get the identity info */
+ path = g_strdup_printf ("/Mail/Accounts/identity_name_%ld", num);
+ a->name = e_config_listener_get_string_with_default (config, path, NULL, NULL);
+ g_free (path);
+
+ path = g_strdup_printf ("/Mail/Accounts/identity_address_%ld", num);
+ a->address = e_config_listener_get_string_with_default (config, path, NULL, NULL);
+ a->address = g_strstrip (a->address);
+ g_free (path);
+
+ a->full = g_strdup_printf ("%s <%s>", a->name, a->address);
+
+ return a;
+}
+
+GList *
itip_addresses_get (void)
{
- if (accounts == NULL)
- accounts = e_account_list_new(gconf_client_get_default());
+ GList *addresses = NULL;
+ glong len, def, i;
- return accounts;
+ if (config == NULL)
+ config = e_config_listener_new ();
+
+ len = e_config_listener_get_long_with_default (config, "/Mail/Accounts/num", 0, NULL);
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
+
+ for (i = 0; i < len; i++) {
+ ItipAddress *a;
+
+ a = get_address (i);
+ if (i == def)
+ a->default_address = TRUE;
+
+ addresses = g_list_append (addresses, a);
+ }
+
+ return addresses;
}
-EAccount *
+ItipAddress *
itip_addresses_get_default (void)
{
- return (EAccount *)e_account_list_get_default(itip_addresses_get());
+ ItipAddress *a;
+ glong def;
+
+ if (config == NULL)
+ config = e_config_listener_new ();
+
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
+
+ a = get_address (def);
+ a->default_address = TRUE;
+
+ return a;
+}
+
+void
+itip_address_free (ItipAddress *address)
+{
+ g_free (address->name);
+ g_free (address->address);
+ g_free (address->full);
+ g_free (address);
+}
+
+void
+itip_addresses_free (GList *addresses)
+{
+ GList *l;
+
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+ itip_address_free (a);
+ }
+ g_list_free (addresses);
}
gboolean
itip_organizer_is_user (CalComponent *comp, CalClient *client)
{
CalComponentOrganizer organizer;
+ GList *addresses, *l;
const char *strip;
gboolean user_org = FALSE;
-
+
if (!cal_component_has_organizer (comp))
return FALSE;
cal_component_get_organizer (comp, &organizer);
if (organizer.value != NULL) {
- strip = itip_strip_mailto (organizer.value);
-
- if (cal_client_get_static_capability (client, "organizer-not-email-address")) {
- const char *email;
-
- email = cal_client_get_cal_address (client);
- if (email && !g_strcasecmp (email, strip))
- return TRUE;
-
- return FALSE;
- }
-
- user_org = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
+ strip = itip_strip_mailto (organizer.value);
+
+ if (cal_client_get_static_capability (client, "organizer-not-email-address")) {
+ const char *email;
+
+ email = cal_client_get_cal_address (client);
+ if (email && !g_strcasecmp (email, strip))
+ return TRUE;
+
+ return FALSE;
+ }
+
+ addresses = itip_addresses_get ();
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, strip)) {
+ user_org = TRUE;
+ break;
+ }
+ }
+ itip_addresses_free (addresses);
}
return user_org;
@@ -116,6 +202,7 @@ gboolean
itip_sentby_is_user (CalComponent *comp)
{
CalComponentOrganizer organizer;
+ GList *addresses, *l;
const char *strip;
gboolean user_sentby = FALSE;
@@ -125,7 +212,17 @@ itip_sentby_is_user (CalComponent *comp)
cal_component_get_organizer (comp, &organizer);
if (organizer.sentby != NULL) {
strip = itip_strip_mailto (organizer.sentby);
- user_sentby = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
+
+ addresses = itip_addresses_get ();
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, strip)) {
+ user_sentby = TRUE;
+ break;
+ }
+ }
+ itip_addresses_free (addresses);
}
return user_sentby;
@@ -258,7 +355,7 @@ comp_from (CalComponentItipMethod method, CalComponent *comp)
case CAL_COMPONENT_METHOD_ADD:
cal_component_get_organizer (comp, &organizer);
if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer must be set."));
return NULL;
}
@@ -293,7 +390,7 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
cal_component_get_attendee_list (comp, &attendees);
len = g_slist_length (attendees);
if (len <= 0) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("At least one attendee is necessary"));
cal_component_free_attendee_list (attendees);
return NULL;
@@ -303,22 +400,13 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
to_list->_maximum = len;
to_list->_length = 0;
to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (len);
-
- cal_component_get_organizer (comp, &organizer);
- if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("An organizer must be set."));
- return NULL;
- }
-
+
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *att = l->data;
if (users_has_attendee (users, att->value))
continue;
- else if (!g_strcasecmp (att->value, organizer.value))
- continue;
-
+
recipient = &(to_list->_buffer[to_list->_length]);
if (att->cn)
recipient->name = CORBA_string_dup (att->cn);
@@ -338,7 +426,7 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp, GList *users)
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
cal_component_get_organizer (comp, &organizer);
if (organizer.value == NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer must be set."));
return NULL;
}
@@ -382,15 +470,15 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
else {
switch (cal_component_get_vtype (comp)) {
case CAL_COMPONENT_EVENT:
- description = _("Event information");
+ description = U_("Event information");
case CAL_COMPONENT_TODO:
- description = _("Task information");
+ description = U_("Task information");
case CAL_COMPONENT_JOURNAL:
- description = _("Journal information");
+ description = U_("Journal information");
case CAL_COMPONENT_FREEBUSY:
- description = _("Free/Busy information");
+ description = U_("Free/Busy information");
default:
- description = _("Calendar information");
+ description = U_("Calendar information");
}
}
@@ -410,13 +498,13 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
switch (a->status) {
case ICAL_PARTSTAT_ACCEPTED:
- prefix = _("Accepted");
+ prefix = U_("Accepted");
break;
case ICAL_PARTSTAT_TENTATIVE:
- prefix = _("Tentatively Accepted");
+ prefix = U_("Tentatively Accepted");
break;
case ICAL_PARTSTAT_DECLINED:
- prefix = _("Declined");
+ prefix = U_("Declined");
break;
default:
break;
@@ -426,23 +514,23 @@ comp_subject (CalComponentItipMethod method, CalComponent *comp)
break;
case CAL_COMPONENT_METHOD_ADD:
- prefix = _("Updated");
+ prefix = U_("Updated");
break;
case CAL_COMPONENT_METHOD_CANCEL:
- prefix = _("Cancel");
+ prefix = U_("Cancel");
break;
case CAL_COMPONENT_METHOD_REFRESH:
- prefix = _("Refresh");
+ prefix = U_("Refresh");
break;
case CAL_COMPONENT_METHOD_COUNTER:
- prefix = _("Counter-proposal");
+ prefix = U_("Counter-proposal");
break;
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
- prefix = _("Declined");
+ prefix = U_("Declined");
break;
default:
@@ -491,11 +579,11 @@ comp_description (CalComponent *comp)
switch (cal_component_get_vtype (comp)) {
case CAL_COMPONENT_EVENT:
- return CORBA_string_dup (_("Event information"));
+ return CORBA_string_dup (U_("Event information"));
case CAL_COMPONENT_TODO:
- return CORBA_string_dup (_("Task information"));
+ return CORBA_string_dup (U_("Task information"));
case CAL_COMPONENT_JOURNAL:
- return CORBA_string_dup (_("Journal information"));
+ return CORBA_string_dup (U_("Journal information"));
case CAL_COMPONENT_FREEBUSY:
cal_component_get_dtstart (comp, &dt);
if (dt.value)
@@ -510,18 +598,18 @@ comp_description (CalComponent *comp)
if (start != NULL && end != NULL) {
char *tmp, *tmp_utf;
tmp = g_strdup_printf (_("Free/Busy information (%s to %s)"), start, end);
- tmp_utf = g_locale_to_utf8 (tmp, -1, NULL, NULL, NULL);
+ tmp_utf = e_utf8_from_locale_string (tmp);
description = CORBA_string_dup (tmp_utf);
g_free (tmp_utf);
g_free (tmp);
} else {
- description = CORBA_string_dup (_("Free/Busy information"));
+ description = CORBA_string_dup (U_("Free/Busy information"));
}
g_free (start);
g_free (end);
return description;
default:
- return CORBA_string_dup (_("iCalendar information"));
+ return CORBA_string_dup (U_("iCalendar information"));
}
}
@@ -547,7 +635,7 @@ comp_server_send (CalComponentItipMethod method, CalComponent *comp, CalClient *
retval = TRUE;
} else if (result == CAL_CLIENT_SEND_BUSY) {
- e_notice (NULL, GTK_MESSAGE_ERROR, error_msg);
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, error_msg);
retval = FALSE;
}
@@ -561,11 +649,13 @@ static gboolean
comp_limit_attendees (CalComponent *comp)
{
icalcomponent *icomp;
+ GList *addresses;
icalproperty *prop;
gboolean found = FALSE, match = FALSE;
GSList *l, *list = NULL;
icomp = cal_component_get_icalcomponent (comp);
+ addresses = itip_addresses_get ();
for (prop = icalcomponent_get_first_property (icomp, ICAL_ATTENDEE_PROPERTY);
prop != NULL;
@@ -574,6 +664,7 @@ comp_limit_attendees (CalComponent *comp)
icalvalue *value;
const char *attendee;
char *text;
+ GList *l;
/* If we've already found something, just erase the rest */
if (found) {
@@ -589,7 +680,12 @@ comp_limit_attendees (CalComponent *comp)
text = g_strdup (itip_strip_mailto (attendee));
text = g_strstrip (text);
- found = match = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, text) != NULL;
+ for (l = addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!g_strcasecmp (a->address, text))
+ found = match = TRUE;
+ }
g_free (text);
if (!match)
@@ -605,6 +701,8 @@ comp_limit_attendees (CalComponent *comp)
}
g_slist_free (list);
+ itip_addresses_free (addresses);
+
return found;
}
@@ -615,25 +713,25 @@ comp_sentby (CalComponent *comp, CalClient *client)
cal_component_get_organizer (comp, &organizer);
if (!organizer.value) {
- EAccount *a = itip_addresses_get_default ();
+ ItipAddress *a = itip_addresses_get_default ();
- organizer.value = g_strdup_printf ("MAILTO:%s", a->id->address);
+ organizer.value = g_strdup_printf ("MAILTO:%s", a->address);
organizer.sentby = NULL;
- organizer.cn = a->id->name;
+ organizer.cn = a->name;
organizer.language = NULL;
cal_component_set_organizer (comp, &organizer);
g_free ((char *) organizer.value);
- g_object_unref(a);
+ itip_address_free (a);
return;
}
if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp)) {
- EAccount *a = itip_addresses_get_default ();
+ ItipAddress *a = itip_addresses_get_default ();
organizer.value = g_strdup (organizer.value);
- organizer.sentby = g_strdup_printf ("MAILTO:%s", a->id->address);
+ organizer.sentby = g_strdup_printf ("MAILTO:%s", a->address);
organizer.cn = g_strdup (organizer.cn);
organizer.language = g_strdup (organizer.language);
@@ -643,7 +741,7 @@ comp_sentby (CalComponent *comp, CalClient *client)
g_free ((char *)organizer.sentby);
g_free ((char *)organizer.cn);
g_free ((char *)organizer.language);
- g_object_unref(a);
+ itip_address_free (a);
}
}
static CalComponent *
@@ -668,7 +766,7 @@ comp_minimal (CalComponent *comp, gboolean attendee)
cal_component_set_attendee_list (clone, attendees);
if (!comp_limit_attendees (clone)) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("You must be an attendee of the event."));
goto error;
}
@@ -719,7 +817,7 @@ comp_minimal (CalComponent *comp, gboolean attendee)
return clone;
error:
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
return NULL;
}
@@ -804,7 +902,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp, CalClient *cl
case CAL_COMPONENT_METHOD_REFRESH:
/* Need to remove almost everything */
temp_clone = comp_minimal (clone, TRUE);
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
clone = temp_clone;
break;
case CAL_COMPONENT_METHOD_COUNTER:
@@ -812,7 +910,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp, CalClient *cl
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
/* Need to remove almost everything */
temp_clone = comp_minimal (clone, FALSE);
- g_object_unref (clone);
+ gtk_object_unref (GTK_OBJECT (clone));
clone = temp_clone;
break;
default:
@@ -826,7 +924,8 @@ gboolean
itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CalClient *client, icalcomponent *zones)
{
- CORBA_Object *composer_server;
+ BonoboObjectClient *bonobo_server;
+ GNOME_Evolution_Composer composer_server;
CalComponent *comp = NULL;
icalcomponent *top_level = NULL;
GList *users;
@@ -843,12 +942,9 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CORBA_exception_init (&ev);
/* Obtain an object reference for the Composer. */
- composer_server = bonobo_activation_activate_from_id (GNOME_EVOLUTION_COMPOSER_OAFIID, 0, NULL, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Could not activate composer: %s", bonobo_exception_get_text (&ev));
- CORBA_exception_free (&ev);
- return FALSE;
- }
+ bonobo_server = bonobo_object_activate (GNOME_EVOLUTION_COMPOSER_OAFIID, 0);
+ g_return_val_if_fail (bonobo_server != NULL, FALSE);
+ composer_server = BONOBO_OBJREF (bonobo_server);
/* Give the server a chance to manipulate the comp */
if (method != CAL_COMPONENT_METHOD_PUBLISH) {
@@ -884,9 +980,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
/* Set recipients, subject */
GNOME_Evolution_Composer_setHeaders (composer_server, from, to_list, cc_list, bcc_list, subject, &ev);
- if (BONOBO_EX (&ev)) {
- g_warning ("Unable to set composer headers while sending iTip message: %s",
- bonobo_exception_get_text (&ev));
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Unable to set composer headers while sending iTip message");
goto cleanup;
}
@@ -950,7 +1045,7 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp,
CORBA_exception_free (&ev);
if (comp != NULL)
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
if (top_level != NULL)
icalcomponent_free (top_level);
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
index c73f11673c..e4826d6a56 100644
--- a/calendar/gui/itip-utils.h
+++ b/calendar/gui/itip-utils.h
@@ -7,7 +7,6 @@
#include <glib.h>
#include <cal-client/cal-client.h>
#include <cal-util/cal-component.h>
-#include <e-util/e-account-list.h>
typedef enum {
CAL_COMPONENT_METHOD_PUBLISH,
@@ -20,8 +19,18 @@ typedef enum {
CAL_COMPONENT_METHOD_DECLINECOUNTER
} CalComponentItipMethod;
-EAccountList *itip_addresses_get (void);
-EAccount *itip_addresses_get_default (void);
+typedef struct {
+ gchar *name;
+ gchar *address;
+ gchar *full;
+
+ gboolean default_address;
+} ItipAddress;
+
+GList *itip_addresses_get (void);
+ItipAddress *itip_addresses_get_default (void);
+void itip_address_free (ItipAddress *address);
+void itip_addresses_free (GList *addresses);
gboolean itip_organizer_is_user (CalComponent *comp, CalClient *client);
gboolean itip_sentby_is_user (CalComponent *comp);
diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c
index e286442a89..950b2d7320 100644
--- a/calendar/gui/misc.c
+++ b/calendar/gui/misc.c
@@ -77,4 +77,4 @@ get_uri_without_password (const char *full_uri)
e_uri_free (uri);
return uristr;
- }
+}
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index d11df6d076..9e67b47895 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -21,11 +21,9 @@
*/
#include <config.h>
-#include <string.h>
-#include <unistd.h>
+#include <gtk/gtksignal.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-moniker-util.h>
-#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs.h>
#include "e-util/e-dbhash.h"
#include "cal-util/cal-recur.h"
@@ -35,11 +33,23 @@
+/* A category that exists in some of the objects of the calendar */
+typedef struct {
+ /* Category name, also used as the key in the categories hash table */
+ char *name;
+
+ /* Number of objects that have this category */
+ int refcount;
+} Category;
+
/* Private part of the CalBackendFile structure */
struct _CalBackendFilePrivate {
/* URI where the calendar data is stored */
char *uri;
+ /* List of Cal objects with their listeners */
+ GList *clients;
+
/* Toplevel VCALENDAR component */
icalcomponent *icalcomp;
@@ -59,8 +69,12 @@ struct _CalBackendFilePrivate {
GList *todos;
GList *journals;
+ /* Hash table of live categories, and a temporary hash of removed categories */
+ GHashTable *categories;
+ GHashTable *removed_categories;
+
/* Config database handle for free/busy organizer information */
- EConfigListener *config_listener;
+ Bonobo_ConfigDatabase db;
/* Idle handler for saving the calendar when it is dirty */
guint idle_id;
@@ -73,9 +87,8 @@ struct _CalBackendFilePrivate {
static void cal_backend_file_class_init (CalBackendFileClass *class);
-static void cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class);
-static void cal_backend_file_dispose (GObject *object);
-static void cal_backend_file_finalize (GObject *object);
+static void cal_backend_file_init (CalBackendFile *cbfile);
+static void cal_backend_file_destroy (GtkObject *object);
static const char *cal_backend_file_get_uri (CalBackend *backend);
static gboolean cal_backend_file_is_read_only (CalBackend *backend);
@@ -96,6 +109,7 @@ static void cal_backend_file_set_mode (CalBackend *backend, CalMode mode);
static int cal_backend_file_get_n_objects (CalBackend *backend, CalObjType type);
static char *cal_backend_file_get_default_object (CalBackend *backend, CalObjType type);
+static char *cal_backend_file_get_object (CalBackend *backend, const char *uid);
static CalComponent *cal_backend_file_get_object_component (CalBackend *backend, const char *uid);
static char *cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid);
static GList *cal_backend_file_get_uids (CalBackend *backend, CalObjType type);
@@ -127,6 +141,9 @@ static icaltimezone* cal_backend_file_get_default_timezone (CalBackend *backend)
static gboolean cal_backend_file_set_default_timezone (CalBackend *backend,
const char *tzid);
+static void notify_categories_changed (CalBackendFile *cbfile);
+static void notify_error (CalBackendFile *cbfile, const char *message);
+
static CalBackendClass *parent_class;
@@ -140,24 +157,24 @@ static CalBackendClass *parent_class;
*
* Return value: The type ID of the #CalBackendFile class.
**/
-GType
+GtkType
cal_backend_file_get_type (void)
{
- static GType cal_backend_file_type = 0;
+ static GtkType cal_backend_file_type = 0;
if (!cal_backend_file_type) {
- static GTypeInfo info = {
- sizeof (CalBackendFileClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_backend_file_class_init,
- NULL, NULL,
- sizeof (CalBackendFile),
- 0,
- (GInstanceInitFunc) cal_backend_file_init
- };
- cal_backend_file_type = g_type_register_static (CAL_BACKEND_TYPE,
- "CalBackendFile", &info, 0);
+ static const GtkTypeInfo cal_backend_file_info = {
+ "CalBackendFile",
+ sizeof (CalBackendFile),
+ sizeof (CalBackendFileClass),
+ (GtkClassInitFunc) cal_backend_file_class_init,
+ (GtkObjectInitFunc) cal_backend_file_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_backend_file_type = gtk_type_unique (CAL_BACKEND_TYPE, &cal_backend_file_info);
}
return cal_backend_file_type;
@@ -167,30 +184,30 @@ cal_backend_file_get_type (void)
static void
cal_backend_file_class_init (CalBackendFileClass *class)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
CalBackendClass *backend_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
backend_class = (CalBackendClass *) class;
- parent_class = (CalBackendClass *) g_type_class_peek_parent (class);
+ parent_class = gtk_type_class (CAL_BACKEND_TYPE);
- object_class->dispose = cal_backend_file_dispose;
- object_class->finalize = cal_backend_file_finalize;
+ object_class->destroy = cal_backend_file_destroy;
backend_class->get_uri = cal_backend_file_get_uri;
backend_class->is_read_only = cal_backend_file_is_read_only;
backend_class->get_cal_address = cal_backend_file_get_cal_address;
- backend_class->get_alarm_email_address = cal_backend_file_get_alarm_email_address;
- backend_class->get_ldap_attribute = cal_backend_file_get_ldap_attribute;
- backend_class->get_static_capabilities = cal_backend_file_get_static_capabilities;
+ backend_class->get_alarm_email_address = cal_backend_file_get_alarm_email_address;
+ backend_class->get_ldap_attribute = cal_backend_file_get_ldap_attribute;
+ backend_class->get_static_capabilities = cal_backend_file_get_static_capabilities;
backend_class->open = cal_backend_file_open;
backend_class->is_loaded = cal_backend_file_is_loaded;
backend_class->get_query = cal_backend_file_get_query;
backend_class->get_mode = cal_backend_file_get_mode;
backend_class->set_mode = cal_backend_file_set_mode;
backend_class->get_n_objects = cal_backend_file_get_n_objects;
- backend_class->get_default_object = cal_backend_file_get_default_object;
+ backend_class->get_default_object = cal_backend_file_get_default_object;
+ backend_class->get_object = cal_backend_file_get_object;
backend_class->get_object_component = cal_backend_file_get_object_component;
backend_class->get_timezone_object = cal_backend_file_get_timezone_object;
backend_class->get_uids = cal_backend_file_get_uids;
@@ -208,9 +225,33 @@ cal_backend_file_class_init (CalBackendFileClass *class)
backend_class->set_default_timezone = cal_backend_file_set_default_timezone;
}
+static Bonobo_ConfigDatabase
+load_db (void)
+{
+ Bonobo_ConfigDatabase db = CORBA_OBJECT_NIL;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
+
+ if (BONOBO_EX (&ev))
+ db = CORBA_OBJECT_NIL;
+
+ CORBA_exception_free (&ev);
+
+ return db;
+}
+
+static void
+cal_added_cb (CalBackend *backend, gpointer user_data)
+{
+ notify_categories_changed (CAL_BACKEND_FILE (backend));
+}
+
/* Object initialization function for the file backend */
static void
-cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class)
+cal_backend_file_init (CalBackendFile *cbfile)
{
CalBackendFilePrivate *priv;
@@ -224,10 +265,16 @@ cal_backend_file_init (CalBackendFile *cbfile, CalBackendFileClass *class)
priv->todos = NULL;
priv->journals = NULL;
+ priv->categories = g_hash_table_new (g_str_hash, g_str_equal);
+ priv->removed_categories = g_hash_table_new (g_str_hash, g_str_equal);
+
/* The timezone defaults to UTC. */
priv->default_zone = icaltimezone_get_utc_timezone ();
- priv->config_listener = e_config_listener_new ();
+ priv->db = load_db ();
+
+ gtk_signal_connect (GTK_OBJECT (cbfile), "cal_added",
+ GTK_SIGNAL_FUNC (cal_added_cb), NULL);
}
/* g_hash_table_foreach() callback to destroy a CalComponent */
@@ -237,7 +284,7 @@ free_cal_component (gpointer key, gpointer value, gpointer data)
CalComponent *comp;
comp = CAL_COMPONENT (value);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Saves the calendar data */
@@ -258,13 +305,13 @@ save (CalBackendFile *cbfile)
uri = gnome_vfs_uri_new (priv->uri);
if (!uri)
- goto error_malformed_uri;
+ goto error;
/* save calendar to backup file */
tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
if (!tmp) {
gnome_vfs_uri_unref (uri);
- goto error_malformed_uri;
+ goto error;
}
backup_uristr = g_strconcat (tmp, "~", NULL);
@@ -275,7 +322,7 @@ save (CalBackendFile *cbfile)
if (!backup_uri) {
gnome_vfs_uri_unref (uri);
- goto error_malformed_uri;
+ goto error;
}
result = gnome_vfs_create_uri (&handle, backup_uri,
@@ -305,27 +352,40 @@ save (CalBackendFile *cbfile)
goto error;
return;
-
- error_malformed_uri:
- cal_backend_notify_error (CAL_BACKEND (cbfile),
- _("Can't save calendar data: Malformed URI."));
- return;
-
+
error:
- cal_backend_notify_error (CAL_BACKEND (cbfile), gnome_vfs_result_to_string (result));
+ notify_error (cbfile, gnome_vfs_result_to_string (result));
return;
}
-/* Dispose handler for the file backend */
+/* Used from g_hash_table_foreach(), frees a Category structure */
+static void
+free_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+
+ c = value;
+ g_free (c->name);
+ g_free (c);
+}
+
+/* Destroy handler for the file backend */
static void
-cal_backend_file_dispose (GObject *object)
+cal_backend_file_destroy (GtkObject *object)
{
CalBackendFile *cbfile;
CalBackendFilePrivate *priv;
+ GList *clients;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (IS_CAL_BACKEND_FILE (object));
cbfile = CAL_BACKEND_FILE (object);
priv = cbfile->priv;
+ clients = CAL_BACKEND (cbfile)->clients;
+ g_assert (clients == NULL);
+
/* Save if necessary */
if (priv->idle_id != 0) {
@@ -334,6 +394,13 @@ cal_backend_file_dispose (GObject *object)
priv->idle_id = 0;
}
+ /* Clean up */
+
+ if (priv->uri) {
+ g_free (priv->uri);
+ priv->uri = NULL;
+ }
+
if (priv->comp_uid_hash) {
g_hash_table_foreach (priv->comp_uid_hash,
free_cal_component, NULL);
@@ -348,45 +415,27 @@ cal_backend_file_dispose (GObject *object)
priv->todos = NULL;
priv->journals = NULL;
+ g_hash_table_foreach (priv->categories, free_category_cb, NULL);
+ g_hash_table_destroy (priv->categories);
+ priv->categories = NULL;
+
+ g_hash_table_foreach (priv->removed_categories, free_category_cb, NULL);
+ g_hash_table_destroy (priv->removed_categories);
+ priv->removed_categories = NULL;
+
if (priv->icalcomp) {
icalcomponent_free (priv->icalcomp);
priv->icalcomp = NULL;
}
- if (priv->config_listener) {
- g_object_unref (priv->config_listener);
- priv->config_listener = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-/* Finalize handler for the file backend */
-static void
-cal_backend_file_finalize (GObject *object)
-{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_CAL_BACKEND_FILE (object));
-
- cbfile = CAL_BACKEND_FILE (object);
- priv = cbfile->priv;
-
- /* Clean up */
-
- if (priv->uri) {
- g_free (priv->uri);
- priv->uri = NULL;
- }
-
+ bonobo_object_release_unref (priv->db, NULL);
+ priv->db = CORBA_OBJECT_NIL;
+
g_free (priv);
cbfile->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -444,24 +493,71 @@ cal_backend_file_get_cal_address (CalBackend *backend)
}
static const char *
-cal_backend_file_get_ldap_attribute (CalBackend *backend)
+cal_backend_file_get_alarm_email_address (CalBackend *backend)
{
+ /* A file backend has no particular email address associated
+ * with it (although that would be a useful feature some day).
+ */
return NULL;
}
static const char *
-cal_backend_file_get_alarm_email_address (CalBackend *backend)
+cal_backend_file_get_ldap_attribute (CalBackend *backend)
{
- /* A file backend has no particular email address associated
- * with it (although that would be a useful feature some day).
- */
return NULL;
}
static const char *
cal_backend_file_get_static_capabilities (CalBackend *backend)
{
- return "no-email-alarms";
+ return "no-email-alarms";
+}
+
+/* Used from g_hash_table_foreach(), adds a category name to the sequence */
+static void
+add_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+ GNOME_Evolution_Calendar_StringSeq *seq;
+
+ c = value;
+ seq = data;
+
+ seq->_buffer[seq->_length] = CORBA_string_dup (c->name);
+ seq->_length++;
+}
+
+/* Notifies the clients with the current list of categories */
+static void
+notify_categories_changed (CalBackendFile *cbfile)
+{
+ CalBackendFilePrivate *priv;
+ GNOME_Evolution_Calendar_StringSeq *seq;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ /* Build the sequence of category names */
+
+ seq = GNOME_Evolution_Calendar_StringSeq__alloc ();
+ seq->_length = 0;
+ seq->_maximum = g_hash_table_size (priv->categories);
+ seq->_buffer = CORBA_sequence_CORBA_string_allocbuf (seq->_maximum);
+ CORBA_sequence_set_release (seq, TRUE);
+
+ g_hash_table_foreach (priv->categories, add_category_cb, seq);
+ g_assert (seq->_length == seq->_maximum);
+
+ /* Notify the clients */
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_categories_changed (cal, seq);
+ }
+
+ CORBA_free (seq);
}
/* Idle handler; we save the calendar since it is dirty */
@@ -526,6 +622,68 @@ check_dup_uid (CalBackendFile *cbfile, CalComponent *comp)
mark_dirty (cbfile);
}
+/* Updates the hash table of categories by adding or removing those in the
+ * component.
+ */
+static void
+update_categories_from_comp (CalBackendFile *cbfile, CalComponent *comp, gboolean add)
+{
+ CalBackendFilePrivate *priv;
+ GSList *categories, *l;
+
+ priv = cbfile->priv;
+
+ cal_component_get_categories_list (comp, &categories);
+
+ for (l = categories; l; l = l->next) {
+ const char *name;
+ Category *c;
+
+ name = l->data;
+ c = g_hash_table_lookup (priv->categories, name);
+
+ if (add) {
+ /* Add the category to the set */
+ if (c)
+ c->refcount++;
+ else {
+ /* See if it was in the removed categories */
+
+ c = g_hash_table_lookup (priv->removed_categories, name);
+ if (c) {
+ /* Move it to the set of live categories */
+ g_assert (c->refcount == 0);
+ g_hash_table_remove (priv->removed_categories, c->name);
+
+ c->refcount = 1;
+ g_hash_table_insert (priv->categories, c->name, c);
+ } else {
+ /* Create a new category */
+ c = g_new (Category, 1);
+ c->name = g_strdup (name);
+ c->refcount = 1;
+
+ g_hash_table_insert (priv->categories, c->name, c);
+ }
+ }
+ } else {
+ /* Remove the category from the set --- it *must* have existed */
+
+ g_assert (c != NULL);
+ g_assert (c->refcount > 0);
+
+ c->refcount--;
+
+ if (c->refcount == 0) {
+ g_hash_table_remove (priv->categories, c->name);
+ g_hash_table_insert (priv->removed_categories, c->name, c);
+ }
+ }
+ }
+
+ cal_component_free_categories_list (categories);
+}
+
/* Tries to add an icalcomponent to the file backend. We only store the objects
* of the types we support; all others just remain in the toplevel component so
* that we don't lose them.
@@ -536,7 +694,6 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
CalBackendFilePrivate *priv;
GList **list;
const char *uid;
- GSList *categories;
priv = cbfile->priv;
@@ -579,9 +736,8 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
}
/* Update the set of categories */
- cal_component_get_categories_list (comp, &categories);
- cal_backend_ref_categories (CAL_BACKEND (cbfile), categories);
- cal_component_free_categories_list (categories);
+
+ update_categories_from_comp (cbfile, comp, TRUE);
}
/* Removes a component from the backend's hash and lists. Does not perform
@@ -595,7 +751,6 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
icalcomponent *icalcomp;
const char *uid;
GList **list, *l;
- GSList *categories;
priv = cbfile->priv;
@@ -637,11 +792,10 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
g_list_free_1 (l);
/* Update the set of categories */
- cal_component_get_categories_list (comp, &categories);
- cal_backend_unref_categories (CAL_BACKEND (cbfile), categories);
- cal_component_free_categories_list (categories);
- g_object_unref (comp);
+ update_categories_from_comp (cbfile, comp, FALSE);
+
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Scans the toplevel VCALENDAR component and stores the objects it finds */
@@ -680,19 +834,53 @@ scan_vcalendar (CalBackendFile *cbfile)
}
}
+/* Callback used from icalparser_parse() */
+static char *
+get_line_fn (char *s, size_t size, void *data)
+{
+ FILE *file;
+
+ file = data;
+ return fgets (s, size, file);
+}
+
+/* Parses an open iCalendar file and returns a toplevel component with the contents */
+static icalcomponent *
+parse_file (FILE *file)
+{
+ icalparser *parser;
+ icalcomponent *icalcomp;
+
+ parser = icalparser_new ();
+ icalparser_set_gen_data (parser, file);
+
+ icalcomp = icalparser_parse (parser, get_line_fn);
+ icalparser_free (parser);
+
+ return icalcomp;
+}
+
/* Parses an open iCalendar file and loads it into the backend */
static CalBackendOpenStatus
-open_cal (CalBackendFile *cbfile, const char *uristr)
+open_cal (CalBackendFile *cbfile, const char *uristr, FILE *file)
{
CalBackendFilePrivate *priv;
icalcomponent *icalcomp;
priv = cbfile->priv;
- icalcomp = cal_util_parse_ics_file (uristr);
- if (!icalcomp)
+ icalcomp = parse_file (file);
+
+ if (fclose (file) != 0) {
+ if (icalcomp)
+ icalcomponent_free (icalcomp);
+
return CAL_BACKEND_OPEN_ERROR;
+ }
+ if (!icalcomp)
+ return CAL_BACKEND_OPEN_ERROR;
+
/* FIXME: should we try to demangle XROOT components and
* individual components as well?
*/
@@ -738,6 +926,7 @@ cal_backend_file_open (CalBackend *backend, const char *uristr, gboolean only_if
{
CalBackendFile *cbfile;
CalBackendFilePrivate *priv;
+ FILE *file;
char *str_uri;
GnomeVFSURI *uri;
CalBackendOpenStatus status;
@@ -772,8 +961,11 @@ cal_backend_file_open (CalBackend *backend, const char *uristr, gboolean only_if
return CAL_BACKEND_OPEN_ERROR;
}
- if (access (str_uri, R_OK) == 0)
- status = open_cal (cbfile, str_uri);
+ /* Load! */
+ file = fopen (str_uri, "r");
+
+ if (file)
+ status = open_cal (cbfile, str_uri, file);
else {
if (only_if_exists)
status = CAL_BACKEND_OPEN_NOT_FOUND;
@@ -826,13 +1018,31 @@ cal_backend_file_get_mode (CalBackend *backend)
return CAL_MODE_LOCAL;
}
+static void
+notify_mode (CalBackendFile *cbfile,
+ GNOME_Evolution_Calendar_Listener_SetModeStatus status,
+ GNOME_Evolution_Calendar_CalMode mode)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_mode (cal, status, mode);
+ }
+}
+
/* Set_mode handler for the file backend */
static void
cal_backend_file_set_mode (CalBackend *backend, CalMode mode)
{
- cal_backend_notify_mode (backend,
- GNOME_Evolution_Calendar_Listener_MODE_NOT_SUPPORTED,
- GNOME_Evolution_Calendar_MODE_LOCAL);
+ notify_mode (CAL_BACKEND_FILE (backend),
+ GNOME_Evolution_Calendar_Listener_MODE_NOT_SUPPORTED,
+ GNOME_Evolution_Calendar_MODE_LOCAL);
}
@@ -863,41 +1073,66 @@ cal_backend_file_get_n_objects (CalBackend *backend, CalObjType type)
return n;
}
+/* Get_object handler for the file backend */
static char *
cal_backend_file_get_default_object (CalBackend *backend, CalObjType type)
{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
- CalComponent *comp;
- char *calobj;
-
- cbfile = CAL_BACKEND_FILE (backend);
- priv = cbfile->priv;
-
- comp = cal_component_new ();
-
- switch (type) {
- case CALOBJ_TYPE_EVENT:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
- break;
- case CALOBJ_TYPE_TODO:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
- break;
- case CALOBJ_TYPE_JOURNAL:
- cal_component_set_new_vtype (comp, CAL_COMPONENT_JOURNAL);
- break;
- default:
- g_object_unref (comp);
- return NULL;
- }
-
- calobj = cal_component_get_as_string (comp);
- g_object_unref (comp);
-
- return calobj;
+ CalBackendFile *cbfile;
+ CalBackendFilePrivate *priv;
+ CalComponent *comp;
+ char *calobj;
+
+ cbfile = CAL_BACKEND_FILE (backend);
+ priv = cbfile->priv;
+
+ comp = cal_component_new ();
+
+ switch (type) {
+ case CALOBJ_TYPE_EVENT:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
+ break;
+ case CALOBJ_TYPE_TODO:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
+ break;
+ case CALOBJ_TYPE_JOURNAL:
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_JOURNAL);
+ break;
+ default:
+ gtk_object_unref (GTK_OBJECT (comp));
+ return NULL;
+ }
+
+ calobj = cal_component_get_as_string (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
+
+ return calobj;
}
-/* Get_object_component handler for the file backend */
+/* Get_object handler for the file backend */
+static char *
+cal_backend_file_get_object (CalBackend *backend, const char *uid)
+{
+ CalBackendFile *cbfile;
+ CalBackendFilePrivate *priv;
+ CalComponent *comp;
+
+ cbfile = CAL_BACKEND_FILE (backend);
+ priv = cbfile->priv;
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ g_return_val_if_fail (priv->icalcomp != NULL, NULL);
+ g_assert (priv->comp_uid_hash != NULL);
+
+ comp = lookup_component (cbfile, uid);
+
+ if (!comp)
+ return NULL;
+
+ return cal_component_get_as_string (comp);
+}
+
+/* Get_object handler for the file backend */
static CalComponent *
cal_backend_file_get_object_component (CalBackend *backend, const char *uid)
{
@@ -915,7 +1150,7 @@ cal_backend_file_get_object_component (CalBackend *backend, const char *uid)
return lookup_component (cbfile, uid);
}
-/* Get_timezone_object handler for the file backend */
+/* Get_object handler for the file backend */
static char *
cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid)
{
@@ -1238,7 +1473,7 @@ cal_backend_file_get_free_busy (CalBackend *backend, GList *users, time_t start,
g_return_val_if_fail (start <= end, NULL);
if (users == NULL) {
- if (cal_backend_mail_account_get_default (priv->config_listener, &address, &name)) {
+ if (cal_backend_mail_account_get_default (priv->db, &address, &name)) {
vfb = create_user_free_busy (cbfile, address, name, start, end);
calobj = icalcomponent_as_ical_string (vfb);
obj_list = g_list_append (obj_list, g_strdup (calobj));
@@ -1249,7 +1484,7 @@ cal_backend_file_get_free_busy (CalBackend *backend, GList *users, time_t start,
} else {
for (l = users; l != NULL; l = l->next ) {
address = l->data;
- if (cal_backend_mail_account_is_valid (priv->config_listener, address, &name)) {
+ if (cal_backend_mail_account_is_valid (priv->db, address, &name)) {
vfb = create_user_free_busy (cbfile, address, name, start, end);
calobj = icalcomponent_as_ical_string (vfb);
obj_list = g_list_append (obj_list, g_strdup (calobj));
@@ -1297,7 +1532,7 @@ cal_backend_file_compute_changes_foreach_key (const char *key, gpointer data)
be_data->change_ids = g_list_prepend (be_data->change_ids, g_strdup (key));
g_free (calobj);
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
}
@@ -1520,6 +1755,88 @@ cal_backend_file_get_alarms_for_object (CalBackend *backend, const char *uid,
return corba_alarms;
}
+/* Notifies a backend's clients that an object was updated */
+static void
+notify_update (CalBackendFile *cbfile, const char *uid)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ cal_backend_obj_updated (CAL_BACKEND (cbfile), uid);
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_update (cal, uid);
+ }
+}
+
+/* Notifies a backend's clients that an object was removed */
+static void
+notify_remove (CalBackendFile *cbfile, const char *uid)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ cal_backend_obj_removed (CAL_BACKEND (cbfile), uid);
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_remove (cal, uid);
+ }
+}
+
+/* Notifies a backend's clients that an error has occurred */
+static void
+notify_error (CalBackendFile *cbfile, const char *message)
+{
+ CalBackendFilePrivate *priv;
+ GList *l;
+
+ priv = cbfile->priv;
+
+ for (l = CAL_BACKEND (cbfile)->clients; l; l = l->next) {
+ Cal *cal;
+
+ cal = CAL (l->data);
+ cal_notify_error (cal, message);
+ }
+}
+
+/* Used from g_hash_table_foreach_remove(); removes and frees a category */
+static gboolean
+remove_category_cb (gpointer key, gpointer value, gpointer data)
+{
+ Category *c;
+
+ c = value;
+ g_free (c->name);
+ g_free (c);
+
+ return TRUE;
+}
+
+/* Clears the table of removed categories */
+static void
+clean_removed_categories (CalBackendFile *cbfile)
+{
+ CalBackendFilePrivate *priv;
+
+ priv = cbfile->priv;
+
+ g_hash_table_foreach_remove (priv->removed_categories,
+ remove_category_cb,
+ NULL);
+}
+
+
/* Creates a CalComponent for the given icalcomponent and adds it to our
cache. Note that the icalcomponent is not added to the toplevel
icalcomponent here. That needs to be done elsewhere. It returns the uid
@@ -1536,14 +1853,14 @@ cal_backend_file_update_object (CalBackendFile *cbfile,
/* Create a CalComponent wrapper for the icalcomponent. */
comp = cal_component_new ();
if (!cal_component_set_icalcomponent (comp, icalcomp)) {
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return NULL;
}
/* Get the UID, and check it isn't empty. */
cal_component_get_uid (comp, &comp_uid);
if (!comp_uid || !comp_uid[0]) {
- g_object_unref (comp);
+ gtk_object_unref (GTK_OBJECT (comp));
return NULL;
}
@@ -1599,6 +1916,7 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
icalcomponent *toplevel_comp, *icalcomp = NULL;
icalcomponent_kind kind;
icalproperty_method method;
+ int old_n_categories, new_n_categories;
icalcomponent *subcomp;
CalBackendResult retval = CAL_BACKEND_RESULT_SUCCESS;
GList *updated_uids = NULL, *removed_uids = NULL, *elem;
@@ -1635,6 +1953,13 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
method = icalcomponent_get_method (toplevel_comp);
+ /* The list of removed categories must be empty because we are about to
+ * start a new scanning process.
+ */
+ g_assert (g_hash_table_size (priv->removed_categories) == 0);
+
+ old_n_categories = g_hash_table_size (priv->categories);
+
/* Step throught the VEVENT/VTODOs being added, create CalComponents
for them, and add them to our cache. */
subcomp = icalcomponent_get_first_component (toplevel_comp,
@@ -1672,6 +1997,8 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
resolving any conflicting TZIDs. */
icalcomponent_merge_component (priv->icalcomp, toplevel_comp);
+ new_n_categories = g_hash_table_size (priv->categories);
+
mark_dirty (cbfile);
/* Now emit notification signals for all of the added components.
@@ -1679,18 +2006,24 @@ cal_backend_file_update_objects (CalBackend *backend, const char *calobj, CalObj
stable state before emitting signals. */
for (elem = updated_uids; elem; elem = elem->next) {
char *comp_uid = elem->data;
- cal_backend_notify_update (backend, comp_uid);
+ notify_update (cbfile, comp_uid);
g_free (comp_uid);
}
g_list_free (updated_uids);
for (elem = removed_uids; elem; elem = elem->next) {
char *comp_uid = elem->data;
- cal_backend_notify_remove (backend, comp_uid);
+ notify_remove (cbfile, comp_uid);
g_free (comp_uid);
}
g_list_free (removed_uids);
+ if (old_n_categories != new_n_categories ||
+ g_hash_table_size (priv->removed_categories) != 0) {
+ clean_removed_categories (cbfile);
+ notify_categories_changed (cbfile);
+ }
+
return retval;
}
@@ -1714,11 +2047,21 @@ cal_backend_file_remove_object (CalBackend *backend, const char *uid, CalObjModT
if (!comp)
return CAL_BACKEND_RESULT_NOT_FOUND;
+ /* The list of removed categories must be empty because we are about to
+ * start a new scanning process.
+ */
+ g_assert (g_hash_table_size (priv->removed_categories) == 0);
+
remove_component (cbfile, comp);
mark_dirty (cbfile);
- cal_backend_notify_remove (backend, uid);
+ notify_remove (cbfile, uid);
+
+ if (g_hash_table_size (priv->removed_categories) != 0) {
+ clean_removed_categories (cbfile);
+ notify_categories_changed (cbfile);
+ }
return CAL_BACKEND_RESULT_SUCCESS;
}
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 765d873f79..e074f09bc2 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -23,38 +23,17 @@
*/
#include <config.h>
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h>
-#include <libxml/xmlmemory.h>
+#include <gtk/gtkobject.h>
+#include <gtk/gtksignal.h>
+#include <gnome-xml/parser.h>
+#include <gnome-xml/parserInternals.h>
+#include <gnome-xml/xmlmemory.h>
#include "cal-backend.h"
#include "libversit/vcc.h"
-/* A category that exists in some of the objects of the calendar */
-typedef struct {
- /* Category name, also used as the key in the categories hash table */
- char *name;
-
- /* Number of objects that have this category */
- int refcount;
-} CalBackendCategory;
-
-/* Private part of the CalBackend structure */
-struct _CalBackendPrivate {
- /* List of Cal objects with their listeners */
- GList *clients;
-
- /* Hash table of live categories, temporary hash of
- * added/removed categories, and idle handler for sending
- * category_changed.
- */
- GHashTable *categories;
- GHashTable *changed_categories;
- guint category_idle_id;
-};
-
/* Signal IDs */
enum {
LAST_CLIENT_GONE,
@@ -64,19 +43,12 @@ enum {
OBJ_REMOVED,
LAST_SIGNAL
};
-static guint cal_backend_signals[LAST_SIGNAL];
static void cal_backend_class_init (CalBackendClass *class);
-static void cal_backend_init (CalBackend *backend);
-static void cal_backend_finalize (GObject *object);
-
-static char *get_object (CalBackend *backend, const char *uid);
-
-static void notify_categories_changed (CalBackend *backend);
-#define CLASS(backend) (CAL_BACKEND_CLASS (G_OBJECT_GET_CLASS (backend)))
+static guint cal_backend_signals[LAST_SIGNAL];
-static GObjectClass *parent_class;
+#define CLASS(backend) (CAL_BACKEND_CLASS (GTK_OBJECT (backend)->klass))
@@ -89,23 +61,25 @@ static GObjectClass *parent_class;
*
* Return value: The type ID of the #CalBackend class.
**/
-GType
+GtkType
cal_backend_get_type (void)
{
- static GType cal_backend_type = 0;
+ static GtkType cal_backend_type = 0;
if (!cal_backend_type) {
- static GTypeInfo info = {
- sizeof (CalBackendClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) cal_backend_class_init,
- NULL, NULL,
- sizeof (CalBackend),
- 0,
- (GInstanceInitFunc) cal_backend_init,
- };
- cal_backend_type = g_type_register_static (G_TYPE_OBJECT, "CalBackend", &info, 0);
+ static const GtkTypeInfo cal_backend_info = {
+ "CalBackend",
+ sizeof (CalBackend),
+ sizeof (CalBackendClass),
+ (GtkClassInitFunc) cal_backend_class_init,
+ (GtkObjectInitFunc) NULL,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ cal_backend_type =
+ gtk_type_unique (GTK_TYPE_OBJECT, &cal_backend_info);
}
return cal_backend_type;
@@ -115,58 +89,51 @@ cal_backend_get_type (void)
static void
cal_backend_class_init (CalBackendClass *class)
{
- GObjectClass *object_class;
-
- parent_class = (GObjectClass *) g_type_class_peek_parent (class);
+ GtkObjectClass *object_class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
cal_backend_signals[LAST_CLIENT_GONE] =
- g_signal_new ("last_client_gone",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, last_client_gone),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ gtk_signal_new ("last_client_gone",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, last_client_gone),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
cal_backend_signals[CAL_ADDED] =
- g_signal_new ("cal_added",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, cal_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ gtk_signal_new ("cal_added",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, cal_added),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_POINTER);
cal_backend_signals[OPENED] =
- g_signal_new ("opened",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, opened),
- NULL, NULL,
- g_cclosure_marshal_VOID__ENUM,
- G_TYPE_NONE, 1,
- G_TYPE_ENUM);
+ gtk_signal_new ("opened",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, opened),
+ gtk_marshal_NONE__ENUM,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_ENUM);
cal_backend_signals[OBJ_UPDATED] =
- g_signal_new ("obj_updated",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, obj_updated),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_updated",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, obj_updated),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
cal_backend_signals[OBJ_REMOVED] =
- g_signal_new ("obj_removed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (CalBackendClass, obj_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ gtk_signal_new ("obj_removed",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (CalBackendClass, obj_removed),
+ gtk_marshal_NONE__STRING,
+ GTK_TYPE_NONE, 1,
+ GTK_TYPE_STRING);
- object_class->finalize = cal_backend_finalize;
+ gtk_object_class_add_signals (object_class, cal_backend_signals, LAST_SIGNAL);
class->last_client_gone = NULL;
class->opened = NULL;
@@ -184,7 +151,7 @@ cal_backend_class_init (CalBackendClass *class)
class->get_mode = NULL;
class->set_mode = NULL;
class->get_n_objects = NULL;
- class->get_object = get_object;
+ class->get_object = NULL;
class->get_object_component = NULL;
class->get_timezone_object = NULL;
class->get_uids = NULL;
@@ -198,51 +165,6 @@ cal_backend_class_init (CalBackendClass *class)
class->send_object = NULL;
}
-/* Object initialization func for the calendar backend */
-void
-cal_backend_init (CalBackend *backend)
-{
- CalBackendPrivate *priv;
-
- priv = g_new0 (CalBackendPrivate, 1);
- backend->priv = priv;
-
- priv->categories = g_hash_table_new (g_str_hash, g_str_equal);
- priv->changed_categories = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-/* Used from g_hash_table_foreach(), frees a CalBackendCategory structure */
-static void
-free_category_cb (gpointer key, gpointer value, gpointer data)
-{
- CalBackendCategory *c = value;
-
- g_free (c->name);
- g_free (c);
-}
-
-void
-cal_backend_finalize (GObject *object)
-{
- CalBackend *backend = (CalBackend *)object;
- CalBackendPrivate *priv;
-
- priv = backend->priv;
-
- g_assert (priv->clients == NULL);
-
- g_hash_table_foreach (priv->categories, free_category_cb, NULL);
- g_hash_table_destroy (priv->categories);
-
- g_hash_table_foreach (priv->changed_categories, free_category_cb, NULL);
- g_hash_table_destroy (priv->changed_categories);
-
- if (priv->category_idle_id)
- g_source_remove (priv->category_idle_id);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
/**
@@ -315,17 +237,37 @@ cal_backend_get_static_capabilities (CalBackend *backend)
/* Callback used when a Cal is destroyed */
static void
-cal_destroy_cb (gpointer data, GObject *where_cal_was)
+cal_destroy_cb (GtkObject *object, gpointer data)
{
- CalBackend *backend = CAL_BACKEND (data);
- CalBackendPrivate *priv = backend->priv;
+ Cal *cal;
+ Cal *lcal;
+ CalBackend *backend;
+ GList *l;
+
+ cal = CAL (object);
+
+ backend = CAL_BACKEND (data);
+
+ /* Find the cal in the list of clients */
- priv->clients = g_list_remove (priv->clients, where_cal_was);
+ for (l = backend->clients; l; l = l->next) {
+ lcal = CAL (l->data);
+
+ if (lcal == cal)
+ break;
+ }
+
+ g_assert (l != NULL);
+
+ /* Disconnect */
+
+ backend->clients = g_list_remove_link (backend->clients, l);
+ g_list_free_1 (l);
/* When all clients go away, notify the parent factory about it so that
* it may decide whether to kill the backend or not.
*/
- if (!priv->clients)
+ if (!backend->clients)
cal_backend_last_client_gone (backend);
}
@@ -340,25 +282,22 @@ cal_destroy_cb (gpointer data, GObject *where_cal_was)
void
cal_backend_add_cal (CalBackend *backend, Cal *cal)
{
- CalBackendPrivate *priv = backend->priv;
-
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (IS_CAL (cal));
- /* we do not keep a (strong) reference to the Cal since the
- * Calendar user agent owns it */
- g_object_weak_ref (G_OBJECT (cal), cal_destroy_cb, backend);
+ /* we do not keep a reference to the Cal since the Calendar
+ * user agent owns it */
+ gtk_signal_connect (GTK_OBJECT (cal), "destroy",
+ GTK_SIGNAL_FUNC (cal_destroy_cb),
+ backend);
- priv->clients = g_list_prepend (priv->clients, cal);
-
- /* Tell the new client about the list of categories.
- * (Ends up telling all the other clients too, but *shrug*.)
- */
- notify_categories_changed (backend);
+ backend->clients = g_list_prepend (backend->clients, cal);
/* notify backend that a new Cal has been added */
- g_signal_emit (backend, cal_backend_signals[CAL_ADDED], 0, cal);
+ gtk_signal_emit (GTK_OBJECT (backend),
+ cal_backend_signals[CAL_ADDED],
+ cal);
}
/**
@@ -520,19 +459,6 @@ cal_backend_get_n_objects (CalBackend *backend, CalObjType type)
return (* CLASS (backend)->get_n_objects) (backend, type);
}
-/* Default cal_backend_get_object implementation */
-static char *
-get_object (CalBackend *backend, const char *uid)
-{
- CalComponent *comp;
-
- comp = cal_backend_get_object_component (backend, uid);
- if (!comp)
- return NULL;
-
- return cal_component_get_as_string (comp);
-}
-
char *
cal_backend_get_default_object (CalBackend *backend, CalObjType type)
{
@@ -894,7 +820,7 @@ cal_backend_last_client_gone (CalBackend *backend)
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[LAST_CLIENT_GONE], 0);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[LAST_CLIENT_GONE]);
}
/**
@@ -911,8 +837,8 @@ cal_backend_opened (CalBackend *backend, CalBackendOpenStatus status)
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OPENED],
- 0, status);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OPENED],
+ status);
}
/**
@@ -930,8 +856,8 @@ cal_backend_obj_updated (CalBackend *backend, const char *uid)
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (uid != NULL);
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OBJ_UPDATED],
- 0, uid);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OBJ_UPDATED],
+ uid);
}
/**
@@ -949,8 +875,8 @@ cal_backend_obj_removed (CalBackend *backend, const char *uid)
g_return_if_fail (IS_CAL_BACKEND (backend));
g_return_if_fail (uid != NULL);
- g_signal_emit (G_OBJECT (backend), cal_backend_signals[OBJ_REMOVED],
- 0, uid);
+ gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[OBJ_REMOVED],
+ uid);
}
@@ -1019,228 +945,3 @@ cal_backend_set_default_timezone (CalBackend *backend, const char *tzid)
return (* CLASS (backend)->set_default_timezone) (backend, tzid);
}
-
-/**
- * cal_backend_notify_mode:
- * @backend: A calendar backend.
- * @status: Status of the mode set
- * @mode: the current mode
- *
- * Notifies each of the backend's listeners about the results of a
- * setMode call.
- **/
-void
-cal_backend_notify_mode (CalBackend *backend,
- GNOME_Evolution_Calendar_Listener_SetModeStatus status,
- GNOME_Evolution_Calendar_CalMode mode)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- for (l = priv->clients; l; l = l->next)
- cal_notify_mode (l->data, status, mode);
-}
-
-/**
- * cal_backend_notify_update:
- * @backend: A calendar backend.
- * @uid: UID of object that was updated.
- *
- * Notifies each of the backend's listeners about an update to a
- * calendar object.
- **/
-void
-cal_backend_notify_update (CalBackend *backend, const char *uid)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- cal_backend_obj_updated (backend, uid);
- for (l = priv->clients; l; l = l->next)
- cal_notify_update (l->data, uid);
-}
-
-/**
- * cal_backend_notify_remove:
- * @backend: A calendar backend.
- * @uid: UID of object that was removed.
- *
- * Notifies each of the backend's listeners about a calendar object
- * that was removed.
- **/
-void
-cal_backend_notify_remove (CalBackend *backend, const char *uid)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- cal_backend_obj_removed (backend, uid);
- for (l = priv->clients; l; l = l->next)
- cal_notify_remove (l->data, uid);
-}
-
-/**
- * cal_backend_notify_error:
- * @backend: A calendar backend.
- * @message: Error message
- *
- * Notifies each of the backend's listeners about an error
- **/
-void
-cal_backend_notify_error (CalBackend *backend, const char *message)
-{
- CalBackendPrivate *priv = backend->priv;
- GList *l;
-
- for (l = priv->clients; l; l = l->next)
- cal_notify_error (l->data, message);
-}
-
-static void
-add_category_cb (gpointer name, gpointer category, gpointer data)
-{
- GNOME_Evolution_Calendar_StringSeq *seq = data;
-
- seq->_buffer[seq->_length++] = CORBA_string_dup (name);
-}
-
-static void
-notify_categories_changed (CalBackend *backend)
-{
- CalBackendPrivate *priv = backend->priv;
- GNOME_Evolution_Calendar_StringSeq *seq;
- GList *l;
-
- /* Build the sequence of category names */
- seq = GNOME_Evolution_Calendar_StringSeq__alloc ();
- seq->_length = 0;
- seq->_maximum = g_hash_table_size (priv->categories);
- seq->_buffer = CORBA_sequence_CORBA_string_allocbuf (seq->_maximum);
- CORBA_sequence_set_release (seq, TRUE);
-
- g_hash_table_foreach (priv->categories, add_category_cb, seq);
-
- /* Notify the clients */
- for (l = priv->clients; l; l = l->next)
- cal_notify_categories_changed (l->data, seq);
-
- CORBA_free (seq);
-}
-
-static gboolean
-prune_changed_categories (gpointer key, gpointer value, gpointer data)
-{
- CalBackendCategory *category = value;
-
- if (!category->refcount) {
- g_free (category->name);
- g_free (category);
- }
- return TRUE;
-}
-
-static gboolean
-idle_notify_categories_changed (gpointer data)
-{
- CalBackend *backend = CAL_BACKEND (data);
- CalBackendPrivate *priv = backend->priv;
-
- if (g_hash_table_size (priv->changed_categories)) {
- notify_categories_changed (backend);
- g_hash_table_foreach_remove (priv->changed_categories, prune_changed_categories, NULL);
- }
- return FALSE;
-}
-
-/**
- * cal_backend_ref_categories:
- * @backend: A calendar backend
- * @categories: a list of categories
- *
- * Adds 1 to the refcount of each of the named categories. If any of
- * the categories are new, clients will be notified of the updated
- * category list at idle time.
- **/
-void
-cal_backend_ref_categories (CalBackend *backend, GSList *categories)
-{
- CalBackendPrivate *priv;
- CalBackendCategory *c;
- const char *name;
-
- priv = backend->priv;
-
- while (categories) {
- name = categories->data;
- c = g_hash_table_lookup (priv->categories, name);
-
- if (c)
- c->refcount++;
- else {
- /* See if it was recently removed */
-
- c = g_hash_table_lookup (priv->changed_categories, name);
- if (c && c->refcount == 0) {
- /* Move it back to the set of live categories */
- g_hash_table_remove (priv->changed_categories, c->name);
-
- c->refcount = 1;
- g_hash_table_insert (priv->categories, c->name, c);
- } else {
- /* Create a new category */
- c = g_new (CalBackendCategory, 1);
- c->name = g_strdup (name);
- c->refcount = 1;
- g_hash_table_insert (priv->changed_categories, c->name, c);
- }
- }
-
- categories = categories->next;
- }
-
- if (g_hash_table_size (priv->changed_categories) &&
- !priv->category_idle_id)
- priv->category_idle_id = g_idle_add (idle_notify_categories_changed, backend);
-}
-
-/**
- * cal_backend_unref_categories:
- * @backend: A calendar backend
- * @categories: a list of categories
- *
- * Subtracts 1 from the refcount of each of the named categories. If
- * any of the refcounts go down to 0, clients will be notified of the
- * updated category list at idle time.
- **/
-void
-cal_backend_unref_categories (CalBackend *backend, GSList *categories)
-{
- CalBackendPrivate *priv;
- CalBackendCategory *c;
- const char *name;
-
- priv = backend->priv;
-
- while (categories) {
- name = categories->data;
- c = g_hash_table_lookup (priv->categories, name);
-
- if (c) {
- g_assert (c != NULL);
- g_assert (c->refcount > 0);
-
- c->refcount--;
-
- if (c->refcount == 0) {
- g_hash_table_remove (priv->categories, c->name);
- g_hash_table_insert (priv->changed_categories, c->name, c);
- }
- }
-
- categories = categories->next;
- }
-
- if (g_hash_table_size (priv->changed_categories) &&
- !priv->category_idle_id)
- priv->category_idle_id = g_idle_add (idle_notify_categories_changed, backend);
-}
diff --git a/calendar/pcs/cal-backend.h b/calendar/pcs/cal-backend.h
index 962b468fc3..04c3c71f5f 100644
--- a/calendar/pcs/cal-backend.h
+++ b/calendar/pcs/cal-backend.h
@@ -24,6 +24,7 @@
#ifndef CAL_BACKEND_H
#define CAL_BACKEND_H
+#include <libgnome/gnome-defs.h>
#include <cal-util/cal-util.h>
#include <cal-util/cal-component.h>
#include "pcs/evolution-calendar.h"
@@ -31,16 +32,16 @@
#include "pcs/cal.h"
#include "pcs/query.h"
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define CAL_BACKEND_TYPE (cal_backend_get_type ())
-#define CAL_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAL_BACKEND_TYPE, CalBackend))
-#define CAL_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAL_BACKEND_TYPE, \
+#define CAL_BACKEND(obj) (GTK_CHECK_CAST ((obj), CAL_BACKEND_TYPE, CalBackend))
+#define CAL_BACKEND_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), CAL_BACKEND_TYPE, \
CalBackendClass))
-#define IS_CAL_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAL_BACKEND_TYPE))
-#define IS_CAL_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAL_BACKEND_TYPE))
+#define IS_CAL_BACKEND(obj) (GTK_CHECK_TYPE ((obj), CAL_BACKEND_TYPE))
+#define IS_CAL_BACKEND_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_BACKEND_TYPE))
/* Open status values */
typedef enum {
@@ -73,16 +74,13 @@ typedef enum {
CAL_BACKEND_GET_ALARMS_INVALID_RANGE
} CalBackendGetAlarmsForObjectResult;
-typedef struct _CalBackendPrivate CalBackendPrivate;
-
struct _CalBackend {
- GObject object;
-
- CalBackendPrivate *priv;
+ GtkObject object;
+ GList *clients;
};
struct _CalBackendClass {
- GObjectClass parent_class;
+ GtkObjectClass parent_class;
/* Notification signals */
void (* last_client_gone) (CalBackend *backend);
@@ -152,7 +150,7 @@ struct _CalBackendClass {
gboolean (* set_default_timezone) (CalBackend *backend, const char *tzid);
};
-GType cal_backend_get_type (void);
+GtkType cal_backend_get_type (void);
const char *cal_backend_get_uri (CalBackend *backend);
@@ -227,17 +225,8 @@ void cal_backend_opened (CalBackend *backend, CalBackendOpenStatus status);
void cal_backend_obj_updated (CalBackend *backend, const char *uid);
void cal_backend_obj_removed (CalBackend *backend, const char *uid);
-void cal_backend_notify_mode (CalBackend *backend,
- GNOME_Evolution_Calendar_Listener_SetModeStatus status,
- GNOME_Evolution_Calendar_CalMode mode);
-void cal_backend_notify_update (CalBackend *backend, const char *uid);
-void cal_backend_notify_remove (CalBackend *backend, const char *uid);
-void cal_backend_notify_error (CalBackend *backend, const char *message);
-void cal_backend_ref_categories (CalBackend *backend, GSList *categories);
-void cal_backend_unref_categories (CalBackend *backend, GSList *categories);
-
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index bd6ffb4b38..c955dd0bb3 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -28,9 +28,9 @@
#include "query.h"
#include "Evolution-Wombat.h"
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
+#define PARENT_TYPE BONOBO_X_OBJECT_TYPE
-static BonoboObjectClass *parent_class;
+static BonoboXObjectClass *parent_class;
/* Private part of the Cal structure */
struct _CalPrivate {
@@ -64,10 +64,10 @@ impl_Cal_get_uri (PortableServer_Servant servant,
return str_uri_copy;
}
-/* Cal::isReadOnly method */
+/* Cal::is_read_only method */
static CORBA_boolean
-impl_Cal_isReadOnly (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_is_read_only (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -78,10 +78,10 @@ impl_Cal_isReadOnly (PortableServer_Servant servant,
return cal_backend_is_read_only (priv->backend);
}
-/* Cal::getEmailAddress method */
+/* Cal::get_cal_address method */
static CORBA_char *
-impl_Cal_getCalAddress (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_cal_address (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -104,8 +104,8 @@ impl_Cal_getCalAddress (PortableServer_Servant servant,
/* Cal::get_alarm_email_address method */
static CORBA_char *
-impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_alarm_email_address (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -128,8 +128,8 @@ impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
/* Cal::get_ldap_attribute method */
static CORBA_char *
-impl_Cal_getLdapAttribute (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_ldap_attribute (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -152,8 +152,8 @@ impl_Cal_getLdapAttribute (PortableServer_Servant servant,
/* Cal::getSchedulingInformation method */
static CORBA_char *
-impl_Cal_getStaticCapabilities (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Cal_get_static_capabilities (PortableServer_Servant servant,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -180,11 +180,10 @@ uncorba_obj_type (GNOME_Evolution_Calendar_CalObjType type)
| ((type & GNOME_Evolution_Calendar_TYPE_JOURNAL) ? CALOBJ_TYPE_JOURNAL : 0));
}
-/* Cal::setMode method */
static void
-impl_Cal_setMode (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalMode mode,
- CORBA_Environment *ev)
+impl_Cal_set_mode (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalMode mode,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -195,11 +194,11 @@ impl_Cal_setMode (PortableServer_Servant servant,
cal_backend_set_mode (priv->backend, mode);
}
-/* Cal::countObjects method */
+/* Cal::get_n_objects method */
static CORBA_long
-impl_Cal_countObjects (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_n_objects (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -214,32 +213,33 @@ impl_Cal_countObjects (PortableServer_Servant servant,
return n;
}
+/* Cal::get_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getDefaultObject (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_default_object (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
- Cal *cal;
- CalPrivate *priv;
- GNOME_Evolution_Calendar_CalObj calobj_copy;
- char *calobj;
-
-
- cal = CAL (bonobo_object_from_servant (servant));
- priv = cal->priv;
-
- calobj = cal_backend_get_default_object (priv->backend, type);
- calobj_copy = CORBA_string_dup (calobj);
- g_free (calobj);
-
- return calobj_copy;
+ Cal *cal;
+ CalPrivate *priv;
+ GNOME_Evolution_Calendar_CalObj calobj_copy;
+ char *calobj;
+
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ calobj = cal_backend_get_default_object (priv->backend, type);
+ calobj_copy = CORBA_string_dup (calobj);
+ g_free (calobj);
+
+ return calobj_copy;
}
-/* Cal::getObject method */
+/* Cal::get_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- CORBA_Environment *ev)
+impl_Cal_get_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -289,11 +289,11 @@ build_uid_seq (GList *uids)
return seq;
}
-/* Cal::getUIDs method */
+/* Cal::get_uids method */
static GNOME_Evolution_Calendar_CalObjUIDSeq *
-impl_Cal_getUIDs (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- CORBA_Environment *ev)
+impl_Cal_get_uids (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -314,12 +314,12 @@ impl_Cal_getUIDs (PortableServer_Servant servant,
return seq;
}
-/* Cal::getChanges method */
+/* Cal::get_changes method */
static GNOME_Evolution_Calendar_CalObjChangeSeq *
-impl_Cal_getChanges (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- const CORBA_char *change_id,
- CORBA_Environment *ev)
+impl_Cal_get_changes (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ const CORBA_char *change_id,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -333,13 +333,13 @@ impl_Cal_getChanges (PortableServer_Servant servant,
return cal_backend_get_changes (priv->backend, t, change_id);
}
-/* Cal::getObjectsInRange method */
+/* Cal::get_objects_in_range method */
static GNOME_Evolution_Calendar_CalObjUIDSeq *
-impl_Cal_getObjectsInRange (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_CalObjType type,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_objects_in_range (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalObjType type,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -395,13 +395,13 @@ build_fb_seq (GList *obj_list)
return seq;
}
-/* Cal::getFreeBusy method */
+/* Cal::get_free_busy method */
static GNOME_Evolution_Calendar_CalObjSeq *
-impl_Cal_getFreeBusy (PortableServer_Servant servant,
- const GNOME_Evolution_Calendar_UserList *user_list,
- const GNOME_Evolution_Calendar_Time_t start,
- const GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_free_busy (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_UserList *user_list,
+ const GNOME_Evolution_Calendar_Time_t start,
+ const GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -440,12 +440,12 @@ impl_Cal_getFreeBusy (PortableServer_Servant servant,
return seq;
}
-/* Cal::getAlarmsInRange method */
+/* Cal::get_alarms_in_range method */
static GNOME_Evolution_Calendar_CalComponentAlarmsSeq *
-impl_Cal_getAlarmsInRange (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment *ev)
+impl_Cal_get_alarms_in_range (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -473,13 +473,13 @@ impl_Cal_getAlarmsInRange (PortableServer_Servant servant,
return seq;
}
-/* Cal::getAlarmsForObject method */
+/* Cal::get_alarms_for_object method */
static GNOME_Evolution_Calendar_CalComponentAlarms *
-impl_Cal_getAlarmsForObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
- CORBA_Environment * ev)
+impl_Cal_get_alarms_for_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment * ev)
{
Cal *cal;
CalPrivate *priv;
@@ -513,12 +513,12 @@ impl_Cal_getAlarmsForObject (PortableServer_Servant servant,
}
}
-/* Cal::updateObjects method */
+/* Cal::update_objects method */
static void
-impl_Cal_updateObjects (PortableServer_Servant servant,
- const CORBA_char *calobj,
- const GNOME_Evolution_Calendar_CalObjModType mod,
- CORBA_Environment *ev)
+impl_Cal_update_objects (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObj calobj,
+ const GNOME_Evolution_Calendar_CalObjModType mod,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -543,12 +543,12 @@ impl_Cal_updateObjects (PortableServer_Servant servant,
}
}
-/* Cal::removeObject method */
+/* Cal::remove_object method */
static void
-impl_Cal_removeObject (PortableServer_Servant servant,
- const CORBA_char *uid,
- const GNOME_Evolution_Calendar_CalObjModType mod,
- CORBA_Environment *ev)
+impl_Cal_remove_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObjUID uid,
+ const GNOME_Evolution_Calendar_CalObjModType mod,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -573,12 +573,12 @@ impl_Cal_removeObject (PortableServer_Servant servant,
}
}
-/* Cal::sendObject method */
+/* Cal::send_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_sendObject (PortableServer_Servant servant,
- const CORBA_char *calobj,
- GNOME_Evolution_Calendar_UserList **user_list,
- CORBA_Environment *ev)
+impl_Cal_send_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalObj calobj,
+ GNOME_Evolution_Calendar_UserList **user_list,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -622,10 +622,10 @@ impl_Cal_sendObject (PortableServer_Servant servant,
/* Cal::getQuery implementation */
static GNOME_Evolution_Calendar_Query
-impl_Cal_getQuery (PortableServer_Servant servant,
- const CORBA_char *sexp,
- GNOME_Evolution_Calendar_QueryListener ql,
- CORBA_Environment *ev)
+impl_Cal_get_query (PortableServer_Servant servant,
+ const CORBA_char *sexp,
+ GNOME_Evolution_Calendar_QueryListener ql,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -645,7 +645,6 @@ impl_Cal_getQuery (PortableServer_Servant servant,
CORBA_exception_init (&ev2);
query_copy = CORBA_Object_duplicate (BONOBO_OBJREF (query), &ev2);
if (BONOBO_EX (&ev2)) {
- bonobo_object_unref (query);
CORBA_exception_free (&ev2);
g_message ("Cal_get_query(): Could not duplicate the query reference");
bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_CouldNotCreate);
@@ -657,11 +656,11 @@ impl_Cal_getQuery (PortableServer_Servant servant,
return query_copy;
}
-/* Cal::setDefaultTimezone method */
+/* Cal::set_default_timezone method */
static void
-impl_Cal_setDefaultTimezone (PortableServer_Servant servant,
- const CORBA_char *tzid,
- CORBA_Environment *ev)
+impl_Cal_set_default_timezone (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalTimezoneObjUID tzid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -677,11 +676,11 @@ impl_Cal_setDefaultTimezone (PortableServer_Servant servant,
}
}
-/* Cal::getTimezoneObject method */
+/* Cal::get_timezone_object method */
static GNOME_Evolution_Calendar_CalObj
-impl_Cal_getTimezoneObject (PortableServer_Servant servant,
- const CORBA_char *tzid,
- CORBA_Environment *ev)
+impl_Cal_get_timezone_object (PortableServer_Servant servant,
+ const GNOME_Evolution_Calendar_CalTimezoneObjUID tzid,
+ CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
@@ -780,7 +779,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener)
g_return_val_if_fail (backend != NULL, NULL);
g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
- cal = CAL (g_object_new (CAL_TYPE, NULL));
+ cal = CAL (gtk_type_new (CAL_TYPE));
retval = cal_construct (cal, backend, listener);
if (!retval) {
@@ -794,7 +793,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener)
/* Destroy handler for the calendar */
static void
-cal_finalize (GObject *object)
+cal_destroy (GtkObject *object)
{
Cal *cal;
CalPrivate *priv;
@@ -818,8 +817,8 @@ cal_finalize (GObject *object)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -828,43 +827,43 @@ cal_finalize (GObject *object)
static void
cal_class_init (CalClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
POA_GNOME_Evolution_Calendar_Cal__epv *epv = &klass->epv;
- parent_class = g_type_class_peek_parent (klass);
+ parent_class = gtk_type_class (PARENT_TYPE);
/* Class method overrides */
- object_class->finalize = cal_finalize;
+ object_class->destroy = cal_destroy;
/* Epv methods */
epv->_get_uri = impl_Cal_get_uri;
- epv->isReadOnly = impl_Cal_isReadOnly;
- epv->getCalAddress = impl_Cal_getCalAddress;
- epv->getAlarmEmailAddress = impl_Cal_getAlarmEmailAddress;
- epv->getLdapAttribute = impl_Cal_getLdapAttribute;
- epv->getStaticCapabilities = impl_Cal_getStaticCapabilities;
- epv->setMode = impl_Cal_setMode;
- epv->countObjects = impl_Cal_countObjects;
- epv->getDefaultObject = impl_Cal_getDefaultObject;
- epv->getObject = impl_Cal_getObject;
- epv->setDefaultTimezone = impl_Cal_setDefaultTimezone;
- epv->getTimezoneObject = impl_Cal_getTimezoneObject;
- epv->getUIDs = impl_Cal_getUIDs;
- epv->getChanges = impl_Cal_getChanges;
- epv->getObjectsInRange = impl_Cal_getObjectsInRange;
- epv->getFreeBusy = impl_Cal_getFreeBusy;
- epv->getAlarmsInRange = impl_Cal_getAlarmsInRange;
- epv->getAlarmsForObject = impl_Cal_getAlarmsForObject;
- epv->updateObjects = impl_Cal_updateObjects;
- epv->removeObject = impl_Cal_removeObject;
- epv->sendObject = impl_Cal_sendObject;
- epv->getQuery = impl_Cal_getQuery;
+ epv->isReadOnly = impl_Cal_is_read_only;
+ epv->getCalAddress = impl_Cal_get_cal_address;
+ epv->getAlarmEmailAddress = impl_Cal_get_alarm_email_address;
+ epv->getLdapAttribute = impl_Cal_get_ldap_attribute;
+ epv->getStaticCapabilities = impl_Cal_get_static_capabilities;
+ epv->setMode = impl_Cal_set_mode;
+ epv->countObjects = impl_Cal_get_n_objects;
+ epv->getDefaultObject = impl_Cal_get_default_object;
+ epv->getObject = impl_Cal_get_object;
+ epv->setDefaultTimezone = impl_Cal_set_default_timezone;
+ epv->getTimezoneObject = impl_Cal_get_timezone_object;
+ epv->getUIDs = impl_Cal_get_uids;
+ epv->getChanges = impl_Cal_get_changes;
+ epv->getObjectsInRange = impl_Cal_get_objects_in_range;
+ epv->getFreeBusy = impl_Cal_get_free_busy;
+ epv->getAlarmsInRange = impl_Cal_get_alarms_in_range;
+ epv->getAlarmsForObject = impl_Cal_get_alarms_for_object;
+ epv->updateObjects = impl_Cal_update_objects;
+ epv->removeObject = impl_Cal_remove_object;
+ epv->sendObject = impl_Cal_send_object;
+ epv->getQuery = impl_Cal_get_query;
}
/* Object initialization function for the calendar */
static void
-cal_init (Cal *cal, CalClass *klass)
+cal_init (Cal *cal)
{
CalPrivate *priv;
@@ -874,7 +873,7 @@ cal_init (Cal *cal, CalClass *klass)
priv->listener = CORBA_OBJECT_NIL;
}
-BONOBO_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal);
+BONOBO_X_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal);
/**
* cal_notify_mode: