aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-08-18 12:01:50 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-08-18 12:01:50 +0800
commitfd232f60704b5bf9ff068d39c25318bb21c301df (patch)
tree7eb859d6b65193427a50bbd5e9835b32905eafe2 /calendar/gui/gnome-cal.c
parent76b456caa4f398c59c7d8af5765ebb652937ce8a (diff)
downloadgsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar.gz
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar.bz2
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar.lz
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar.xz
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.tar.zst
gsoc2013-evolution-fd232f60704b5bf9ff068d39c25318bb21c301df.zip
new function to open the task editor to add a new task.
2001-08-17 Damon Chaplin <damon@ximian.com> * gui/gnome-cal.c (gnome_calendar_new_task): new function to open the task editor to add a new task. * gui/calendar-commands.c: added new_task_cb() to create a new task in the calendar folder, and added menu commands for it, and a toolbar button (I think that is what Ettore wanted. Maybe he just meant menu commands. Anyway, it is easy to take out.) Note that we don't have a decent icon for 'New Task' for the toolbar. Also added the new Goto button (but we don't have a similar one for the menu command). svn path=/trunk/; revision=12195
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index e26150a86f..6d0e7cbb53 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -41,6 +41,7 @@
#include <cal-util/timeutil.h>
#include "widgets/menus/gal-view-menus.h"
#include "dialogs/event-editor.h"
+#include "dialogs/task-editor.h"
#include "e-calendar-table.h"
#include "e-day-view.h"
#include "e-week-view.h"
@@ -1958,6 +1959,39 @@ gnome_calendar_new_appointment (GnomeCalendar *gcal)
gnome_calendar_new_appointment_for (gcal, dtstart, dtend, FALSE);
}
+/**
+ * gnome_calendar_new_task:
+ * @gcal: An Evolution calendar.
+ *
+ * Opens a task editor dialog for a new task.
+ **/
+void
+gnome_calendar_new_task (GnomeCalendar *gcal)
+{
+ GnomeCalendarPrivate *priv;
+ TaskEditor *tedit;
+ CalComponent *comp;
+
+ g_print ("In gnome_calendar_new_task\n");
+
+ g_return_if_fail (gcal != NULL);
+ g_return_if_fail (GNOME_IS_CALENDAR (gcal));
+
+ priv = gcal->priv;
+
+ tedit = task_editor_new ();
+ comp_editor_set_cal_client (COMP_EDITOR (tedit), priv->task_pad_client);
+
+ comp = cal_component_new ();
+ cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
+
+ comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
+ gtk_object_unref (GTK_OBJECT (comp));
+
+ comp_editor_focus (COMP_EDITOR (tedit));
+}
+
+
/* Returns the selected time range for the current view. Note that this may be
different from the fields in the GnomeCalendar, since the view may clip
this or choose a more appropriate time. */