feat: simplify DSH tool navigation and remove account onboarding

This commit is contained in:
阿白叔 committed 2026-10-30 11:47:20 +08:00
1 parent 96227eed2e
commit f437df2a83
10 files changed
+109 -50

No files matched your search

@@ -5,9 +5,9 @@ from ..stop_control import StopControl
from shiboken6 import isValid
import time
from PySide6.QtCore import QElapsedTimer, QSettings, QSignalBlocker, QThreadPool, QTimer, Qt
from PySide6.QtGui import QAction
from PySide6.QtGui import QAction, QActionGroup
from PySide6.QtWidgets import (QApplication, QCheckBox, QDialog, QFileDialog, QHBoxLayout, QMainWindow, QMessageBox,
QPushButton, QLabel, QSplitter, QStackedWidget, QTabWidget, QVBoxLayout, QWidget)
QPushButton, QLabel, QSizePolicy, QSplitter, QStackedWidget, QTabWidget, QToolButton, QVBoxLayout, QWidget)
from ..errors import TaskCenterError
from ..models import TaskStatus
from ..version import VERSION
@@ -36,14 +36,29 @@ class TrialTaskCenterWindow(QMainWindow):
self._dsh = DshSupervisor(DshServiceAdapter(service).execute)
self._dsh_view = None
self._dsh_stopping = False
tools_menu = self.menuBar().addMenu('工具(&T)')
self.task_center_action = QAction('任务中心(&C)', self)
self.task_center_action = QAction('任务中心', self)
self.task_center_action.triggered.connect(lambda: self.content_stack.setCurrentIndex(0))
tools_menu.addAction(self.task_center_action)
self.dsh_action = QAction('DSH助手(&D)', self)
self.dsh_action = QAction('DSH助手', self)
self.dsh_action.setShortcut('Ctrl+Shift+D')
self.dsh_action.triggered.connect(self._open_dsh)
tools_menu.addAction(self.dsh_action)
self._navigation_actions = QActionGroup(self)
self._navigation_actions.setExclusive(True)
navigation = QWidget(objectName='toolNavigation')
navigation_layout = QHBoxLayout(navigation)
navigation_layout.setContentsMargins(12, 6, 12, 6)
navigation_layout.setSpacing(8)
for name, action in (('task_center_navigation', self.task_center_action), ('dsh_navigation', self.dsh_action)):
action.setCheckable(True)
self._navigation_actions.addAction(action)
self.addAction(action)
button = QToolButton(navigation)
button.setObjectName(name)
button.setDefaultAction(action)
button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
navigation_layout.addWidget(button, 1)
setattr(self, name, button)
self.task_center_action.setChecked(True)
self.setMenuWidget(navigation)
self._close_plan_confirmer = close_plan_confirmer or self._confirm_close_plans
self._close_pending = False
self._close_saving = False
@@ -186,6 +201,8 @@ class TrialTaskCenterWindow(QMainWindow):
layout.addWidget(self.workspace_splitter)
self.content_stack = QStackedWidget()
self.content_stack.addWidget(container)
self.content_stack.currentChanged.connect(lambda index: (
self.task_center_action if index == 0 else self.dsh_action).setChecked(True))
self.setCentralWidget(self.content_stack)
self._reset_layout()
@@ -35,6 +35,10 @@ QSplitter::handle { background: #bccbd8; border: 1px solid #e7edf2; }
QSplitter::handle:hover { background: #83abc9; }
QToolButton { background: #ffffff; border: 1px solid #aebdca; border-radius: 4px; padding: 4px 7px; }
QToolButton:hover { background: #edf4fa; }
QWidget#toolNavigation { background: #ffffff; border-bottom: 1px solid #e1e5ea; }
QWidget#toolNavigation QToolButton { min-height: 32px; border: 0; border-radius: 7px; padding: 2px 18px; color: #637083; }
QWidget#toolNavigation QToolButton:checked { background: #edf3ff; color: #2864d7; font-weight: 600; }
QWidget#toolNavigation QToolButton:hover { background: #f0f4fa; }
QLabel#statusLabel { color: #49616f; }
QTextEdit { padding: 5px; font-family: Consolas, "Courier New", monospace; }
"""