From 8e03be1b452837fd438b811fbdcfe9ac65765bc4 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 11 May 2012 18:35:03 +0900 Subject: Fix for 997886 : Document Metadata : Crash when saving with 2 documents open (bzr r11353) --- src/ui/widget/licensor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ui/widget/licensor.cpp') diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index d31d4b759..98a5808d6 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -25,6 +25,7 @@ #include "rdf.h" #include "inkscape.h" #include "document-undo.h" +#include "document-private.h" #include "verbs.h" #include @@ -66,9 +67,11 @@ void LicenseItem::on_toggled() if (_wr.isUpdating()) return; _wr.setUpdating (true); - rdf_set_license (SP_ACTIVE_DOCUMENT, _lic->details ? _lic : 0); - DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_NONE, - /* TODO: annotate */ "licensor.cpp:65"); + SPDocument *doc = SP_ACTIVE_DOCUMENT; + rdf_set_license (doc, _lic->details ? _lic : 0); + if (doc->priv->sensitive) { + DocumentUndo::done(doc, SP_VERB_NONE, "Document license updated"); + } _wr.setUpdating (false); static_cast(_eep->_packable)->set_text (_lic->uri); _eep->on_changed(); -- cgit v1.2.3 From 7ac5d5232dc0d8c05f392f717c56193b8ac9e222 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 31 May 2012 22:54:28 +0100 Subject: Gtkmm 3 fixes for licensor widget (bzr r11444) --- src/ui/widget/licensor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/widget/licensor.cpp') diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 98a5808d6..7fff7d87f 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -133,10 +133,18 @@ void Licensor::update (SPDocument *doc) for (i=0; rdf_licenses[i].name; i++) if (license == &rdf_licenses[i]) break; +#if WITH_GTKMM_3_0 + static_cast(get_children()[i+1])->set_active(); +#else static_cast(children()[i+1].get_widget())->set_active(); +#endif } else { +#if WITH_GTKMM_3_0 + static_cast(get_children()[0])->set_active(); +#else static_cast(children()[0].get_widget())->set_active(); +#endif } /* update the URI */ -- cgit v1.2.3 From 3c76aba3f2e1dfe8c0568a7d38a732cd2cf3dd8b Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 31 Oct 2012 09:25:06 +0900 Subject: Fix for 1068763 : Opening 'File > Document Properties' dirties current document (bzr r11855) --- src/ui/widget/licensor.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ui/widget/licensor.cpp') diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 7fff7d87f..8ecd36af2 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -44,7 +44,7 @@ const struct rdf_license_t _other_license = class LicenseItem : public Gtk::RadioButton { public: - LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr); + LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr, Gtk::RadioButtonGroup *group); protected: void on_toggled(); struct rdf_license_t const *_lic; @@ -52,13 +52,12 @@ protected: Registry &_wr; }; -LicenseItem::LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr) +LicenseItem::LicenseItem (struct rdf_license_t const* license, EntityEntry* entity, Registry &wr, Gtk::RadioButtonGroup *group) : Gtk::RadioButton(_(license->name)), _lic(license), _eep(entity), _wr(wr) { - static Gtk::RadioButtonGroup group = get_group(); - static bool first = true; - if (first) first = false; - else set_group (group); + if (group) { + set_group (*group); + } } /// \pre it is assumed that the license URI entry is a Gtk::Entry @@ -97,18 +96,19 @@ void Licensor::init (Registry& wr) LicenseItem *i; wr.setUpdating (true); - i = manage (new LicenseItem (&_proprietary_license, _eentry, wr)); + i = manage (new LicenseItem (&_proprietary_license, _eentry, wr, NULL)); + Gtk::RadioButtonGroup group = i->get_group(); add (*i); LicenseItem *pd = i; for (struct rdf_license_t * license = rdf_licenses; license && license->name; license++) { - i = manage (new LicenseItem (license, _eentry, wr)); + i = manage (new LicenseItem (license, _eentry, wr, &group)); add(*i); } // add Other at the end before the URI field for the confused ppl. - LicenseItem *io = manage (new LicenseItem (&_other_license, _eentry, wr)); + LicenseItem *io = manage (new LicenseItem (&_other_license, _eentry, wr, &group)); add (*io); pd->set_active(); -- cgit v1.2.3 From d570aaf4446417dd50323db02470c1f9f5437b22 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 17 Mar 2013 13:53:46 +0100 Subject: cppcheck (bzr r12218) --- src/ui/widget/licensor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ui/widget/licensor.cpp') diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 8ecd36af2..c729354cb 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -79,7 +79,8 @@ void LicenseItem::on_toggled() //--------------------------------------------------- Licensor::Licensor() -: Gtk::VBox(false,4) +: Gtk::VBox(false,4), + _eentry (NULL) { } -- cgit v1.2.3