diff options
Diffstat (limited to 'gtk/file_dlg.c')
-rw-r--r-- | gtk/file_dlg.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index 565754d722..535e84e9fc 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -1385,6 +1385,24 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) { return; } + /* Check whether the range is valid. */ + if (!range_check_validity(&range)) { + /* The range isn't valid; don't dismiss the open dialog box, + just leave it around so that the user can, after they + dismiss the alert box popped up for the error, try again. */ + g_free(cf_name); +#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 + /* XXX - as we cannot start a new event loop (using gtk_dialog_run()), + * as this will prevent the user from closing the now existing error + * message, simply close the dialog (this is the best we can do here). */ + if (file_save_as_w) + window_destroy(GTK_WIDGET (fs)); +#else + gtk_widget_show(GTK_WIDGET (fs)); +#endif + return; + } + /* don't show the dialog while saving */ gtk_widget_hide(GTK_WIDGET (fs)); @@ -1396,9 +1414,9 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) { dismiss the alert box popped up for the error, try again. */ g_free(cf_name); #if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 4) || GTK_MAJOR_VERSION > 2 - /* as we cannot start a new event loop (using gtk_dialog_run()), as this - * will prevent the user from closing the now existing error message, - * simply close the dialog (this is the best we can do here). */ + /* XXX - as we cannot start a new event loop (using gtk_dialog_run()), + * as this will prevent the user from closing the now existing error + * message, simply close the dialog (this is the best we can do here). */ if (file_save_as_w) window_destroy(GTK_WIDGET (fs)); #else |