mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
MainWindow: Create a study file copy in current dire before update.
This commit is contained in:
1 parent
bbf85a6048
commit
3a78d6d6f7
3 files changed
+28
-4
No files matched your search
@@ -31,7 +31,7 @@ from platformdirs import user_cache_dir
|
||||
|
||||
from Solver.AdisTS import AdisTS
|
||||
from Solver.Mage import Mage8
|
||||
from tools import logger_exception
|
||||
from tools import logger_exception, pamhyr_db_need_update
|
||||
|
||||
from PyQt5 import QtGui
|
||||
from PyQt5.QtGui import (
|
||||
@@ -1087,10 +1087,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
dialog.setDirectory(os.path.dirname(self.conf.last_study))
|
||||
|
||||
if dialog.exec_():
|
||||
file_name = dialog.selectedFiles()
|
||||
file_name = dialog.selectedFiles()[0]
|
||||
|
||||
if pamhyr_db_need_update(file_name, Study._version):
|
||||
shutil.copyfile(file_name, file_name + ".old")
|
||||
|
||||
def fn():
|
||||
self._tmp_study = Study.open(file_name[0])
|
||||
self._tmp_study = Study.open(file_name)
|
||||
|
||||
dlg = WaitingDialog(
|
||||
payload_fn=fn,
|
||||
|
||||
Reference in new issue
Block a user