diff options
author | nobody <nobody@localhost> | 2002-06-04 08:04:04 +0800 |
---|---|---|
committer | nobody <nobody@localhost> | 2002-06-04 08:04:04 +0800 |
commit | 7760ee15585aca92e42e860d9967ac4d70021c5a (patch) | |
tree | de637e066d27368c7895eb176998ffe0218d787d /calendar/gui/control-factory.c | |
parent | b0d3a768d1197ef3fdd2f5884d981a23c367d594 (diff) | |
download | gsoc2013-evolution-EVOLUTION_1_0_6.tar.gz gsoc2013-evolution-EVOLUTION_1_0_6.tar.zst gsoc2013-evolution-EVOLUTION_1_0_6.zip |
This commit was manufactured by cvs2svn to create tagEVOLUTION_1_0_6
'EVOLUTION_1_0_6'.
svn path=/tags/EVOLUTION_1_0_6/; revision=17093
Diffstat (limited to 'calendar/gui/control-factory.c')
-rw-r--r-- | calendar/gui/control-factory.c | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/calendar/gui/control-factory.c b/calendar/gui/control-factory.c index a17790f197..9f0a17c999 100644 --- a/calendar/gui/control-factory.c +++ b/calendar/gui/control-factory.c @@ -37,11 +37,9 @@ #include "control-factory.h" -#define PROPERTY_CALENDAR_URI "folder_uri" -#define PROPERTY_CALENDAR_URI_IDX 1 +#define PROPERTY_CALENDAR_URI "folder_uri" -#define PROPERTY_CALENDAR_VIEW "view" -#define PROPERTY_CALENDAR_VIEW_IDX 2 +#define PROPERTY_CALENDAR_URI_IDX 1 #define CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_ControlFactory" @@ -71,7 +69,7 @@ get_prop (BonoboPropertyBag *bag, gpointer user_data) { GnomeCalendar *gcal = user_data; - const char *uri; + char *uri; switch (arg_id) { @@ -80,23 +78,6 @@ get_prop (BonoboPropertyBag *bag, BONOBO_ARG_SET_STRING (arg, uri); break; - case PROPERTY_CALENDAR_VIEW_IDX: - switch (gnome_calendar_get_view (gcal)) { - case GNOME_CAL_DAY_VIEW: - BONOBO_ARG_SET_STRING (arg, "day"); - break; - case GNOME_CAL_WEEK_VIEW: - BONOBO_ARG_SET_STRING (arg, "week"); - break; - case GNOME_CAL_WORK_WEEK_VIEW: - BONOBO_ARG_SET_STRING (arg, "workweek"); - break; - case GNOME_CAL_MONTH_VIEW: - BONOBO_ARG_SET_STRING (arg, "month"); - break; - } - break; - default: g_warning ("Unhandled arg %d\n", arg_id); } @@ -111,16 +92,15 @@ set_prop (BonoboPropertyBag *bag, gpointer user_data) { GnomeCalendar *gcal = user_data; - char *string; - GnomeCalendarViewType view; + char *uri; switch (arg_id) { case PROPERTY_CALENDAR_URI_IDX: - string = BONOBO_ARG_GET_STRING (arg); - if (!gnome_calendar_open (gcal, string)) { + uri = BONOBO_ARG_GET_STRING (arg); + if (!gnome_calendar_open (gcal, uri)) { char *msg; - msg = g_strdup_printf (_("Could not open the folder in '%s'"), string); + msg = g_strdup_printf (_("Could not open the folder in '%s'"), uri); gnome_error_dialog_parented ( msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); @@ -128,23 +108,6 @@ set_prop (BonoboPropertyBag *bag, } break; - case PROPERTY_CALENDAR_VIEW_IDX: - string = BONOBO_ARG_GET_STRING (arg); - if (!g_strcasecmp (string, "week")) - view = GNOME_CAL_WEEK_VIEW; - else if (!g_strcasecmp (string, "workweek")) - view = GNOME_CAL_WORK_WEEK_VIEW; - else if (!g_strcasecmp (string, "month")) - view = GNOME_CAL_MONTH_VIEW; - else - view = GNOME_CAL_DAY_VIEW; - - /* This doesn't actually work, because the GalView - * comes along and resets the view. FIXME. - */ - gnome_calendar_set_view (gcal, view, FALSE, TRUE); - break; - default: g_warning ("Unhandled arg %d\n", arg_id); break; @@ -166,13 +129,6 @@ calendar_properties_init (GnomeCalendar *gcal, BonoboControl *control) NULL, _("The URI that the calendar will display"), 0); - bonobo_property_bag_add (pbag, - PROPERTY_CALENDAR_VIEW, - PROPERTY_CALENDAR_VIEW_IDX, - BONOBO_ARG_STRING, - NULL, - _("The type of view to show"), - 0); bonobo_control_set_properties (control, pbag); bonobo_object_unref (BONOBO_OBJECT (pbag)); @@ -203,7 +159,7 @@ control_factory_init (void) factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID, control_factory_fn, NULL); bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory)); - + if (factory == NULL) g_error ("I could not register a Calendar control factory."); } @@ -253,7 +209,6 @@ control_factory_new_control (void) g_message ("control_factory_fn(): could not create the control!"); return NULL; } - gtk_object_set_data (GTK_OBJECT (gcal), "control", control); calendar_properties_init (gcal, control); #if 0 |