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
This commit is contained in:
parent
77e9f3d5f5
commit
3bf2d9d5b1
|
|
@ -43,6 +43,25 @@ from PyQt6.QtWidgets import QGraphicsOpacityEffect
|
||||||
from core.eu_styles import get_all_colors
|
from core.eu_styles import get_all_colors
|
||||||
from core.icon_manager import get_icon_manager
|
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
|
# DESIGN TOKENS - Material Design 3 Inspired
|
||||||
|
|
@ -720,6 +739,10 @@ class PerfectMainWindow(QMainWindow):
|
||||||
self._current_view = "dashboard"
|
self._current_view = "dashboard"
|
||||||
self.icon_manager = get_icon_manager()
|
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_window()
|
||||||
self._setup_ui()
|
self._setup_ui()
|
||||||
self._setup_shortcuts()
|
self._setup_shortcuts()
|
||||||
|
|
@ -819,7 +842,15 @@ class PerfectMainWindow(QMainWindow):
|
||||||
self._create_status_bar()
|
self._create_status_bar()
|
||||||
|
|
||||||
def _create_dashboard_view(self) -> QWidget:
|
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 = QScrollArea()
|
||||||
scroll.setWidgetResizable(True)
|
scroll.setWidgetResizable(True)
|
||||||
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||||
|
|
@ -965,6 +996,14 @@ class PerfectMainWindow(QMainWindow):
|
||||||
|
|
||||||
def _create_plugins_view(self) -> QWidget:
|
def _create_plugins_view(self) -> QWidget:
|
||||||
"""Create the Plugins view."""
|
"""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()
|
container = QWidget()
|
||||||
layout = QVBoxLayout(container)
|
layout = QVBoxLayout(container)
|
||||||
layout.setContentsMargins(32, 32, 32, 32)
|
layout.setContentsMargins(32, 32, 32, 32)
|
||||||
|
|
@ -1015,6 +1054,14 @@ class PerfectMainWindow(QMainWindow):
|
||||||
|
|
||||||
def _create_settings_view(self) -> QWidget:
|
def _create_settings_view(self) -> QWidget:
|
||||||
"""Create the Settings view."""
|
"""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()
|
container = QWidget()
|
||||||
layout = QVBoxLayout(container)
|
layout = QVBoxLayout(container)
|
||||||
layout.setContentsMargins(32, 32, 32, 32)
|
layout.setContentsMargins(32, 32, 32, 32)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue