EGLSyncGroup: Properly find the correct rows to insert widgets
This commit is contained in:
parent
b5a18f2858
commit
d563421391
|
@ -6,7 +6,7 @@ from typing import Tuple, Iterable, List, Union
|
|||
|
||||
from PyQt5.QtCore import Qt, QThreadPool, QRunnable, pyqtSlot, pyqtSignal
|
||||
from PyQt5.QtGui import QShowEvent
|
||||
from PyQt5.QtWidgets import QGroupBox, QListWidgetItem, QFileDialog, QMessageBox, QFrame, QLabel
|
||||
from PyQt5.QtWidgets import QGroupBox, QListWidgetItem, QFileDialog, QMessageBox, QFrame, QFormLayout
|
||||
from legendary.models.egl import EGLManifest
|
||||
from legendary.models.game import InstalledGame
|
||||
|
||||
|
@ -39,25 +39,27 @@ class EGLSyncGroup(QGroupBox):
|
|||
save_func=self.egl_path_edit_save_cb,
|
||||
parent=self,
|
||||
)
|
||||
self.ui.egl_path_edit_layout.addWidget(self.egl_path_edit)
|
||||
self.ui.egl_sync_layout.setWidget(
|
||||
self.ui.egl_sync_layout.getWidgetPosition(self.ui.egl_path_edit_label)[0],
|
||||
QFormLayout.FieldRole, self.egl_path_edit
|
||||
)
|
||||
|
||||
self.egl_path_info_label = QLabel(self.tr("Estimated path"), self)
|
||||
self.egl_path_info = ElideLabel(parent=self)
|
||||
self.egl_path_info.setProperty("infoLabel", 1)
|
||||
self.ui.egl_sync_layout.insertRow(
|
||||
self.ui.egl_sync_layout.indexOf(self.ui.egl_path_edit_label) + 1,
|
||||
self.egl_path_info_label, self.egl_path_info
|
||||
self.ui.egl_sync_layout.setWidget(
|
||||
self.ui.egl_sync_layout.getWidgetPosition(self.ui.egl_path_info_label)[0],
|
||||
QFormLayout.FieldRole, self.egl_path_info
|
||||
)
|
||||
|
||||
if platform.system() == "Windows":
|
||||
self.ui.egl_path_edit_label.setEnabled(False)
|
||||
self.egl_path_edit.setEnabled(False)
|
||||
self.egl_path_info_label.setEnabled(False)
|
||||
self.ui.egl_path_info_label.setEnabled(False)
|
||||
self.egl_path_info.setEnabled(False)
|
||||
else:
|
||||
self.egl_path_edit.textChanged.connect(self.egl_path_changed)
|
||||
if self.core.egl.programdata_path:
|
||||
self.egl_path_info_label.setEnabled(True)
|
||||
self.ui.egl_path_info_label.setEnabled(True)
|
||||
self.egl_path_info.setEnabled(True)
|
||||
|
||||
self.ui.egl_sync_check.setChecked(self.core.egl_sync_enabled)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/games/integrations/egl_sync_group.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.9
|
||||
# Created by: PyQt5 UI code generator 5.15.10
|
||||
#
|
||||
# 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.
|
||||
|
@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||
class Ui_EGLSyncGroup(object):
|
||||
def setupUi(self, EGLSyncGroup):
|
||||
EGLSyncGroup.setObjectName("EGLSyncGroup")
|
||||
EGLSyncGroup.resize(217, 88)
|
||||
EGLSyncGroup.resize(424, 106)
|
||||
EGLSyncGroup.setWindowTitle("EGLSyncGroup")
|
||||
EGLSyncGroup.setCheckable(False)
|
||||
EGLSyncGroup.setChecked(False)
|
||||
|
@ -24,19 +24,21 @@ class Ui_EGLSyncGroup(object):
|
|||
self.egl_path_edit_label = QtWidgets.QLabel(EGLSyncGroup)
|
||||
self.egl_path_edit_label.setObjectName("egl_path_edit_label")
|
||||
self.egl_sync_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.egl_path_edit_label)
|
||||
self.egl_path_edit_layout = QtWidgets.QHBoxLayout()
|
||||
self.egl_path_edit_layout.setObjectName("egl_path_edit_layout")
|
||||
self.egl_sync_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.egl_path_edit_layout)
|
||||
self.egl_sync_check_label = QtWidgets.QLabel(EGLSyncGroup)
|
||||
self.egl_sync_check_label.setObjectName("egl_sync_check_label")
|
||||
self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.egl_sync_check_label)
|
||||
self.egl_sync_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.egl_sync_check_label)
|
||||
self.egl_sync_check = QtWidgets.QCheckBox(EGLSyncGroup)
|
||||
self.egl_sync_check.setText("")
|
||||
font = QtGui.QFont()
|
||||
font.setItalic(True)
|
||||
self.egl_sync_check.setFont(font)
|
||||
self.egl_sync_check.setObjectName("egl_sync_check")
|
||||
self.egl_sync_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.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(2, QtWidgets.QFormLayout.SpanningRole, self.import_export_layout)
|
||||
self.egl_sync_layout.setLayout(3, QtWidgets.QFormLayout.SpanningRole, self.import_export_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.retranslateUi(EGLSyncGroup)
|
||||
|
||||
|
@ -45,6 +47,8 @@ class Ui_EGLSyncGroup(object):
|
|||
EGLSyncGroup.setTitle(_translate("EGLSyncGroup", "Sync with Epic Games Launcher"))
|
||||
self.egl_path_edit_label.setText(_translate("EGLSyncGroup", "Prefix/Manifest path"))
|
||||
self.egl_sync_check_label.setText(_translate("EGLSyncGroup", "Enable automatic sync"))
|
||||
self.egl_sync_check.setText(_translate("EGLSyncGroup", "This will immediately synchronize with EGL"))
|
||||
self.egl_path_info_label.setText(_translate("EGLSyncGroup", "Estimated path"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>217</width>
|
||||
<height>88</height>
|
||||
<width>424</width>
|
||||
<height>106</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -33,26 +33,35 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="egl_path_edit_layout"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="egl_sync_check_label">
|
||||
<property name="text">
|
||||
<string>Enable automatic sync</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="egl_sync_check">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
<string>This will immediately synchronize with EGL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="import_export_layout"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="egl_path_info_label">
|
||||
<property name="text">
|
||||
<string>Estimated path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
Loading…
Reference in a new issue