diff --git a/core/overlay_window.py b/core/overlay_window.py index 12a6eb6..9402ea8 100644 --- a/core/overlay_window.py +++ b/core/overlay_window.py @@ -767,22 +767,39 @@ class OverlayWindow(QMainWindow): if self.plugin_manager: all_plugins = self.plugin_manager.get_all_discovered_plugins() - sorted_plugins = sorted(all_plugins.items(), key=lambda x: x[1].name) + + # Sort by name with error handling + def get_plugin_name(item): + try: + return getattr(item[1], 'name', item[0]) + except: + return item[0] + + sorted_plugins = sorted(all_plugins.items(), key=get_plugin_name) for plugin_id, plugin_class in sorted_plugins: - row = QHBoxLayout() - - cb = QCheckBox(f"{plugin_class.name} (v{plugin_class.version})") - cb.setChecked(self.plugin_manager.is_plugin_enabled(plugin_id)) - cb.setStyleSheet(f"color: {c['text_primary']};") - self.settings_checkboxes[plugin_id] = cb - row.addWidget(cb) - - desc = QLabel(plugin_class.description) - desc.setStyleSheet(f"color: {c['text_muted']}; font-size: {EU_TYPOGRAPHY['size_xs']};") - row.addWidget(desc, 1) - - layout.addLayout(row) + try: + row = QHBoxLayout() + + # Safely get plugin attributes + name = getattr(plugin_class, 'name', plugin_id.split('.')[-1]) + version = getattr(plugin_class, 'version', '?.?.?') + description = getattr(plugin_class, 'description', 'No description') + + cb = QCheckBox(f"{name} (v{version})") + cb.setChecked(self.plugin_manager.is_plugin_enabled(plugin_id)) + cb.setStyleSheet(f"color: {c['text_primary']};") + self.settings_checkboxes[plugin_id] = cb + row.addWidget(cb) + + desc = QLabel(description) + desc.setStyleSheet(f"color: {c['text_muted']}; font-size: {EU_TYPOGRAPHY['size_xs']};") + row.addWidget(desc, 1) + + layout.addLayout(row) + except Exception as e: + print(f"[Overlay] Error creating settings for {plugin_id}: {e}") + continue layout.addStretch() return tab