From 98317c656590737ced646d6fb4bd65e527c7e178 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 15 May 2000 16:51:36 +0000 Subject: gladeified replacement for eventedit.c * gui/event-editor.[ch]: gladeified replacement for eventedit.c * gui/event-editor-utils.[ch]: utilities used by event-editor.c * gui/event-editor-dialog.glade: glade file used by event-editor.c svn path=/trunk/; revision=3046 --- calendar/gui/Makefile.am | 22 +- calendar/gui/e-day-view.c | 4 +- calendar/gui/event-editor-dialog.glade | 1943 +++++++++++++++++++++++++++++ calendar/gui/event-editor-utils.c | 228 ++++ calendar/gui/event-editor-utils.h | 22 + calendar/gui/event-editor.c | 438 +++++++ calendar/gui/event-editor.h | 41 + calendar/gui/eventedit.c | 3 +- calendar/gui/evolution-calendar-control.c | 8 +- calendar/gui/prop.c | 8 +- 10 files changed, 2709 insertions(+), 8 deletions(-) create mode 100644 calendar/gui/event-editor-dialog.glade create mode 100644 calendar/gui/event-editor-utils.c create mode 100644 calendar/gui/event-editor-utils.h create mode 100644 calendar/gui/event-editor.c create mode 100644 calendar/gui/event-editor.h diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index cffe6aaa22..3d13df9148 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -6,6 +6,10 @@ help_base = $(datadir)/gnome/help/cal # calendar-pilot-sync #endif + +CPPFLAGS = \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" + INCLUDES = \ -DG_LOG_DOMAIN=\"calendar-gui\" \ -I$(top_srcdir) \ @@ -15,6 +19,7 @@ INCLUDES = \ $(BONOBO_VFS_GNOME_CFLAGS) \ $(GNOME_CONDUIT_INCLUDEDIR) \ $(PISOCK_INCLUDEDIR) \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" LINK_FLAGS = \ @@ -27,6 +32,9 @@ LINK_FLAGS = \ $(top_builddir)/libversit/libversit.la \ $(top_builddir)/libical/src/libical/libical.la +gladedir = $(datadir)/evolution/glade +glade_DATA = event-editor-dialog.glade + bin_PROGRAMS = evolution-calendar evolution_calendar_SOURCES = \ @@ -48,8 +56,8 @@ evolution_calendar_SOURCES = \ e-week-view-titles-item.h \ e-week-view.c \ e-week-view.h \ - eventedit.c \ - eventedit.h \ + event-editor-utils.c \ + event-editor-utils.h \ getdate.y \ gncal-todo.c \ gncal-todo.h \ @@ -70,8 +78,18 @@ evolution_calendar_SOURCES = \ year-view.h \ calendar-commands.c \ calendar-commands.h \ + event-editor.c \ + event-editor.h \ evolution-calendar-control.c +# eventedit.c \ +# eventedit.h \ + + + + + + evolution_calendar_LDADD = \ $(EXTRA_GNOME_LIBS) \ $(BONOBO_HTML_GNOME_LIBS) \ diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 15b0ea805f..e21a492c71 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -2318,7 +2318,7 @@ e_day_view_on_new_appointment (GtkWidget *widget, gpointer data) &ico->dtend); event_editor = event_editor_new (day_view->calendar, ico); ical_object_unref (ico); - gtk_widget_show (event_editor); + //gtk_widget_show (event_editor); } @@ -2342,7 +2342,7 @@ e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data) event_editor = event_editor_new (day_view->calendar, ico); ical_object_unref (ico); - gtk_widget_show (event_editor); + //gtk_widget_show (event_editor); } diff --git a/calendar/gui/event-editor-dialog.glade b/calendar/gui/event-editor-dialog.glade new file mode 100644 index 0000000000..72bb7bbd98 --- /dev/null +++ b/calendar/gui/event-editor-dialog.glade @@ -0,0 +1,1943 @@ + + + + + event-editor-dialog + event-editor-dialog + + . + pixmaps + C + True + True + False + False + False + True + event-editor-strings + + + + GnomeDialog + event-editor-dialog + Edit appointment + GTK_WINDOW_DIALOG + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button1 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button2 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button3 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkNotebook + notebook2 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkVBox + vbox2 + False + 0 + + + GtkHBox + hbox4 + False + 0 + + 0 + True + True + + + + GtkLabel + label13 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + general-owner + True + True + True + 0 + + + 0 + True + True + + + + + + GtkHBox + hbox5 + False + 0 + + 0 + False + False + + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + False + False + + + + GtkText + general-summary + True + True + + + + + + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table3 + 2 + 3 + False + 0 + 0 + + + GtkLabel + label15 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkLabel + label16 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + Custom + start-time + make_date_edit + + + 0 + 0 + Fri, 12 May 2000 16:49:54 GMT + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + + Custom + end-time + make_date_edit + 0 + 0 + Fri, 12 May 2000 16:50:00 GMT + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + + GtkCheckButton + all-day-event + True + + False + True + + 2 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + + + GtkFrame + frame6 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table4 + 4 + 5 + False + 0 + 0 + + + GtkSpinButton + alarm-display-amount + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 1 + 10 + 10 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkSpinButton + alarm-audio-amount + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 1 + 10 + 10 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkSpinButton + alarm-program-amount + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 1 + 10 + 10 + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + + GtkSpinButton + alarm-mail-amount + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 + 0 + 100 + 1 + 10 + 10 + + 1 + 2 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + + GtkOptionMenu + alarm-display-unit + True + Minutes +Hours +Days + + 0 + + 2 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkOptionMenu + alarm-audio-unit + True + Minutes +Hours +Days + + 0 + + 2 + 3 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + GtkOptionMenu + alarm-program-unit + True + Minutes +Hours +Days + + 0 + + 2 + 3 + 2 + 3 + 0 + 0 + False + False + False + False + False + False + + + + + GtkOptionMenu + alarm-mail-unit + True + Minutes +Hours +Days + + 0 + + 2 + 3 + 3 + 4 + 0 + 0 + False + False + False + False + False + False + + + + + GtkEntry + mail-to + True + True + True + 0 + + + 4 + 5 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + + GnomeFileEntry + fileentry1 + 10 + False + False + + 4 + 5 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + GtkEntry + GnomeEntry:entry + run-program + True + True + True + 0 + + + + + + GtkCheckButton + alarm-display + True + + False + True + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCheckButton + alarm-audio + True + + False + True + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCheckButton + alarm-program + True + + False + True + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCheckButton + alarm-mail + True + + False + True + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label18 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 3 + 4 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label17 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 3 + 4 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + + + GtkFrame + frame5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkHBox + hbox6 + False + 0 + + + GtkRadioButton + classification-public + True + + True + True + classification_radio_group + + 0 + False + False + + + + + GtkRadioButton + classification-private + True + + False + True + classification_radio_group + + 0 + False + False + + + + + GtkRadioButton + classification-confidential + True + + False + True + classification_radio_group + + 0 + False + False + + + + + + + + GtkLabel + Notebook:tab + label11 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox3 + 4 + False + 0 + + + GtkFrame + frame8 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkHBox + hbox7 + False + 0 + + + GtkVBox + vbox4 + False + 0 + + 0 + False + False + + + + GtkRadioButton + recurrence-rule-none + True + + True + True + recurrence_rule_group + + 0 + False + False + + + + + GtkRadioButton + recurrence-rule-daily + True + + False + True + recurrence_rule_group + + 0 + False + False + + + + + GtkRadioButton + recurrence-rule-weekly + True + + False + True + recurrence_rule_group + + 0 + False + False + + + + + GtkRadioButton + recurrence-rule-monthly + True + + False + True + recurrence_rule_group + + 0 + False + False + + + + + GtkRadioButton + recurrence-rule-yearly + True + + False + True + recurrence_rule_group + + 0 + False + False + + + + + + GtkVSeparator + vseparator1 + + 0 + False + True + + + + + GtkNotebook + recurrence-rule-notebook + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + Placeholder + + + + GtkLabel + Notebook:tab + label23 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkAlignment + alignment1 + 0.5 + 0.5 + 1 + 1 + + + GtkVBox + vbox7 + False + 0 + + + GtkHBox + hbox13 + False + 0 + + 0 + False + True + + + + GtkLabel + label31 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkSpinButton + recurrence-rule-daily-days + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 0 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label32 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + + GtkLabel + Notebook:tab + label24 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox8 + False + 0 + + + GtkHBox + hbox14 + False + 0 + + 0 + False + True + + + + GtkLabel + label33 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkSpinButton + recurrence-rule-weekly-weeks + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 0 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label34 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHBox + hbox15 + False + 0 + + 0 + False + True + + + + GtkCheckButton + recurrence-rule-weekly-mon + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-tue + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-wed + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-thu + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-fri + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-sat + True + + False + True + + 0 + False + False + + + + + GtkCheckButton + recurrence-rule-weekly-sun + True + + False + True + + 0 + False + False + + + + + + + GtkLabel + Notebook:tab + label25 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox16 + False + 0 + + + GtkVBox + vbox9 + False + 0 + + 0 + True + True + + + + GtkVBox + vbox10 + False + 0 + + 0 + True + True + + + + GtkHBox + hbox17 + False + 0 + + 0 + True + True + + + + GtkRadioButton + recurrence-rule-monthly-on-day + True + + True + True + recurrence_rule_monthly_group + + 0 + False + False + + + + + GtkSpinButton + recurrence-rule-monthly-day + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 0 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label35 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHBox + hbox18 + False + 0 + + 0 + False + False + + + + GtkRadioButton + recurrence-rule-monthly-weekday + True + + False + True + recurrence_rule_monthly_group + + 0 + False + False + + + + + GtkOptionMenu + recurrence-rule-monthly-week + True + 1st +2nd +3rd +4th +5th + + 0 + + 0 + False + False + + + + + GtkOptionMenu + recurrence-rule-monthly-day + True + Monday +Tuesday +Wednesday +Thursday +Friday +Saturday +Sunday + + 0 + + 0 + False + False + + + + + + + Placeholder + + + + + GtkHBox + hbox19 + False + 0 + + 0 + False + True + + + + GtkLabel + label36 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkSpinButton + recurrence-rule-monthly-every-n-months + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 1 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label37 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + GtkLabel + Notebook:tab + label26 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox11 + False + 0 + + + GtkHBox + hbox20 + False + 0 + + 0 + False + True + + + + GtkLabel + label38 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkSpinButton + recurrence-rule-yearly-every-n-years + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 0 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label39 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + GtkLabel + Notebook:tab + label27 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkHBox + hbox8 + False + 0 + + 0 + False + True + + + + GtkFrame + frame9 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox5 + True + 0 + + + GtkRadioButton + recurrence-ending-date-repeat-forever + True + + False + True + recurrence_ending_date + + 0 + False + False + + + + + GtkHBox + hbox12 + False + 0 + + 0 + False + True + + + + GtkRadioButton + recurrence-ending-date-end-on + True + + False + True + recurrence_ending_date + + 0 + False + False + + + + + Custom + recurrence-ending-date-end-on-date + 100 + make_date_edit + 0 + 0 + Sat, 13 May 2000 18:02:55 GMT + + 0 + True + True + + + + + + GtkHBox + hbox10 + False + 0 + + 0 + True + True + + + + GtkRadioButton + recurrence-ending-date-end-after + True + + False + True + recurrence_ending_date + + 0 + False + False + + + + + GtkSpinButton + recurrence-ending-date-end-after-count + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 2 + 0 + 100 + 1 + 10 + 10 + + 0 + False + True + + + + + GtkLabel + label28 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + + GtkFrame + frame10 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkHBox + hbox11 + False + 0 + + + GtkVBox + vbox6 + False + 0 + + 0 + True + True + + + + Custom + recurrence-exceptions-date + make_date_edit + 0 + 0 + Sat, 13 May 2000 18:04:39 GMT + + 0 + True + True + + + + + GtkButton + recurrence-exceptions-add + True + + + 0 + False + False + + + + + GtkButton + recurrence-exceptions-change + True + + + 0 + False + False + + + + + GtkButton + recurrence-exceptions-delete + True + + + 0 + False + False + + + + + + GtkList + recurrence-exceptions-list + 40 + GTK_SELECTION_SINGLE + + 0 + True + True + + + + + + + + + GtkLabel + Notebook:tab + label12 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + diff --git a/calendar/gui/event-editor-utils.c b/calendar/gui/event-editor-utils.c new file mode 100644 index 0000000000..8361a493c5 --- /dev/null +++ b/calendar/gui/event-editor-utils.c @@ -0,0 +1,228 @@ +#include +#include +#include +#include + + +/***************/ +/*** storing ***/ +/***************/ + +void +store_to_editable (GladeXML *gui, char *widget_name, gchar *content) +{ + GtkWidget *widget = glade_xml_get_widget (gui, widget_name); + GtkEditable *editable = GTK_EDITABLE (widget); + int position = 0; + + if (! content) + return; + + gtk_editable_delete_text (editable, 0, -1); + gtk_editable_insert_text (editable, content, + strlen (content), &position); +} + + +void +store_to_toggle (GladeXML *gui, char *widget_name, gboolean content) +{ + GtkWidget *widget = glade_xml_get_widget (gui, widget_name); + GtkToggleButton *toggle = GTK_TOGGLE_BUTTON (widget); + gtk_toggle_button_set_active (toggle, content); +} + + +void +store_to_spin (GladeXML *gui, char *widget_name, gint content) +{ + GtkWidget *widget; + GtkSpinButton *spin; + + widget = glade_xml_get_widget (gui, widget_name); + spin = GTK_SPIN_BUTTON (widget); + gtk_spin_button_set_value (spin, (gfloat) content); +} + + +void +store_to_alarm_unit (GladeXML *gui, char *widget_name, enum AlarmUnit content) +{ + GtkWidget *widget; + GtkOptionMenu *option; + + widget = glade_xml_get_widget (gui, widget_name); + option = GTK_OPTION_MENU (widget); + + switch (content) { + case ALARM_MINUTES: + gtk_option_menu_set_history (option, 0); break; + case ALARM_HOURS: + gtk_option_menu_set_history (option, 1); break; + case ALARM_DAYS: + gtk_option_menu_set_history (option, 2); break; + } +} + + +void +store_to_option (GladeXML *gui, char *widget_name, gint content) +{ + GtkWidget *widget; + GtkOptionMenu *option; + + widget = glade_xml_get_widget (gui, widget_name); + option = GTK_OPTION_MENU (widget); + + gtk_option_menu_set_history (option, content); +} + + +void +store_to_gnome_dateedit (GladeXML *gui, char *widget_name, time_t content) +{ + GtkWidget *widget; + GnomeDateEdit *gde; + + widget = glade_xml_get_widget (gui, widget_name); + gde = GNOME_DATE_EDIT (widget); + gnome_date_edit_set_time (gde, content); +} + + + +/******************/ +/*** extracting ***/ +/******************/ + + +gchar *extract_from_editable (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkEditable *editable; + gchar *content; + + widget = glade_xml_get_widget (gui, widget_name); + editable = GTK_EDITABLE (widget); + content = gtk_editable_get_chars (editable, 0, -1); + return content; +} + + +gboolean extract_from_toggle (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkToggleButton *toggle; + gboolean content; + + widget = glade_xml_get_widget (gui, widget_name); + toggle = GTK_TOGGLE_BUTTON (widget); + content = gtk_toggle_button_get_active (toggle); + return content; +} + + +gint extract_from_spin (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkSpinButton *spin; + gint content; + + widget = glade_xml_get_widget (gui, widget_name); + spin = GTK_SPIN_BUTTON (widget); + content = gtk_spin_button_get_value_as_int (spin); + return content; +} + + +#if 0 +char *extract_from_option (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkOptionMenu *option; + GtkWidget *picked; + GtkMenu *menu; + GtkMenuItem *menu_item; + //GList *children; + GtkLabel *label; + char *content = NULL; + + widget = glade_xml_get_widget (gui, widget_name); + option = GTK_OPTION_MENU (widget); + picked = gtk_option_menu_get_menu (option); + menu = GTK_MENU (picked); + menu_item = GTK_MENU_ITEM (gtk_menu_get_active (menu)); + label = GTK_LABEL (GTK_BIN (menu_item)->child); + gtk_label_get (label, &content); + + return content; +} +#endif /* 0 */ + + +#if 0 +enum AlarmUnit +extract_from_alarm_unit (GladeXML *gui, char *widget_name) +{ + GtkWidget *option; + enum AlarmUnit u; + + option = glade_xml_get_widget (gui, widget_name); + u = (enum AlarmUnit) gtk_object_get_data (GTK_OBJECT (option), "unit"); + return u; +} +#endif /* 0 */ + + +enum AlarmUnit +extract_from_alarm_unit (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkOptionMenu *option; + GtkMenu *menu; + GtkMenuShell *menu_shell; + GtkMenuItem *menu_item; + enum AlarmUnit content; + + widget = glade_xml_get_widget (gui, widget_name); + option = GTK_OPTION_MENU (widget); + menu = GTK_MENU (gtk_option_menu_get_menu (option)); + menu_shell = GTK_MENU_SHELL (menu); + menu_item = GTK_MENU_ITEM (gtk_menu_get_active (menu)); + + content = g_list_index (menu_shell->children, (gpointer) menu_item); + return (content >= 0) ? content : ALARM_MINUTES; +} + + +guint +extract_from_option (GladeXML *gui, char *widget_name) +{ + GtkWidget *widget; + GtkOptionMenu *option; + GtkMenu *menu; + GtkMenuShell *menu_shell; + GtkMenuItem *menu_item; + enum AlarmUnit content; + + widget = glade_xml_get_widget (gui, widget_name); + option = GTK_OPTION_MENU (widget); + menu = GTK_MENU (gtk_option_menu_get_menu (option)); + menu_shell = GTK_MENU_SHELL (menu); + menu_item = GTK_MENU_ITEM (gtk_menu_get_active (menu)); + + content = g_list_index (menu_shell->children, (gpointer) menu_item); + return (content >= 0) ? content : 0; +} + + +time_t extract_from_gnome_dateedit (GladeXML *gui, char *widget_name) +{ + GtkWidget *de; + time_t t; + + de = glade_xml_get_widget (gui, widget_name); + t = gnome_date_edit_get_date (GNOME_DATE_EDIT (de)); + return t; +} + diff --git a/calendar/gui/event-editor-utils.h b/calendar/gui/event-editor-utils.h new file mode 100644 index 0000000000..61631028db --- /dev/null +++ b/calendar/gui/event-editor-utils.h @@ -0,0 +1,22 @@ + + +#include "gnome-cal.h" +#include +//#include + +void store_to_editable (GladeXML *gui, char *widget_name, gchar *content); +void store_to_toggle (GladeXML *gui, char *widget_name, gboolean content); +void store_to_spin (GladeXML *gui, char *widget_name, gint content); +void store_to_alarm_unit (GladeXML *gui, char *widget_name, + enum AlarmUnit content); +void store_to_option (GladeXML *gui, char *widget_name, gint content); +void store_to_gnome_dateedit (GladeXML *gui, char *widget_name, + time_t content); + + +gchar *extract_from_editable (GladeXML *gui, char *widget_name); +gboolean extract_from_toggle (GladeXML *gui, char *widget_name); +gint extract_from_spin (GladeXML *gui, char *widget_name); +enum AlarmUnit extract_from_alarm_unit (GladeXML *gui, char *widget_name); +guint extract_from_option (GladeXML *gui, char *widget_name); +time_t extract_from_gnome_dateedit (GladeXML *gui, char *widget_name); diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c new file mode 100644 index 0000000000..50d6c8a346 --- /dev/null +++ b/calendar/gui/event-editor.c @@ -0,0 +1,438 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#include +#include +#include +#include +#include + +typedef struct { + GladeXML *gui; + GtkWidget *dialog; + GnomeCalendar *gnome_cal; + iCalObject *ical; +} EventEditorDialog; + + +extern int day_begin, day_end; +extern char *user_name; +extern int am_pm_flag; +extern int week_starts_on_monday; + + +static void +fill_in_dialog_from_ical (EventEditorDialog *dialog) +{ + iCalObject *ical = dialog->ical; + GladeXML *gui = dialog->gui; + + store_to_editable (gui, "general-owner", + dialog->ical->organizer->addr ? + dialog->ical->organizer->addr : _("?")); + + store_to_editable (gui, "general-summary", ical->summary); + + /* start and end time */ + store_to_gnome_dateedit (gui, "start-time", ical->dtstart); + store_to_gnome_dateedit (gui, "end-time", ical->dtend); + + /* all day event checkbox */ + if (get_time_t_hour (ical->dtstart) <= day_begin && + get_time_t_hour (ical->dtend) >= day_end) + store_to_toggle (gui, "all-day-event", TRUE); + else + store_to_toggle (gui, "all-day-event", FALSE); + + /* alarms */ + store_to_toggle (gui, "alarm-display", ical->dalarm.enabled); + store_to_toggle (gui, "alarm-program", ical->palarm.enabled); + store_to_toggle (gui, "alarm-audio", ical->aalarm.enabled); + store_to_toggle (gui, "alarm-mail", ical->malarm.enabled); + + /* alarm counts */ + store_to_spin (gui, "alarm-display-amount", ical->dalarm.count); + store_to_spin (gui, "alarm-audio-amount", ical->aalarm.count); + store_to_spin (gui, "alarm-program-amount", ical->palarm.count); + store_to_spin (gui, "alarm-mail-amount", ical->malarm.count); + + store_to_alarm_unit (gui, "alarm-display-unit", ical->dalarm.units); + store_to_alarm_unit (gui, "alarm-audio-unit", ical->aalarm.units); + store_to_alarm_unit (gui, "alarm-program-unit", ical->palarm.units); + store_to_alarm_unit (gui, "alarm-mail-unit", ical->malarm.units); + + store_to_editable (gui, "run-program", ical->palarm.data); + store_to_editable (gui, "mail-to", ical->malarm.data); + + /* classification */ + if (strcmp (ical->class, "PUBLIC") == 0) + store_to_toggle (gui, "classification-public", TRUE); + if (strcmp (ical->class, "PRIVATE") == 0) + store_to_toggle (gui, "classification-private", TRUE); + if (strcmp (ical->class, "CONFIDENTIAL") == 0) + store_to_toggle (gui, "classification-confidential", TRUE); + + /* recurrence rules */ + + if (! ical->recur) + return; + + switch (ical->recur->type) { + case RECUR_DAILY: + store_to_toggle (gui, "recurrence-rule-daily", TRUE); + store_to_spin (gui, "recurrence-rule-daily-days", ical->recur->interval); + break; + case RECUR_WEEKLY: + store_to_toggle (gui, "recurrence-rule-weekly", TRUE); + store_to_spin (gui, "recurrence-rule-weekly-weeks", ical->recur->interval); + if (ical->recur->weekday & (1 << 0)) + store_to_toggle (gui, "recurrence-rule-weekly-sun", TRUE); + if (ical->recur->weekday & (1 << 1)) + store_to_toggle (gui, "recurrence-rule-weekly-mon", TRUE); + if (ical->recur->weekday & (1 << 2)) + store_to_toggle (gui, "recurrence-rule-weekly-tue", TRUE); + if (ical->recur->weekday & (1 << 3)) + store_to_toggle (gui, "recurrence-rule-weekly-wed", TRUE); + if (ical->recur->weekday & (1 << 4)) + store_to_toggle (gui, "recurrence-rule-weekly-thu", TRUE); + if (ical->recur->weekday & (1 << 5)) + store_to_toggle (gui, "recurrence-rule-weekly-fri", TRUE); + if (ical->recur->weekday & (1 << 6)) + store_to_toggle (gui, "recurrence-rule-weekly-sat", TRUE); + break; + case RECUR_MONTHLY_BY_DAY: + store_to_toggle (gui, "recurrence-rule-monthly", TRUE); + store_to_toggle (gui, "recurrence-rule-monthly-on-day", TRUE); + store_to_spin (gui, "recurrence-rule-monthly-day", ical->recur->u.month_day); + store_to_spin (gui, "recurrence-rule-monthly-every-n-months", ical->recur->interval); + break; + case RECUR_MONTHLY_BY_POS: + store_to_toggle (gui, "recurrence-rule-monthly", TRUE); + store_to_toggle (gui, "recurrence-rule-monthly-weekday", TRUE); + store_to_option (gui, "recurrence-rule-monthly-week", ical->recur->u.month_pos); + store_to_option (gui, "recurrence-rule-monthly-day", ical->recur->weekday); + store_to_spin (gui, "recurrence-rule-monthly-every-n-months", ical->recur->interval); + break; + case RECUR_YEARLY_BY_DAY: + case RECUR_YEARLY_BY_MONTH: + store_to_toggle (gui, "recurrence-rule-yearly", TRUE); + store_to_spin (gui, "recurrence-rule-yearly-every-n-years", ical->recur->interval); + break; + } + + /* recurrence ending date */ + if (ical->recur->duration != 0) { + store_to_toggle (gui, "recurrence-ending-date-end-after", TRUE); + store_to_spin (gui, "recurrence-ending-date-end-after-count", ical->recur->duration); + } + else if (ical->recur->enddate != 0) { + store_to_toggle (gui, "recurrence-ending-date-end-on", TRUE); + /* Shorten by one day, as we store end-on date a day ahead */ + store_to_gnome_dateedit (gui, "recurrence-ending-date-end-on-date", ical->recur->enddate - 86400); + } + /* else repeat forever */ +} + + +static void +fill_in_dialog_from_defaults (EventEditorDialog *dialog) +{ + time_t now = time (NULL); + time_t soon = time_add_minutes (now, 30); + + store_to_editable (dialog->gui, "general-owner", "?"); + + /* start and end time */ + store_to_gnome_dateedit (dialog->gui, "start-time", now); + store_to_gnome_dateedit (dialog->gui, "end-time", soon); +} + + +static void +dialog_to_ical (EventEditorDialog *dialog) +{ + iCalObject *ical = dialog->ical; + gboolean all_day_event; + GladeXML *gui = dialog->gui; + + /* general event information */ + + if (ical->summary) + g_free (ical->summary); + ical->summary = extract_from_editable (gui, "general-summary"); + + ical->dtstart = extract_from_gnome_dateedit (gui, "start-time"); + ical->dtend = extract_from_gnome_dateedit (gui, "end-time"); + + all_day_event = extract_from_toggle (gui, "all-day-event"); + + ical->dalarm.enabled = extract_from_toggle (gui, "alarm-display"); + ical->aalarm.enabled = extract_from_toggle (gui, "alarm-program"); + ical->palarm.enabled = extract_from_toggle (gui, "alarm-audio"); + ical->malarm.enabled = extract_from_toggle (gui, "alarm-mail"); + + ical->dalarm.count = extract_from_spin (gui, "alarm-display-amount"); + ical->aalarm.count = extract_from_spin (gui, "alarm-audio-amount"); + ical->palarm.count = extract_from_spin (gui, "alarm-program-amount"); + ical->malarm.count = extract_from_spin (gui, "alarm-mail-amount"); + + ical->dalarm.units = extract_from_alarm_unit (gui, "alarm-display-unit"); + ical->aalarm.units = extract_from_alarm_unit (gui, "alarm-audio-unit"); + ical->palarm.units = extract_from_alarm_unit (gui, "alarm-program-unit"); + ical->malarm.units = extract_from_alarm_unit (gui, "alarm-mail-unit"); + + ical->palarm.data = g_strdup (extract_from_editable (gui, "run-program")); + ical->malarm.data = g_strdup (extract_from_editable (gui, "mail-to")); + + if (extract_from_toggle (gui, "classification-public")) + ical->class = g_strdup ("PUBLIC"); + else if (extract_from_toggle (gui, "classification-private")) + ical->class = g_strdup ("PRIVATE"); + else /* "classification-confidential" */ + ical->class = g_strdup ("CONFIDENTIAL"); + + + /* recurrence information */ + + if (extract_from_toggle (gui, "recurrence-rule-none")) + return; /* done */ + if (!ical->recur) + ical->recur = g_new0 (Recurrence, 1); + + if (extract_from_toggle (gui, "recurrence-rule-daily")) { + ical->recur->type = RECUR_DAILY; + ical->recur->interval = extract_from_spin (gui, "recurrence-rule-daily-days"); + } + if (extract_from_toggle (gui, "recurrence-rule-weekly")) { + ical->recur->type = RECUR_WEEKLY; + ical->recur->interval = extract_from_spin (gui, "recurrence-rule-weekly-weeks"); + ical->recur->weekday = 0; + + if (extract_from_toggle (gui, "recurrence-rule-weekly-sun")) + ical->recur->weekday |= 1 << 0; + if (extract_from_toggle (gui, "recurrence-rule-weekly-mon")) + ical->recur->weekday |= 1 << 1; + if (extract_from_toggle (gui, "recurrence-rule-weekly-tue")) + ical->recur->weekday |= 1 << 2; + if (extract_from_toggle (gui, "recurrence-rule-weekly-wed")) + ical->recur->weekday |= 1 << 3; + if (extract_from_toggle (gui, "recurrence-rule-weekly-thu")) + ical->recur->weekday |= 1 << 4; + if (extract_from_toggle (gui, "recurrence-rule-weekly-fri")) + ical->recur->weekday |= 1 << 5; + if (extract_from_toggle (gui, "recurrence-rule-weekly-sat")) + ical->recur->weekday |= 1 << 6; + } + if (extract_from_toggle (gui, "recurrence-rule-monthly")) { + if (extract_from_toggle (gui, "recurrence-rule-monthly-on-day")) { + /* by day of in the month (ex: the 5th) */ + ical->recur->type = RECUR_MONTHLY_BY_DAY; + ical->recur->u.month_day = extract_from_spin (gui, "recurrence-rule-monthly-day"); + + } + else { /* "recurrence-rule-monthly-weekday" is TRUE */ + /* by position on the calender (ex: 2nd monday) */ + ical->recur->type = RECUR_MONTHLY_BY_POS; + ical->recur->u.month_pos = extract_from_option (gui, "recurrence-rule-monthly-week"); + ical->recur->weekday = extract_from_option (gui, "recurrence-rule-monthly-day"); + } + ical->recur->interval = extract_from_spin (gui, "recurrence-rule-monthly-every-n-months"); + } + if (extract_from_toggle (gui, "recurrence-rule-yearly")) { + ical->recur->type = RECUR_YEARLY_BY_DAY; + ical->recur->interval = extract_from_spin (gui, "recurrence-rule-yearly-every-n-years"); + /* FIXME: need to specify anything else? I am assuming the code will look at the dtstart + * to figure out when to recur. - Federico + */ + } + + /* recurrence ending date */ + if (extract_from_toggle (gui, "recurrence-ending-date-repeat-forever")) { + ical->recur->_enddate = 0; + ical->recur->enddate = 0; + ical->recur->duration = 0; + } + if (extract_from_toggle (gui, "recurrence-ending-date-end-on")) { + /* Also here, to ensure that the event is used, we add 86400 secs to get + get next day, in accordance to the RFC */ + ical->recur->_enddate = extract_from_gnome_dateedit (gui, "recurrence-ending-date-end-on-date") + 86400; + ical->recur->enddate = ical->recur->_enddate; + ical->recur->duration = 0; + } + if (extract_from_toggle (gui, "recurrence-ending-date-end-after")) { + ical->recur->duration = extract_from_spin (gui, "recurrence-ending-date-end-after-count"); + ical_object_compute_end (ical); + } +} + + +static void +ee_ok (GtkWidget *widget, EventEditorDialog *dialog) +{ + dialog_to_ical (dialog); + + if (dialog->ical->new) + gnome_calendar_add_object (dialog->gnome_cal, dialog->ical); + else + gnome_calendar_object_changed (dialog->gnome_cal, + dialog->ical, + CHANGE_ALL); + dialog->ical->new = 0; +} + + +static void +ee_cancel (GtkWidget *widget, EventEditorDialog *dialog) +{ + if (dialog->ical) { + ical_object_unref (dialog->ical); + dialog->ical = NULL; + } +} + + +static void +recurrence_toggled (GtkWidget *radio, EventEditorDialog *dialog) +{ + GtkWidget *recurrence_rule_notebook = glade_xml_get_widget (dialog->gui, "recurrence-rule-notebook"); + + GtkWidget *recurrence_rule_none = glade_xml_get_widget (dialog->gui, "recurrence-rule-none"); + GtkWidget *recurrence_rule_daily = glade_xml_get_widget (dialog->gui, "recurrence-rule-daily"); + GtkWidget *recurrence_rule_weekly = glade_xml_get_widget (dialog->gui, "recurrence-rule-weekly"); + GtkWidget *recurrence_rule_monthly = glade_xml_get_widget (dialog->gui, "recurrence-rule-monthly"); + GtkWidget *recurrence_rule_yearly = glade_xml_get_widget (dialog->gui, "recurrence-rule-yearly"); + + if (radio == recurrence_rule_none) + gtk_notebook_set_page (GTK_NOTEBOOK (recurrence_rule_notebook), 0); + if (radio == recurrence_rule_daily) + gtk_notebook_set_page (GTK_NOTEBOOK (recurrence_rule_notebook), 1); + if (radio == recurrence_rule_weekly) + gtk_notebook_set_page (GTK_NOTEBOOK (recurrence_rule_notebook), 2); + if (radio == recurrence_rule_monthly) + gtk_notebook_set_page (GTK_NOTEBOOK (recurrence_rule_notebook), 3); + if (radio == recurrence_rule_yearly) + gtk_notebook_set_page (GTK_NOTEBOOK (recurrence_rule_notebook), 4); +} + + + +GtkWidget *event_editor_new (GnomeCalendar *gcal, iCalObject *ical) +{ + EventEditorDialog *dialog = g_new0 (EventEditorDialog, 1); + + dialog->ical = ical; + dialog->gnome_cal = gcal; + + printf ("glade_xml_new (%s, NULL)\n", + EVOLUTION_GLADEDIR "/event-editor-dialog.glade"); + + dialog->gui = glade_xml_new (EVOLUTION_GLADEDIR + "/event-editor-dialog.glade", + NULL); + + dialog->dialog = glade_xml_get_widget (dialog->gui, + "event-editor-dialog"); + + gnome_dialog_button_connect (GNOME_DIALOG (dialog->dialog), + 0, GTK_SIGNAL_FUNC(ee_ok), dialog); + gnome_dialog_button_connect (GNOME_DIALOG (dialog->dialog), + 1, GTK_SIGNAL_FUNC(ee_cancel), dialog); + + + { + GtkWidget *recurrence_rule_none = glade_xml_get_widget (dialog->gui, "recurrence-rule-none"); + GtkWidget *recurrence_rule_daily = glade_xml_get_widget (dialog->gui, "recurrence-rule-daily"); + GtkWidget *recurrence_rule_weekly = glade_xml_get_widget (dialog->gui, "recurrence-rule-weekly"); + GtkWidget *recurrence_rule_monthly = glade_xml_get_widget (dialog->gui, "recurrence-rule-monthly"); + GtkWidget *recurrence_rule_yearly = glade_xml_get_widget (dialog->gui, "recurrence-rule-yearly"); + + gtk_signal_connect (GTK_OBJECT (recurrence_rule_none), "toggled", + GTK_SIGNAL_FUNC (recurrence_toggled), dialog); + gtk_signal_connect (GTK_OBJECT (recurrence_rule_daily), "toggled", + GTK_SIGNAL_FUNC (recurrence_toggled), dialog); + gtk_signal_connect (GTK_OBJECT (recurrence_rule_weekly), "toggled", + GTK_SIGNAL_FUNC (recurrence_toggled), dialog); + gtk_signal_connect (GTK_OBJECT (recurrence_rule_monthly), "toggled", + GTK_SIGNAL_FUNC (recurrence_toggled), dialog); + gtk_signal_connect (GTK_OBJECT (recurrence_rule_yearly), "toggled", + GTK_SIGNAL_FUNC (recurrence_toggled), dialog); + + } + + + + if (ical->new) + fill_in_dialog_from_defaults (dialog); + else + fill_in_dialog_from_ical (dialog); + + + gnome_dialog_run (GNOME_DIALOG(dialog->dialog)); + + gnome_dialog_close (GNOME_DIALOG(dialog->dialog)); + + return dialog->dialog; +} + + +void event_editor_new_whole_day (GnomeCalendar *owner, time_t day) +{ +} + + + +GtkWidget *make_date_edit (void) +{ + return date_edit_new (time (NULL), TRUE); +} + + +GtkWidget *date_edit_new (time_t the_time, int show_time) +{ + return gnome_date_edit_new_flags (the_time, + ((show_time ? GNOME_DATE_EDIT_SHOW_TIME : 0) + | (am_pm_flag ? 0 : GNOME_DATE_EDIT_24_HR) + | (week_starts_on_monday + ? GNOME_DATE_EDIT_WEEK_STARTS_ON_MONDAY + : 0))); +} + + + +GtkWidget * +make_spin_button (int val, int low, int high) +{ + GtkAdjustment *adj; + GtkWidget *spin; + + adj = GTK_ADJUSTMENT (gtk_adjustment_new (val, low, high, 1, 10, 10)); + spin = gtk_spin_button_new (adj, 0.5, 0); + gtk_widget_set_usize (spin, 60, 0); + + return spin; +} + + +/* todo + + build some of the recur stuff by hand to take into account + the start-on-monday preference? + + make the alarm controls insensitive until you enable them + + get reading and storing of all_day_event to work + + if you set the start time and it is after the end time, change + the end time + + get the apply button to work right + + make the properties stuff unglobal + + figure out why alarm units aren't sticking between edits + + extract from and store to the ending date in the recurrence rule stuff + + finish the recurrence rule exceptions + + */ + diff --git a/calendar/gui/event-editor.h b/calendar/gui/event-editor.h new file mode 100644 index 0000000000..3cd00e9604 --- /dev/null +++ b/calendar/gui/event-editor.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#ifndef __EVENT_EDITOR_DIALOG_H__ +#define __EVENT_EDITOR_DIALOG_H__ + +#include "gnome-cal.h" +#include +#include + +typedef struct { + + /* The associated ical object */ + iCalObject *ical; + + /* The calendar owner of this event */ + GnomeCalendar *gnome_cal; + + /* + char *description; + char *host; + int port; + char *rootdn; + */ +} EventEditor; + + +GtkWidget *event_editor_new (GnomeCalendar *owner, iCalObject *ico); + +/* Convenience function to create and show a new event editor for an + * event that goes from day_begin to day_end of the specified day. + */ +void event_editor_new_whole_day (GnomeCalendar *owner, time_t day); + +GtkWidget *make_date_edit (void); +GtkWidget *date_edit_new (time_t the_time, int show_time); + +GtkWidget *make_spin_button (int val, int low, int high); + + + +#endif /* __EVENT_EDITOR_DIALOG_H__ */ diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c index f6b14aa67f..517f2f83c8 100644 --- a/calendar/gui/eventedit.c +++ b/calendar/gui/eventedit.c @@ -1537,6 +1537,8 @@ event_editor_new (GnomeCalendar *gcal, iCalObject *ical) ee->ical = ical; ee->gnome_cal = gcal; event_editor_init_widgets (ee); + + gtk_widget_show (retval); return retval; } @@ -1571,5 +1573,4 @@ event_editor_new_whole_day (GnomeCalendar *owner, time_t day) /* Launch the event editor */ ee = event_editor_new (owner, ico); - gtk_widget_show (ee); } diff --git a/calendar/gui/evolution-calendar-control.c b/calendar/gui/evolution-calendar-control.c index ac0801bcc8..904e146c7c 100644 --- a/calendar/gui/evolution-calendar-control.c +++ b/calendar/gui/evolution-calendar-control.c @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef USING_OAF #include @@ -61,6 +62,8 @@ init_bonobo (int *argc, char **argv) if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) g_error (_("Could not initialize Bonobo")); + + glade_gnome_init (); } @@ -71,7 +74,7 @@ get_prop (BonoboPropertyBag *bag, guint arg_id, gpointer user_data) { - GnomeCalendar *gcal = user_data; + /*GnomeCalendar *gcal = user_data;*/ switch (arg_id) { @@ -184,6 +187,9 @@ main (int argc, char **argv) init_calendar (); //g_log_set_always_fatal ((GLogLevelFlags) 0xFFFF); + g_log_set_always_fatal (G_LOG_LEVEL_ERROR | + G_LOG_LEVEL_CRITICAL | + G_LOG_LEVEL_WARNING); CORBA_exception_init (&ev); diff --git a/calendar/gui/prop.c b/calendar/gui/prop.c index c5169a05bd..6bf56c7c57 100644 --- a/calendar/gui/prop.c +++ b/calendar/gui/prop.c @@ -841,7 +841,9 @@ create_alarm_page (void) gtk_table_set_row_spacings (GTK_TABLE (default_table), 4); gtk_table_set_col_spacings (GTK_TABLE (default_table), 4); gtk_container_add (GTK_CONTAINER (default_frame), default_table); - + +#warning "FIX ME" + /* ee_create_ae (GTK_TABLE (default_table), _("Display"), &alarm_defaults [ALARM_DISPLAY], ALARM_DISPLAY, 1, FALSE, prop_changed); @@ -854,12 +856,14 @@ create_alarm_page (void) ee_create_ae (GTK_TABLE (default_table), _("Mail"), &alarm_defaults [ALARM_MAIL], ALARM_MAIL, 4, FALSE, prop_changed); + */ } static void prop_store_alarm_default_values (CalendarAlarm* alarm) { - ee_store_alarm (alarm, alarm->type); +#warning "FIX ME" + // ee_store_alarm (alarm, alarm->type); switch (alarm->type) { case ALARM_DISPLAY: -- cgit