handle loading plugins with same name as installed plugin (update)
This commit is contained in:
@@ -67,6 +67,10 @@ class PluginDialog(WindowModalDialog):
|
|||||||
install_button = QPushButton(_('Install...'))
|
install_button = QPushButton(_('Install...'))
|
||||||
install_button.clicked.connect(self.accept)
|
install_button.clicked.connect(self.accept)
|
||||||
buttons.insert(0, install_button)
|
buttons.insert(0, install_button)
|
||||||
|
elif self.plugins.get_metadata(name).get('zip_hash_sha256') != zip_hash:
|
||||||
|
update_button = QPushButton(_('Update...'))
|
||||||
|
update_button.clicked.connect(self.accept)
|
||||||
|
buttons.insert(0, update_button)
|
||||||
else:
|
else:
|
||||||
remove_button = QPushButton(_('Uninstall'))
|
remove_button = QPushButton(_('Uninstall'))
|
||||||
remove_button.clicked.connect(self.do_remove)
|
remove_button.clicked.connect(self.do_remove)
|
||||||
|
|||||||
@@ -401,6 +401,8 @@ class Plugins(DaemonThread):
|
|||||||
self.config.set_key(f'plugins.{name}.enabled', [])
|
self.config.set_key(f'plugins.{name}.enabled', [])
|
||||||
|
|
||||||
def install_external_plugin(self, name, path, privkey, manifest):
|
def install_external_plugin(self, name, path, privkey, manifest):
|
||||||
|
# uninstall old version first to get rid of old zip files when updating plugin
|
||||||
|
self.uninstall(name)
|
||||||
self.external_plugin_metadata[name] = manifest
|
self.external_plugin_metadata[name] = manifest
|
||||||
self.authorize_plugin(name, path, privkey)
|
self.authorize_plugin(name, path, privkey)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user