Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9a8fe41d5 | ||
|
|
e591c6619c | ||
|
|
a172bcd8a5 | ||
|
|
ac852b6be2 | ||
|
|
c007084e52 |
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
import tkinter as tk
|
||||||
|
|
||||||
|
# Создаем главное окно
|
||||||
|
root = tk.Tk()
|
||||||
|
|
||||||
|
# Задаем размеры окна
|
||||||
|
root.geometry("560x660")
|
||||||
|
|
||||||
|
# Задаем заголовок окна
|
||||||
|
root.title("Лицензионное соглашение")
|
||||||
|
|
||||||
|
# Текст лицензионного соглашения
|
||||||
|
license_text = """
|
||||||
|
Лицензионное соглашение
|
||||||
|
|
||||||
|
Разрешение на использование:
|
||||||
|
Любой может свободно использовать программное обеспечение под MIT лицензией в своих проектах, включая коммерческие приложения.
|
||||||
|
|
||||||
|
Разрешение на модификацию:
|
||||||
|
Пользователи имеют право изменять и модифицировать исходный код программы.
|
||||||
|
|
||||||
|
Сохранение авторских прав:
|
||||||
|
MIT лицензия требует сохранения копии оригинального уведомления об авторских правах и лицензионной информации во всех копиях программного обеспечения.
|
||||||
|
|
||||||
|
Отказ от гарантий:
|
||||||
|
Лицензия предоставляется "как есть", без каких-либо явных или подразумеваемых гарантий, что делает авторов или держателей лицензии невиновными в случае проблем, возникающих в результате использования программного обеспечения.
|
||||||
|
|
||||||
|
Отказ от ответственности:
|
||||||
|
Авторы или держатели лицензии не несут ответственности за любые ущербы, прямые или косвенные, возникающие в результате использования программного обеспечения.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Создаем текстовое поле для отображения лицензионного соглашения
|
||||||
|
license_label = tk.Label(root, text=license_text, justify='left', anchor='w', padx=10, pady=10, wraplength=540)
|
||||||
|
license_label.pack(fill='both', expand=True)
|
||||||
|
|
||||||
|
# Запускаем главный цикл обработки событий
|
||||||
|
root.mainloop()
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import time
|
import time
|
||||||
|
import asyncio
|
||||||
|
import subprocess
|
||||||
|
|
||||||
class RoundedMenuApp:
|
class RoundedMenuApp:
|
||||||
def __init__(self, width, height, corner_radius):
|
def __init__(self, width, height, corner_radius):
|
||||||
@@ -9,7 +11,7 @@ class RoundedMenuApp:
|
|||||||
self.corner_radius = corner_radius
|
self.corner_radius = corner_radius
|
||||||
|
|
||||||
self.root = tk.Tk()
|
self.root = tk.Tk()
|
||||||
self.root.title("Klajer") # Изменено название приложения
|
self.root.title("Klajer") # Changed the title of the application
|
||||||
|
|
||||||
# Get the screen width and height
|
# Get the screen width and height
|
||||||
screen_width = self.root.winfo_screenwidth()
|
screen_width = self.root.winfo_screenwidth()
|
||||||
@@ -26,12 +28,14 @@ class RoundedMenuApp:
|
|||||||
|
|
||||||
self.draw_rounded_corners()
|
self.draw_rounded_corners()
|
||||||
self.create_youtube_button()
|
self.create_youtube_button()
|
||||||
|
self.create_license_button() # Added the license button
|
||||||
|
self.create_update_button() # Added the update button
|
||||||
|
|
||||||
# Создаем метку для отображения времени
|
# Create a label to display the time
|
||||||
self.time_label = tk.Label(self.root, text="", font=("Arial", 12))
|
self.time_label = tk.Label(self.root, text="", font=("Arial", 12))
|
||||||
self.time_label.place(relx=0.5, rely=1, anchor="s")
|
self.time_label.place(relx=0.5, rely=1, anchor="s")
|
||||||
|
|
||||||
# Запускаем обновление времени
|
# Start updating time
|
||||||
self.update_time()
|
self.update_time()
|
||||||
|
|
||||||
def draw_rounded_corners(self):
|
def draw_rounded_corners(self):
|
||||||
@@ -51,18 +55,38 @@ class RoundedMenuApp:
|
|||||||
youtube_button = tk.Button(self.root, text="YouTube", command=self.open_youtube)
|
youtube_button = tk.Button(self.root, text="YouTube", command=self.open_youtube)
|
||||||
youtube_button.place(relx=1, rely=1, anchor="se")
|
youtube_button.place(relx=1, rely=1, anchor="se")
|
||||||
|
|
||||||
|
def create_license_button(self):
|
||||||
|
license_button = tk.Button(self.root, text="License", command=self.open_license)
|
||||||
|
license_button.place(relx=0, rely=1, anchor="sw")
|
||||||
|
|
||||||
|
def create_update_button(self):
|
||||||
|
update_button = tk.Button(self.root, text="Проверить обновление", command=self.open_update)
|
||||||
|
update_button.place(relx=0.5, rely=0.5, anchor="center")
|
||||||
|
|
||||||
|
async def async_open_license(self):
|
||||||
|
await asyncio.create_subprocess_exec('python', 'License-agreement.py')
|
||||||
|
|
||||||
|
async def async_open_update(self):
|
||||||
|
await asyncio.create_subprocess_exec('python', 'check-the-update.py')
|
||||||
|
|
||||||
|
def open_license(self):
|
||||||
|
asyncio.run(self.async_open_license()) # Run the async function in a synchronous context
|
||||||
|
|
||||||
|
def open_update(self):
|
||||||
|
asyncio.run(self.async_open_update()) # Run the async function in a synchronous context
|
||||||
|
|
||||||
def open_youtube(self):
|
def open_youtube(self):
|
||||||
webbrowser.open_new_tab("https://www.youtube.com/")
|
webbrowser.open_new_tab("https://www.youtube.com/")
|
||||||
|
|
||||||
def update_time(self):
|
def update_time(self):
|
||||||
current_time = time.strftime("%H:%M:%S")
|
current_time = time.strftime("%H:%M:%S")
|
||||||
self.time_label.config(text=current_time)
|
self.time_label.config(text=current_time)
|
||||||
self.root.after(1000, self.update_time) # Обновляем время каждую секунду
|
self.root.after(1000, self.update_time) # Update time every second
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.root.mainloop()
|
self.root.mainloop()
|
||||||
|
|
||||||
|
|
||||||
# Создаем и запускаем приложение
|
# Create and run the application
|
||||||
app = RoundedMenuApp(width=646, height=396, corner_radius=30)
|
app = RoundedMenuApp(width=646, height=396, corner_radius=30)
|
||||||
app.run()
|
app.run()
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import os
|
||||||
|
import requests
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def download_file(url, save_path):
|
||||||
|
try:
|
||||||
|
response = requests.get(url)
|
||||||
|
with open(save_path, 'wb') as f:
|
||||||
|
f.write(response.content)
|
||||||
|
print("Файл успешно скачан и сохранён в", save_path)
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
print("Ошибка при скачивании файла:", e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def run_update_file(file_path):
|
||||||
|
try:
|
||||||
|
subprocess.call(file_path, shell=True)
|
||||||
|
print("Файл обновления успешно запущен")
|
||||||
|
except Exception as e:
|
||||||
|
print("Ошибка при запуске файла обновления:", e)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
update_url = "https://github.com/kromskii2/Klajer/releases/download/check-the-update/123.mp4"
|
||||||
|
temp_folder = "temp"
|
||||||
|
update_file_name = "123.mp4" # Имя скачиваемого файла обновления
|
||||||
|
|
||||||
|
if not os.path.exists(temp_folder):
|
||||||
|
os.makedirs(temp_folder)
|
||||||
|
|
||||||
|
update_file_path = os.path.join(temp_folder, update_file_name)
|
||||||
|
|
||||||
|
if download_file(update_url, update_file_path):
|
||||||
|
run_update_file(update_file_path)
|
||||||
|
else:
|
||||||
|
print("Не удалось скачать файл обновления.")
|
||||||
Reference in new issue
Block a user