From 458e233327a34bfdea051bf110e4a4fd7d466535 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Sun, 17 Oct 2021 02:17:54 +0300 Subject: [PATCH] Rename ImportSync files to indicate what the underlying widget is. Split Import/Export lists to separate widgets to reduce code duplication. Signed-off-by: Stelios Tsampas --- .../tabs/games/import_sync/__init__.py | 9 +- .../{egl_sync_widget.py => egl_sync_group.py} | 170 ++++++------ .../{import_widget.py => import_group.py} | 2 +- .../stylesheets/RareStyle/stylesheet.qss | 5 +- .../tabs/games/import_sync/egl_sync_group.py | 67 +++++ .../tabs/games/import_sync/egl_sync_group.ui | 77 ++++++ .../games/import_sync/egl_sync_list_group.py | 71 +++++ .../games/import_sync/egl_sync_list_group.ui | 102 +++++++ .../tabs/games/import_sync/egl_sync_widget.py | 140 ---------- .../tabs/games/import_sync/egl_sync_widget.ui | 254 ------------------ .../{import_widget.py => import_group.py} | 2 +- .../{import_widget.ui => import_group.ui} | 0 12 files changed, 400 insertions(+), 499 deletions(-) rename rare/components/tabs/games/import_sync/{egl_sync_widget.py => egl_sync_group.py} (71%) rename rare/components/tabs/games/import_sync/{import_widget.py => import_group.py} (97%) create mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_group.py create mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_group.ui create mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_list_group.py create mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_list_group.ui delete mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_widget.py delete mode 100644 rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui rename rare/ui/components/tabs/games/import_sync/{import_widget.py => import_group.py} (98%) rename rare/ui/components/tabs/games/import_sync/{import_widget.ui => import_group.ui} (100%) diff --git a/rare/components/tabs/games/import_sync/__init__.py b/rare/components/tabs/games/import_sync/__init__.py index 0d1fdf95..74d028e0 100644 --- a/rare/components/tabs/games/import_sync/__init__.py +++ b/rare/components/tabs/games/import_sync/__init__.py @@ -1,8 +1,8 @@ from PyQt5.QtWidgets import QVBoxLayout, QWidget, QLabel, QSpacerItem, QSizePolicy from rare.utils.extra_widgets import SideTabWidget -from .egl_sync_widget import EGLSyncGroup -from .import_widget import ImportGroup +from .egl_sync_group import EGLSyncGroup +from .import_group import ImportGroup class ImportSyncTabs(SideTabWidget): @@ -42,8 +42,9 @@ class ImportSyncWidget(QWidget): def __init__(self, widget: QWidget, title: str, info: str, parent=None): super(ImportSyncWidget, self).__init__(parent=parent) self.layout = QVBoxLayout() - # self.title = QLabel(f"

{title}{title}{info}

