Merge pull request #251 from upday7/master
disable form.viewPage button when add-on was not downloaded from AnkiWeb
This commit is contained in:
commit
36b763e45f
@ -302,6 +302,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()
|
||||
|
||||
@ -313,6 +314,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 IndexError:
|
||||
addon = ''
|
||||
self.form.viewPage.setEnabled(bool (re.match(r"^\d+$", addon)))
|
||||
|
||||
def annotatedName(self, dir):
|
||||
meta = self.mgr.addonMeta(dir)
|
||||
buf = self.mgr.addonName(dir)
|
||||
|
Loading…
Reference in New Issue
Block a user