From 62c3d011985f444f1200aa1fecfc9d0175caea59 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 17 Dec 2023 20:21:04 +0300 Subject: [PATCH] Feat(wx): Add dialig "About" [skip ci] --- m_librarian/wx/Application.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/m_librarian/wx/Application.py b/m_librarian/wx/Application.py index 35575c3..308d65d 100644 --- a/m_librarian/wx/Application.py +++ b/m_librarian/wx/Application.py @@ -1,6 +1,7 @@ # coding: utf-8 -import wx +import wx, wx.adv +from ..__version__ import __version__ class MainWindow(wx.Frame): @@ -14,9 +15,27 @@ class MainWindow(wx.Frame): self.Bind(wx.EVT_MENU, self.OnQuit, exit) MenuBar.Append(file_menu, u"&Файл") + about_menu = wx.Menu() + about = about_menu.Append(wx.ID_ABOUT, + u"&О m_Librarian", u"О m_Librarian") + self.Bind(wx.EVT_MENU, self.OnAbout, about) + MenuBar.Append(about_menu, u"&О программе") + def OnQuit(self, event): self.Close(True) + def OnAbout(self, event): + aboutInfo = wx.adv.AboutDialogInfo() + aboutInfo.SetName(u'm_Librarian') + aboutInfo.SetVersion(__version__) + aboutInfo.SetDescription( + u'Библиотекарь для библиотек LibRusEc/Flibusta') + aboutInfo.AddDeveloper(u'Олег Бройтман') + aboutInfo.SetWebSite(u'https://phdru.name/Software/Python/m_librarian/') + aboutInfo.SetCopyright(u'(C) 2023 Олег Бройтман') + aboutInfo.SetLicense(u'GPL') + wx.adv.AboutBox(aboutInfo) + class Application(wx.App): -- 2.39.5