Add update checking and documentation features
- Implement UpdateChecker for version comparison and update notifications - Add menu options for documentation and update checking - Enhance AboutWindow with dynamic version display - Update requirements.txt with new dependencies - Create infrastructure for opening local documentation - Improve application menu with additional help options
This commit is contained in:
@@ -2,19 +2,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import tkinter as tk
|
||||
from tkinter import ttk, BOTH, X, BOTTOM
|
||||
from tkinter import ttk, BOTH, X, BOTTOM, END
|
||||
import webbrowser
|
||||
|
||||
class AboutWindow(tk.Toplevel):
|
||||
def __init__(self, parent):
|
||||
super().__init__(parent)
|
||||
self.title("О программе")
|
||||
self.geometry("400x300")
|
||||
self.geometry("600x500")
|
||||
self.resizable(False, False)
|
||||
|
||||
# Создаем фрейм
|
||||
# Сохраняем ссылку на родительское окно
|
||||
self.parent = parent
|
||||
|
||||
# Создаем фрейм для содержимого
|
||||
about_frame = ttk.Frame(self, padding="20")
|
||||
about_frame.pack(fill=BOTH, expand=True)
|
||||
about_frame.pack(fill=BOTH, expand=True, padx=10, pady=10)
|
||||
|
||||
# Заголовок
|
||||
ttk.Label(
|
||||
@@ -33,7 +36,7 @@ class AboutWindow(tk.Toplevel):
|
||||
# Версия
|
||||
ttk.Label(
|
||||
about_frame,
|
||||
text="Версия 1.0",
|
||||
text=f"Версия {getattr(parent, 'VERSION', '1.0.0')}",
|
||||
font=("Segoe UI", 10)
|
||||
).pack(pady=(0, 20))
|
||||
|
||||
@@ -80,14 +83,14 @@ class AboutWindow(tk.Toplevel):
|
||||
|
||||
# Кнопка закрытия
|
||||
ttk.Button(
|
||||
about_frame,
|
||||
self,
|
||||
text="Закрыть",
|
||||
command=self.destroy
|
||||
).pack(side=BOTTOM, pady=(20, 0))
|
||||
).pack(side=BOTTOM, pady=10)
|
||||
|
||||
# Центрируем окно
|
||||
self.center_window()
|
||||
|
||||
|
||||
def center_window(self):
|
||||
self.update_idletasks()
|
||||
width = self.winfo_width()
|
||||
@@ -95,6 +98,6 @@ class AboutWindow(tk.Toplevel):
|
||||
x = (self.winfo_screenwidth() // 2) - (width // 2)
|
||||
y = (self.winfo_screenheight() // 2) - (height // 2)
|
||||
self.geometry(f"{width}x{height}+{x}+{y}")
|
||||
|
||||
|
||||
def open_url(self, url):
|
||||
webbrowser.open(url)
|
||||
Reference in New Issue
Block a user