Code

Refactoring SPColor to C++ and removing legacy CMYK implementation
[inkscape.git] / src / ui / widget / licensor.cpp
index 50c49e9122da129e902694b9dfae0e92bced8338..24bd5595f54fd583a67f4fcbc9ecfb4f243e2054 100644 (file)
@@ -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);
@@ -64,7 +67,7 @@ LicenseItem::on_toggled()
     sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, 
                       /* TODO: annotate */ "licensor.cpp:65");
     _wr.setUpdating (false);
-    reinterpret_cast<Gtk::Entry*>(_eep->_packable)->set_text (_lic->uri);
+    static_cast<Gtk::Entry*>(_eep->_packable)->set_text (_lic->uri);
     _eep->on_changed();
 }
 
@@ -92,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);
 
@@ -121,10 +129,10 @@ Licensor::update (SPDocument *doc)
         for (i=0; rdf_licenses[i].name; i++) 
             if (license == &rdf_licenses[i]) 
                 break;
-        reinterpret_cast<LicenseItem*>(children()[i+1].get_widget())->set_active();
+        static_cast<LicenseItem*>(children()[i+1].get_widget())->set_active();
     }
     else {
-        reinterpret_cast<LicenseItem*>(children()[0].get_widget())->set_active();
+        static_cast<LicenseItem*>(children()[0].get_widget())->set_active();
     }
     
     /* update the URI */