X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fwidget%2Flicensor.cpp;h=24bd5595f54fd583a67f4fcbc9ecfb4f243e2054;hb=5ae629c910bd31486272c4dc7c31f450b7b454fd;hp=9a571322096a72e0838fe13c4ee39e04a4ea50e7;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 9a5713220..24bd5595f 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -34,6 +34,9 @@ namespace Widget { const struct rdf_license_t _proprietary_license = {_("Proprietary"), "", 0}; +const struct rdf_license_t _other_license = + {_("Other"), "", 0}; + class LicenseItem : public Gtk::RadioButton { public: LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr); @@ -45,7 +48,7 @@ protected: }; LicenseItem::LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr) -: Gtk::RadioButton(license->name), _lic(license), _eep(entity), _wr(wr) +: Gtk::RadioButton(_(license->name)), _lic(license), _eep(entity), _wr(wr) { static Gtk::RadioButtonGroup group = get_group(); static bool first = true; @@ -61,9 +64,10 @@ LicenseItem::on_toggled() _wr.setUpdating (true); rdf_set_license (SP_ACTIVE_DOCUMENT, _lic->details ? _lic : 0); - sp_document_done (SP_ACTIVE_DOCUMENT); + sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, + /* TODO: annotate */ "licensor.cpp:65"); _wr.setUpdating (false); - reinterpret_cast(_eep->_packable)->set_text (_lic->uri); + static_cast(_eep->_packable)->set_text (_lic->uri); _eep->on_changed(); } @@ -91,12 +95,17 @@ Licensor::init (Gtk::Tooltips& tt, Registry& wr) i = manage (new LicenseItem (&_proprietary_license, _eentry, wr)); add (*i); LicenseItem *pd = i; + for (struct rdf_license_t * license = rdf_licenses; license && license->name; license++) { i = manage (new LicenseItem (license, _eentry, wr)); add(*i); } + // add Other at the end before the URI field for the confused ppl. + LicenseItem *io = manage (new LicenseItem (&_other_license, _eentry, wr)); + add (*io); + pd->set_active(); wr.setUpdating (false); @@ -120,10 +129,10 @@ Licensor::update (SPDocument *doc) for (i=0; rdf_licenses[i].name; i++) if (license == &rdf_licenses[i]) break; - reinterpret_cast(children()[i+1].get_widget())->set_active(); + static_cast(children()[i+1].get_widget())->set_active(); } else { - reinterpret_cast(children()[0].get_widget())->set_active(); + static_cast(children()[0].get_widget())->set_active(); } /* update the URI */