") diff --git a/rare/components/tabs/games/import_sync/egl_sync_widget.py b/rare/components/tabs/games/import_sync/egl_sync_group.py similarity index 71% rename from rare/components/tabs/games/import_sync/egl_sync_widget.py rename to rare/components/tabs/games/import_sync/egl_sync_group.py index b03c8a04..f5368ff5 100644 --- a/rare/components/tabs/games/import_sync/egl_sync_widget.py +++ b/rare/components/tabs/games/import_sync/egl_sync_group.py @@ -1,32 +1,28 @@ import os import platform -from glob import glob -from typing import Tuple from logging import getLogger +from typing import List, Tuple from PyQt5.QtCore import Qt, QThread, QFileSystemWatcher from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QLabel, QGroupBox, \ - QCheckBox, QPushButton, QListWidgetItem, QDialog, QFileDialog, QSizePolicy + 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.ui.components.tabs.games.import_sync.egl_sync_group import Ui_EGLSyncGroup +from rare.ui.components.tabs.games.import_sync.egl_sync_list_group import Ui_EGLSyncListGroup from rare.utils.extra_widgets import PathEdit -from rare.utils.utils import WineResolver from rare.utils.models import PathSpec +from rare.utils.utils import WineResolver logger = getLogger("EGLSync") 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) self.core = shared.core @@ -88,24 +84,10 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup): self.egl_sync_check.setChecked(shared.core.egl_sync_enabled) self.egl_sync_check.stateChanged.connect(self.egl_sync_changed) - self.export_list.itemDoubleClicked.connect( - lambda item: - item.setCheckState(Qt.Unchecked) if item.checkState() != Qt.Unchecked else item.setCheckState(Qt.Checked)) - self.import_list.itemDoubleClicked.connect( - lambda item: - item.setCheckState(Qt.Unchecked) if item.checkState() != Qt.Unchecked else item.setCheckState(Qt.Checked)) - - self.export_select_all_button.clicked.connect( - lambda: self.select_items(self.exportable_items, Qt.Checked)) - self.export_select_none_button.clicked.connect( - lambda: self.select_items(self.exportable_items, Qt.Unchecked)) - self.import_select_all_button.clicked.connect( - lambda: self.select_items(self.importable_items, Qt.Checked)) - self.import_select_none_button.clicked.connect( - lambda: self.select_items(self.importable_items, Qt.Unchecked)) - - self.export_button.clicked.connect(self.export_selected) - self.import_button.clicked.connect(self.import_selected) + self.import_list = EGLSyncListGroup(export=False, parent=self) + self.import_export_layout.addWidget(self.import_list) + self.export_list = EGLSyncListGroup(export=True, parent=self) + self.import_export_layout.addWidget(self.export_list) self.update_lists() @@ -173,73 +155,15 @@ class EGLSyncGroup(QGroupBox, Ui_EGLSyncGroup): self.egl_sync_label.setEnabled(have_path) self.egl_sync_check.setEnabled(have_path) - self.import_export_widget.setEnabled(have_path) - - self.import_label.setVisible(not have_path) - self.import_list.setVisible(have_path) - self.import_buttons_widget.setVisible(have_path) - - self.export_label.setVisible(not have_path) - self.export_list.setVisible(have_path) - self.export_buttons_widget.setVisible(have_path) - - if not have_path: - return - - self.update_import_list() - self.update_export_list() - - def update_import_list(self): - self.import_list.clear() - self.importable_items.clear() - importable_games = shared.core.egl_get_importable() - for game in importable_games: - iw = EGLSyncItem(game, False, self.import_list) - self.importable_items.append(iw) - self.import_list.addItem(iw) - have_importable = bool(importable_games) - self.import_label.setVisible(not have_importable) - self.import_list.setVisible(have_importable) - self.import_buttons_widget.setVisible(have_importable) - - def update_export_list(self): - self.export_list.clear() - self.exportable_items.clear() - exportable_games = shared.core.egl_get_exportable() - for igame in exportable_games: - ew = EGLSyncItem(igame, True, self.export_list) - self.exportable_items.append(ew) - self.export_list.addItem(ew) - have_exportable = bool(exportable_games) - self.export_label.setVisible(not have_exportable) - self.export_list.setVisible(have_exportable) - self.export_buttons_widget.setVisible(have_exportable) - - @staticmethod - def select_items(item_list, state): - for w in item_list: - w.setCheckState(state) - - def import_selected(self): - for iw in self.importable_items: - if iw.is_checked: - iw.import_game() - self.import_list.takeItem(self.import_list.row(iw)) - self.core.egl_sync() - self.update_import_list() - - def export_selected(self): - for ew in self.exportable_items: - if ew.is_checked(): - ew.export_game() - self.export_list.takeItem(self.export_list.row(ew)) - self.core.egl_sync() - self.update_export_list() + self.import_list.populate(have_path) + self.import_list.setEnabled(have_path) + self.export_list.populate(have_path) + self.export_list.setEnabled(have_path) -class EGLSyncItem(QListWidgetItem): +class EGLSyncListItem(QListWidgetItem): def __init__(self, game, export: bool, parent=None): - super(EGLSyncItem, self).__init__(parent=parent) + super(EGLSyncListItem, self).__init__(parent=parent) self.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable) self.setCheckState(Qt.Unchecked) self.game = game @@ -252,11 +176,67 @@ class EGLSyncItem(QListWidgetItem): def is_checked(self): return True if self.checkState() == Qt.Checked else False - def export_game(self): - shared.core.egl_export(self.game.app_name) + def action(self): + if self.export: + shared.core.egl_export(self.game.app_name) + else: + shared.core.egl_import(self.game.app_name) - def import_game(self): - shared.core.egl_import(self.game.app_name) + +class EGLSyncListGroup(QGroupBox, Ui_EGLSyncListGroup): + + def __init__(self, export: bool, parent=None): + super(EGLSyncListGroup, self).__init__(parent=parent) + self.setupUi(self) + self.list.setProperty("noBorder", 1) + + self.export = export + + if export: + self.setTitle(self.tr('Exportable games')) + self.label.setText(self.tr('No games to export to EGL')) + self.action_button.setText(self.tr('Export')) + self.list_func = shared.core.egl_get_exportable + else: + self.setTitle(self.tr('Importable games')) + self.label.setText(self.tr('No games to import from EGL')) + self.action_button.setText(self.tr('Import')) + self.list_func = shared.core.egl_get_importable + + self.list.itemDoubleClicked.connect( + lambda item: + item.setCheckState(Qt.Unchecked) if item.checkState() != Qt.Unchecked else item.setCheckState(Qt.Checked) + ) + + self.select_all_button.clicked.connect(lambda: self.mark(Qt.Checked)) + self.select_none_button.clicked.connect(lambda: self.mark(Qt.Unchecked)) + + self.action_button.clicked.connect(self.action) + + def mark(self, state): + for item in self.items: + item.setCheckState(state) + + def populate(self, enabled: bool): + if enabled: + self.list.clear() + for item in self.list_func(): + self.list.addItem(EGLSyncListItem(item, self.export, self.list)) + self.label.setVisible(not enabled or not bool(self.list.count())) + self.list.setVisible(enabled and bool(self.list.count())) + self.buttons_widget.setVisible(enabled and bool(self.list.count())) + + def action(self): + for item in self.items: + if item.is_checked: + item.action() + self.list.takeItem(self.list.row(item)) + self.core.egl_sync() + self.populate(True) + + @property + def items(self) -> List[EGLSyncListItem]: + return [self.list.item(i) for i in range(self.list.count())] class DisableSyncDialog(QDialog): diff --git a/rare/components/tabs/games/import_sync/import_widget.py b/rare/components/tabs/games/import_sync/import_group.py similarity index 97% rename from rare/components/tabs/games/import_sync/import_widget.py rename to rare/components/tabs/games/import_sync/import_group.py index ef29d873..9799ef8f 100644 --- a/rare/components/tabs/games/import_sync/import_widget.py +++ b/rare/components/tabs/games/import_sync/import_group.py @@ -6,7 +6,7 @@ from typing import Tuple from PyQt5.QtWidgets import QFileDialog, QGroupBox import rare.shared as shared -from rare.ui.components.tabs.games.import_sync.import_widget import Ui_ImportGroup +from rare.ui.components.tabs.games.import_sync.import_group import Ui_ImportGroup from rare.utils import legendary_utils from rare.utils.extra_widgets import IndicatorLineEdit, PathEdit diff --git a/rare/resources/stylesheets/RareStyle/stylesheet.qss b/rare/resources/stylesheets/RareStyle/stylesheet.qss index 2e3dea96..62405657 100644 --- a/rare/resources/stylesheets/RareStyle/stylesheet.qss +++ b/rare/resources/stylesheets/RareStyle/stylesheet.qss @@ -12,10 +12,7 @@ } QLabel { - border-width: 1px; - border-style: solid; - border-radius: 2px; - border-color: transparent; + border-width: 0px; background-color: transparent; padding: 0px; selection-background-color: #2f4f4f; diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_group.py b/rare/ui/components/tabs/games/import_sync/egl_sync_group.py new file mode 100644 index 00000000..44da393d --- /dev/null +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_group.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/import_sync/egl_sync_group.ui' +# +# Created by: PyQt5 UI code generator 5.15.4 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_EGLSyncGroup(object): + def setupUi(self, EGLSyncGroup): + EGLSyncGroup.setObjectName("EGLSyncGroup") + EGLSyncGroup.resize(478, 106) + EGLSyncGroup.setWindowTitle("EGLSyncGroup") + EGLSyncGroup.setCheckable(False) + EGLSyncGroup.setChecked(False) + 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.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_layout = QtWidgets.QHBoxLayout() + self.egl_path_layout.setObjectName("egl_path_layout") + self.egl_sync_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.egl_path_layout) + 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("error") + self.egl_path_info.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) + self.egl_path_info.setObjectName("egl_path_info") + self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.egl_path_info) + self.egl_sync_check = QtWidgets.QCheckBox(EGLSyncGroup) + self.egl_sync_check.setText("") + self.egl_sync_check.setObjectName("egl_sync_check") + self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.egl_sync_check) + self.import_export_layout = QtWidgets.QVBoxLayout() + self.import_export_layout.setObjectName("import_export_layout") + self.egl_sync_layout.setLayout(3, QtWidgets.QFormLayout.SpanningRole, self.import_export_layout) + self.egl_sync_label = QtWidgets.QLabel(EGLSyncGroup) + self.egl_sync_label.setObjectName("egl_sync_label") + self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.egl_sync_label) + + self.retranslateUi(EGLSyncGroup) + QtCore.QMetaObject.connectSlotsByName(EGLSyncGroup) + + def retranslateUi(self, EGLSyncGroup): + _translate = QtCore.QCoreApplication.translate + EGLSyncGroup.setTitle(_translate("EGLSyncGroup", "Sync with Epic Games Launcher")) + self.egl_path_label.setText(_translate("EGLSyncGroup", "Prefix/Manifest path")) + self.egl_path_info_label.setText(_translate("EGLSyncGroup", "Estimated path")) + self.egl_sync_label.setText(_translate("EGLSyncGroup", "Enable automatic sync")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + EGLSyncGroup = QtWidgets.QGroupBox() + ui = Ui_EGLSyncGroup() + ui.setupUi(EGLSyncGroup) + EGLSyncGroup.show() + sys.exit(app.exec_()) diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_group.ui b/rare/ui/components/tabs/games/import_sync/egl_sync_group.ui new file mode 100644 index 00000000..f62c5c91 --- /dev/null +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_group.ui @@ -0,0 +1,77 @@ + + + EGLSyncGroup + + + + 0 + 0 + 478 + 106 + + + + EGLSyncGroup + + + Sync with Epic Games Launcher + + + false + + + false + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Prefix/Manifest path + + + + + + + + + + Estimated path + + + + + + + error + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + + + + + + + Enable automatic sync + + + + + + + + diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.py b/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.py new file mode 100644 index 00000000..40b8090a --- /dev/null +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/import_sync/egl_sync_list_group.ui' +# +# Created by: PyQt5 UI code generator 5.15.4 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_EGLSyncListGroup(object): + def setupUi(self, EGLSyncListGroup): + EGLSyncListGroup.setObjectName("EGLSyncListGroup") + EGLSyncListGroup.resize(461, 206) + EGLSyncListGroup.setWindowTitle("EGLSyncListGroup") + EGLSyncListGroup.setTitle("") + self.egl_sync_list_layout = QtWidgets.QVBoxLayout(EGLSyncListGroup) + self.egl_sync_list_layout.setObjectName("egl_sync_list_layout") + self.label = QtWidgets.QLabel(EGLSyncListGroup) + self.label.setText("") + self.label.setObjectName("label") + self.egl_sync_list_layout.addWidget(self.label) + self.list = QtWidgets.QListWidget(EGLSyncListGroup) + self.list.setAlternatingRowColors(True) + self.list.setObjectName("list") + self.egl_sync_list_layout.addWidget(self.list) + self.buttons_widget = QtWidgets.QWidget(EGLSyncListGroup) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.buttons_widget.sizePolicy().hasHeightForWidth()) + self.buttons_widget.setSizePolicy(sizePolicy) + self.buttons_widget.setObjectName("buttons_widget") + self.buttons_layout = QtWidgets.QHBoxLayout(self.buttons_widget) + self.buttons_layout.setContentsMargins(0, 0, 0, 0) + self.buttons_layout.setObjectName("buttons_layout") + self.select_all_button = QtWidgets.QPushButton(self.buttons_widget) + self.select_all_button.setObjectName("select_all_button") + self.buttons_layout.addWidget(self.select_all_button) + self.select_none_button = QtWidgets.QPushButton(self.buttons_widget) + self.select_none_button.setObjectName("select_none_button") + self.buttons_layout.addWidget(self.select_none_button) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.buttons_layout.addItem(spacerItem) + self.action_button = QtWidgets.QPushButton(self.buttons_widget) + self.action_button.setText("Action") + self.action_button.setObjectName("action_button") + self.buttons_layout.addWidget(self.action_button) + self.egl_sync_list_layout.addWidget(self.buttons_widget) + + self.retranslateUi(EGLSyncListGroup) + QtCore.QMetaObject.connectSlotsByName(EGLSyncListGroup) + + def retranslateUi(self, EGLSyncListGroup): + _translate = QtCore.QCoreApplication.translate + self.list.setSortingEnabled(True) + self.select_all_button.setText(_translate("EGLSyncListGroup", "Select all")) + self.select_none_button.setText(_translate("EGLSyncListGroup", "Select none")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + EGLSyncListGroup = QtWidgets.QGroupBox() + ui = Ui_EGLSyncListGroup() + ui.setupUi(EGLSyncListGroup) + EGLSyncListGroup.show() + sys.exit(app.exec_()) diff --git a/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.ui b/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.ui new file mode 100644 index 00000000..23b402d5 --- /dev/null +++ b/rare/ui/components/tabs/games/import_sync/egl_sync_list_group.ui @@ -0,0 +1,102 @@ + + + EGLSyncListGroup + + + + 0 + 0 + 461 + 206 + + + + EGLSyncListGroup + + + + + + + + + + + + + + + + true + + + 1 + + + true + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Select all + + + + + + + Select none + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 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 deleted file mode 100644 index 583d17fe..00000000 --- a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.py +++ /dev/null @@ -1,140 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui' -# -# Created by: PyQt5 UI code generator 5.15.4 -# -# WARNING: Any manual changes made to this file will be lost when pyuic5 is -# run again. Do not edit this file unless you know what you are doing. - - -from PyQt5 import QtCore, QtGui, QtWidgets - - -class Ui_EGLSyncGroup(object): - def setupUi(self, EGLSyncGroup): - EGLSyncGroup.setObjectName("EGLSyncGroup") - EGLSyncGroup.resize(814, 702) - EGLSyncGroup.setCheckable(False) - EGLSyncGroup.setChecked(False) - 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.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_layout = QtWidgets.QHBoxLayout() - self.egl_path_layout.setObjectName("egl_path_layout") - self.egl_sync_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.egl_path_layout) - 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("error") - self.egl_path_info.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) - self.egl_path_info.setObjectName("egl_path_info") - self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.egl_path_info) - self.egl_sync_label = QtWidgets.QLabel(EGLSyncGroup) - self.egl_sync_label.setObjectName("egl_sync_label") - self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.egl_sync_label) - self.egl_sync_check = QtWidgets.QCheckBox(EGLSyncGroup) - self.egl_sync_check.setText("") - self.egl_sync_check.setObjectName("egl_sync_check") - self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.egl_sync_check) - self.import_export_widget = QtWidgets.QWidget(EGLSyncGroup) - self.import_export_widget.setObjectName("import_export_widget") - self.import_export_layout = QtWidgets.QVBoxLayout(self.import_export_widget) - self.import_export_layout.setContentsMargins(0, 0, 0, 0) - self.import_export_layout.setObjectName("import_export_layout") - self.import_group = QtWidgets.QGroupBox(self.import_export_widget) - self.import_group.setObjectName("import_group") - self.import_layout = QtWidgets.QVBoxLayout(self.import_group) - self.import_layout.setObjectName("import_layout") - self.import_label = QtWidgets.QLabel(self.import_group) - self.import_label.setObjectName("import_label") - self.import_layout.addWidget(self.import_label) - self.import_list = QtWidgets.QListWidget(self.import_group) - self.import_list.setAlternatingRowColors(True) - self.import_list.setObjectName("import_list") - self.import_layout.addWidget(self.import_list) - self.import_buttons_widget = QtWidgets.QWidget(self.import_group) - self.import_buttons_widget.setObjectName("import_buttons_widget") - self.import_buttons_layout = QtWidgets.QHBoxLayout(self.import_buttons_widget) - self.import_buttons_layout.setContentsMargins(0, 0, 0, 0) - self.import_buttons_layout.setObjectName("import_buttons_layout") - self.import_select_all_button = QtWidgets.QPushButton(self.import_buttons_widget) - self.import_select_all_button.setObjectName("import_select_all_button") - self.import_buttons_layout.addWidget(self.import_select_all_button) - self.import_select_none_button = QtWidgets.QPushButton(self.import_buttons_widget) - self.import_select_none_button.setObjectName("import_select_none_button") - self.import_buttons_layout.addWidget(self.import_select_none_button) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.import_buttons_layout.addItem(spacerItem) - self.import_button = QtWidgets.QPushButton(self.import_buttons_widget) - self.import_button.setObjectName("import_button") - self.import_buttons_layout.addWidget(self.import_button) - self.import_layout.addWidget(self.import_buttons_widget, 0, QtCore.Qt.AlignLeft) - self.import_export_layout.addWidget(self.import_group) - self.export_group = QtWidgets.QGroupBox(self.import_export_widget) - self.export_group.setObjectName("export_group") - self.export_layout = QtWidgets.QVBoxLayout(self.export_group) - self.export_layout.setObjectName("export_layout") - self.export_label = QtWidgets.QLabel(self.export_group) - self.export_label.setObjectName("export_label") - self.export_layout.addWidget(self.export_label) - self.export_list = QtWidgets.QListWidget(self.export_group) - self.export_list.setAlternatingRowColors(True) - self.export_list.setObjectName("export_list") - self.export_layout.addWidget(self.export_list) - self.export_buttons_widget = QtWidgets.QWidget(self.export_group) - self.export_buttons_widget.setObjectName("export_buttons_widget") - self.export_buttons_layout = QtWidgets.QHBoxLayout(self.export_buttons_widget) - self.export_buttons_layout.setContentsMargins(0, 0, 0, 0) - self.export_buttons_layout.setObjectName("export_buttons_layout") - self.export_select_all_button = QtWidgets.QPushButton(self.export_buttons_widget) - self.export_select_all_button.setObjectName("export_select_all_button") - self.export_buttons_layout.addWidget(self.export_select_all_button) - self.export_select_none_button = QtWidgets.QPushButton(self.export_buttons_widget) - self.export_select_none_button.setObjectName("export_select_none_button") - self.export_buttons_layout.addWidget(self.export_select_none_button) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.export_buttons_layout.addItem(spacerItem1) - self.export_button = QtWidgets.QPushButton(self.export_buttons_widget) - self.export_button.setObjectName("export_button") - self.export_buttons_layout.addWidget(self.export_button) - self.export_layout.addWidget(self.export_buttons_widget, 0, QtCore.Qt.AlignLeft) - self.import_export_layout.addWidget(self.export_group) - self.egl_sync_layout.setWidget(3, QtWidgets.QFormLayout.SpanningRole, self.import_export_widget) - - self.retranslateUi(EGLSyncGroup) - QtCore.QMetaObject.connectSlotsByName(EGLSyncGroup) - - def retranslateUi(self, EGLSyncGroup): - _translate = QtCore.QCoreApplication.translate - EGLSyncGroup.setWindowTitle(_translate("EGLSyncGroup", "EGLSyncGroup")) - EGLSyncGroup.setTitle(_translate("EGLSyncGroup", "Sync with Epic Games Launcher")) - self.egl_path_label.setText(_translate("EGLSyncGroup", "Prefix/Manifest path")) - self.egl_path_info_label.setText(_translate("EGLSyncGroup", "Estimated path")) - self.egl_sync_label.setText(_translate("EGLSyncGroup", "Enable automatic sync")) - self.import_group.setTitle(_translate("EGLSyncGroup", "Importable games")) - self.import_label.setText(_translate("EGLSyncGroup", "No games to import from EGS")) - self.import_list.setSortingEnabled(True) - 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.export_group.setTitle(_translate("EGLSyncGroup", "Exportable games")) - self.export_label.setText(_translate("EGLSyncGroup", "No games to export to EGS")) - self.export_list.setSortingEnabled(True) - self.export_select_all_button.setText(_translate("EGLSyncGroup", "Select all")) - self.export_select_none_button.setText(_translate("EGLSyncGroup", "Select none")) - self.export_button.setText(_translate("EGLSyncGroup", "Export")) - - -if __name__ == "__main__": - import sys - app = QtWidgets.QApplication(sys.argv) - EGLSyncGroup = QtWidgets.QGroupBox() - ui = Ui_EGLSyncGroup() - ui.setupUi(EGLSyncGroup) - EGLSyncGroup.show() - sys.exit(app.exec_()) 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 deleted file mode 100644 index 828d3c4b..00000000 --- a/rare/ui/components/tabs/games/import_sync/egl_sync_widget.ui +++ /dev/null @@ -1,254 +0,0 @@ - - - EGLSyncGroup - - - - 0 - 0 - 814 - 702 - - - - EGLSyncGroup - - - Sync with Epic Games Launcher - - - false - - - false - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Prefix/Manifest path - - - - - - - - - - Estimated path - - - - - - - error - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Enable automatic sync - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Importable games - - - - - - No games to import from EGS - - - - - - - true - - - 1 - - - true - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Select all - - - - - - - Select none - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Import - - - - - - - - - - - - - Exportable games - - - - - - No games to export to EGS - - - - - - - true - - - 1 - - - true - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Select all - - - - - - - Select none - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Export - - - - - - - - - - - - - - - - - diff --git a/rare/ui/components/tabs/games/import_sync/import_widget.py b/rare/ui/components/tabs/games/import_sync/import_group.py similarity index 98% rename from rare/ui/components/tabs/games/import_sync/import_widget.py rename to rare/ui/components/tabs/games/import_sync/import_group.py index 2fe778f2..b7fada01 100644 --- a/rare/ui/components/tabs/games/import_sync/import_widget.py +++ b/rare/ui/components/tabs/games/import_sync/import_group.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/import_sync/import_widget.ui' +# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/import_sync/import_group.ui' # # Created by: PyQt5 UI code generator 5.15.4 # diff --git a/rare/ui/components/tabs/games/import_sync/import_widget.ui b/rare/ui/components/tabs/games/import_sync/import_group.ui similarity index 100% rename from rare/ui/components/tabs/games/import_sync/import_widget.ui rename to rare/ui/components/tabs/games/import_sync/import_group.ui