mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix save path for new games.
This commit is contained in:
parent
4cfed08247
commit
e6bf318cdf
@ -234,10 +234,14 @@ class QLiberationWindow(QMainWindow):
|
|||||||
wizard.accepted.connect(lambda: self.onGameGenerated(wizard.generatedGame))
|
wizard.accepted.connect(lambda: self.onGameGenerated(wizard.generatedGame))
|
||||||
|
|
||||||
def openFile(self):
|
def openFile(self):
|
||||||
|
if self.game is not None and self.game.savepath:
|
||||||
|
save_dir = self.game.savepath
|
||||||
|
else:
|
||||||
|
save_dir = str(persistency.save_dir())
|
||||||
file = QFileDialog.getOpenFileName(
|
file = QFileDialog.getOpenFileName(
|
||||||
self,
|
self,
|
||||||
"Select game file to open",
|
"Select game file to open",
|
||||||
dir=self.game.savepath if self.game else persistency._dcs_saved_game_folder,
|
dir=save_dir,
|
||||||
filter="*.liberation",
|
filter="*.liberation",
|
||||||
)
|
)
|
||||||
if file is not None and file[0] != "":
|
if file is not None and file[0] != "":
|
||||||
@ -257,10 +261,14 @@ class QLiberationWindow(QMainWindow):
|
|||||||
self.saveGameAs()
|
self.saveGameAs()
|
||||||
|
|
||||||
def saveGameAs(self):
|
def saveGameAs(self):
|
||||||
|
if self.game is not None and self.game.savepath:
|
||||||
|
save_dir = self.game.savepath
|
||||||
|
else:
|
||||||
|
save_dir = str(persistency.save_dir())
|
||||||
file = QFileDialog.getSaveFileName(
|
file = QFileDialog.getSaveFileName(
|
||||||
self,
|
self,
|
||||||
"Save As",
|
"Save As",
|
||||||
dir=self.game.savepath if self.game else persistency._dcs_saved_game_folder,
|
dir=save_dir,
|
||||||
filter="*.liberation",
|
filter="*.liberation",
|
||||||
)
|
)
|
||||||
if file is not None:
|
if file is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user