Author: post
Date: 2010-03-28 12:39:17 +0200 (Sun, 28 Mar 2010)
New Revision: 3268

Modified:
   trunk/src/rs-save-dialog.c
Log:
Export As: Display a message, if file saving fails.

Modified: trunk/src/rs-save-dialog.c
===================================================================
--- trunk/src/rs-save-dialog.c  2010-03-27 12:35:43 UTC (rev 3267)
+++ trunk/src/rs-save-dialog.c  2010-03-28 10:39:17 UTC (rev 3268)
@@ -252,6 +252,25 @@
        gtk_widget_show_all(dialog->file_pref);
 }
 
+/* Function to open a dialog box displaying the message provided. */
+
+static void
+show_save_error ( const gchar *message, const char* filename )
+{
+
+       GtkWidget *dialog;
+
+       /* Create the widget */
+       gdk_threads_enter();
+
+       dialog = gtk_message_dialog_new ( NULL, GTK_DIALOG_DESTROY_WITH_PARENT, 
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("File not saved!"));
+       gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG(dialog), 
message, filename);
+       gtk_dialog_run ( GTK_DIALOG ( dialog ) );
+       gtk_widget_destroy ( dialog );
+       gdk_threads_leave();
+
+}
+
 static gpointer 
 job(RSJobQueueSlot *slot, gpointer data)
 {
@@ -307,9 +326,12 @@
                "settings", dialog->photo->settings[dialog->snapshot],
                NULL);
 
+       rs_job_update_progress(slot, 0.15);
        if (g_object_class_find_property(G_OBJECT_GET_CLASS(dialog->output), 
"filename"))
                g_object_set(dialog->output, "filename", 
gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->chooser)), NULL);
-       rs_output_execute(dialog->output, dialog->fend);
+       if(!rs_output_execute(dialog->output, dialog->fend))
+               show_save_error(_("Could not save file: %s\n\nCheck that you 
have write permissions to this folder."),
+                       
gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->chooser)));
        rs_job_update_progress(slot, 0.75);
 
        gdk_threads_enter();


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to