Notify users that to apply changes, Cthulhu has to be restarted. The previous attempt was not screen reader accessible, a terrible thing for a screen reader itself to have inaccessible components lol.

This commit is contained in:
Storm Dragon
2025-08-02 13:14:23 -04:00
parent 06894693b0
commit d41d9076d1

View File

@ -151,7 +151,7 @@ class PluginManager(Plugin):
# Add info label about PluginManager
info_label = Gtk.Label()
info_label.set_markup("<i>Note: PluginManager is always enabled and not shown here</i>")
info_label.set_markup("<i>Note:To apply changes, restart Cthulhu</i>")
info_label.set_halign(Gtk.Align.CENTER)
content_area.pack_start(info_label, False, False, 5)
@ -382,32 +382,10 @@ class PluginManager(Plugin):
debug.printMessage(debug.LEVEL_INFO, f"PluginManager: Updated active plugins: {active_plugins}", True)
# Show restart message
self._show_restart_message()
except Exception as e:
logger.error(f"PluginManager: Error toggling plugin {plugin_name}: {e}")
debug.printMessage(debug.LEVEL_INFO, f"PluginManager: Error toggling {plugin_name}: {e}", True)
def _show_restart_message(self):
"""Show a message that restart is needed to apply plugin changes."""
if not hasattr(self, '_restart_message_shown'):
try:
# Get the content area of the existing dialog
content_area = self._dialog.get_content_area()
# Add restart message if not already shown
restart_label = Gtk.Label()
restart_label.set_markup("<i>Restart Cthulhu to apply plugin changes</i>")
restart_label.set_halign(Gtk.Align.CENTER)
content_area.pack_end(restart_label, False, False, 10)
restart_label.show()
self._restart_message_shown = True
debug.printMessage(debug.LEVEL_INFO, "PluginManager: Added restart message to dialog", True)
except Exception as e:
debug.printMessage(debug.LEVEL_INFO, f"PluginManager: Error showing restart message: {e}", True)
def _on_dialog_response(self, dialog, response_id):
"""Handle dialog response (close button clicked)."""
@ -418,4 +396,4 @@ class PluginManager(Plugin):
debug.printMessage(debug.LEVEL_INFO, "PluginManager: Dialog closed", True)
except Exception as e:
logger.error(f"PluginManager: Error handling dialog response: {e}")
logger.error(f"PluginManager: Error handling dialog response: {e}")