settings: show difference between errored and disabled plugin
add option to disable errored plugin
This commit is contained in:
parent
4d7cdfb35e
commit
e6b358f495
|
@ -26,6 +26,11 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-properties</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="img_disable">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon-name">_Cancel</property>
|
||||
</object>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -124,11 +129,19 @@
|
|||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_disable_errored">
|
||||
<property name="visible">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="image">img_disable</property>
|
||||
<property name="tooltip-text" translatable="yes">Disable permanently</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<style>
|
||||
<class name="btn_circle"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_properties">
|
||||
|
@ -143,11 +156,6 @@
|
|||
<class name="btn_circle"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -303,7 +303,7 @@ class PluginManager:
|
|||
# Check for dependencies
|
||||
message = utility.check_plugin_dependencies(plugin['id'], plugin_config, plugin.get('settings', {}), plugin_path)
|
||||
if message:
|
||||
if plugin_config['required_plugin']:
|
||||
if plugin_config.get('required_plugin', False):
|
||||
raise RequiredPluginException(
|
||||
plugin['id'],
|
||||
plugin_config['meta']['name'],
|
||||
|
|
|
@ -232,18 +232,24 @@ class SettingsDialog:
|
|||
lbl_plugin_name.set_sensitive(False)
|
||||
lbl_plugin_description.set_sensitive(False)
|
||||
switch_enable.set_sensitive(False)
|
||||
btn_properties.set_sensitive(False)
|
||||
if plugin_config['enabled']:
|
||||
btn_disable_errored = builder.get_object('btn_disable_errored')
|
||||
btn_disable_errored.set_visible(True)
|
||||
btn_disable_errored.connect('clicked', lambda button: self.__disable_errored_plugin(button, plugin_config))
|
||||
|
||||
else:
|
||||
lbl_plugin_description.set_label(_(plugin_config['meta']['description']))
|
||||
if plugin_config['settings']:
|
||||
btn_properties.set_sensitive(True)
|
||||
btn_properties.connect('clicked', lambda button: self.__show_plugins_properties_dialog(plugin_config))
|
||||
else:
|
||||
btn_properties.set_sensitive(False)
|
||||
self.plugin_switches[plugin_config['id']] = switch_enable
|
||||
if plugin_config.get('break_override_allowed', False):
|
||||
self.plugin_map[plugin_config['id']] = plugin_config['meta']['name']
|
||||
if plugin_config['icon']:
|
||||
builder.get_object('img_plugin_icon').set_from_file(plugin_config['icon'])
|
||||
if plugin_config['settings']:
|
||||
btn_properties.set_sensitive(True)
|
||||
btn_properties.connect('clicked', lambda button: self.__show_plugins_properties_dialog(plugin_config))
|
||||
else:
|
||||
btn_properties.set_sensitive(False)
|
||||
box = builder.get_object('box')
|
||||
box.set_visible(True)
|
||||
return box
|
||||
|
@ -255,6 +261,13 @@ class SettingsDialog:
|
|||
dialog = PluginSettingsDialog(plugin_config)
|
||||
dialog.show()
|
||||
|
||||
def __disable_errored_plugin(self, button, plugin_config):
|
||||
"""
|
||||
Permanently disable errored plugin
|
||||
"""
|
||||
button.set_sensitive(False)
|
||||
self.plugin_switches[plugin_config['id']].set_active(False)
|
||||
|
||||
def __show_break_properties_dialog(self, break_config, is_short, parent, on_close, on_add, on_remove):
|
||||
"""
|
||||
Show the BreakProperties dialog
|
||||
|
|
|
@ -241,7 +241,6 @@ def load_plugins_config(safeeyes_config):
|
|||
continue
|
||||
dependency_description = check_plugin_dependencies(plugin['id'], config, plugin.get('settings', {}), plugin_path)
|
||||
if dependency_description:
|
||||
plugin['enabled'] = False
|
||||
config['error'] = True
|
||||
config['meta']['dependency_description'] = dependency_description
|
||||
icon = get_resource_path('ic_warning.png')
|
||||
|
|
Loading…
Reference in New Issue