diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-07-12 08:19:58 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-07-12 08:19:58 +0000 |
| commit | d9da2a4f178e71f5b33ea158c0631e86220f2e5d (patch) | |
| tree | 5502c8d1addd8f0b270877102185604c103936e8 /src/ui/dialog/document-properties.cpp | |
| parent | Fix for 1023655 : IMprovments to Embedded script UI (diff) | |
| download | inkscape-d9da2a4f178e71f5b33ea158c0631e86220f2e5d.tar.gz inkscape-d9da2a4f178e71f5b33ea158c0631e86220f2e5d.zip | |
Fix for 612221 : Add metadata default configuration in the preferences
(bzr r11544)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 0202360d5..71fc3ac1f 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -781,6 +781,20 @@ void DocumentProperties::build_metadata() } } + Gtk::Button *button_save = manage (new Gtk::Button(_("_Save as default"),1)); + button_save->set_tooltip_text(_("Save this metadata as the default metadata")); + Gtk::Button *button_load = manage (new Gtk::Button(_("Use _default"),1)); + button_load->set_tooltip_text(_("Use the previously saved default metadata here")); + Gtk::HButtonBox *box_buttons = manage (new Gtk::HButtonBox); + box_buttons->set_layout(Gtk::BUTTONBOX_END); + box_buttons->set_spacing(4); + box_buttons->pack_start(*button_save, true, true, 6); + box_buttons->pack_start(*button_load, true, true, 6); + _page_metadata1.pack_end(*box_buttons, false, false, 0); + + button_save->signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::save_default_metadata)); + button_load->signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::load_default_metadata)); + _page_metadata2.show(); row = 0; @@ -1257,6 +1271,23 @@ void DocumentProperties::on_response (int id) hide(); } +void DocumentProperties::load_default_metadata() +{ + /* Get the data RDF entities data from preferences*/ + for (RDElist::iterator it = _rdflist.begin(); it != _rdflist.end(); ++it) { + (*it)->load_from_preferences (); + } +} + +void DocumentProperties::save_default_metadata() +{ + /* Save these RDF entities to preferences*/ + for (RDElist::iterator it = _rdflist.begin(); it != _rdflist.end(); ++it) { + (*it)->save_to_preferences (SP_ACTIVE_DOCUMENT); + } +} + + void DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *document) { Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr(); |
