From ae93efb17a7e50dd368446763c48baddaba1013f Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 2 Jul 2019 09:26:07 -0500 Subject: [PATCH] Display version type in about dialog between alpha or stable --- src/controller/mainController.py | 6 +++++- src/wxUI/mainWindow.py | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index b8e7215..643d2af 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -547,7 +547,7 @@ class Controller(object): widgetUtils.connect_event(self.window, widgetUtils.CLOSE_EVENT, self.exit) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.update_buffer, menuitem=self.window.update_buffer) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_for_updates, menuitem=self.window.check_for_updates) - widgetUtils.connect_event(self.window, widgetUtils.MENU, self.window.about_dialog, menuitem=self.window.about) + widgetUtils.connect_event(self.window, widgetUtils.MENU, self.on_about, menuitem=self.window.about) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_audios, menuitem=self.window.search_audios) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_videos, menuitem=self.window.search_videos) widgetUtils.connect_event(self.window, widgetUtils.MENU,self.remove_buffer, menuitem=self.window.remove_buffer_) @@ -598,6 +598,10 @@ class Controller(object): if update == False: commonMessages.no_update_available() + def on_about(self, *args, **kwargs): + channel = self.session.settings["general"]["update_channel"] + self.window.about_dialog(channel) + def search_audios(self, *args, **kwargs): dlg = searchDialogs.searchAudioDialog() if dlg.get_response() == widgetUtils.OK: diff --git a/src/wxUI/mainWindow.py b/src/wxUI/mainWindow.py index d5b43fa..d37256f 100644 --- a/src/wxUI/mainWindow.py +++ b/src/wxUI/mainWindow.py @@ -133,10 +133,14 @@ class mainWindow(wx.Frame): def advance_selection(self, forward): self.tb.AdvanceSelection(forward) - def about_dialog(self, *args, **kwargs): + def about_dialog(self, channel="stable", *args, **kwargs): + if channel == "stable": + version = _("{version} (stable)").format(version=application.version) + else: + version = _("{version} (alpha)").format(version=application.update_next_version) info = wx.adv.AboutDialogInfo() info.SetName(application.name) - info.SetVersion(application.version) + info.SetVersion(version) info.SetDescription(application.description) info.SetCopyright(application.copyright) info.SetTranslators(application.translators)