1
0
Fork 0
mirror of synced 2024-05-24 06:19:55 +12:00

Merge pull request #351 from loathingKernel/next

Usability fixes
This commit is contained in:
Stelios Tsampas 2023-12-23 14:27:01 +02:00 committed by GitHub
commit 95d73ea234
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 6 deletions

View file

@ -1,6 +1,10 @@
#!/bin/sh
if [ -n "${1}" ]; then
if [ ! -f "${1}" ]; then
echo "${1} does not exist"
exit 0
fi
echo "Generating python file for ${1}"
pyuic5 "${1}" -x -o "${1%.ui}.py"
sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${1%.ui}.py"
@ -13,6 +17,10 @@ cd "$(dirname "$0")"/.. || exit
changed="$(git diff --name-only HEAD | grep '\.ui')"
for ui in $changed; do
if [ ! -f "$ui" ]; then
echo "$ui does not exist. Skipping"
continue
fi
echo "Generating python file for ${ui}"
pyuic5 "${ui}" -x -o "${ui%.ui}.py"
sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${ui%.ui}.py"

View file

@ -3,7 +3,7 @@ import random
from logging import getLogger
from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot, QObject, QEvent, QTimer
from PyQt5.QtGui import QMouseEvent, QShowEvent
from PyQt5.QtGui import QMouseEvent, QShowEvent, QPaintEvent
from PyQt5.QtWidgets import QMessageBox, QAction
from rare.models.game import RareGame
@ -106,11 +106,21 @@ class GameWidget(LibraryWidget):
# lk: attributes as `GameWidgetUi` class
__slots__ = "ui"
def paintEvent(self, a0: QPaintEvent) -> None:
if not self.visibleRegion().isNull() and self.rgame.pixmap.isNull():
self.startTimer(random.randrange(42, 2361, 129), Qt.CoarseTimer)
# self.startTimer(random.randrange(42, 2361, 363), Qt.VeryCoarseTimer)
# self.rgame.load_pixmap()
# QTimer.singleShot(random.randrange(42, 2361, 7), Qt.VeryCoarseTimer, self.rgame.load_pixmap)
super().paintEvent(a0)
def timerEvent(self, a0):
self.killTimer(a0.timerId())
self.rgame.load_pixmap()
def showEvent(self, a0: QShowEvent) -> None:
if a0.spontaneous():
return super().showEvent(a0)
if self.rgame.pixmap.isNull():
QTimer.singleShot(random.randrange(42, 361, 7), self.rgame.load_pixmap)
super().showEvent(a0)
@pyqtSlot()

View file

@ -65,6 +65,10 @@ class EGLSyncGroup(QGroupBox):
self.ui.egl_sync_check.setChecked(self.core.egl_sync_enabled)
self.ui.egl_sync_check.stateChanged.connect(self.egl_sync_changed)
# lk: Temporarily disable automatic sync with EGL
self.ui.egl_sync_check_label.setHidden(True)
self.ui.egl_sync_check.setHidden(True)
self.import_list = EGLSyncImportGroup(parent=self)
self.ui.import_export_layout.addWidget(self.import_list)
self.export_list = EGLSyncExportGroup(parent=self)

View file

@ -31,7 +31,7 @@ class LegendaryCore(LegendaryCoreReal):
def __init__(self, *args, **kwargs):
super(LegendaryCore, self).__init__(*args, **kwargs)
self.log.info("Using Rare's LegendaryCore monkey")
self.log.info("Using config in %s", self.lgd.path.replace(os.getlogin(), "<username>"))
self.log.info("Using config in %s", self.lgd.path)
self.handler = LgndrLogHandler(logging.CRITICAL)
self.log.addHandler(self.handler)

View file

@ -165,9 +165,14 @@ class RareCore(QObject):
self.__core.lgd.config.set(
"Legendary", "mac_install_dir", self.__core.get_default_install_dir(self.__core.default_platform)
)
# Always set these options
# Avoid falling back to Windows games on macOS
self.__core.lgd.config.set("Legendary", "install_platform_fallback", 'false')
# Avoid implicitly falling back to Windows games on macOS
self.__core.lgd.config.set("Legendary", "install_platform_fallback", str(False))
# Force-disable automatic use of crossover on macOS (remove this when we support crossover)
self.__core.lgd.config.set("Legendary", "disable_auto_crossover", str(True))
# Force-disable automatic sync with EGL, it seems to have issues
self.__core.lgd.config.set("Legendary", "egl_sync", str(False))
# workaround if egl sync enabled, but no programdata_path
# programdata_path might be unset if logging in through the browser