aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-component.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2001-01-08 08:47:35 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-01-08 08:47:35 +0800
commita223b88a9034f0c33f2e979403e1352ff822f8a2 (patch)
tree180ec792800fb8d2468fb2ae6829b5c87cc7f5f8 /calendar/gui/calendar-component.c
parent45b8f9d767b5a178e0fdcb48901e664334fd8183 (diff)
downloadgsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.tar.gz
gsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.tar.zst
gsoc2013-evolution-a223b88a9034f0c33f2e979403e1352ff822f8a2.zip
added new source files for the Tasks folders.
2001-01-08 Damon Chaplin <damon@helixcode.com> * gui/Makefile.am: added new source files for the Tasks folders. * gui/e-tasks.[hc]: new widget to encapsulate the Tasks view. * gui/tasks-control.[hc]: new files to implement the Tasks control. * gui/tasks-control-factory.[hc]: new files to implement the factory for the Tasks controls. (I think the way I've split the code up is a lot cleaner than the GnomeCal implementation - the factory file just contains the factory functions and the control file contains all the control functions. Maybe we should make GnomeCal like this.) * gui/main.c: initialize the Tasks control factory. * gui/component-factory.c: added support for the Tasks control. Also added a "create_folder" function so we can now create new Tasks and Calendar folders within Evolution. I'm not a Bonobo expert so someone might want to check these over. * gui/calendar-config.[hc]: added convenience functions to configure the common settings of ECalendar and EDateEdit widgets. * gui/dialogs/task-editor.c (task_editor_create_date_edit): * gui/gnome-cal.c (gnome_calendar_update_config_settings): * gui/event-editor.c: used function to configure the ECalendars and EDateEdits. * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event): fixed minor bug in format strings. svn path=/trunk/; revision=7297
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r--calendar/gui/calendar-component.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 700631b78d..f0fc7fffcf 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -26,6 +26,7 @@
#include "evolution-shell-component.h"
#include <executive-summary/evolution-services/executive-summary-component.h>
#include "component-factory.h"
+#include "tasks-control-factory.h"
#include "control-factory.h"
#include "calendar-config.h"
#include "calendar-summary.h"
@@ -39,6 +40,7 @@ char *evolution_dir;
static const EvolutionShellComponentFolderType folder_types[] = {
{ "calendar", "evolution-calendar.png" },
+ { "tasks", "evolution-tasks.png" },
{ NULL, NULL }
};
@@ -54,12 +56,17 @@ create_view (EvolutionShellComponent *shell_component,
{
BonoboControl *control;
- if (g_strcasecmp (type, "calendar") != 0)
+ if (!g_strcasecmp (type, "calendar")) {
+ control = control_factory_new_control ();
+ if (!control)
+ return EVOLUTION_SHELL_COMPONENT_CORBAERROR;
+ } else if (!g_strcasecmp (type, "tasks")) {
+ control = tasks_control_new ();
+ if (!control)
+ return EVOLUTION_SHELL_COMPONENT_CORBAERROR;
+ } else {
return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE;
-
- control = control_factory_new_control ();
- if (!control)
- return EVOLUTION_SHELL_COMPONENT_CORBAERROR;
+ }
bonobo_control_set_property (control, "folder_uri", physical_uri, NULL);
@@ -68,6 +75,27 @@ create_view (EvolutionShellComponent *shell_component,
return EVOLUTION_SHELL_COMPONENT_OK;
}
+static void
+create_folder (EvolutionShellComponent *shell_component,
+ const char *physical_uri,
+ const char *type,
+ const GNOME_Evolution_ShellComponentListener listener,
+ void *closure)
+{
+ CORBA_Environment ev;
+
+ CORBA_exception_init(&ev);
+ /* FIXME: I don't think we have to do anything to create a calendar
+ or tasks folder - the '.ics' files are created automatically when
+ needed. But I'm not sure - Damon. */
+ if (!strcmp(type, "calendar") || !strcmp(type, "tasks")) {
+ GNOME_Evolution_ShellComponentListener_notifyResult(listener, GNOME_Evolution_ShellComponentListener_OK, &ev);
+ } else {
+ GNOME_Evolution_ShellComponentListener_notifyResult(listener, GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, &ev);
+ }
+ CORBA_exception_free(&ev);
+}
+
static gint owner_count = 0;
static void
@@ -77,7 +105,6 @@ owner_set_cb (EvolutionShellComponent *shell_component,
gpointer user_data)
{
evolution_dir = g_strdup (evolution_homedir);
- g_print ("evolution_dir: %s\n", evolution_dir);
calendar_config_init ();
owner_count ++;
}
@@ -101,7 +128,7 @@ factory_fn (BonoboGenericFactory *factory,
EvolutionShellComponent *shell_component;
shell_component = evolution_shell_component_new (folder_types,
- create_view, NULL, NULL, NULL, NULL);
+ create_view, create_folder, NULL, NULL, NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
GTK_SIGNAL_FUNC (owner_set_cb), NULL);