From 8de27024bcd0eb7d8dbede490368a68261204955 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 5 Feb 2024 18:59:32 +0300 Subject: [PATCH] Feat(wx/books): Add menu command `Save` Work around a problem the grid closes up the download button. [skip ci] --- m_librarian/wx/ListBooks.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/m_librarian/wx/ListBooks.py b/m_librarian/wx/ListBooks.py index 4252c2a..fcf7eab 100644 --- a/m_librarian/wx/ListBooks.py +++ b/m_librarian/wx/ListBooks.py @@ -181,7 +181,7 @@ class ListBooksPanel(GridPanel): else: event.Skip() - def Download(self, event): + def Download(self, event=None): book_by_row = self.book_by_row found_books = False try: @@ -207,3 +207,15 @@ class ListBooksWindow(GridWindow): session_config_section_name = 'list_books' window_title = u"m_Librarian: Список книг" GridPanelClass = ListBooksPanel + + def InitMenu(self): + GridWindow.InitMenu(self) + + download_menu = wx.Menu() + download = download_menu.Append(wx.ID_SAVE, + u"&Скачать", u"Скачать") + self.Bind(wx.EVT_MENU, self.OnDownload, download) + self.GetMenuBar().Append(download_menu, u"&Скачать") + + def OnDownload(self, event): + self.panel.Download() -- 2.39.2