From 0a505aa40e7504dec10119c0bb4c84087e3d06d4 Mon Sep 17 00:00:00 2001 From: Russell Steinthal Date: Thu, 21 Oct 1999 22:29:47 +0000 Subject: Fix bug #1818 on HEAD. svn path=/trunk/; revision=1337 --- calendar/gui/main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'calendar/gui/main.c') diff --git a/calendar/gui/main.c b/calendar/gui/main.c index 6689ca80cb..50f8941489 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -340,10 +340,22 @@ new_calendar_cmd (GtkWidget *widget, void *data) static void open_ok (GtkWidget *widget, GtkFileSelection *fs) { - /* FIXME: find out who owns this calendar and use that name */ - new_calendar ("Somebody", gtk_file_selection_get_filename (fs), NULL, NULL, FALSE); - - gtk_widget_destroy (GTK_WIDGET (fs)); + GtkWidget *error_dialog; + int ret; + if(!g_file_exists (gtk_file_selection_get_filename (fs))) { + error_dialog = gnome_message_box_new ( + _("File not found"), + GNOME_MESSAGE_BOX_ERROR, + GNOME_STOCK_BUTTON_OK, + NULL); + + gnome_dialog_set_parent (GNOME_DIALOG (error_dialog), GTK_WINDOW (fs)); + ret = gnome_dialog_run (GNOME_DIALOG (error_dialog)); + } else { + /* FIXME: find out who owns this calendar and use that name */ + new_calendar ("Somebody", gtk_file_selection_get_filename (fs), NULL, NULL, FALSE); + gtk_widget_destroy (GTK_WIDGET (fs)); + } } static void -- cgit v1.2.3