diff --git a/src/file.cpp b/src/file.cpp
index 420eaec6393c7038ba576ad9f7a99f4beb4bc4d2..924ddc53d7595e7b54cdeb66faba007b66e500fd 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -591,6 +591,14 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri,
g_free(text);
g_free(safeUri);
return FALSE;
g_free(text);
g_free(safeUri);
return FALSE;
+ } catch (Inkscape::Extension::Output::file_read_only &e) {
+ gchar *safeUri = Inkscape::IO::sanitizeString(uri.c_str());
+ gchar *text = g_strdup_printf(_("File %s is write protected. Please remove write protection and try again."), safeUri);
+ SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved."));
+ sp_ui_error_dialog(text);
+ g_free(text);
+ g_free(safeUri);
+ return FALSE;
} catch (Inkscape::Extension::Output::save_failed &e) {
gchar *safeUri = Inkscape::IO::sanitizeString(uri.c_str());
gchar *text = g_strdup_printf(_("File %s could not be saved."), safeUri);
} catch (Inkscape::Extension::Output::save_failed &e) {
gchar *safeUri = Inkscape::IO::sanitizeString(uri.c_str());
gchar *text = g_strdup_printf(_("File %s could not be saved."), safeUri);
return FALSE;
} catch (Inkscape::Extension::Output::no_overwrite &e) {
return sp_file_save_dialog(parentWindow, doc, Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS);
return FALSE;
} catch (Inkscape::Extension::Output::no_overwrite &e) {
return sp_file_save_dialog(parentWindow, doc, Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS);
+ } catch (...) {
+ SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved."));
+ return FALSE;
}
SP_ACTIVE_DESKTOP->event_log->rememberFileSave();
}
SP_ACTIVE_DESKTOP->event_log->rememberFileSave();
if (doc->isModifiedSinceSave()) {
if ( doc->uri == NULL )
{
if (doc->isModifiedSinceSave()) {
if ( doc->uri == NULL )
{
- // Hier sollte in Argument mitgegeben werden, das anzeigt, daß das Dokument das erste
- // Mal gespeichert wird, so daß als default .svg ausgewählt wird und nicht die zuletzt
+ // Hier sollte in Argument mitgegeben werden, das anzeigt, da� das Dokument das erste
+ // Mal gespeichert wird, so da� als default .svg ausgew�hlt wird und nicht die zuletzt
// benutzte "Save as ..."-Endung
return sp_file_save_dialog(parentWindow, doc, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG);
} else {
// benutzte "Save as ..."-Endung
return sp_file_save_dialog(parentWindow, doc, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG);
} else {
* Display an Export dialog, export as the selected type if OK pressed
*/
bool
* Display an Export dialog, export as the selected type if OK pressed
*/
bool
-sp_file_export_dialog(void *widget)
+sp_file_export_dialog(Gtk::Window &parentWindow)
{
//# temp hack for 'doc' until we can switch to this dialog
SPDocument *doc = SP_ACTIVE_DOCUMENT;
{
//# temp hack for 'doc' until we can switch to this dialog
SPDocument *doc = SP_ACTIVE_DOCUMENT;
//# Show the Export dialog
Inkscape::UI::Dialog::FileExportDialog *exportDialogInstance =
Inkscape::UI::Dialog::FileExportDialog::create(
//# Show the Export dialog
Inkscape::UI::Dialog::FileExportDialog *exportDialogInstance =
Inkscape::UI::Dialog::FileExportDialog::create(
+ parentWindow,
export_path,
Inkscape::UI::Dialog::EXPORT_TYPES,
(char const *) _("Select file to export to"),
export_path,
Inkscape::UI::Dialog::EXPORT_TYPES,
(char const *) _("Select file to export to"),
else
g_warning( "Error converting save filename to UTF-8." );
else
g_warning( "Error converting save filename to UTF-8." );
- success = file_save(doc, fileName, selectionType, TRUE, FALSE);
+ success = file_save(parentWindow, doc, fileName, selectionType, TRUE, FALSE, Inkscape::Extension::FILE_SAVE_METHOD_EXPORT);
if (success) {
Glib::RefPtr<Gtk::RecentManager> recent = Gtk::RecentManager::get_default();
if (success) {
Glib::RefPtr<Gtk::RecentManager> recent = Gtk::RecentManager::get_default();
*
*/
bool
*
*/
bool
-sp_file_export_dialog(void */*widget*/)
+sp_file_export_dialog(Gtk::Window &/*parentWindow*/)
{
sp_export_dialog();
return true;
{
sp_export_dialog();
return true;