updater ui & message
This commit is contained in:
parent
ef662527fa
commit
49599cd368
@ -59,7 +59,7 @@ class Ui_DialogUpdates(object):
|
||||
QtCore.QMetaObject.connectSlotsByName(DialogUpdates)
|
||||
|
||||
def retranslateUi(self, DialogUpdates):
|
||||
DialogUpdates.setWindowTitle(_translate("DialogUpdates", "FastWQ - Update Checker", None))
|
||||
DialogUpdates.setWindowTitle(_translate("DialogUpdates", "FastWQ - Updater", None))
|
||||
self.labelUpdates.setText(_translate("DialogUpdates", "<html><head/><body><p>A new version of {0} is available for download! </p><p>Do you want to update {1}to version {2}?</p><p>Changes from your version are listed below:</p></body></html>", None))
|
||||
#self.always.setText(_translate("DialogUpdates", "Always update", None))
|
||||
self.update.setText(_translate("DialogUpdates", "Update", None))
|
||||
|
||||
@ -15,13 +15,13 @@ import io
|
||||
import aqt
|
||||
from aqt import mw
|
||||
from aqt.qt import *
|
||||
from aqt.utils import showInfo
|
||||
from anki.hooks import addHook
|
||||
from anki.utils import isMac, isWin
|
||||
from ..context import APP_ICON
|
||||
from .AnkiHub.updates import Ui_DialogUpdates
|
||||
from .AnkiHub.markdown2 import markdown
|
||||
|
||||
|
||||
# taken from Anki's aqt/profiles.py
|
||||
def defaultBase():
|
||||
path = mw.pm.addonFolder()
|
||||
@ -69,6 +69,9 @@ class DialogUpdates(QDialog, Ui_DialogUpdates):
|
||||
self.textBrowser.scrollToAnchor('text_bottom')
|
||||
|
||||
def finish(self):
|
||||
self.hide()
|
||||
self.destroy()
|
||||
showInfo('Updated. Please restart Anki.')
|
||||
pass
|
||||
|
||||
|
||||
@ -138,7 +141,7 @@ def updateSingle(repositories, path, data):
|
||||
with open(dataPath,'w') as f:
|
||||
json.dump(repositories,f,indent=2)
|
||||
f.close()
|
||||
appendHtml('Done.<br/>Please restart Anki.<br/>')
|
||||
appendHtml('Done.<br/>')
|
||||
onReady() # close the AnkiHub update window
|
||||
|
||||
return callback
|
||||
@ -146,7 +149,7 @@ def updateSingle(repositories, path, data):
|
||||
|
||||
def update(add=[], install=False, VERSION='v0.0.0'):
|
||||
# progress win
|
||||
progresswin = QProgressDialog('Update Checking...', 'FastWQ - Updater', 0, 0, mw)
|
||||
progresswin = QProgressDialog('Update Checking...', '', 0, 0, mw)
|
||||
progresswin.setWindowModality(Qt.ApplicationModal)
|
||||
progresswin.setCancelButton(None)
|
||||
progresswin.setWindowFlags(
|
||||
@ -154,6 +157,7 @@ def update(add=[], install=False, VERSION='v0.0.0'):
|
||||
~Qt.WindowContextHelpButtonHint
|
||||
)
|
||||
progresswin.setWindowIcon(APP_ICON)
|
||||
progresswin.setWindowTitle('FastWQ - Updater')
|
||||
progresswin.resize(280, 60)
|
||||
progresswin.show()
|
||||
#
|
||||
|
||||
@ -53,7 +53,7 @@ class Ui_DialogUpdates(object):
|
||||
QMetaObject.connectSlotsByName(DialogUpdates)
|
||||
|
||||
def retranslateUi(self, DialogUpdates):
|
||||
DialogUpdates.setWindowTitle(_translate("DialogUpdates", "FastWQ - Update Checker", None))
|
||||
DialogUpdates.setWindowTitle(_translate("DialogUpdates", "FastWQ - Updater", None))
|
||||
self.labelUpdates.setText(_translate("DialogUpdates", "<html><head/><body><p>A new version of {0} is available for download! </p><p>Do you want to update {1}to version {2}?</p><p>Changes from your version are listed below:</p></body></html>", None))
|
||||
#self.always.setText(_translate("DialogUpdates", "Always update", None))
|
||||
self.update.setText(_translate("DialogUpdates", "Update", None))
|
||||
|
||||
@ -15,6 +15,7 @@ import io
|
||||
import aqt
|
||||
from aqt import mw
|
||||
from aqt.qt import *
|
||||
from aqt.utils import showInfo
|
||||
from anki.hooks import addHook
|
||||
from anki.utils import isMac, isWin
|
||||
from ..context import APP_ICON
|
||||
@ -69,6 +70,9 @@ class DialogUpdates(QDialog, Ui_DialogUpdates):
|
||||
self.textBrowser.scrollToAnchor('text_bottom')
|
||||
|
||||
def finish(self):
|
||||
self.hide()
|
||||
self.destroy()
|
||||
showInfo('Updated. Please restart Anki.')
|
||||
pass
|
||||
|
||||
|
||||
@ -138,7 +142,7 @@ def updateSingle(repositories, path, data):
|
||||
with open(dataPath,'w') as f:
|
||||
json.dump(repositories,f,indent=2)
|
||||
f.close()
|
||||
appendHtml('Done.<br/>Please restart Anki.<br/>')
|
||||
appendHtml('Done.<br/>')
|
||||
onReady() # close the AnkiHub update window
|
||||
|
||||
return callback
|
||||
@ -146,13 +150,14 @@ def updateSingle(repositories, path, data):
|
||||
|
||||
def update(add=[], install=False, VERSION='v0.0.0'):
|
||||
# progress win
|
||||
progresswin = QProgressDialog('Update Checking...', 'FastWQ - Updater', 0, 0, mw)
|
||||
progresswin = QProgressDialog('Update Checking...', '', 0, 0, mw)
|
||||
progresswin.setWindowModality(Qt.ApplicationModal)
|
||||
progresswin.setCancelButton(None)
|
||||
progresswin.setWindowFlags(
|
||||
progresswin.windowFlags() &
|
||||
~Qt.WindowContextHelpButtonHint
|
||||
)
|
||||
progresswin.setWindowTitle('FastWQ - Updater')
|
||||
progresswin.setWindowIcon(APP_ICON)
|
||||
progresswin.resize(280, 60)
|
||||
progresswin.show()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user