diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-05-17 04:34:35 +0000 |
|---|---|---|
| committer | John Smith <removethis.john.q.public@bigmail.com> | 2012-05-17 04:34:35 +0000 |
| commit | 9e2a21da898684d22362206ff422094ccac7cc51 (patch) | |
| tree | 003f04a909a6b9bd81764cf097962e84fd251963 /src | |
| parent | Corrected protected type access (comments were incorrect). (diff) | |
| download | inkscape-9e2a21da898684d22362206ff422094ccac7cc51.tar.gz inkscape-9e2a21da898684d22362206ff422094ccac7cc51.zip | |
Fix for 997888 : Merge into Document Properties
(bzr r11374)
Diffstat (limited to 'src')
| -rw-r--r-- | src/menus-skeleton.h | 2 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 61 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.h | 16 |
3 files changed, 77 insertions, 2 deletions
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 44d448fd1..70add3393 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -35,7 +35,7 @@ static char const menus_skeleton[] = " <verb verb-id=\"FileVacuum\" />\n" " <separator/>\n" " <verb verb-id=\"DialogDocumentProperties\" />\n" -" <verb verb-id=\"DialogMetadata\" />\n" +//" <verb verb-id=\"DialogMetadata\" />\n" " <verb verb-id=\"DialogInput\" />\n" " <separator/>\n" " <verb verb-id=\"FileClose\" />\n" diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index f45b52f5b..2b322e065 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -42,6 +42,9 @@ #include "xml/node-event-vector.h" #include "xml/repr.h" +#include "rdf.h" +#include "ui/widget/entity-entry.h" + #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) #include "color-profile.h" #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -92,6 +95,8 @@ DocumentProperties::DocumentProperties() _page_scripting(1, 1), _page_external_scripts(1, 1), _page_embedded_scripts(1, 1), + _page_metadata1(1, 1), + _page_metadata2(1, 1), //--------------------------------------------------------------- _rcb_canb(_("Show page _border"), _("If set, rectangular page border is shown"), "showborder", _wr, false), _rcb_bord(_("Border on _top of drawing"), _("If set, border is always on top of the drawing"), "borderlayer", _wr, false), @@ -146,8 +151,10 @@ DocumentProperties::DocumentProperties() _notebook.append_page(_page_guides, _("Guides")); _notebook.append_page(_grids_vbox, _("Grids")); _notebook.append_page(_page_snap, _("Snap")); - _notebook.append_page(_page_cms, _("Color Management")); + _notebook.append_page(_page_cms, _("Color")); _notebook.append_page(_page_scripting, _("Scripting")); + _notebook.append_page(_page_metadata1, _("Metadata")); + _notebook.append_page(_page_metadata2, _("License")); build_page(); build_guides(); @@ -157,6 +164,7 @@ DocumentProperties::DocumentProperties() build_cms(); #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) build_scripting(); + build_metadata(); _grids_button_new.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onNewGrid)); _grids_button_remove.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onRemoveGrid)); @@ -185,6 +193,9 @@ DocumentProperties::~DocumentProperties() repr->removeListenerByData (this); Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->getRoot()->getRepr(); root->removeListenerByData (this); + + for (RDElist::iterator it = _rdflist.begin(); it != _rdflist.end(); ++it) + delete (*it); } //======================================================================== @@ -726,6 +737,46 @@ void DocumentProperties::build_scripting() _scripts_observer.signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::populate_script_lists)); } +void DocumentProperties::build_metadata() +{ + using Inkscape::UI::Widget::EntityEntry; + + _page_metadata1.show(); + + Gtk::Label *label = manage (new Gtk::Label); + label->set_markup (_("<b>Dublin Core Entities</b>")); + label->set_alignment (0.0); + _page_metadata1.table().attach (*label, 0,3,0,1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + /* add generic metadata entry areas */ + struct rdf_work_entity_t * entity; + int row = 1; + for (entity = rdf_work_entities; entity && entity->name; entity++, row++) { + if ( entity->editable == RDF_EDIT_GENERIC ) { + EntityEntry *w = EntityEntry::create (entity, _wr); + _rdflist.push_back (w); + Gtk::HBox *space = manage (new Gtk::HBox); + space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y); + _page_metadata1.table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata1.table().attach (w->_label, 1,2, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata1.table().attach (*w->_packable, 2,3, row, row+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0); + } + } + + _page_metadata2.show(); + + row = 0; + Gtk::Label *llabel = manage (new Gtk::Label); + llabel->set_markup (_("<b>License</b>")); + llabel->set_alignment (0.0); + _page_metadata2.table().attach (*llabel, 0,3, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + /* add license selector pull-down and URI */ + ++row; + _licensor.init (_wr); + Gtk::HBox *space = manage (new Gtk::HBox); + space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y); + _page_metadata2.table().attach (*space, 0,1, row, row+1, Gtk::FILL, (Gtk::AttachOptions)0,0,0); + _page_metadata2.table().attach (_licensor, 1,3, row, row+1, Gtk::EXPAND|Gtk::FILL, (Gtk::AttachOptions)0,0,0); +} void DocumentProperties::addExternalScript(){ SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -1069,6 +1120,14 @@ void DocumentProperties::update() populate_available_profiles(); #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) + //-----------------------------------------------------------meta pages + /* update the RDF entities */ + for (RDElist::iterator it = _rdflist.begin(); it != _rdflist.end(); ++it) + (*it)->update (SP_ACTIVE_DOCUMENT); + + _licensor.update (SP_ACTIVE_DOCUMENT); + + _wr.setUpdating (false); } diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index 21453141a..951a8eeb1 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -27,13 +27,22 @@ #include "ui/widget/registry.h" #include "ui/widget/tolerance-slider.h" #include "ui/widget/panel.h" +#include "ui/widget/licensor.h" #include "xml/helper-observer.h" namespace Inkscape { + namespace XML { + class Node; + } namespace UI { + namespace Widget { + class EntityEntry; + } namespace Dialog { +typedef std::list<UI::Widget::EntityEntry*> RDElist; + class DocumentProperties : public UI::Widget::Panel { public: void update(); @@ -52,6 +61,7 @@ protected: void build_cms(); #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) void build_scripting(); + void build_metadata(); void init(); virtual void on_response (int); @@ -93,6 +103,9 @@ protected: UI::Widget::NotebookPage _page_external_scripts; UI::Widget::NotebookPage _page_embedded_scripts; + UI::Widget::NotebookPage _page_metadata1; + UI::Widget::NotebookPage _page_metadata2; + Gtk::VBox _grids_vbox; UI::Widget::Registry _wr; @@ -175,6 +188,9 @@ protected: Gtk::HBox _grids_space; //--------------------------------------------------------------- + RDElist _rdflist; + UI::Widget::Licensor _licensor; + Gtk::HBox& _createPageTabLabel(const Glib::ustring& label, const char *label_image); private: |
