aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1999-04-26 06:33:47 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-04-26 06:33:47 +0800
commit519a5a0b5bf1a1431d0ddbb0605c3b8c84f16977 (patch)
tree1fbd77a4830e22d8345aa49067b87b1a5173f954 /calendar
parentd224d1aaad9aca13a716278df6f81b96e9d58aea (diff)
downloadgsoc2013-evolution-519a5a0b5bf1a1431d0ddbb0605c3b8c84f16977.tar.gz
gsoc2013-evolution-519a5a0b5bf1a1431d0ddbb0605c3b8c84f16977.tar.zst
gsoc2013-evolution-519a5a0b5bf1a1431d0ddbb0605c3b8c84f16977.zip
Add --todo support
Add --todo support svn path=/trunk/; revision=880
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog4
-rw-r--r--calendar/Makefile.am1
-rw-r--r--calendar/gnome-cal.html2
-rw-r--r--calendar/gui/Makefile.am1
-rw-r--r--calendar/gui/gnome-cal.html2
-rw-r--r--calendar/gui/main.c57
-rw-r--r--calendar/main.c57
7 files changed, 122 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 948146f481..32aa1ba745 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,7 @@
+1999-04-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * main.c (dump_todo): Add --todo flag to dump the todo contents.
+
1999-04-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gncal-todo.c (add_activated): Use same hack used in edit_activated
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 20f5f37132..8042e05d94 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -33,6 +33,7 @@ gnomecal_SOURCES = \
gnome-month-item.h \
gnome-cal.c \
gnome-cal.h \
+ html-month.c \
goto.c \
layout.c \
layout.h \
diff --git a/calendar/gnome-cal.html b/calendar/gnome-cal.html
index eeb8d4e25e..5a7d0a537f 100644
--- a/calendar/gnome-cal.html
+++ b/calendar/gnome-cal.html
@@ -28,6 +28,8 @@ Several options are available on the command line, they are:
<li><tt>--file FILE</tt> Set the calendar to the FILE
specified on the command line.
+
+ <li><tt>--todo</tt> Dumps the to-do values to standard output.
</ul>
<p>
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 20f5f37132..8042e05d94 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -33,6 +33,7 @@ gnomecal_SOURCES = \
gnome-month-item.h \
gnome-cal.c \
gnome-cal.h \
+ html-month.c \
goto.c \
layout.c \
layout.h \
diff --git a/calendar/gui/gnome-cal.html b/calendar/gui/gnome-cal.html
index eeb8d4e25e..5a7d0a537f 100644
--- a/calendar/gui/gnome-cal.html
+++ b/calendar/gui/gnome-cal.html
@@ -28,6 +28,8 @@ Several options are available on the command line, they are:
<li><tt>--file FILE</tt> Set the calendar to the FILE
specified on the command line.
+
+ <li><tt>--todo</tt> Dumps the to-do values to standard output.
</ul>
<p>
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 76736acfbe..29e0049ae2 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -77,6 +77,9 @@ static char *load_file;
/* If set, show events for the specified date and quit */
static int show_events;
+/* If set, show todo items quit */
+static int show_todo;
+
static void
init_username (void)
{
@@ -439,6 +442,14 @@ save_default_calendar (GnomeCalendar *gcal)
save_calendar_cmd (NULL, gcal);
}
+#if 0
+static void
+make_html_cmd (GtkWidget *widget, GtkWidget *gcal)
+{
+ make_month_html (gcal, "output.html");
+}
+#endif
+
static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_MENU_NEW_ITEM(N_("_New calendar"),
N_("Create a new calendar"),
@@ -452,6 +463,13 @@ static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_SEPARATOR,
+#if 0
+ GNOMEUIINFO_ITEM(N_("Create HTML for this month"),
+ N_("Creates an HTML version of this month's appointments"),
+ make_html_cmd, NULL);
+#endif
+ GNOMEUIINFO_SEPARATOR,
+
GNOMEUIINFO_MENU_CLOSE_ITEM(close_cmd, NULL),
GNOMEUIINFO_MENU_EXIT_ITEM(quit_cmd, NULL),
@@ -596,6 +614,7 @@ enum {
USERFILE_KEY = -2,
VIEW_KEY = -3,
HIDDEN_KEY = -4,
+ TODO_KEY = -5
};
/* Lists used to startup various GnomeCalendars */
@@ -657,6 +676,34 @@ dump_events (void)
exit (0);
}
+static void
+dump_todo (void)
+{
+ Calendar *cal;
+ GList *l;
+ char *s;
+
+ process_dates ();
+ init_calendar ();
+
+ cal = calendar_new (full_name);
+ s = calendar_load (cal, load_file ? load_file : user_calendar_file);
+ if (s){
+ printf ("error: %s\n", s);
+ exit (1);
+ }
+ for (l = cal->todo; l; l = l->next){
+ iCalObject *object = l->data;
+
+ if (object->type != ICAL_TODO)
+ continue;
+
+ printf ("[%s]: %s\n", object->organizer, object->summary);
+ }
+ calendar_destroy (cal);
+ exit (0);
+}
+
extern time_t get_date ();
static void
@@ -695,6 +742,10 @@ parse_an_arg (poptContext ctx,
start_calendars = g_list_append (start_calendars, arg);
break;
+ case TODO_KEY:
+ show_todo = 1;
+ break;
+
case 'e':
show_events = 1;
break;
@@ -711,6 +762,8 @@ static const struct poptOption options [] = {
{ NULL, '\0', POPT_ARG_CALLBACK, parse_an_arg, 0, NULL, NULL },
{ "events", 'e', POPT_ARG_NONE, NULL, 'e', N_("Show events and quit"),
NULL },
+ { "todo", 0, POPT_ARG_NONE, NULL, TODO_KEY, N_("Show TO-DO items and quit"),
+ NULL },
{ "from", 'f', POPT_ARG_STRING, NULL, 'f', N_("Specifies start date [for --events]"), N_("DATE") },
{ "file", 'F', POPT_ARG_STRING, NULL, 'F', N_("File to load calendar from"), N_("FILE") },
{ "userfile", '\0', POPT_ARG_NONE, NULL, USERFILE_KEY, N_("Load the user calendar"), NULL },
@@ -785,7 +838,9 @@ main(int argc, char *argv[])
if (show_events)
dump_events ();
-
+ if (show_todo)
+ dump_todo ();
+
client = gnome_master_client ();
if (client){
gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
diff --git a/calendar/main.c b/calendar/main.c
index 76736acfbe..29e0049ae2 100644
--- a/calendar/main.c
+++ b/calendar/main.c
@@ -77,6 +77,9 @@ static char *load_file;
/* If set, show events for the specified date and quit */
static int show_events;
+/* If set, show todo items quit */
+static int show_todo;
+
static void
init_username (void)
{
@@ -439,6 +442,14 @@ save_default_calendar (GnomeCalendar *gcal)
save_calendar_cmd (NULL, gcal);
}
+#if 0
+static void
+make_html_cmd (GtkWidget *widget, GtkWidget *gcal)
+{
+ make_month_html (gcal, "output.html");
+}
+#endif
+
static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_MENU_NEW_ITEM(N_("_New calendar"),
N_("Create a new calendar"),
@@ -452,6 +463,13 @@ static GnomeUIInfo gnome_cal_file_menu [] = {
GNOMEUIINFO_SEPARATOR,
+#if 0
+ GNOMEUIINFO_ITEM(N_("Create HTML for this month"),
+ N_("Creates an HTML version of this month's appointments"),
+ make_html_cmd, NULL);
+#endif
+ GNOMEUIINFO_SEPARATOR,
+
GNOMEUIINFO_MENU_CLOSE_ITEM(close_cmd, NULL),
GNOMEUIINFO_MENU_EXIT_ITEM(quit_cmd, NULL),
@@ -596,6 +614,7 @@ enum {
USERFILE_KEY = -2,
VIEW_KEY = -3,
HIDDEN_KEY = -4,
+ TODO_KEY = -5
};
/* Lists used to startup various GnomeCalendars */
@@ -657,6 +676,34 @@ dump_events (void)
exit (0);
}
+static void
+dump_todo (void)
+{
+ Calendar *cal;
+ GList *l;
+ char *s;
+
+ process_dates ();
+ init_calendar ();
+
+ cal = calendar_new (full_name);
+ s = calendar_load (cal, load_file ? load_file : user_calendar_file);
+ if (s){
+ printf ("error: %s\n", s);
+ exit (1);
+ }
+ for (l = cal->todo; l; l = l->next){
+ iCalObject *object = l->data;
+
+ if (object->type != ICAL_TODO)
+ continue;
+
+ printf ("[%s]: %s\n", object->organizer, object->summary);
+ }
+ calendar_destroy (cal);
+ exit (0);
+}
+
extern time_t get_date ();
static void
@@ -695,6 +742,10 @@ parse_an_arg (poptContext ctx,
start_calendars = g_list_append (start_calendars, arg);
break;
+ case TODO_KEY:
+ show_todo = 1;
+ break;
+
case 'e':
show_events = 1;
break;
@@ -711,6 +762,8 @@ static const struct poptOption options [] = {
{ NULL, '\0', POPT_ARG_CALLBACK, parse_an_arg, 0, NULL, NULL },
{ "events", 'e', POPT_ARG_NONE, NULL, 'e', N_("Show events and quit"),
NULL },
+ { "todo", 0, POPT_ARG_NONE, NULL, TODO_KEY, N_("Show TO-DO items and quit"),
+ NULL },
{ "from", 'f', POPT_ARG_STRING, NULL, 'f', N_("Specifies start date [for --events]"), N_("DATE") },
{ "file", 'F', POPT_ARG_STRING, NULL, 'F', N_("File to load calendar from"), N_("FILE") },
{ "userfile", '\0', POPT_ARG_NONE, NULL, USERFILE_KEY, N_("Load the user calendar"), NULL },
@@ -785,7 +838,9 @@ main(int argc, char *argv[])
if (show_events)
dump_events ();
-
+ if (show_todo)
+ dump_todo ();
+
client = gnome_master_client ();
if (client){
gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
mp;id=6b02d1b35c173832c085697cf76aa156d04ad843'>Assist getting more ports working on AMD64 by obeying theobrien2005-04-111-1/+1 * Split the postgresql ports into a server and a client part.girgen2005-01-311-2/+1 * Switch to mysql41-client as defaultache2005-01-141-1/+1 * Add missing filekris2004-11-131-0/+1 * OPTIONS not counted when PARALLEL_PACKAGE_BUILD, workaroundache2004-06-151-0/+4 * Issue missing DB specs error at pre-configure stage, allowing all previous.ache2004-06-141-2/+2 * Use LOCALBASE for libtoolache2004-06-142-1/+2 * Properly detect <netinet/ip.h>ache2004-06-142-6/+16 * Use libtool from portsache2004-06-142-2/+49 * Upgrade to 3.1.21ache2004-05-216-53/+47 * Add size data, approved by maintainers.trevor2004-03-211-0/+1 * Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-141-1/+1 * Remove FORBIDDEN. The maintainer (ache) reports that this version isnectar2004-02-161-2/+0 * Mark FORBIDDEN due to remotely exploitable buffer overflow. Seenectar2004-02-161-0/+2 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-1/+1 * unbreak "make describe"edwin2003-11-071-3/+0 * Use the new Apache bits from bsd.port.mk.marcus2003-11-071-1/+1 * fix www/mnogosearch to adhere to ${APACHE_PORT}edwin2003-10-061-2/+5 * Add WITHOUT_MNOGO_SSL knobache2003-10-011-1/+1 * Add WITHOUT_MNOGO_THREADS knobache2003-10-011-2/+4 * Teach PTHREADSache2003-09-242-1/+17 * Remove specific mysqlclient majorache2003-06-171-1/+1 * Clear moonlight beckons.ade2003-03-072-1/+1 * Chase libpq version bump.seanc2003-01-041-1/+2