1
0
Fork 0
mirror of synced 2024-05-15 01:52:53 +12:00

Some small fixes

This commit is contained in:
Dummerle 2021-04-05 10:57:11 +02:00
parent ab895d4bc9
commit 836ec1f895
4 changed files with 21 additions and 6 deletions

View file

@ -36,7 +36,8 @@ Using the exe file could cause errors
- For Arch Linux is an AUR package available: [rare-git](https://aur.archlinux.org/packages/rare-git)
or [rare](https://aur.archlinux.org/packages/rare)
- Other distributions have to install it with pip or clone the repo and install it manually: *python3 setup.py install*
- For Debian-based Distros is a .deb package at the releases
- Other distributions have to install it with pip or clone the repo and install it manually: *python3 setup.py install (--user)*
## Features
@ -51,6 +52,7 @@ Using the exe file could cause errors
- Offline mode
- More Translations (Need help)
- More Information about Games
More planned features are in projects
## Contributing
There are more options to contribute.

View file

@ -147,7 +147,6 @@ class SyncWidget(QWidget):
def change_path(self):
path = PathInputDialog("Select directory", "Select savepath. Warning: Do not change if you are not sure",
self.igame.save_path).get_path()
print(path)
if path != "":
self.igame.save_path = path
self.core.lgd.set_installed_game(self.igame.app_name, self.igame)

View file

@ -36,11 +36,11 @@ class IconWidgetUninstalled(BaseUninstalledWidget):
self.setLayout(self.layout)
self.setFixedWidth(self.sizeHint().width())
def mousePressEvent(self, a0) -> None:
def mousePressEvent(self, e) -> None:
self.install()
def enterEvent(self, QEvent):
def enterEvent(self, e):
self.info_label.setText(self.tr("Install Game"))
def leaveEvent(self, QEvent):
def leaveEvent(self, e):
self.info_label.setText("")

View file

@ -1,3 +1,4 @@
import configparser
import logging
import os
import sys
@ -23,11 +24,22 @@ class App(QApplication):
def __init__(self):
super(App, self).__init__(sys.argv)
# init Legendary
self.core = LegendaryCore()
try:
self.core = LegendaryCore()
except configparser.MissingSectionHeaderError as e:
logger.warning(f"Config is corrupt: {e}")
if config_path := os.environ.get('XDG_CONFIG_HOME'):
path = os.path.join(config_path, 'legendary')
else:
path = os.path.expanduser('~/.config/legendary')
with open(os.path.join(path, "config.ini"), "w") as config_file:
config_file.write("[Legendary]")
self.core = LegendaryCore()
if not "Legendary" in self.core.lgd.config.sections():
self.core.lgd.config.add_section("Legendary")
self.core.lgd.save_config()
# set Application name for settings
self.setApplicationName("Rare")
self.setOrganizationName("Rare")
settings = QSettings()
@ -46,12 +58,14 @@ class App(QApplication):
self.setStyleSheet(open(style_path + "RareStyle.qss").read())
self.setWindowIcon(QIcon(style_path + "Logo.png"))
# launch app
self.launch_dialog = LaunchDialog(self.core)
self.launch_dialog.start_app.connect(self.start_app)
self.launch_dialog.show()
def start_app(self):
self.mainwindow = MainWindow(self.core)
# close launch dialog after app widgets were created
self.launch_dialog.close()