Commit 460450f5 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Pamhyr: Fix save as method and minor change.

No related merge requests found
Pipeline #56286 passed with stages
in 3 minutes and 25 seconds
Showing with 13 additions and 2 deletions
+13 -2
......@@ -117,6 +117,9 @@ class Study(SQLModel):
if ".backup" in self.filename:
is_new = True
if not os.path.exists(self.filename):
is_new = True
self._init_db_file(self.filename, is_new=is_new)
self.commit()
......
......@@ -579,9 +579,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
Nothing
"""
if self._study.filename is None or self._study.filename == "":
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
file_name, _ = QFileDialog.getSaveFileName(
self, "Save File",
"", "Pamhyr(*.pamhyr)"
"", "Pamhyr(*.pamhyr)",
options=options,
)
if file_name.rsplit(".", 1)[-1] == "pamhyr":
......@@ -630,9 +634,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
Returns:
Nothing
"""
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
file_name, _ = QFileDialog.getSaveFileName(
self, "Save File",
"", "Pamhyr(*.pamhyr)"
"", "Pamhyr(*.pamhyr)",
options=options,
)
logger.debug(f"Save study as : {repr(file_name)}")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment