]> git.phdru.name Git - m_librarian.git/commitdiff
Feat(wx): Add dialig "About"
authorOleg Broytman <phd@phdru.name>
Sun, 17 Dec 2023 17:21:04 +0000 (20:21 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 17 Dec 2023 20:48:01 +0000 (23:48 +0300)
[skip ci]

m_librarian/wx/Application.py

index 35575c3880928b7d729b383fe1c3cc51c6fe1ec0..308d65d4e6a5635123e5f902d97c9dfb47d929f6 100644 (file)
@@ -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):