some small fixes
This commit is contained in:
parent
c649547109
commit
43e9e76920
5 changed files with 16 additions and 43 deletions
|
@ -4,40 +4,12 @@
|
|||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="6">
|
||||
<item index="0" class="java.lang.String" itemvalue="certifi" />
|
||||
<item index="1" class="java.lang.String" itemvalue="requests" />
|
||||
<item index="2" class="java.lang.String" itemvalue="urllib3" />
|
||||
<item index="3" class="java.lang.String" itemvalue="Pillow" />
|
||||
<item index="4" class="java.lang.String" itemvalue="PyQt5" />
|
||||
<item index="5" class="java.lang.String" itemvalue="legendary_gl" />
|
||||
<list size="2">
|
||||
<item index="0" class="java.lang.String" itemvalue="requests" />
|
||||
<item index="1" class="java.lang.String" itemvalue="Pillow" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="N802" />
|
||||
<option value="N806" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyStubPackagesAdvertiser" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<list>
|
||||
<option value="PyQt5-stubs==5.14.2.2" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredIdentifiers">
|
||||
<list>
|
||||
<option value="bool.sum" />
|
||||
<option value="PyQt5.QtWidgets.clicked.connect" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (2)" project-jdk-type="Python SDK" />
|
||||
</project>
|
|
@ -22,19 +22,20 @@ class GameWidgetUninstalled(QWidget):
|
|||
self.layout = QVBoxLayout()
|
||||
self.core = core
|
||||
self.game = game
|
||||
|
||||
IMAGE_DIR = QSettings().value("img_dir", type=str)
|
||||
s = QSettings()
|
||||
IMAGE_DIR = s.value("img_dir", os.path.expanduser("~/.cache/rare"), type=str)
|
||||
if os.path.exists(f"{IMAGE_DIR}/{game.app_name}/UninstalledArt.png"):
|
||||
pixmap = QPixmap(f"{IMAGE_DIR}/{game.app_name}/UninstalledArt.png")
|
||||
|
||||
if pixmap.isNull():
|
||||
logger.info(game.app_title + " has a corrupt image.")
|
||||
download_image(game, force=True)
|
||||
pixmap = QPixmap(f"{IMAGE_DIR}/{game.app_name}/UninstalledArt.png")
|
||||
|
||||
else:
|
||||
logger.warning(f"No Image found: {self.game.app_title}")
|
||||
pixmap = None
|
||||
|
||||
if pixmap.isNull():
|
||||
logger.info(game.app_title + " has a corrupt image.")
|
||||
download_image(game, force=True)
|
||||
pixmap = QPixmap(f"{IMAGE_DIR}/{game.app_name}/UninstalledArt.png")
|
||||
|
||||
if pixmap:
|
||||
w = 200
|
||||
pixmap = pixmap.scaled(w, int(w * 4 / 3))
|
||||
|
|
|
@ -75,7 +75,7 @@ class RareSettings(QWidget):
|
|||
print(old_path, new_path)
|
||||
del settings
|
||||
if old_path != new_path:
|
||||
if os.path.exists(new_path):
|
||||
if not os.path.exists(new_path):
|
||||
os.makedirs(new_path)
|
||||
logger.info("Move Images")
|
||||
shutil.move(old_path, new_path)
|
||||
|
|
|
@ -12,9 +12,9 @@ from Rare import lang_path
|
|||
from Rare.utils import legendaryConfig
|
||||
|
||||
logger = getLogger("Utils")
|
||||
s = QSettings()
|
||||
IMAGE_DIR = s.value("language", os.path.expanduser("~/.cache/rare"), type=str)
|
||||
|
||||
s = QSettings("Rare","Rare")
|
||||
IMAGE_DIR = s.value("img_dir", os.path.expanduser("~/.cache/rare"), type=str)
|
||||
logger.info("IMAGE DIRECTORY: "+IMAGE_DIR)
|
||||
|
||||
def download_images(signal: pyqtSignal, core: LegendaryCore):
|
||||
if not os.path.isdir(IMAGE_DIR):
|
||||
|
|
Loading…
Reference in a new issue