mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
disable form.viewPage button when add-on was not downloaded from AnkiWeb
This commit is contained in:
parent
65b826d787
commit
8aa27dcdf5
1 changed files with 8 additions and 0 deletions
|
@ -291,6 +291,7 @@ class AddonsDialog(QDialog):
|
|||
f.viewFiles.clicked.connect(self.onViewFiles)
|
||||
f.delete_2.clicked.connect(self.onDelete)
|
||||
f.config.clicked.connect(self.onConfig)
|
||||
self.form.addonList.currentRowChanged.connect(self._onAddonItemSelected)
|
||||
self.redrawAddons()
|
||||
self.show()
|
||||
|
||||
|
@ -302,6 +303,13 @@ class AddonsDialog(QDialog):
|
|||
if self.addons:
|
||||
self.form.addonList.setCurrentRow(0)
|
||||
|
||||
def _onAddonItemSelected(self, row_int):
|
||||
try:
|
||||
addon = self.addons[row_int][1]
|
||||
except:
|
||||
addon = ''
|
||||
self.form.viewPage.setEnabled(True if re.match(r"^\d+$", addon) else False)
|
||||
|
||||
def annotatedName(self, dir):
|
||||
meta = self.mgr.addonMeta(dir)
|
||||
buf = self.mgr.addonName(dir)
|
||||
|
|
Loading…
Reference in a new issue