From 9f5c69ee94c98d4ac0801b6e8f2895e995d99caf Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Thu, 7 May 2020 15:01:56 -0300 Subject: [PATCH] Keep an window open showing the migration is in progress --- qt/aqt/profiles.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/qt/aqt/profiles.py b/qt/aqt/profiles.py index 1c75eb6f7..cae7dbfdc 100644 --- a/qt/aqt/profiles.py +++ b/qt/aqt/profiles.py @@ -144,7 +144,29 @@ class ProfileManager: retval = conformation.exec() if retval == QMessageBox.Ok: + progress = QMessageBox() + progress.setIcon(QMessageBox.Information) + progress.setStandardButtons(QMessageBox.NoButton) + progress.setWindowIcon(icon) + progress.setWindowTitle(window_title) + progress.setText( + f"Please wait while your Anki collection is moved from {migration_directories}" + ) + progress.show() + app.processEvents() shutil.move(oldBase, self.base) + progress.hide() + + completion = QMessageBox() + completion.setIcon(QMessageBox.Information) + completion.setStandardButtons(QMessageBox.Ok) + completion.setWindowIcon(icon) + completion.setWindowTitle(window_title) + completion.setText( + f"Your Anki Collection was successfully moved from {migration_directories}" + ) + completion.show() + completion.exec() else: self.base = oldBase