mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
fix issue preventing profile rename/delete
qtwebengineprocess.exe inherits the current working directory, so if it is started after the profile is loaded, it prevents the profile media folder from being renamed/deleted also, load profile on first run at the same point we normally load the profile
This commit is contained in:
parent
8dbebe3583
commit
478ee66d0e
1 changed files with 11 additions and 6 deletions
17
aqt/main.py
17
aqt/main.py
|
@ -39,12 +39,6 @@ class AnkiQt(QMainWindow):
|
|||
aqt.mw = self
|
||||
self.app = app
|
||||
self.pm = profileManager
|
||||
# running 2.0 for the first time?
|
||||
if self.pm.meta['firstRun']:
|
||||
# load the new deck user profile
|
||||
self.pm.load(self.pm.profiles()[0])
|
||||
self.pm.meta['firstRun'] = False
|
||||
self.pm.save()
|
||||
# init rest of app
|
||||
self.safeMode = self.app.queryKeyboardModifiers() & Qt.ShiftModifier
|
||||
try:
|
||||
|
@ -108,6 +102,12 @@ class AnkiQt(QMainWindow):
|
|||
self.closeFires = True
|
||||
|
||||
def setupProfile(self):
|
||||
if self.pm.meta['firstRun']:
|
||||
# load the new deck user profile
|
||||
self.pm.load(self.pm.profiles()[0])
|
||||
self.pm.meta['firstRun'] = False
|
||||
self.pm.save()
|
||||
|
||||
self.pendingImport = None
|
||||
self.restoringBackup = False
|
||||
# profile not provided on command line?
|
||||
|
@ -607,6 +607,11 @@ title="%s" %s>%s</button>''' % (
|
|||
self.mainLayout.addWidget(sweb)
|
||||
self.form.centralwidget.setLayout(self.mainLayout)
|
||||
|
||||
# force webengine processes to load before cwd is changed
|
||||
if isWin:
|
||||
self.web._page.setHtml("")
|
||||
self.bottomWeb._page.setHtml("")
|
||||
|
||||
def closeAllWindows(self, onsuccess):
|
||||
aqt.dialogs.closeAll(onsuccess)
|
||||
|
||||
|
|
Loading…
Reference in a new issue