Compare commits
3 Commits
e1d7bca05e
...
61115411e7
Author | SHA1 | Date | |
---|---|---|---|
61115411e7
|
|||
55c32457d6
|
|||
b965b23a50
|
@@ -18,8 +18,8 @@
|
||||
- Сохранение и восстановление размера окна при перезапуске
|
||||
- Переключатель полноэкранного режима приложения
|
||||
- Пункт в контекстном меню «Открыть папку игры»
|
||||
- Пункт в контекстном меню «Добавить в Steam»
|
||||
- Пункт в контекстном меню «Удалить из Steam»
|
||||
- Пункты в контекстном меню «Добавить в Steam» и «Удалить из Steam»
|
||||
- Пункты в контекстном меню «Добавить в Избранное» и «Удалить из Избранного» для переключения статуса избранного через геймпад
|
||||
- Метод сортировки «Сначала избранное»
|
||||
- Настройка автоматического перехода в полноэкранный режим при подключении геймпада (по умолчанию отключена)
|
||||
- Обработчики для QMenu и QComboBox при управлении геймпадом
|
||||
|
@@ -20,9 +20,9 @@ Current translation status:
|
||||
|
||||
| Locale | Progress | Translated |
|
||||
| :----- | -------: | ---------: |
|
||||
| [de_DE](./de_DE/LC_MESSAGES/messages.po) | 0% | 0 of 153 |
|
||||
| [es_ES](./es_ES/LC_MESSAGES/messages.po) | 0% | 0 of 153 |
|
||||
| [ru_RU](./ru_RU/LC_MESSAGES/messages.po) | 100% | 153 of 153 |
|
||||
| [de_DE](./de_DE/LC_MESSAGES/messages.po) | 0% | 0 of 157 |
|
||||
| [es_ES](./es_ES/LC_MESSAGES/messages.po) | 0% | 0 of 157 |
|
||||
| [ru_RU](./ru_RU/LC_MESSAGES/messages.po) | 100% | 157 of 157 |
|
||||
|
||||
---
|
||||
|
||||
|
@@ -20,9 +20,9 @@
|
||||
|
||||
| Локаль | Прогресс | Переведено |
|
||||
| :----- | -------: | ---------: |
|
||||
| [de_DE](./de_DE/LC_MESSAGES/messages.po) | 0% | 0 из 153 |
|
||||
| [es_ES](./es_ES/LC_MESSAGES/messages.po) | 0% | 0 из 153 |
|
||||
| [ru_RU](./ru_RU/LC_MESSAGES/messages.po) | 100% | 153 из 153 |
|
||||
| [de_DE](./de_DE/LC_MESSAGES/messages.po) | 0% | 0 из 157 |
|
||||
| [es_ES](./es_ES/LC_MESSAGES/messages.po) | 0% | 0 из 157 |
|
||||
| [ru_RU](./ru_RU/LC_MESSAGES/messages.po) | 100% | 157 из 157 |
|
||||
|
||||
---
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import subprocess
|
||||
from PySide6.QtWidgets import QMessageBox, QDialog, QMenu
|
||||
from PySide6.QtCore import QUrl, QPoint
|
||||
from PySide6.QtGui import QDesktopServices
|
||||
from portprotonqt.config_utils import parse_desktop_entry
|
||||
from portprotonqt.config_utils import parse_desktop_entry, read_favorites, save_favorites
|
||||
from portprotonqt.localization import _
|
||||
from portprotonqt.steam_api import is_game_in_steam, add_to_steam, remove_from_steam
|
||||
from portprotonqt.dialogs import AddGameDialog
|
||||
@@ -41,6 +41,17 @@ class ContextMenuManager:
|
||||
"""
|
||||
|
||||
menu = QMenu(self.parent)
|
||||
|
||||
favorites = read_favorites()
|
||||
is_favorite = game_card.name in favorites
|
||||
|
||||
if is_favorite:
|
||||
favorite_action = menu.addAction(_("Remove from Favorites"))
|
||||
favorite_action.triggered.connect(lambda: self.toggle_favorite(game_card, False))
|
||||
else:
|
||||
favorite_action = menu.addAction(_("Add to Favorites"))
|
||||
favorite_action.triggered.connect(lambda: self.toggle_favorite(game_card, True))
|
||||
|
||||
if game_card.game_source not in ("steam", "epic"):
|
||||
desktop_dir = subprocess.check_output(['xdg-user-dir', 'DESKTOP']).decode('utf-8').strip()
|
||||
desktop_path = os.path.join(desktop_dir, f"{game_card.name}.desktop")
|
||||
@@ -80,6 +91,26 @@ class ContextMenuManager:
|
||||
|
||||
menu.exec(game_card.mapToGlobal(pos))
|
||||
|
||||
def toggle_favorite(self, game_card, add: bool):
|
||||
"""
|
||||
Toggle the favorite status of a game and update its icon.
|
||||
|
||||
Args:
|
||||
game_card: The GameCard instance to toggle.
|
||||
add: True to add to favorites, False to remove.
|
||||
"""
|
||||
favorites = read_favorites()
|
||||
if add and game_card.name not in favorites:
|
||||
favorites.append(game_card.name)
|
||||
game_card.is_favorite = True
|
||||
self.parent.statusBar().showMessage(_("Added '{0}' to favorites").format(game_card.name), 3000)
|
||||
elif not add and game_card.name in favorites:
|
||||
favorites.remove(game_card.name)
|
||||
game_card.is_favorite = False
|
||||
self.parent.statusBar().showMessage(_("Removed '{0}' from favorites").format(game_card.name), 3000)
|
||||
save_favorites(favorites)
|
||||
game_card.update_favorite_icon()
|
||||
|
||||
def _check_portproton(self):
|
||||
"""Check if PortProton is available."""
|
||||
if self.portproton_location is None:
|
||||
|
Binary file not shown.
@@ -9,7 +9,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2025-06-08 09:31+0500\n"
|
||||
"POT-Creation-Date: 2025-06-08 22:55+0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language: de_DE\n"
|
||||
@@ -20,6 +20,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.17.0\n"
|
||||
|
||||
msgid "Remove from Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Add to Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Remove from Desktop"
|
||||
msgstr ""
|
||||
|
||||
@@ -47,6 +53,14 @@ msgstr ""
|
||||
msgid "Add to Steam"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Added '{0}' to favorites"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed '{0}' from favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
|
Binary file not shown.
@@ -9,7 +9,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2025-06-08 09:31+0500\n"
|
||||
"POT-Creation-Date: 2025-06-08 22:55+0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language: es_ES\n"
|
||||
@@ -20,6 +20,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.17.0\n"
|
||||
|
||||
msgid "Remove from Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Add to Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Remove from Desktop"
|
||||
msgstr ""
|
||||
|
||||
@@ -47,6 +53,14 @@ msgstr ""
|
||||
msgid "Add to Steam"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Added '{0}' to favorites"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed '{0}' from favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
|
@@ -9,7 +9,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PortProtonQT 0.1.1\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2025-06-08 09:31+0500\n"
|
||||
"POT-Creation-Date: 2025-06-08 22:55+0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -18,6 +18,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.17.0\n"
|
||||
|
||||
msgid "Remove from Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Add to Favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Remove from Desktop"
|
||||
msgstr ""
|
||||
|
||||
@@ -45,6 +51,14 @@ msgstr ""
|
||||
msgid "Add to Steam"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Added '{0}' to favorites"
|
||||
msgstr ""
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed '{0}' from favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
|
Binary file not shown.
@@ -9,8 +9,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2025-06-08 09:31+0500\n"
|
||||
"PO-Revision-Date: 2025-06-08 09:31+0500\n"
|
||||
"POT-Creation-Date: 2025-06-08 22:55+0500\n"
|
||||
"PO-Revision-Date: 2025-06-08 22:55+0500\n"
|
||||
"Last-Translator: \n"
|
||||
"Language: ru_RU\n"
|
||||
"Language-Team: ru_RU <LL@li.org>\n"
|
||||
@@ -21,6 +21,12 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.17.0\n"
|
||||
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Удалить из Избранного"
|
||||
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Добавить в Избранное"
|
||||
|
||||
msgid "Remove from Desktop"
|
||||
msgstr "Удалить с рабочего стола"
|
||||
|
||||
@@ -48,6 +54,14 @@ msgstr "Удалить из Steam"
|
||||
msgid "Add to Steam"
|
||||
msgstr "Добавить в Steam"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Added '{0}' to favorites"
|
||||
msgstr "Добавление '{0}' в избранное"
|
||||
|
||||
#, python-brace-format
|
||||
msgid "Removed '{0}' from favorites"
|
||||
msgstr "Удаление '{0}' из избранного"
|
||||
|
||||
msgid "Error"
|
||||
msgstr "Ошибка"
|
||||
|
||||
|
Reference in New Issue
Block a user