aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/main.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-18 12:02:46 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-18 12:02:46 +0800
commitf1b08663ddff6432289ca4780bc823c96d471657 (patch)
treefed1c651f292c4855550302ef94808338b9fd0dc /calendar/main.c
parentd79ee74dad39ee5210482aa90a7c6a7b2f0b7517 (diff)
downloadgsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar.gz
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar.bz2
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar.lz
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar.xz
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.tar.zst
gsoc2013-evolution-f1b08663ddff6432289ca4780bc823c96d471657.zip
Yes.
Yes. It works. It loads, it saves, it does all that stuff. It works, even if federico complains that we did not test close. Repetition, alarms, all that stuff you all guys love. It it is there. We did minimal testing, but we know you will happilly commit a fix if you find a problem, right? Ok, we are off to a party now. Miguel svn path=/trunk/; revision=155
Diffstat (limited to 'calendar/main.c')
-rw-r--r--calendar/main.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/calendar/main.c b/calendar/main.c
index 8249763ff0..ff4fc370a9 100644
--- a/calendar/main.c
+++ b/calendar/main.c
@@ -11,6 +11,7 @@
#include <gnome.h>
#include <pwd.h>
#include <sys/types.h>
+
#include "calendar.h"
#include "eventedit.h"
#include "gnome-cal.h"
@@ -96,6 +97,8 @@ init_calendar (void)
gnome_config_pop_prefix ();
}
+void save_calendar_cmd (GtkWidget *widget, void *data);
+
void
about_calendar_cmd (GtkWidget *widget, void *data)
{
@@ -125,30 +128,34 @@ display_objedit (GtkWidget *widget, GnomeCalendar *gcal)
}
void
-quit_cmd (GtkWidget *widget, GnomeCalendar *gcal)
-{
- /* FIXME: check all of the calendars for their state (modified) */
-
- gtk_main_quit ();
-}
-
-void
close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
{
if (gcal->cal->modified){
- gnome_message_box_new (_("The calendar has unsaved changes, Save them?"),
- GNOME_MESSAGE_BOX_WARNING,
- "Yes", "No");
+ if (!gcal->cal->filename)
+ save_calendar_cmd (widget, gcal);
+ else
+ calendar_save (gcal->cal, gcal->cal->filename);
}
- gtk_widget_destroy (widget);
+ gtk_widget_destroy (GTK_WIDGET (gcal));
active_calendars--;
-
+ all_calendars = g_list_remove (all_calendars, gcal);
+
if (active_calendars == 0)
gtk_main_quit ();
}
void
+quit_cmd (GtkWidget *widget, GnomeCalendar *gcal)
+{
+ while (all_calendars){
+ GnomeCalendar *cal = GNOME_CALENDAR (all_calendars->data);
+
+ close_cmd (GTK_WIDGET (cal), cal);
+ }
+}
+
+void
previous_clicked (GtkWidget *widget, GnomeCalendar *gcal)
{
gnome_calendar_previous (gcal);
@@ -307,7 +314,6 @@ new_calendar (char *full_name, char *calendar_file)
printf ("Trying to load %s\n", calendar_file);
gnome_calendar_load (GNOME_CALENDAR (toplevel), calendar_file);
}
-
active_calendars++;
all_calendars = g_list_prepend (all_calendars, toplevel);
gtk_widget_show (toplevel);
@@ -320,12 +326,12 @@ main(int argc, char *argv[])
argp_program_version = VERSION;
- /* Initialise the i18n stuff */
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
textdomain(PACKAGE);
gnome_init ("gncal", NULL, argc, argv, 0, NULL);
+ alarm_init ();
init_calendar ();
new_calendar (full_name, user_calendar_file);