diff --git a/src/file.cpp b/src/file.cpp
index d5819cf0ff0d6f805dea4d9f105c716e08f4db7d..e8e9af9d350d4c7582d7199a27ce9d6ed26d06f0 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
if ((!doc->uri) && (!str))
return false;
-
- Inkscape::Extension::Output *extension;
-
- // Get the default extension name
- Glib::ustring default_extension;
- char *attr = (char *)repr->attribute("inkscape:output_extension");
- if (!attr)
- attr = (char *)prefs_get_string_attribute("dialogs.save_as", "default");
- if (attr)
- default_extension = attr;
-
+ // Get the default extension name
+ Glib::ustring default_extension = "org.inkscape.output.svg.inkscape";
char formatBuf[256];
Glib::ustring filename_extension = ".svg";
- extension = dynamic_cast<Inkscape::Extension::Output *>
- (Inkscape::Extension::db.get(default_extension.c_str()));
- if (extension)
- filename_extension = extension->get_extension();
+ selectionType = Inkscape::Extension::db.get(default_extension.c_str());
export_path = Glib::get_tmp_dir ();
exportDialogInstance = Inkscape::UI::Dialog::FileExportToOCALDialog::create(
parentWindow,
Inkscape::UI::Dialog::EXPORT_TYPES,
- (char const *) _("Select file to export to"),
- default_extension
+ (char const *) _("Select file to export to")
);
success = exportDialogInstance->show();
return success;
fileName = exportDialogInstance->getFilename();
-
- selectionType = exportDialogInstance->getSelectionType();
-
+
+ fileName.append(filename_extension.c_str());
if (fileName.size() > 0) {
Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
success = file_save(parentWindow, doc, filePath, selectionType, FALSE, FALSE);
if (!success){
- g_warning( "Error saving a temporary copy." );
+ gchar *text = g_strdup_printf(_("Error saving a temporary copy"));
+ sp_ui_error_dialog(text);
+
return success;
}
success = file_save_remote(doc, uri, selectionType, FALSE, FALSE);
remove(fileName.c_str());
if (!success)
- g_warning( "Error exporting the document." );
+ {
+ gchar *text = g_strdup_printf(_("Error exporting the document. Verify if the server name, username and password are correct. If the server have support for webdav and verify if you didn't forget to choose a license too."));
+ sp_ui_error_dialog(text);
+ }
else
gotSuccess = true;