def show_new_version_hint(gui, info): """ @param gui: main gui (Gui) @param info: UpdateInfo instance """ title = _(u"New version of Unknown Horizons") #xgettext:python-format text = _( u"There is a more recent release of Unknown Horizons ({new_version}) " u"than the one you are currently using ({old_version}).").format( new_version=info.version, old_version=VERSION.RELEASE_VERSION) dl_btn = Button(name="dl", text=_("Click to download")) dl_btn.position = ( 48, 138) # i've tried, this button cannot be placed in a sane way def do_dl(): webbrowser.open(info.link) dl_btn.text = _("A page has been opened in your browser.") popup.adaptLayout() dl_btn.capture(do_dl) popup = gui.build_popup(title, text) popup.addChild(dl_btn) gui.show_dialog(popup, {OkButton.DEFAULT_NAME: True}, modal=True)
def prepare(self, **kwargs): super(VersionHint, self).prepare(**kwargs) dl_btn = Button(name="dl", text=T("Click to download")) dl_btn.position = (48, 138) # i've tried, this button cannot be placed in a sane way def do_dl(): webbrowser.open(self.info.link) dl_btn.text = T("A page has been opened in your browser.") self._gui.adaptLayout() dl_btn.capture(do_dl) self._gui.addChild(dl_btn)
def prepare(self, **kwargs): super(VersionHint, self).prepare(**kwargs) dl_btn = Button(name="dl", text=_("Click to download")) dl_btn.position = (48, 138) # i've tried, this button cannot be placed in a sane way def do_dl(): webbrowser.open(self.info.link) dl_btn.text = _("A page has been opened in your browser.") self._gui.adaptLayout() dl_btn.capture(do_dl) self._gui.addChild(dl_btn)
def show_new_version_hint(gui, info): """ @param gui: main gui (Gui) @param info: UpdateInfo instance """ title = _(u"New version of Unknown Horizons") #xgettext:python-format text = _(u"There is a more recent release of Unknown Horizons ({new_version}) " u"than the one you are currently using ({old_version}).").format( new_version=info.version, old_version=VERSION.RELEASE_VERSION) dl_btn = Button(name="dl", text=_("Click to download")) dl_btn.position = (48, 138) # i've tried, this button cannot be placed in a sane way def do_dl(): webbrowser.open(info.link) dl_btn.text = _("A page has been opened in your browser.") popup.adaptLayout() dl_btn.capture(do_dl) popup = gui.build_popup(title, text) popup.addChild( dl_btn ) gui.show_dialog(popup, {OkButton.DEFAULT_NAME : True}, modal=True)