diff --git a/rare/components/tabs/games/game_info/move_game.py b/rare/components/tabs/games/game_info/move_game.py index e156f8fd..37ebebac 100644 --- a/rare/components/tabs/games/game_info/move_game.py +++ b/rare/components/tabs/games/game_info/move_game.py @@ -86,6 +86,8 @@ class MoveGamePopUp(QWidget): def path_edit_callback(self, path: str) -> Tuple[bool, str, int]: self.button.setEnabled(True) self.warn_label.setHidden(False) + self.req_space.setText("...") + self.avail_space.setText("...") def helper_func(reason: int) -> Tuple[bool, str, int]: self.button.setEnabled(False) diff --git a/rare/widgets/indicator_edit.py b/rare/widgets/indicator_edit.py index 46054887..cd03602a 100644 --- a/rare/widgets/indicator_edit.py +++ b/rare/widgets/indicator_edit.py @@ -98,7 +98,7 @@ class EditFuncRunnable(QRunnable): super(EditFuncRunnable, self).__init__() self.setAutoDelete(True) self.signals = EditFuncRunnable.Signals() - self.func = func + self.func = self.__wrap_edit_function(func) self.args = args def run(self): @@ -106,6 +106,13 @@ class EditFuncRunnable(QRunnable): self.signals.result.emit(o0, o1, o2) self.signals.deleteLater() + @staticmethod + def __wrap_edit_function(func: Callable[[str], Tuple[bool, str, int]]): + if func: + return lambda text: func(os.path.expanduser(text) if text.startswith("~") else text) + else: + return func + class IndicatorLineEdit(QWidget): textChanged = pyqtSignal(str) @@ -171,6 +178,11 @@ class IndicatorLineEdit(QWidget): if text: self.line_edit.setText(text) + def deleteLater(self) -> None: + if self.__thread is not None: + self.__thread.signals.result.disconnect() + super(IndicatorLineEdit, self).deleteLater() + def text(self) -> str: return self.line_edit.text() @@ -279,8 +291,6 @@ class PathEdit(IndicatorLineEdit): self.compl_model.setRootPath(path) self.completer.setModel(self.compl_model) - edit_func = self.__wrap_edit_function(edit_func) - super(PathEdit, self).__init__( text=path, placeholder=placeholder, @@ -319,10 +329,3 @@ class PathEdit(IndicatorLineEdit): names = dlg.selectedFiles() self.line_edit.setText(names[0]) self.compl_model.setRootPath(names[0]) - - @staticmethod - def __wrap_edit_function(func: Callable[[str], Tuple[bool, str, int]]): - if func: - return lambda text: func(os.path.expanduser(text) if text.startswith("~") else text) - else: - return func