Compare commits
2 Commits
f0690f8811
...
0294c90c54
Author | SHA1 | Date | |
---|---|---|---|
0294c90c54
|
|||
17dfef2d27
|
@@ -16,6 +16,8 @@
|
|||||||
- Общие json (steam_apps и anticheat_games) теперь перекачиваются если сломаны
|
- Общие json (steam_apps и anticheat_games) теперь перекачиваются если сломаны
|
||||||
- Временно удалена светлая тема
|
- Временно удалена светлая тема
|
||||||
- Добавление и удаление игр из Steam теперь не требует перезагрузки Steam
|
- Добавление и удаление игр из Steam теперь не требует перезагрузки Steam
|
||||||
|
- Обновлены все зависимости (затрагивает только AppImage)
|
||||||
|
- Удалён отдельный трей так как у PortProton есть свой трей
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- legendary list теперь не вызывается если вход в EGS не был произведён
|
- legendary list теперь не вызывается если вход в EGS не был произведён
|
||||||
@@ -23,7 +25,6 @@
|
|||||||
- Данные от HLTB теперь не отображаются в карточке если нет данных о времени прохождения
|
- Данные от HLTB теперь не отображаются в карточке если нет данных о времени прохождения
|
||||||
- Диалог добавления игры теперь не добавляет игру если exe не существует
|
- Диалог добавления игры теперь не добавляет игру если exe не существует
|
||||||
|
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
- @Alex Smith
|
- @Alex Smith
|
||||||
|
|
||||||
|
@@ -3,8 +3,7 @@ from PySide6.QtCore import QLocale, QTranslator, QLibraryInfo
|
|||||||
from PySide6.QtWidgets import QApplication
|
from PySide6.QtWidgets import QApplication
|
||||||
from PySide6.QtGui import QIcon
|
from PySide6.QtGui import QIcon
|
||||||
from portprotonqt.main_window import MainWindow
|
from portprotonqt.main_window import MainWindow
|
||||||
from portprotonqt.tray import SystemTray
|
from portprotonqt.config_utils import save_fullscreen_config
|
||||||
from portprotonqt.config_utils import read_theme_from_config, save_fullscreen_config
|
|
||||||
from portprotonqt.logger import get_logger
|
from portprotonqt.logger import get_logger
|
||||||
from portprotonqt.cli import parse_args
|
from portprotonqt.cli import parse_args
|
||||||
|
|
||||||
@@ -38,35 +37,13 @@ def main():
|
|||||||
save_fullscreen_config(True)
|
save_fullscreen_config(True)
|
||||||
window.showFullScreen()
|
window.showFullScreen()
|
||||||
|
|
||||||
current_theme_name = read_theme_from_config()
|
|
||||||
tray = SystemTray(app, current_theme_name)
|
|
||||||
tray.show_action.triggered.connect(window.show)
|
|
||||||
tray.hide_action.triggered.connect(window.hide)
|
|
||||||
|
|
||||||
def recreate_tray():
|
|
||||||
nonlocal tray
|
|
||||||
if tray:
|
|
||||||
logger.debug("Recreating system tray")
|
|
||||||
tray.cleanup()
|
|
||||||
tray = None
|
|
||||||
current_theme = read_theme_from_config()
|
|
||||||
tray = SystemTray(app, current_theme)
|
|
||||||
# Ensure window is not None before connecting signals
|
|
||||||
if window:
|
|
||||||
tray.show_action.triggered.connect(window.show)
|
|
||||||
tray.hide_action.triggered.connect(window.hide)
|
|
||||||
|
|
||||||
def cleanup_on_exit():
|
def cleanup_on_exit():
|
||||||
nonlocal tray, window
|
nonlocal window
|
||||||
app.aboutToQuit.disconnect()
|
app.aboutToQuit.disconnect()
|
||||||
if tray:
|
|
||||||
tray.cleanup()
|
|
||||||
tray = None
|
|
||||||
if window:
|
if window:
|
||||||
window.close()
|
window.close()
|
||||||
app.quit()
|
app.quit()
|
||||||
|
|
||||||
window.settings_saved.connect(recreate_tray)
|
|
||||||
app.aboutToQuit.connect(cleanup_on_exit)
|
app.aboutToQuit.connect(cleanup_on_exit)
|
||||||
|
|
||||||
window.show()
|
window.show()
|
||||||
|
@@ -188,7 +188,7 @@ class GameCard(QFrame):
|
|||||||
self.egsLabel.setVisible(self.egs_visible)
|
self.egsLabel.setVisible(self.egs_visible)
|
||||||
|
|
||||||
# PortProton бейдж
|
# PortProton бейдж
|
||||||
portproton_icon = self.theme_manager.get_icon("ppqt-tray")
|
portproton_icon = self.theme_manager.get_icon("portproton")
|
||||||
self.portprotonLabel = ClickableLabel(
|
self.portprotonLabel = ClickableLabel(
|
||||||
"PortProton",
|
"PortProton",
|
||||||
icon=portproton_icon,
|
icon=portproton_icon,
|
||||||
|
@@ -48,7 +48,6 @@ logger = get_logger(__name__)
|
|||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
"""Main window of PortProtonQt."""
|
"""Main window of PortProtonQt."""
|
||||||
settings_saved = Signal()
|
|
||||||
games_loaded = Signal(list)
|
games_loaded = Signal(list)
|
||||||
update_progress = Signal(int) # Signal to update progress bar
|
update_progress = Signal(int) # Signal to update progress bar
|
||||||
update_status_message = Signal(str, int) # Signal to update status message
|
update_status_message = Signal(str, int) # Signal to update status message
|
||||||
@@ -1331,7 +1330,6 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
self.settingsDebounceTimer.start()
|
self.settingsDebounceTimer.start()
|
||||||
|
|
||||||
self.settings_saved.emit()
|
|
||||||
|
|
||||||
# Управление полноэкранным режимом
|
# Управление полноэкранным режимом
|
||||||
gamepad_connected = self.input_manager.find_gamepad() is not None
|
gamepad_connected = self.input_manager.find_gamepad() is not None
|
||||||
@@ -1676,7 +1674,7 @@ class MainWindow(QMainWindow):
|
|||||||
egsLabel.setVisible(egs_visible)
|
egsLabel.setVisible(egs_visible)
|
||||||
|
|
||||||
# PortProton badge
|
# PortProton badge
|
||||||
portproton_icon = self.theme_manager.get_icon("ppqt-tray")
|
portproton_icon = self.theme_manager.get_icon("portproton")
|
||||||
portprotonLabel = ClickableLabel(
|
portprotonLabel = ClickableLabel(
|
||||||
"PortProton",
|
"PortProton",
|
||||||
icon=portproton_icon,
|
icon=portproton_icon,
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,49 +0,0 @@
|
|||||||
from PySide6.QtGui import QAction, QIcon
|
|
||||||
from PySide6.QtWidgets import QSystemTrayIcon, QMenu
|
|
||||||
from portprotonqt.theme_manager import ThemeManager
|
|
||||||
from typing import cast
|
|
||||||
import portprotonqt.themes.standart.styles as default_styles
|
|
||||||
from portprotonqt.config_utils import read_theme_from_config
|
|
||||||
|
|
||||||
class SystemTray:
|
|
||||||
def __init__(self, app, theme=None):
|
|
||||||
self.app = app
|
|
||||||
self.theme_manager = ThemeManager()
|
|
||||||
self.theme = theme if theme is not None else default_styles
|
|
||||||
self.current_theme_name = read_theme_from_config()
|
|
||||||
self.tray = QSystemTrayIcon()
|
|
||||||
self.tray.setIcon(cast(QIcon, self.theme_manager.get_icon("ppqt-tray", self.current_theme_name)))
|
|
||||||
self.tray.setToolTip("PortProtonQt")
|
|
||||||
self.tray.setVisible(True)
|
|
||||||
|
|
||||||
# Создаём меню
|
|
||||||
self.menu = QMenu()
|
|
||||||
|
|
||||||
self.hide_action = QAction("Скрыть окно")
|
|
||||||
self.menu.addAction(self.hide_action)
|
|
||||||
|
|
||||||
self.show_action = QAction("Показать окно")
|
|
||||||
self.menu.addAction(self.show_action)
|
|
||||||
|
|
||||||
self.quit_action = QAction("Выход")
|
|
||||||
self.quit_action.triggered.connect(app.quit)
|
|
||||||
self.menu.addAction(self.quit_action)
|
|
||||||
|
|
||||||
self.tray.setContextMenu(self.menu)
|
|
||||||
|
|
||||||
def hide_tray(self):
|
|
||||||
"""Скрыть иконку трея"""
|
|
||||||
if self.tray:
|
|
||||||
self.tray.setVisible(False)
|
|
||||||
if self.menu:
|
|
||||||
self.menu.deleteLater()
|
|
||||||
self.menu = None
|
|
||||||
|
|
||||||
def cleanup(self):
|
|
||||||
"""Очистка ресурсов трея"""
|
|
||||||
if self.tray:
|
|
||||||
self.tray.setVisible(False)
|
|
||||||
self.tray = None
|
|
||||||
if self.menu:
|
|
||||||
self.menu.deleteLater()
|
|
||||||
self.menu = None
|
|
Reference in New Issue
Block a user