From 3bf2d9d5b11e70ef6b45f8ef956d167c6e984791 Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 16 Feb 2026 00:18:37 +0000 Subject: [PATCH] fix: Settings and Plugins views now show actual content - Import actual views from core.ui (DashboardView, SettingsView, PluginsView) - Update _create_settings_view() to use SettingsView with full tabs - Update _create_plugins_view() to use PluginsView with plugin management - Keep fallback placeholders if views fail to load - Add settings attribute to PerfectMainWindow for SettingsView compatibility Views now show: - Settings: General, Plugin Store, My Plugins, Hotkeys, Data & Backup, Updates tabs - Plugins: Installed plugin list with enable/disable checkboxes --- core/perfect_ux.py | 49 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/core/perfect_ux.py b/core/perfect_ux.py index bc6686d..a852449 100644 --- a/core/perfect_ux.py +++ b/core/perfect_ux.py @@ -43,6 +43,25 @@ from PyQt6.QtWidgets import QGraphicsOpacityEffect from core.eu_styles import get_all_colors from core.icon_manager import get_icon_manager +# Import actual UI views +try: + from core.ui.dashboard_view import DashboardView + DASHBOARD_VIEW_AVAILABLE = True +except ImportError: + DASHBOARD_VIEW_AVAILABLE = False + +try: + from core.ui.settings_view import SettingsView + SETTINGS_VIEW_AVAILABLE = True +except ImportError: + SETTINGS_VIEW_AVAILABLE = False + +try: + from core.ui.plugins_view import PluginsView + PLUGINS_VIEW_AVAILABLE = True +except ImportError: + PLUGINS_VIEW_AVAILABLE = False + # ============================================================ # DESIGN TOKENS - Material Design 3 Inspired @@ -720,6 +739,10 @@ class PerfectMainWindow(QMainWindow): self._current_view = "dashboard" self.icon_manager = get_icon_manager() + # Add settings reference for SettingsView compatibility + from core.settings import get_settings + self.settings = get_settings() + self._setup_window() self._setup_ui() self._setup_shortcuts() @@ -819,7 +842,15 @@ class PerfectMainWindow(QMainWindow): self._create_status_bar() def _create_dashboard_view(self) -> QWidget: - """Create the polished Dashboard view.""" + """Create the Dashboard view.""" + # Try to use the actual DashboardView if available + if DASHBOARD_VIEW_AVAILABLE: + try: + return DashboardView(self) + except Exception as e: + print(f"[PerfectUX] Failed to create DashboardView: {e}") + + # Fallback to built-in dashboard scroll = QScrollArea() scroll.setWidgetResizable(True) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff) @@ -965,6 +996,14 @@ class PerfectMainWindow(QMainWindow): def _create_plugins_view(self) -> QWidget: """Create the Plugins view.""" + # Try to use the actual PluginsView if available + if PLUGINS_VIEW_AVAILABLE and self.plugin_manager: + try: + return PluginsView(self) + except Exception as e: + print(f"[PerfectUX] Failed to create PluginsView: {e}") + + # Fallback to placeholder container = QWidget() layout = QVBoxLayout(container) layout.setContentsMargins(32, 32, 32, 32) @@ -1015,6 +1054,14 @@ class PerfectMainWindow(QMainWindow): def _create_settings_view(self) -> QWidget: """Create the Settings view.""" + # Try to use the actual SettingsView if available + if SETTINGS_VIEW_AVAILABLE: + try: + return SettingsView(self) + except Exception as e: + print(f"[PerfectUX] Failed to create SettingsView: {e}") + + # Fallback to placeholder container = QWidget() layout = QVBoxLayout(container) layout.setContentsMargins(32, 32, 32, 32)