diff options
| author | Jeff Schiller <codedread@gmail.com> | 2008-09-11 07:39:53 +0000 |
|---|---|---|
| committer | jeff_schiller <jeff_schiller@users.sourceforge.net> | 2008-09-11 07:39:53 +0000 |
| commit | 8719fea9bb4c58075ab1abbc654760233aef1128 (patch) | |
| tree | d36f77ef37c4833cad80b9cbc7951fa889fdbf52 /src/file.cpp | |
| parent | LIBNR REMOVAL. remove nartbpath test code in build.xml (diff) | |
| download | inkscape-8719fea9bb4c58075ab1abbc654760233aef1128.tar.gz inkscape-8719fea9bb4c58075ab1abbc654760233aef1128.zip | |
First patch for Bug 209199: Update Win32 Save As dialog to include a Title edit box (and label). This edit box is sync'ed with the RDF and doc-level title and allows a user to edit the title prior to save. This patch does not update the GTK dialogs (that will be submitted in a subsequent patch).
(bzr r6791)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/file.cpp b/src/file.cpp index b620e9c9e..ac8c0a40e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -67,6 +67,7 @@ #include "inkscape.h" #include "uri.h" #include "id-clash.h" +#include "dialogs/rdf.h" #ifdef WITH_GNOME_VFS # include <libgnomevfs/gnome-vfs.h> @@ -749,13 +750,15 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) } else { dialog_title = (char const *) _("Select file to save to"); } + gchar* doc_title = doc->root->title(); Inkscape::UI::Dialog::FileSaveDialog *saveDialog = Inkscape::UI::Dialog::FileSaveDialog::create( parentWindow, save_loc, Inkscape::UI::Dialog::SVG_TYPES, dialog_title, - default_extension + default_extension, + doc_title ? doc_title : "" ); saveDialog->setSelectionType(extension); @@ -766,6 +769,11 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) return success; } + // set new title here (call RDF to ensure metadata and title element are updated) + rdf_set_work_entity(doc, rdf_find_entity("title"), saveDialog->getDocTitle().c_str()); + // free up old string + if(doc_title) g_free(doc_title); + Glib::ustring fileName = saveDialog->getFilename(); Inkscape::Extension::Extension *selectionType = saveDialog->getSelectionType(); @@ -897,10 +905,10 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, Inkscape::XML::Document *xml_in_doc = sp_document_repr_doc(in_doc); prevent_id_clashes(doc, in_doc); - + SPObject *in_defs = SP_DOCUMENT_DEFS(in_doc); Inkscape::XML::Node *last_def = SP_OBJECT_REPR(in_defs)->lastChild(); - + SPCSSAttr *style = sp_css_attr_from_object(SP_DOCUMENT_ROOT(doc)); // Count the number of top-level items in the imported document. @@ -945,7 +953,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, if (newgroup) newgroup->appendChild(newitem); else new_obj = place_to_insert->appendChildRepr(newitem); } - + // don't lose top-level defs or style elements else if (SP_OBJECT_REPR(child)->type() == Inkscape::XML::ELEMENT_NODE) { const gchar *tag = SP_OBJECT_REPR(child)->name(); |
