aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/main.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-25 10:23:26 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-25 10:23:26 +0800
commit07f873d107539a4357c69e1f3ce8cef17cc6277f (patch)
treed45a8c78f766cbf861b8bf7b34d80dc76b75da7c /calendar/main.c
parentce6e9cd00e965c92debe331b7c762b18674bbc85 (diff)
downloadgsoc2013-evolution-07f873d107539a4357c69e1f3ce8cef17cc6277f.tar.gz
gsoc2013-evolution-07f873d107539a4357c69e1f3ce8cef17cc6277f.tar.zst
gsoc2013-evolution-07f873d107539a4357c69e1f3ce8cef17cc6277f.zip
Fixed alarm saving code. Fixed alarm loading code. New -partial-
Fixed alarm saving code. Fixed alarm loading code. New -partial- implementation of the mail alarm. It is not working, I do not know what is closing stdin to sendmail svn path=/trunk/; revision=194
Diffstat (limited to 'calendar/main.c')
-rw-r--r--calendar/main.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/calendar/main.c b/calendar/main.c
index f7d7838fe4..1d19da236c 100644
--- a/calendar/main.c
+++ b/calendar/main.c
@@ -51,6 +51,9 @@ static char *load_file;
/* If set, show events for the specified date and quit */
static int show_events;
+/* Session management */
+static GnomeClient *sm_client;
+
static void
init_username (void)
{
@@ -121,7 +124,7 @@ about_calendar_cmd (GtkWidget *widget, void *data)
};
about = gnome_about_new (_("Gnome Calendar"), VERSION,
- "(C) 1998 the Free Software Fundation",
+ "(C) 1998 the Free Software Foundation",
authors,
_("The GNOME personal calendar and schedule manager."),
NULL);
@@ -171,7 +174,7 @@ day_range_changed (void)
}
static void
-quit_cmd (GtkWidget *widget, GnomeCalendar *gcal)
+quit_cmd (void)
{
while (all_calendars){
GnomeCalendar *cal = GNOME_CALENDAR (all_calendars->data);
@@ -500,6 +503,42 @@ static struct argp parser =
argp_options, parse_an_arg, NULL, NULL, NULL, NULL, NULL
};
+static void
+session_die (void)
+{
+ quit_cmd ();
+}
+
+static int
+session_save_state (GnomeClient *client, gint phase, GnomeRestartStyle save_style, gint shutdown,
+ GnomeInteractStyle interact_style, gint fast, gpointer client_data)
+{
+ printf ("Got a message to save the state\n");
+}
+
+/* Setup the Session Manager shutdown routine */
+static GnomeClient *
+new_client (void)
+{
+ GnomeClient *client;
+ char buf [4096];
+
+ client = gnome_client_new_default ();
+ if (client)
+ return NULL;
+
+ getcwd ((void *)&buf, sizeof (buf));
+
+ gtk_object_ref(GTK_OBJECT(client));
+ gtk_object_sink(GTK_OBJECT(client));
+
+ gtk_signal_connect (GTK_OBJECT (client), "save_yourself",
+ GTK_SIGNAL_FUNC (session_save_state), NULL);
+ gtk_signal_connect (GTK_OBJECT (client), "die",
+ GTK_SIGNAL_FUNC (session_die), NULL);
+ return client;
+}
+
int
main(int argc, char *argv[])
{
@@ -510,6 +549,8 @@ main(int argc, char *argv[])
gnome_init ("calendar", &parser, argc, argv, 0, NULL);
+ sm_client = new_client ();
+
process_dates ();
alarm_init ();
init_calendar ();