diff --git a/rare/components/dialogs/install_dialog.py b/rare/components/dialogs/install_dialog.py index fb0bb191..ec793030 100644 --- a/rare/components/dialogs/install_dialog.py +++ b/rare/components/dialogs/install_dialog.py @@ -31,6 +31,10 @@ class InstallDialog(QDialog, Ui_InstallDialog): self.update = update self.silent = silent + self.options_changed = False + self.worker_running = False + self.reject_close = True + self.threadpool = QThreadPool(self) self.threadpool.setMaxThreadCount(1) @@ -38,16 +42,14 @@ class InstallDialog(QDialog, Ui_InstallDialog): self.install_dialog_label.setText(f"

{header} \"{self.game.app_title}\"

") self.setWindowTitle(f"{self.windowTitle()} - {header} \"{self.game.app_title}\"") + default_path = os.path.expanduser("~/legendary") if self.core.lgd.config.has_option("Legendary", "install_dir"): default_path = self.core.lgd.config.get("Legendary", "install_dir") - else: - default_path = os.path.expanduser("~/legendary") - if not default_path: - default_path = os.path.expanduser("~/legendary") - self.install_dir_edit = PathEdit(text=default_path, + self.install_dir_edit = PathEdit(path=default_path, file_type=QFileDialog.DirectoryOnly, - edit_func=self.option_changed) + edit_func=self.option_changed, + parent=self) self.install_dir_layout.addWidget(self.install_dir_edit) if self.update: @@ -91,10 +93,6 @@ class InstallDialog(QDialog, Ui_InstallDialog): self.verify_button.clicked.connect(self.verify_clicked) self.install_button.clicked.connect(self.install_clicked) - self.options_changed = False - self.worker_running = False - self.reject_close = True - self.resize(self.minimumSize()) # self.setFixedSize(self.size()) diff --git a/rare/components/tabs/games/game_info/game_dlc.py b/rare/components/tabs/games/game_info/game_dlc.py index 0ce0990a..701a9da4 100644 --- a/rare/components/tabs/games/game_info/game_dlc.py +++ b/rare/components/tabs/games/game_info/game_dlc.py @@ -19,8 +19,8 @@ class GameDlc(QWidget, Ui_GameDlc): super(GameDlc, self).__init__(parent=parent) self.setupUi(self) - self.available_dlc_scroll.setObjectName("noborder") - self.installed_dlc_scroll.setObjectName("noborder") + self.available_dlc_scroll.setProperty("noBorder", 1) + self.installed_dlc_scroll.setProperty("noBorder", 1) self.signals = shared.signals self.core = shared.core @@ -95,19 +95,22 @@ class GameDlcWidget(QFrame, Ui_GameDlcWidget): self.app_name.setText(dlc.app_name) if installed: - self.install_button.clicked.connect(self.uninstall_dlc) + self.action_button.setProperty("uninstall", 1) + self.action_button.clicked.connect(self.uninstall_dlc) self.status.setText(self.tr("Installed")) - self.install_button.setText("Uninstall") - + self.action_button.setText(self.tr("Uninstall DLC")) else: - self.install_button.clicked.connect(self.install_game) + self.action_button.setProperty("install", 1) + self.action_button.clicked.connect(self.install_game) self.status.setText(self.tr("Not installed")) - self.install_button.setText("Install") + self.action_button.setText(self.tr("Install DLC")) def uninstall_dlc(self): + self.action_button.setDisabled(True) + self.action_button.setText(self.tr("Uninstalling")) self.uninstall.emit(self.dlc) def install_game(self): - self.install_button.setDisabled(True) - self.install_button.setText(self.tr("Installing")) + self.action_button.setDisabled(True) + self.action_button.setText(self.tr("Installing")) self.install.emit(self.dlc.app_name) diff --git a/rare/components/tabs/games/game_info/game_settings.py b/rare/components/tabs/games/game_info/game_settings.py index faf68091..c64203d2 100644 --- a/rare/components/tabs/games/game_info/game_settings.py +++ b/rare/components/tabs/games/game_info/game_settings.py @@ -73,8 +73,11 @@ class GameSettings(QWidget, Ui_GameSettings): self.proton_wrapper.addItems(self.possible_proton_wrappers) self.proton_wrapper.currentIndexChanged.connect(self.change_proton) - self.proton_prefix = PathEdit("None", QFileDialog.DirectoryOnly, - edit_func=self.proton_prefix_edit, save_func=self.proton_prefix_save) + self.proton_prefix = PathEdit( + file_type=QFileDialog.DirectoryOnly, + edit_func=self.proton_prefix_edit, + save_func=self.proton_prefix_save + ) self.proton_prefix_layout.addWidget(self.proton_prefix) self.linux_settings = LinuxAppSettings() diff --git a/rare/components/tabs/games/head_bar.py b/rare/components/tabs/games/head_bar.py index 3cc71da7..83efa685 100644 --- a/rare/components/tabs/games/head_bar.py +++ b/rare/components/tabs/games/head_bar.py @@ -42,16 +42,16 @@ class GameListHeadBar(QWidget): self.egl_sync_clicked = self.egl_sync.clicked self.layout().addWidget(self.egl_sync) # FIXME: Until it is ready - self.egl_sync.setEnabled(False) + # self.egl_sync.setEnabled(False) self.layout().addStretch(1) - self.search_bar = QLineEdit() - self.search_bar.setObjectName("search_bar") - self.search_bar.setFrame(False) icon_label = QLabel() icon_label.setPixmap(icon("fa.search").pixmap(QSize(20, 20))) self.layout().addWidget(icon_label) + self.search_bar = QLineEdit() + self.search_bar.setObjectName("search_bar") + self.search_bar.setFrame(False) self.search_bar.setMinimumWidth(200) self.search_bar.setPlaceholderText(self.tr("Search Game")) self.layout().addWidget(self.search_bar) diff --git a/rare/components/tabs/games/import_sync/__init__.py b/rare/components/tabs/games/import_sync/__init__.py index 562506ab..77102f49 100644 --- a/rare/components/tabs/games/import_sync/__init__.py +++ b/rare/components/tabs/games/import_sync/__init__.py @@ -26,7 +26,7 @@ class ImportSyncTabs(SideTabWidget): ) self.addTab(self.egl_sync_widget, self.tr("Sync with EGL")) # FIXME: Until it is ready - self.setTabEnabled(2, False) + # self.setTabEnabled(2, False) self.tabBar().setCurrentIndex(1) diff --git a/rare/components/tabs/games/import_sync/egl_sync_widget.py b/rare/components/tabs/games/import_sync/egl_sync_widget.py index 5ac6c1bc..676955f9 100644 --- a/rare/components/tabs/games/import_sync/egl_sync_widget.py +++ b/rare/components/tabs/games/import_sync/egl_sync_widget.py @@ -1,34 +1,54 @@ import os import platform +from glob import glob from logging import getLogger -from PyQt5.QtCore import Qt +from PyQt5.QtCore import Qt, QThread from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QLabel, QGroupBox, \ QCheckBox, QPushButton, QListWidgetItem, QDialog, QFileDialog import rare.shared as shared from rare.ui.components.tabs.games.import_sync.egl_sync_widget import Ui_EGLSyncGroup from rare.utils.extra_widgets import PathEdit +from rare.utils.utils import WineResolver logger = getLogger("EGLSync") +appdata_path_spec = \ + r'%LOCALAPPDATA%\EpicGamesLauncher\Saved\Config\Windows' +programdata_path_spec = \ + r'%PROGRAMDATA%\Epic\EpicGamesLauncher\Data\Manifests' + class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup): importable_items = list() exportable_items = list() + wine_resolver: QThread def __init__(self, parent=None): super(EGLSyncGroup, self).__init__(parent=parent) self.setupUi(self) + self.export_list.setProperty("noBorder", 1) + self.import_list.setProperty("noBorder", 1) + + if platform.system() == "Windows": + estimated_path = os.path.expandvars(programdata_path_spec) + else: + estimated_path = str() + self.wine_resolver = WineResolver(programdata_path_spec, 'default', shared.legendary_core) + self.wine_resolver.result_ready.connect(self.egl_path_info.setText) + self.wine_resolver.finished.connect(self.wine_resolver.quit) + self.wine_resolver.finished.connect(self.wine_resolver.deleteLater) + self.wine_resolver.start() + self.egl_path_info.setText(estimated_path) - self.egl_path_info.setText( - self.tr("EGL path is at C:\\ProgramData\\Epic\\EpicGamesLauncher\\Data\\Manifests")) egl_path = os.path.expanduser("~/") if egl_path := shared.legendary_core.egl.programdata_path: pass elif egl_path := shared.legendary_core.lgd.config.get("default", "wine_prefix", fallback=""): - egl_data_path = os.path.join(shared.legendary_core.lgd.config.get("default", "wine_prefix", fallback=""), - 'drive_c/ProgramData/Epic/EpicGamesLauncher/Data') + egl_data_path = os.path.join( + shared.legendary_core.lgd.config.get("default", "wine_prefix", fallback=""), + 'drive_c/ProgramData/Epic/EpicGamesLauncher/Data') egl_path = os.path.join(egl_data_path, 'Manifests') else: possible_wine_prefixes = [os.path.expanduser("~/.wine"), @@ -37,7 +57,13 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup): if os.path.exists(p := os.path.join(i, "drive_c/ProgramData/Epic/EpicGamesLauncher/Data/Manifests")): egl_path = p - self.egl_path_edit = PathEdit(egl_path, QFileDialog.DirectoryOnly, save_func=self.save_egl_path) + self.egl_path_edit = PathEdit( + path=egl_path, + file_type=QFileDialog.DirectoryOnly, + edit_func=self.egl_path_edit_cb, + save_func=self.egl_path_save_cb, + parent=self + ) self.egl_path_layout.addWidget(self.egl_path_edit) if platform.system() != "Windows": shared.legendary_core.lgd.config.set('Legendary', 'egl_programdata', egl_path) @@ -71,12 +97,18 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup): self.export_button.clicked.connect(self.export_selected) self.import_button.clicked.connect(self.import_selected) - def check_egl_path(self, path): - pass + def egl_path_edit_cb(self, path): + if platform.system() != "Windows": + if os.path.exists(os.path.join(path, "system.reg")) and os.path.exists(os.path.join(path, "dosdevices/c:")): + # path is a wine prefix + path = os.path.join(path, "dosdevices/c:", "ProgramData/Epic/EpicGamesLauncher/Data/Manifests") + if os.path.exists(path) and glob(f"{path}/*.item"): + return True, path + return False, path - def save_egl_path(self): - shared.legendary_core.lgd.config.set("Legendary", "egl_programdata", self.egl_path_edit.text()) - shared.legendary_core.egl.programdata_path = self.egl_path_edit.text() + def egl_path_save_cb(self, path): + shared.legendary_core.lgd.config.set("Legendary", "egl_programdata", path) + shared.legendary_core.egl.programdata_path = path shared.legendary_core.lgd.save_config() self.update_lists() diff --git a/rare/components/tabs/settings/legendary.py b/rare/components/tabs/settings/legendary.py index 824c8d61..75b77bf3 100644 --- a/rare/components/tabs/settings/legendary.py +++ b/rare/components/tabs/settings/legendary.py @@ -52,15 +52,15 @@ class LegendarySettings(QWidget, Ui_LegendarySettings): self.locale_edit = IndicatorLineEdit( f"{self.core.language_code}-{self.core.country_code}", - edit_func=self.locale_chck, - save_func=self.locale_save, + edit_func=self.locale_edit_cb, + save_func=self.locale_save_cb, horiz_policy=QSizePolicy.Minimum, parent=self ) self.locale_layout.addWidget(self.locale_edit) @staticmethod - def locale_chck(text: str) -> Tuple[bool, str]: + def locale_edit_cb(text: str) -> Tuple[bool, str]: if text: if re.match("^[a-zA-Z]{2,3}[-_][a-zA-Z]{2,3}$", text): language, country = text.replace("_", "-").split("-") @@ -69,7 +69,7 @@ class LegendarySettings(QWidget, Ui_LegendarySettings): else: return True, text - def locale_save(self, text: str): + def locale_save_cb(self, text: str): if text: self.core.egs.language_code, self.core.egs.country_code = text.split("-") self.core.lgd.config.set("Legendary", "locale", text) diff --git a/rare/resources/stylesheets/RareStyle/stylesheet.qss b/rare/resources/stylesheets/RareStyle/stylesheet.qss index a82d0ab7..b21b2477 100644 --- a/rare/resources/stylesheets/RareStyle/stylesheet.qss +++ b/rare/resources/stylesheets/RareStyle/stylesheet.qss @@ -79,7 +79,8 @@ QToolButton { QFrame[frameShape="6"] { border-radius: 4px; } -QScrollArea#noborder { +QListView[noBorder="1"], +QScrollArea[noBorder="1"] { border-color: transparent; } QComboBox { @@ -268,21 +269,27 @@ QPushButton#menu_button { QPushButton:hover#menu_button { background-color: #334; } +QPushButton[install="1"], QPushButton#install_button { background-color: #090; } +QPushButton[install="1"]::hover, QPushButton::hover#install_button { background-color: #060; } +QPushButton[install="1"]::disabled, QPushButton::disabled#install_button { background-color: #020; } +QPushButton[uninstall="1"], QPushButton#uninstall_button { background-color: #900; } +QPushButton[uninstall="1"]::hover, QPushButton::hover#uninstall_button { background-color: #600; } +QPushButton[uninstall="1"]::disabled, QPushButton::disabled#uninstall_button { background-color: #200; } diff --git a/rare/ui/components/tabs/games/game_info/game_dlc_widget.py b/rare/ui/components/tabs/games/game_info/game_dlc_widget.py index 2349d69f..de90784a 100644 --- a/rare/ui/components/tabs/games/game_info/game_dlc_widget.py +++ b/rare/ui/components/tabs/games/game_info/game_dlc_widget.py @@ -100,16 +100,17 @@ class Ui_GameDlcWidget(object): self.actions_label.setFont(font) self.actions_label.setObjectName("actions_label") self.dlc_info_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.actions_label) - self.install_button = QtWidgets.QPushButton(GameDlcWidget) + self.action_button = QtWidgets.QPushButton(GameDlcWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.install_button.sizePolicy().hasHeightForWidth()) - self.install_button.setSizePolicy(sizePolicy) - self.install_button.setMinimumSize(QtCore.QSize(250, 0)) - self.install_button.setStyleSheet("") - self.install_button.setObjectName("install_button") - self.dlc_info_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.install_button) + sizePolicy.setHeightForWidth(self.action_button.sizePolicy().hasHeightForWidth()) + self.action_button.setSizePolicy(sizePolicy) + self.action_button.setMinimumSize(QtCore.QSize(250, 0)) + self.action_button.setStyleSheet("") + self.action_button.setText("Action") + self.action_button.setObjectName("action_button") + self.dlc_info_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.action_button) self.app_name_label = QtWidgets.QLabel(GameDlcWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -140,7 +141,6 @@ class Ui_GameDlcWidget(object): self.version_label.setText(_translate("GameDlcWidget", "Version")) self.status_label.setText(_translate("GameDlcWidget", "Status")) self.actions_label.setText(_translate("GameDlcWidget", "Actions")) - self.install_button.setText(_translate("GameDlcWidget", "Install DLC")) self.app_name_label.setText(_translate("GameDlcWidget", "Application")) diff --git a/rare/ui/components/tabs/games/game_info/game_dlc_widget.ui b/rare/ui/components/tabs/games/game_info/game_dlc_widget.ui index 75518f7c..a3680aff 100644 --- a/rare/ui/components/tabs/games/game_info/game_dlc_widget.ui +++ b/rare/ui/components/tabs/games/game_info/game_dlc_widget.ui @@ -17,7 +17,7 @@ - GameDlcWidget + GameDlcWidget QFrame::StyledPanel @@ -172,7 +172,7 @@ - + 0 @@ -189,7 +189,7 @@ - Install DLC + Action diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.py b/rare/ui/components/tabs/games/import_sync/egl_sync_widget.py index c4a92c24..ebac0679 100644 --- a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.py +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_widget.py @@ -14,18 +14,10 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_EGLSyncGroup(object): def setupUi(self, EGLSyncGroup): EGLSyncGroup.setObjectName("EGLSyncGroup") - EGLSyncGroup.resize(694, 440) - self.egl_sync_layout = QtWidgets.QGridLayout(EGLSyncGroup) + EGLSyncGroup.resize(680, 430) + self.egl_sync_layout = QtWidgets.QFormLayout(EGLSyncGroup) + self.egl_sync_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.egl_sync_layout.setObjectName("egl_sync_layout") - self.refresh_button = QtWidgets.QPushButton(EGLSyncGroup) - self.refresh_button.setObjectName("refresh_button") - self.egl_sync_layout.addWidget(self.refresh_button, 2, 0, 1, 1) - self.egl_sync_check = QtWidgets.QCheckBox(EGLSyncGroup) - self.egl_sync_check.setObjectName("egl_sync_check") - self.egl_sync_layout.addWidget(self.egl_sync_check, 3, 0, 1, 1) - self.egl_path_info = QtWidgets.QLabel(EGLSyncGroup) - self.egl_path_info.setObjectName("egl_path_info") - self.egl_sync_layout.addWidget(self.egl_path_info, 1, 0, 1, 1) self.export_import_layout = QtWidgets.QHBoxLayout() self.export_import_layout.setObjectName("export_import_layout") self.export_group = QtWidgets.QGroupBox(EGLSyncGroup) @@ -80,10 +72,30 @@ class Ui_EGLSyncGroup(object): self.import_buttons_layout.addWidget(self.import_button) self.import_layout.addLayout(self.import_buttons_layout) self.export_import_layout.addWidget(self.import_group) - self.egl_sync_layout.addLayout(self.export_import_layout, 4, 0, 1, 1) + self.egl_sync_layout.setLayout(4, QtWidgets.QFormLayout.SpanningRole, self.export_import_layout) self.egl_path_layout = QtWidgets.QVBoxLayout() self.egl_path_layout.setObjectName("egl_path_layout") - self.egl_sync_layout.addLayout(self.egl_path_layout, 0, 0, 1, 1) + self.egl_sync_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.egl_path_layout) + self.egl_path_label = QtWidgets.QLabel(EGLSyncGroup) + self.egl_path_label.setObjectName("egl_path_label") + self.egl_sync_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.egl_path_label) + self.egl_path_info_label = QtWidgets.QLabel(EGLSyncGroup) + self.egl_path_info_label.setObjectName("egl_path_info_label") + self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.egl_path_info_label) + self.egl_path_info = QtWidgets.QLabel(EGLSyncGroup) + self.egl_path_info.setText("") + self.egl_path_info.setObjectName("egl_path_info") + self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.egl_path_info) + self.egl_auto_check = QtWidgets.QCheckBox(EGLSyncGroup) + self.egl_auto_check.setText("") + self.egl_auto_check.setObjectName("egl_auto_check") + self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.egl_auto_check) + self.refresh_button = QtWidgets.QPushButton(EGLSyncGroup) + self.refresh_button.setObjectName("refresh_button") + self.egl_sync_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.refresh_button) + self.egl_auto_check_label = QtWidgets.QLabel(EGLSyncGroup) + self.egl_auto_check_label.setObjectName("egl_auto_check_label") + self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.egl_auto_check_label) self.retranslateUi(EGLSyncGroup) QtCore.QMetaObject.connectSlotsByName(EGLSyncGroup) @@ -92,9 +104,6 @@ class Ui_EGLSyncGroup(object): _translate = QtCore.QCoreApplication.translate EGLSyncGroup.setWindowTitle(_translate("EGLSyncGroup", "EGLSyncGroup")) EGLSyncGroup.setTitle(_translate("EGLSyncGroup", "Sync with Epic Games Launcher")) - self.refresh_button.setText(_translate("EGLSyncGroup", "Refresh")) - self.egl_sync_check.setText(_translate("EGLSyncGroup", "Enable automatic sync")) - self.egl_path_info.setText(_translate("EGLSyncGroup", "TextLabel")) self.export_group.setTitle(_translate("EGLSyncGroup", "Exportable games")) self.export_label.setText(_translate("EGLSyncGroup", "No games to export to EGS")) self.export_list.setSortingEnabled(True) @@ -107,6 +116,10 @@ class Ui_EGLSyncGroup(object): self.import_select_all_button.setText(_translate("EGLSyncGroup", "Select all")) self.import_select_none_button.setText(_translate("EGLSyncGroup", "Select none")) self.import_button.setText(_translate("EGLSyncGroup", "Import")) + self.egl_path_label.setText(_translate("EGLSyncGroup", "Manifest path")) + self.egl_path_info_label.setText(_translate("EGLSyncGroup", "Estimated path")) + self.refresh_button.setText(_translate("EGLSyncGroup", "Refresh")) + self.egl_auto_check_label.setText(_translate("EGLSyncGroup", "Enable automatic sync")) if __name__ == "__main__": diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui b/rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui index 51667b54..9940bda5 100644 --- a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui @@ -6,8 +6,8 @@ 0 0 - 694 - 440 + 680 + 430 @@ -16,29 +16,11 @@ Sync with Epic Games Launcher - - - - - Refresh - - - - - - - Enable automatic sync - - - - - - - TextLabel - - - - + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + @@ -170,9 +152,51 @@ - + + + + + Manifest path + + + + + + + Estimated path + + + + + + + + + + + + + + + + + + + + + Refresh + + + + + + + Enable automatic sync + + + diff --git a/rare/ui/components/tabs/games/import_sync/import_widget.py b/rare/ui/components/tabs/games/import_sync/import_widget.py index a1241bce..2fe778f2 100644 --- a/rare/ui/components/tabs/games/import_sync/import_widget.py +++ b/rare/ui/components/tabs/games/import_sync/import_widget.py @@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ImportGroup(object): def setupUi(self, ImportGroup): ImportGroup.setObjectName("ImportGroup") - ImportGroup.resize(223, 128) + ImportGroup.resize(223, 127) self.import_layout = QtWidgets.QFormLayout(ImportGroup) self.import_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.import_layout.setObjectName("import_layout") @@ -49,8 +49,8 @@ class Ui_ImportGroup(object): def retranslateUi(self, ImportGroup): _translate = QtCore.QCoreApplication.translate ImportGroup.setWindowTitle(_translate("ImportGroup", "ImportGroup")) - ImportGroup.setTitle(_translate("ImportGroup", "Import EGL game from directory")) - self.path_edit_label.setText(_translate("ImportGroup", "Select path")) + ImportGroup.setTitle(_translate("ImportGroup", "Import EGL game from a directory")) + self.path_edit_label.setText(_translate("ImportGroup", "Installation path")) self.app_name_label.setText(_translate("ImportGroup", "Override app name")) self.import_button.setText(_translate("ImportGroup", "Import Game")) diff --git a/rare/ui/components/tabs/games/import_sync/import_widget.ui b/rare/ui/components/tabs/games/import_sync/import_widget.ui index 1dbb2cfa..0419a200 100644 --- a/rare/ui/components/tabs/games/import_sync/import_widget.ui +++ b/rare/ui/components/tabs/games/import_sync/import_widget.ui @@ -7,14 +7,14 @@ 0 0 223 - 128 + 127 ImportGroup - Import EGL game from directory + Import EGL game from a directory @@ -23,7 +23,7 @@ - Select path + Installation path diff --git a/rare/utils/extra_widgets.py b/rare/utils/extra_widgets.py index cc7d939d..ae2c9421 100644 --- a/rare/utils/extra_widgets.py +++ b/rare/utils/extra_widgets.py @@ -148,6 +148,7 @@ class IndicatorLineEdit(QWidget): self.indicator_label = QLabel() self.indicator_label.setPixmap(icon("ei.info-circle", color="gray").pixmap(16, 16)) self.indicator_label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + self.__indicator(edit_func(text)) self.layout.addWidget(self.indicator_label) if not ph_text: @@ -191,7 +192,7 @@ class IndicatorLineEdit(QWidget): class PathEdit(IndicatorLineEdit): def __init__(self, - text: str = "", + path: str = "", file_type: QFileDialog.FileType = QFileDialog.AnyFile, type_filter: str = "", name_filter: str = "", @@ -200,7 +201,7 @@ class PathEdit(IndicatorLineEdit): save_func: Callable[[str], None] = None, horiz_policy: QSizePolicy = QSizePolicy.Expanding, parent=None): - super(PathEdit, self).__init__(text=text, ph_text=ph_text, + super(PathEdit, self).__init__(text=path, ph_text=ph_text, edit_func=edit_func, save_func=save_func, horiz_policy=horiz_policy, parent=parent) self.setObjectName("PathEdit")