set window title empty on new game

also fixed small exception when aborting the open file dialog which lead to " as filename

fixes #1305

(cherry picked from commit 752c91a721)
This commit is contained in:
RndName
2021-06-23 19:59:13 +02:00
committed by Dan Albert
parent 2bb1c0b3f2
commit 1f318aff3c

View File

@@ -240,7 +240,7 @@ class QLiberationWindow(QMainWindow):
dir=persistency._dcs_saved_game_folder,
filter="*.liberation",
)
if file is not None:
if file is not None and file[0] != "":
game = persistency.load_game(file[0])
GameUpdateSignal.get_instance().game_loaded.emit(game)
@@ -282,6 +282,7 @@ class QLiberationWindow(QMainWindow):
self.setWindowTitle(window_title)
def onGameGenerated(self, game: Game):
self.updateWindowTitle()
logging.info("On Game generated")
self.game = game
GameUpdateSignal.get_instance().game_loaded.emit(self.game)