aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Steinthal <steintr@src.gnome.org>1999-10-22 06:29:47 +0800
committerRussell Steinthal <steintr@src.gnome.org>1999-10-22 06:29:47 +0800
commit0a505aa40e7504dec10119c0bb4c84087e3d06d4 (patch)
tree0ed2c64c92eac48d7f276eded346b1b7da801171
parent7a5e03ee78f6bd107bc57f723862b618d17e4f09 (diff)
downloadgsoc2013-evolution-0a505aa40e7504dec10119c0bb4c84087e3d06d4.tar.gz
gsoc2013-evolution-0a505aa40e7504dec10119c0bb4c84087e3d06d4.tar.zst
gsoc2013-evolution-0a505aa40e7504dec10119c0bb4c84087e3d06d4.zip
Fix bug #1818 on HEAD.
svn path=/trunk/; revision=1337
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/main.c20
-rw-r--r--calendar/main.c20
3 files changed, 37 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 760966a38e..d86a3a2958 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,8 @@
+1999-10-21 Russell Steinthal <rms39@columbia.edu>
+
+ * main.c (open_ok): Show an error box if the user tries to open a
+ non-existent file; fixes bug #1818
+
1999-10-19 Russell Steinthal <rms39@columbia.edu>
* gnome-cal.c (calendar_notify): Fix typos which were causing
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
diff --git a/calendar/main.c b/calendar/main.c
index 6689ca80cb..50f8941489 100644
--- a/calendar/main.c
+++ b/calendar/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