aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/query.c
Commit message (Collapse)AuthorAgeFilesLines
* This commit was manufactured by cvs2svn to create tagGPERFMETER_GNOME_1_4_1nobody2001-12-051-1437/+0
| | | | | | 'GPERFMETER_GNOME_1_4_1'. svn path=/tags/GPERFMETER_GNOME_1_4_1/; revision=14882
* If a query is not in progress, just retag the whole thing. An event mayFederico Mena Quintero2001-10-311-41/+41
| | | | | | | | | | | | | | | | | | | | 2001-10-31 Federico Mena Quintero <federico@ximian.com> * gui/gnome-cal.c (dn_query_obj_updated_cb): If a query is not in progress, just retag the whole thing. An event may change dates and tag_calendar_by_comp() would not know how to untag the old dates. Fixes bug #10220. * pcs/query.c (start_query_cb): Connect to the backend's "obj_updated" and "obj_removed" signals here instead of in query_construct(). If a query is started while another one is notifying of an update, these signal connections would get appened to the running signal (the one that triggered the notification about an update) and the new signal handlers would also get called. We are really not interested in updates before we populate the query, because we'll catch the changes anyways. svn path=/trunk/; revision=14533
* Fixing the license text.Ettore Perazzoli2001-10-281-4/+3
| | | | svn path=/trunk/; revision=14214
* added setDefaultTimezone() method.Damon Chaplin2001-10-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-10-22 Damon Chaplin <damon@ximian.com> * idl/evolution-calendar.idl: added setDefaultTimezone() method. * pcs/cal-backend.c (cal_backend_get_default_timezone): (cal_backend_set_default_timezone): new functions to call class methods. * pcs/cal-backend-file.c: lots of changes to handle the default timezone and use it. * pcs/query.c: use the default timezone. * gui/dialogs/task-details-page.c (date_changed_cb): initialized completed_tt. * gui/dialogs/event-page.c: changed it to handle DATE values. The 'All Day Event' checkbox is only set now when the DTSTART and DTEND are DATE values. * gui/dialogs/comp-editor-util.c (comp_editor_free_dates): free the CalComponentDateTime structs as well. * gui/e-tasks.c: set the default timezone on the server. * gui/tag-calendar.c: * gui/gnome-cal.c: * gui/e-week-view.c: * gui/e-day-view.c: updates to handle DATE values. * gui/e-calendar-table.c (date_compare_cb): updated to use the new ECellDateEditValue values, so it now works. (percent_compare_cb): updated to use GPOINTER_TO_INT values. (e_calendar_table_init): use an ECellPercent for the percent field and an ECellDateEditText for the date fields. * gui/comp-util.c (cal_comp_util_compare_event_timezones): return TRUE if the DTSTART or DTEND is a DATE value. We don't want to show the timezone icons for DATE values. * gui/comp-editor-factory.c (resolve_pending_requests): set the default timezone on the server. * gui/calendar-model.c: major changes to support sorting properly. For date and percent fields we now use subclasses of ECellText, so we don't use a char* as the model value. For the percent field we now use a GINT_TO_POINTER. For the date fields we now use a ECellDateEditValue* as the value. * gui/calendar-config.c (calendar_config_configure_e_cell_date_edit): set the timezone and use_24_hour flags of the new ECellDateEditText. * conduits/todo/todo-conduit.c (pre_sync): * conduits/calendar/calendar-conduit.c (pre_sync): set the default timezone on the server. * cal-util/timeutil.c (time_days_in_month): removed debug message. * cal-util/test-recur.c: try to handle timezones in the iCalendar file properly, and updated to pass default timezone. * cal-util/cal-util.c (cal_util_generate_alarms_for_comp): (cal_util_generate_alarms_for_list): added default timezone argument. * cal-util/cal-recur.c: changed many of the functions to take a default timezone, to use to resolve DATE and floating DATE-TIME values. * cal-client/cal-client.c (cal_client_set_default_timezone): new function to set the default timezone. (cal_client_ensure_timezone_on_server): new function to ensure that a given timezone is on the server. * gui/e-cell-date-edit-text.c: new subclass of ECellText to display and edit a date value. * cal-util/cal-recur.c (cal_obj_byday_expand_monthly): changed week_num to -week_num when calculating the weeks to go back from the end of the month for things like BYDAY=-2WE. Fixes bug #11525. (cal_recur_generate_instances_of_rule): only go up to MAX_YEAR (2037). We can't really handle anything past that anyway. (cal_recur_ensure_rule_end_date): initialize cb_date.end_date to 0, so if the RULE doesn't generate COUNT instances we save 0 as the time_t. svn path=/trunk/; revision=13920
* there may be cases when the backend will return an invalid component fromRodrigo Moya2001-10-181-1/+1
| | | | | | | | | | 2001-10-17 Rodrigo Moya <rodrigo@ximian.com> * pcs/query.c (match_component): there may be cases when the backend will return an invalid component from a valid UID (an UID returned by the get_uids method), so don't abort if that's the case svn path=/trunk/; revision=13725
* util function to get address (itip_addresses_get_default): get only theJP Rosevear2001-10-101-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-10-09 JP Rosevear <jpr@ximian.com> * gui/itip-utils.c (get_address): util function to get address (itip_addresses_get_default): get only the default address (itip_address_free): free single address (itip_addresses_free): use above (comp_limit_attendees): limit the number of attendees to one, the user (comp_sentby): set the sentby parameter if the user is not the organizer (comp_minimal): remove extraneous info for send (for refresh and declinecounter) (comp_compliant): remove all alarms, do various things to make the components comply with itip spec based on method (itip_send_comp): use comp_compliant method * gui/itip-utils.h: new protos * gui/e-itip-control.c: rescan the component when necessary (get_next): don't get stuck in infinite loop if there are no viewable components (e_itip_control_set_data): if there are no viewable components, spit an error message * gui/dialogs/meeting-page.h: tidy * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): use organizer's cn if possible (other_clicked_cb): no longer doing the sent by stuff directly, hide more widgets * pcs/query.c: use bonobo exception stuff * cal-util/cal-component.c (cal_component_rescan): have the comp rescan its libical component (for when you change things directly) (free_icalcomponent): take a param on whether to free the component or just clean up the mappings (cal_component_has_attendees): util function * cal-util/cal-component.h: new protos svn path=/trunk/; revision=13525
* added a timeout to refresh the list every 10 minutes. Not ideal, as theDamon Chaplin2001-09-181-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-09-17 Damon Chaplin <damon@ximian.com> * gui/calendar-model.c: added a timeout to refresh the list every 10 minutes. Not ideal, as the user may be editing a task when it gets refreshed. (adjust_query_sexp): use the 'completed-before?' operator to filter out tasks according to the config settings. * gui/dialogs/task-details-page.c (task_details_page_fill_widgets): added support for the 'Completed' date. This code must have got lost somewhere, as it used to work. (date_changed_cb): set the priv->updating flag while updating the other widgets. * pcs/cal-backend-file.c (cal_backend_file_update_objects): made sure we freed the components. * pcs/query.c (func_completed_before): added 'completed-before?' operator. * gui/calendar-config.c (calendar_config_configure_e_cell_date_edit): don't set the lower & upper hour. Use 0-24 like the EDateEdit does. * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config): set the 12/24-hour time format options sensitive only if we support both. * gui/calendar-config.c (config_read): if the locale doesn't define 'am' and 'pm' strings then we must use 24-hour format. * gui/calendar-commands.c (calendar_set_folder_bar_label): don't translate the '%d' as it doesn't make much sense. Resolves bug #8027. svn path=/trunk/; revision=12925
* Fixes bug #7879, a query may receive an update notification from theFederico Mena Quintero2001-08-291-28/+98
| | | | | | | | | | | | | | | | | | | | 2001-08-28 Federico Mena Quintero <federico@ximian.com> Fixes bug #7879, a query may receive an update notification from the backend before the query itself gets populated. * pcs/query.c (ensure_sexp): New function; ensures that the esexp is created and notifies of parse errors. It is the bulk of start_query_cb() but put in a separate function so that we can share it elsewhere. (start_query_cb): Use ensure_sexp(). (process_component_cb): Oops, notify of a successfully finished query. (match_component): Call ensure_sexp(). This function can be called by the backend notification callbacks before the query is populated, so we need to make sure the esexp exists here. svn path=/trunk/; revision=12509
* added new e-sexp operator. We don't currently use it though.Damon Chaplin2001-08-221-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-21 Damon Chaplin <damon@ximian.com> * pcs/query.c (func_is_completed): added new e-sexp operator. We don't currently use it though. * gui/dialogs/cal-prefs-dialog.glade: Changed '_Overdue' to 'O_verdue' since we have an '_Other' notebook tab. Added '_Hide' accel. * gui/dialogs/cal-prefs-dialog.c: hooked up config options to dialog. * gui/calendar-config.c: added config options for hiding completed tasks. * gui/e-week-view-event-item.c (e_week_view_event_item_draw): * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event): * gui/e-day-view.c (e_day_view_reshape_long_event): added 2 pixels extra space between icons and text for long events, and 1 pixel space between icons in all events. (e_day_view_realize): changed the background color to match the EGrayBar in the shell. svn path=/trunk/; revision=12347
* added new backend method to get the component given a UID.Damon Chaplin2001-08-101-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-09 Damon Chaplin <damon@ximian.com> * pcs/cal-backend.c (cal_backend_get_object_component): added new backend method to get the component given a UID. * pcs/cal-backend-file.c (cal_backend_file_get_object_component): added implementation of above virtual method. * pcs/query.c (match_component): use the new backend function to get the CalComponent rather than the string. This avoids converting all the calendar components to strings and parsing them back into components for every query! (That wasn't a good idea, was it ;) * gui/e-week-view.c: * gui/e-day-view.c: use a timeout handler to layout the events, to avoid doing a layout for each event we get from a query. * gui/print.c (print_day_add_event): * gui/e-day-view.c (e_day_view_add_event): set start_row_or_col and num_columns to 0. They are guint8's. * gui/e-week-view.c (e_week_view_free_events): hide all the jump buttons. Fixes bug #5946. * gui/calendar-commands.c (calendar_set_folder_bar_label): added the day numbers for the month view. * gui/dialogs/recurrence-page.glade: changed "_Delete" to "_Remove", since it clashed with "_Add". Also added underlined accelerators for the recurrence radio buttons. Note that none of these accelerators actually work at present, due to the way we are using .glade files for each notebook page. I need to add a bug about this. Also, the "_Action" menu doesn't popup when I press Alt+A, even though the "_File" menu does popup when I press Alt+F. Strange. * pcs/cal-backend-file.c (cal_backend_file_get_timezone_object): removed debug msgs. svn path=/trunk/; revision=11866
* The calendar search bar widget now includes a drop-down menu of availableFederico Mena Quintero2001-08-021-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-01 Federico Mena Quintero <federico@ximian.com> The calendar search bar widget now includes a drop-down menu of available categories. * pcs/query.c (func_has_categories): Handle one and only one #f value as meaning "unfiled", for components that have no categories at all. * pcs/cal-backend-file.c (open_cal): Duh, do not notify here about changed categories since at this point we don't have any clients bound to us yet. (create_cal): Likewise. (cal_backend_file_add_cal): Notify here. * gui/cal-search-bar.h (CalSearchBarClass): New signal "category_changed". * gui/cal-search-bar.c (cal_search_bar_construct): Add a drop-down menu for the list of categories. (search_option_items): Removed the "Has category" option, since we now have the drop-down menu instad and it would be confusing to have both options. (regen_query): Likewise. Also, this function is now the old cal_search_bar_query_changed() and is shared by that very function and by the callback from the drop-down menu. (notify_query_contains): Include the sub-sexp for the categories. (cal_search_bar_set_categories): New function. (cal_search_bar_get_category): New function. (categories_selection_done_cb): Emit the "category_changed" signal. * gui/e-tasks.c (obj_updated_cb): Removed function since it did not do anything; all updates are handled by the CalendarModel. (obj_removed_cb): Likewise. (ETasksPrivate): Removed the fields for the categories option menu, since now it is in the ESearchBar. (search_bar_sexp_changed_cb): Use calendar_model_set_query() directly here, as we do not need to frob the sexp anymore. (update_query): Removed. (client_categories_changed_cb): New callback. (search_bar_category_changed_cb): New callback. (e_tasks_new_task): Set the default category on the component to the one that is selected in the search bar. (e_tasks_on_filter_selected): Removed. (e_tasks_on_categories_changed): Removed. (e_tasks_rebuild_categories_menu): Removed. (e_tasks_add_menu_item): Removed. (e_tasks_setup_view_menus): Sanitized not to sink objects wildly. (e_tasks_discard_view_menus): New function. * gui/calendar-model.h (CalendarModelClass): Removed the "categories_changed" signal since this is handled in the Wombat now. * gui/calendar-model.c (calendar_model_get_categories): Removed. (calendar_model_set_value_at): Do not collect the categories. (query_obj_updated_cb): Likewise. (calendar_model_collect_categories): Removed. (calendar_model_set_default_category): Constify. * gui/tasks-control.c (tasks_control_deactivate): Call e_tasks_discard_view_menus(). * gui/gnome-cal.c (search_bar_category_changed_cb): Set the default category for the task pad's model. svn path=/trunk/; revision=11559
* more timezone updates. I'm pretty much done with the calendar code now,Damon Chaplin2001-07-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-10 Damon Chaplin <damon@ximian.com> * gui/calendar-model.c: * gui/e-calendar-table.c: * gui/e-day-view-main-item.c: * gui/e-day-view-top-item.c: * gui/e-day-view.[hc]: * gui/e-week-view.c: * gui/gnome-cal.c: * gui/print.c: * gui/dialogs/cal-prefs-dialog.c: * gui/dialogs/comp-editor-util.c: * gui/dialogs/event-page.c: * pcs/cal-backend-file.c: * pcs/query.c: * cal-util/cal-component.[hc]: * cal-util/cal-recur.c: * cal-util/timeutil.[hc]: * cal-client/cal-client.[hc]: more timezone updates. I'm pretty much done with the calendar code now, except for alarms and conduits, which Federico and JP know more about. And there are a couple of other minor things to fix. But it is still pretty buggy. svn path=/trunk/; revision=10984
* added virtual method to get a VTIMEZONE component given a TZID. We needDamon Chaplin2001-07-031-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-03 Damon Chaplin <damon@ximian.com> * pcs/cal-backend.[hc]: added virtual method to get a VTIMEZONE component given a TZID. We need this to resolve TZIDs when expanding an event using cal_recur_generate_instances() in query.c. * pcs/cal-backend-file.c (cal_backend_file_get_timezone): implemented virtual method. (cal_backend_file_update_object): fixed bug, kind -> child_kind. * pcs/query.c (func_occur_in_time_range): use the virtual method for resolving TZIDs. The other way didn't work anyway, as we didn't have the entire VCALENDAR with VTIMEZONEs in it. * gui/dialogs/recurrence-page.c (init_widgets): (make_ending_until_special): moved the call to e_date_edit_set_get_time_callback() from init_widgets to make_ending_until_special(), since that is where the widget gets created. * gui/e-timezone-entry.c (e_timezone_entry_set_timezone): handle zone being NULL. svn path=/trunk/; revision=10732
* cal-client/cal-client.[hc] cal-util/cal-component.cDamon Chaplin2001-07-031-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-07-03 Damon Chaplin <damon@ximian.com> * cal-client/cal-client.[hc] * cal-util/cal-component.c * cal-util/cal-recur.[hc] * cal-util/test-recur.c * cal-util/timeutil.c * gui/calendar-config.c * gui/calendar-model.[hc] * gui/comp-util.[hc] * gui/e-calendar-table.c * gui/e-day-view-main-item.c * gui/e-day-view-top-item.c * gui/e-day-view.[hc] * gui/e-itip-control.c * gui/e-timezone-entry.[hc] * gui/e-week-view.[hc] * gui/gnome-cal.[hc] * gui/goto.c * gui/tag-calendar.[hc] * gui/dialogs/cal-prefs-dialog.c * gui/dialogs/comp-editor-page.[hc] * gui/dialogs/comp-editor-util.[hc] * gui/dialogs/comp-editor.c * gui/dialogs/e-timezone-dialog.[hc] * gui/dialogs/event-page.c * gui/dialogs/meeting-page.c * gui/dialogs/recurrence-page.c * gui/dialogs/task-details-page.c * gui/dialogs/task-details-page.glade * gui/dialogs/task-page.c * idl/evolution-calendar.idl * pcs/cal-backend-file.c * pcs/cal-backend.c * pcs/cal-backend.h * pcs/cal.c * pcs/query.c: timezone changes everywhere. There's still quite a few things to update, and its not working well at present. svn path=/trunk/; revision=10729
* Connect to the "changed" signal of the categories entry so that they willFederico Mena Quintero2001-04-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 2001-04-17 Federico Mena Quintero <federico@ximian.com> * gui/event-editor.c (init_widgets): Connect to the "changed" signal of the categories entry so that they will be applied correctly. (EventEditorPrivate): Added fields for the contacts button and entry. (init_widgets): Disable the contacts widgets as we do not support them yet. (get_widgets): Get the contacts widgets. * gui/dialogs/task-editor.c (get_widgets): Get the contacts button, which was missing. (init_widgets): Disable the contacts widgets as we do not support them yet. * pcs/query.c (matches_text_list): Use e_utf8_strstrcasedecomp() instead of plain e_utf8_strstrcase(). (matches_summary): Likewise. svn path=/trunk/; revision=9436
* Create the ESearchBar thingy. (search_bar_query_changed_cb): Build theFederico Mena Quintero2001-04-161-7/+272
| | | | | | | | | | | | | | | | | | | | | 2001-04-15 Federico Mena Quintero <federico@ximian.com> * gui/gnome-cal.c (setup_widgets): Create the ESearchBar thingy. (search_bar_query_changed_cb): Build the different queries based on the type and string. * pcs/query.c (backend_obj_updated_cb): Ref the query while we are notifying the listener so that it will not disappear from under us. (backend_obj_removed_cb): Likewise. (process_component_cb): Likewise. (func_contains): New function to match text fields. (matches_comment): New function to match comment lists. (matches_description): New function to match description lists. (matches_summary): New function to match summaries. (matches_any): New function to match any text field. (func_has_categories): New function to match categories. svn path=/trunk/; revision=9340
* New function to restart a query for the day view. (query_obj_updated_cb):Federico Mena Quintero2001-04-131-12/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-12 Federico Mena Quintero <federico@ximian.com> * gui/e-day-view.c (update_query): New function to restart a query for the day view. (query_obj_updated_cb): Renamed from obj_updated_cb(); updated for queries instead of calendar clients. (query_obj_removed_cb): Likewise. (cal_opened_cb): Just update_query() instead of queueing reloading all the events. (e_day_view_set_cal_client): Likewise. (e_day_view_set_query): Likewise. (e_day_view_set_selected_time_range): Likewise. (e_day_view_set_days_shown): Likewise. (e_day_view_recalc_work_week): Likewise. (e_day_view_queue_reload_events): Removed function now that events are updated entirely by the query. (e_day_view_reload_events_idle_cb): Likewise. (e_day_view_reload_events): Likewise. (e_day_view_init): Use a pretty arrow instead of GDK_TOP_LEFT_ARROW. * gui/e-week-view.c: Analogous changes to the ones in e-day-view.c. (e_week_view_init): Use a pretty arrow instead of GDK_TOP_LEFT_ARROW. * cal-util/timeutil.c (isodate_from_time_t): Return a g_strdup()ed version of the string instead of a pointer to a static buffer. (time_from_isodate): Resurrected function. Polished up to our current standards of paranoia. * pcs/query.c (func_time_now): New function (time-now). (func_make_time): New function (make-time ISODATE). (func_time_add_day): New function (time-add-day TIME N). (func_time_day_begin): New function (time-day-begin TIME). (func_time_day_end): New function (time-day-end TIME). (func_occur_in_time_range): Use time_t values instead of ints. (match_component): Free the stringized component. Free the ESexp result value. * gui/e-day-view.h: Removed a couple of unused prototypes. * pcs/query.c (query_destroy): Oops, disconnect from the backend. * pcs/cal.c (Cal_get_query): Duplicate the query reference before we return it. * gui/calendar-commands.c (pixmaps): Fixed paths to image files. svn path=/trunk/; revision=9266
* Engine for live queries to calendars. A query object watches a CalBackendFederico Mena Quintero2001-03-301-0/+780
2001-03-29 Federico Mena Quintero <federico@ximian.com> Engine for live queries to calendars. A query object watches a CalBackend in the PCS and is otherwise completely separate from it; backends need to do nothing to support live queries. Right now we have the following functions: (get-vtype) Returns a string indicating the type of component (VEVENT, VTODO, VJOURNAL, VFREEBUSY, VTIMEZONE, UNKNOWN). (occur-in-time-range? START END) START - int, time_t start of the time range END - int, time_t end of the time range Returns a boolean indicating whether the component has any occurrences in the specified time range. * idl/evolution-calendar.idl (Cal::getQuery): New method that initiates a live query. (Query): New interface for a handle to a live query. (QueryListener): New interface for a listener to changes in a live query. * pcs/query.[ch]: New files with the live query engine. * pcs/cal-backend.h (CalBackendClass): Added notification signals so that the query system can catch them. (CalBackendClass): New virtual method ::get_load_state(). * pcs/cal-backend.c (cal_backend_opened): (cal_backend_obj_updated): (cal_backend_obj_updated): New functions to emit the notification signals; to be used only by backend implementations. (cal_backend_get_load_state): New function. * pcs/cal-backend-file.c (notify_update): Call cal_backend_obj_updated(). (notify_remove): Call call_backend_obj_removed(). (open_cal): Free the icalcomp if it is not of the correct type. (cal_backend_file_get_load_state): Implemented new method. * pcs/cal-backend-db.c (cal_backend_db_update_object): Call cal_backend_obj_updated(). (cal_backend_db_remove_object): Call cal_backend_obj_removed(). (cal_backend_db_get_load_state): Implemented new method. * pcs/cal.c (Cal_get_query): Implementation of the ::getQuery() method. svn path=/trunk/; revision=9013