1
0
Fork 0
mirror of synced 2024-05-18 19:42:54 +12:00

Utils: fix unresolved references

This commit is contained in:
loathingKernel 2022-07-30 09:02:08 +03:00
parent 7408116deb
commit f375357a2c
4 changed files with 12 additions and 9 deletions

View file

@ -24,7 +24,7 @@ class GameProcess(QObject):
game_launched = pyqtSignal(str)
tried_connections = 0
def __init__(self, app_name: str, on_startup=False, always_ask_sync: bool= False):
def __init__(self, app_name: str, on_startup=False, always_ask_sync: bool = False):
super(GameProcess, self).__init__()
self.app_name = app_name
self.on_startup = on_startup
@ -208,7 +208,7 @@ class GameUtils(QObject):
wine_pfx: str = None,
ask_always_sync: bool = False,
):
executable = utils.get_rare_executable()
executable = misc.get_rare_executable()
executable, args = executable[0], executable[1:]
args.extend([
"start", app_name

View file

@ -18,6 +18,7 @@ from rare.utils.misc import (
get_style_sheets,
set_style_sheet,
get_size,
create_desktop_link,
)
logger = getLogger("RareSettings")
@ -160,7 +161,7 @@ class RareSettings(QWidget, Ui_RareSettings):
def create_start_menu_link(self):
try:
if not os.path.exists(self.start_menu_link):
utils.create_desktop_link(type_of_link="start_menu", for_rare=True)
create_desktop_link(type_of_link="start_menu", for_rare=True)
self.startmenu_link_btn.setText(self.tr("Remove start menu link"))
else:
os.remove(self.start_menu_link)
@ -169,23 +170,24 @@ class RareSettings(QWidget, Ui_RareSettings):
logger.error(str(e))
QMessageBox.warning(
self,
"Error",
f"Permission error, cannot remove {self.start_menu_link}",
self.tr("Error"),
self.tr("Permission error, cannot remove {}").format(self.start_menu_link),
)
def create_desktop_link(self):
try:
if not os.path.exists(self.desktop_file):
utils.create_desktop_link(type_of_link="desktop", for_rare=True)
create_desktop_link(type_of_link="desktop", for_rare=True)
self.desktop_link_btn.setText(self.tr("Remove Desktop link"))
else:
os.remove(self.desktop_file)
self.desktop_link_btn.setText(self.tr("Create desktop link"))
except PermissionError as e:
logger.error(str(e))
logger.warning(
self,
"Error",
f"Permission error, cannot remove {self.desktop_file}",
self.tr("Error"),
self.tr("Permission error, cannot remove {}").format(self.start_menu_link),
)
def on_color_select_changed(self, color):

View file

@ -17,7 +17,7 @@ class LgndrCommonArgs:
class _GetBooleanChoiceP(Protocol):
def __call__(self, prompt: str, default: bool = ...) -> bool:
...
pass
def _get_boolean_choice(prompt: str, default: bool = True) -> bool:

View file

@ -1,3 +1,4 @@
typing_extensions
requests
PyQt5
QtAwesome