From 7463b3c0eeba36906a6a94130c243a41c65d5e98 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 27 Jul 2001 19:42:21 +0000 Subject: New files with a derivative of ESearchBar that generates sexps for 2001-07-27 Federico Mena Quintero * gui/cal-search-bar.[ch]: New files with a derivative of ESearchBar that generates sexps for calendar queries directly. * gui/gnome-cal.c (setup_widgets): Use CalSearchBar instead of ESearchBar. * gui/e-calendar-table.h (ECalendarTable): Removed the ->colors array since it is handled by ETableExtras now. * gui/e-calendar-table.[ch]: Removed the subset_model. Now we use the live query facility to filter tasks. Removed the filter function stuff as well. * gui/e-tasks.c (e_tasks_construct): Use calendar_model_set_cal_client() directly instead of e_calendar_table_set_model(). (setup_widgets): Create a calendar search bar for the tasks component. (search_bar_sexp_changed_cb): Set the query sexp on the table model. (e_tasks_on_filter_selected): Regenerate the query from the selected category and the current sexp. (update_query): New convenience function to recompute the real query sexp. * gui/gnome-cal.c (gnome_calendar_construct): Likewise. * gui/e-calendar-table.c (e_calendar_table_set_cal_client): Removed function; people are now supposed to get the model from the calendar table and operate on it. * gui/calendar-commands.c (verbs): Consistency fixes with the XML file. (pixmaps): Likewise. * gui/Makefile.am (evolution_calendar_SOURCES): Added cal-search-bar.[ch] to the list of sources. 2001-07-20 Federico Mena Quintero * idl/evolution-calendar.idl (CompEditorFactory): New interface to a centralized factory for calendar component editors. Has editExisting() and editNew() methods to edit an existing component from a URI/UID pair, and to create a new component in a calendar that is in a particular URI, respectively. * gui/comp-editor-factory.[ch]: Implementation files for the component editor factory. * gui/GNOME_Evolution_Calendar.oaf.in: Added the CompEditorFactory stuff. * gui/Makefile.am (evolution_calendar_SOURCES): Added comp-editor-factory.[ch] to the list of sources. svn path=/trunk/; revision=11455 --- calendar/gui/calendar-commands.c | 120 ++++----------------------------------- 1 file changed, 10 insertions(+), 110 deletions(-) (limited to 'calendar/gui/calendar-commands.c') diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 0216c15f48..a0366685c9 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -263,104 +263,7 @@ show_month_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path static void -new_calendar_cmd (BonoboUIComponent *uic, gpointer data, const char *path) -{ - new_calendar (); -} - -static void -open_ok (GtkWidget *widget, GtkFileSelection *fs) -{ - GtkWidget *error_dialog; - int ret; - if(!g_file_exists (gtk_file_selection_get_filename (fs))) { - error_dialog = gnome_message_box_new ( - _("File not found"), - GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, - NULL); - - gnome_dialog_set_parent (GNOME_DIALOG (error_dialog), GTK_WINDOW (fs)); - ret = gnome_dialog_run (GNOME_DIALOG (error_dialog)); - } else { - /* FIXME: find out who owns this calendar and use that name */ -#ifndef NO_WARNINGS -#warning "FIXME: find out who owns this calendar and use that name" -#endif - /* - new_calendar ("Somebody", gtk_file_selection_get_filename (fs)); - */ - gtk_widget_destroy (GTK_WIDGET (fs)); - } -} - -static void -open_calendar_cmd (BonoboUIComponent *uic, gpointer data, const char *path) -{ - GtkFileSelection *fs; - - fs = GTK_FILE_SELECTION (gtk_file_selection_new (_("Open calendar"))); - - gtk_signal_connect (GTK_OBJECT (fs->ok_button), "clicked", - (GtkSignalFunc) open_ok, - fs); - gtk_signal_connect_object (GTK_OBJECT (fs->cancel_button), "clicked", - (GtkSignalFunc) gtk_widget_destroy, - GTK_OBJECT (fs)); - - gtk_widget_show (GTK_WIDGET (fs)); - gtk_grab_add (GTK_WIDGET (fs)); /* Yes, it is modal, so sue me */ -} - -static void -save_ok (GtkWidget *widget, GtkFileSelection *fs) -{ - GnomeCalendar *gcal; - gchar *fname; - - gcal = GNOME_CALENDAR (gtk_object_get_user_data (GTK_OBJECT (fs))); - gtk_window_set_wmclass (GTK_WINDOW (gcal), "gnomecal", "gnomecal"); - - fname = g_strdup (gtk_file_selection_get_filename (fs)); - g_free(fname); - gtk_main_quit (); -} - -static gint -close_save (GtkWidget *w) -{ - gtk_main_quit (); - return TRUE; -} - -static void -save_as_calendar_cmd (BonoboUIComponent *uic, gpointer data, const char *path) -{ - GnomeCalendar *gcal; - GtkFileSelection *fs; - - gcal = GNOME_CALENDAR (data); - - fs = GTK_FILE_SELECTION (gtk_file_selection_new (_("Save calendar"))); - gtk_object_set_user_data (GTK_OBJECT (fs), gcal); - - gtk_signal_connect (GTK_OBJECT (fs->ok_button), "clicked", - (GtkSignalFunc) save_ok, - fs); - gtk_signal_connect_object (GTK_OBJECT (fs->cancel_button), "clicked", - (GtkSignalFunc) close_save, - GTK_OBJECT (fs)); - gtk_signal_connect_object (GTK_OBJECT (fs), "delete_event", - GTK_SIGNAL_FUNC (close_save), - GTK_OBJECT (fs)); - gtk_widget_show (GTK_WIDGET (fs)); - gtk_grab_add (GTK_WIDGET (fs)); /* Yes, it is modal, so sue me even more */ - gtk_main (); - gtk_widget_destroy (GTK_WIDGET (fs)); -} - -static void -preferences_cmd (BonoboUIComponent *uic, gpointer data, const char *path) +settings_cmd (BonoboUIComponent *uic, gpointer data, const char *path) { if (!preferences_dialog) preferences_dialog = cal_prefs_dialog_new (); @@ -471,21 +374,16 @@ clear_folder_bar_label (BonoboControl *control) } static BonoboUIVerb verbs [] = { - BONOBO_UI_VERB ("CalendarNew", new_calendar_cmd), - BONOBO_UI_VERB ("CalendarOpen", open_calendar_cmd), - BONOBO_UI_VERB ("CalendarSaveAs", save_as_calendar_cmd), BONOBO_UI_VERB ("CalendarPrint", file_print_cb), BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb), - BONOBO_UI_VERB ("EditNewAppointment", new_appointment_cb), - BONOBO_UI_VERB ("EditNewEvent", new_event_cb), - BONOBO_UI_VERB ("CalendarPreferences", preferences_cmd), + BONOBO_UI_VERB ("CalendarNewAppointment", new_appointment_cb), + BONOBO_UI_VERB ("CalendarNewEvent", new_event_cb), + BONOBO_UI_VERB ("CalendarSettings", settings_cmd), BONOBO_UI_VERB ("CutEvent", cut_event_cmd), BONOBO_UI_VERB ("CopyEvent", copy_event_cmd), BONOBO_UI_VERB ("PasteEvent", paste_event_cmd), - BONOBO_UI_VERB ("PublishFreeBusy", publish_freebusy_cmd), - BONOBO_UI_VERB ("CalendarPrev", previous_clicked), BONOBO_UI_VERB ("CalendarToday", today_clicked), BONOBO_UI_VERB ("CalendarNext", next_clicked), @@ -496,16 +394,18 @@ static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("ShowWeekView", show_week_view_clicked), BONOBO_UI_VERB ("ShowMonthView", show_month_view_clicked), + BONOBO_UI_VERB ("PublishFreeBusy", publish_freebusy_cmd), + BONOBO_UI_VERB_END }; static EPixmap pixmaps [] = { - E_PIXMAP ("/menu/File/New/NewFirstItem/CalendarNew", "new_appointment.xpm"), + E_PIXMAP ("/menu/File/New/NewFirstItem/NewAppointment", "new_appointment.xpm"), E_PIXMAP ("/menu/File/Print/Print", "print.xpm"), - E_PIXMAP ("/menu/File/Print/Print Preview", "print-preview.xpm"), - E_PIXMAP ("/menu/Actions/Component/CalendarNew", "new_appointment.xpm"), - E_PIXMAP ("/menu/Tools/Component/CalendarPreferences", "configure_16_calendar.xpm"), + E_PIXMAP ("/menu/File/Print/PrintPreview", "print-preview.xpm"), + E_PIXMAP ("/menu/Actions/Component/NewAppointment", "new_appointment.xpm"), + E_PIXMAP ("/menu/Tools/Component/CalendarSettings", "configure_16_calendar.xpm"), E_PIXMAP ("/Toolbar/New", "buttons/new_appointment.png"), E_PIXMAP ("/Toolbar/Print", "buttons/print.png"), -- cgit v1.2.3