Add About window to application menu
- Import and integrate AboutWindow class - Create new "Help" menu with "About Program" option - Add `open_about()` method to display About window - Enhance application's help and information accessibility
This commit is contained in:
@@ -36,6 +36,7 @@ from tkinter import ttk
|
||||
import serial
|
||||
import serial.tools.list_ports
|
||||
from serial.serialutil import SerialException
|
||||
from about_window import AboutWindow
|
||||
# from TFTPServer import TFTPServerThread
|
||||
|
||||
# Создаем необходимые папки
|
||||
@@ -590,6 +591,11 @@ class SerialAppGUI(tk.Tk):
|
||||
file_menu.add_separator()
|
||||
file_menu.add_command(label="Выход", command=self.quit)
|
||||
|
||||
# Меню "Справка"
|
||||
help_menu = tk.Menu(menubar, tearoff=0)
|
||||
menubar.add_cascade(label="Справка", menu=help_menu)
|
||||
help_menu.add_command(label="О программе", command=self.open_about)
|
||||
|
||||
def open_settings(self):
|
||||
settings_window = SettingsWindow(self, self.settings, self.on_settings_changed)
|
||||
settings_window.transient(self)
|
||||
@@ -812,6 +818,11 @@ class SerialAppGUI(tk.Tk):
|
||||
logging.error(f"Ошибка сохранения файла: {e}", exc_info=True)
|
||||
messagebox.showerror("Ошибка", f"Не удалось сохранить файл:\n{e}")
|
||||
|
||||
def open_about(self):
|
||||
about_window = AboutWindow(self)
|
||||
about_window.transient(self)
|
||||
about_window.grab_set()
|
||||
|
||||
# ==========================
|
||||
# Парсер аргументов (не используется)
|
||||
# ==========================
|
||||
|
||||
Reference in New Issue
Block a user