mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Include the save name in the window title.
This commit is contained in:
parent
4259cf8764
commit
7808da118a
@ -50,7 +50,7 @@ class QLiberationWindow(QMainWindow):
|
|||||||
self.liberation_map = QLiberationMap(self.game_model, self)
|
self.liberation_map = QLiberationMap(self.game_model, self)
|
||||||
|
|
||||||
self.setGeometry(300, 100, 270, 100)
|
self.setGeometry(300, 100, 270, 100)
|
||||||
self.setWindowTitle(f"DCS Liberation - v{VERSION}")
|
self.updateWindowTitle()
|
||||||
self.setWindowIcon(QIcon("./resources/icon.png"))
|
self.setWindowIcon(QIcon("./resources/icon.png"))
|
||||||
self.statusBar().showMessage("Ready")
|
self.statusBar().showMessage("Ready")
|
||||||
|
|
||||||
@ -71,6 +71,7 @@ class QLiberationWindow(QMainWindow):
|
|||||||
logging.info("Loading last saved game : " + str(last_save_file))
|
logging.info("Loading last saved game : " + str(last_save_file))
|
||||||
game = persistency.load_game(last_save_file)
|
game = persistency.load_game(last_save_file)
|
||||||
self.onGameGenerated(game)
|
self.onGameGenerated(game)
|
||||||
|
self.updateWindowTitle(last_save_file)
|
||||||
except:
|
except:
|
||||||
logging.info("Error loading latest save game")
|
logging.info("Error loading latest save game")
|
||||||
else:
|
else:
|
||||||
@ -243,6 +244,8 @@ class QLiberationWindow(QMainWindow):
|
|||||||
game = persistency.load_game(file[0])
|
game = persistency.load_game(file[0])
|
||||||
GameUpdateSignal.get_instance().game_loaded.emit(game)
|
GameUpdateSignal.get_instance().game_loaded.emit(game)
|
||||||
|
|
||||||
|
self.updateWindowTitle(file[0])
|
||||||
|
|
||||||
def saveGame(self):
|
def saveGame(self):
|
||||||
logging.info("Saving game")
|
logging.info("Saving game")
|
||||||
|
|
||||||
@ -266,6 +269,18 @@ class QLiberationWindow(QMainWindow):
|
|||||||
liberation_install.setup_last_save_file(self.game.savepath)
|
liberation_install.setup_last_save_file(self.game.savepath)
|
||||||
liberation_install.save_config()
|
liberation_install.save_config()
|
||||||
|
|
||||||
|
self.updateWindowTitle(file[0])
|
||||||
|
|
||||||
|
def updateWindowTitle(self, save_path: Optional[str] = None) -> None:
|
||||||
|
"""
|
||||||
|
to DCS Liberation - vX.X.X - file_name
|
||||||
|
"""
|
||||||
|
window_title = f"DCS Liberation - v{VERSION}"
|
||||||
|
if save_path: # appending the file name to title as it is updated
|
||||||
|
file_name = save_path.split("/")[-1].split(".liberation")[0]
|
||||||
|
window_title = f"{window_title} - {file_name}"
|
||||||
|
self.setWindowTitle(window_title)
|
||||||
|
|
||||||
def onGameGenerated(self, game: Game):
|
def onGameGenerated(self, game: Game):
|
||||||
logging.info("On Game generated")
|
logging.info("On Game generated")
|
||||||
self.game = game
|
self.game = game
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user