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