Merge branch 'feat/9-restart-claude-desktop' into integration/v1.2.0

# Conflicts:
#	bcc_core.py
#	tests/test_core.py
This commit is contained in:
Cowork Supervisor
2026-07-07 22:12:35 -04:00
3 changed files with 292 additions and 1 deletions
+37 -1
View File
@@ -1265,9 +1265,19 @@ class MainWindow(QMainWindow):
root.addLayout(self._build_actionbar())
status_row = QHBoxLayout()
status_row.setContentsMargins(0, 0, 0, 0)
self.status = QLabel("Ready.")
self.status.setObjectName("statusbar")
root.addWidget(self.status)
status_row.addWidget(self.status, 1)
self.restart_btn = QPushButton("Restart Claude Desktop")
self.restart_btn.setToolTip(
"Quit and relaunch Claude Desktop so the saved config takes effect"
)
self.restart_btn.clicked.connect(self._restart_claude_desktop)
self.restart_btn.hide()
status_row.addWidget(self.restart_btn)
root.addLayout(status_row)
self._restore_layout()
self.reload_profiles()
@@ -1514,6 +1524,7 @@ class MainWindow(QMainWindow):
self.current_profile = profile
self.servers = core.extract_servers(self.full_config)
self.dirty = False
self.restart_btn.hide()
self._undo_stack.clear()
self.undo_btn.setEnabled(False)
self._refresh_tables(select_index=0 if self.servers else -1)
@@ -1890,6 +1901,7 @@ class MainWindow(QMainWindow):
f"Merged & saved {self.current_profile.path}{bnote}"
f" · Restart {self.current_profile.label} to apply."
)
self._offer_restart_button()
return
# else OVERWRITE: fall through to normal write
@@ -1907,6 +1919,29 @@ class MainWindow(QMainWindow):
self.status.setText(
f"Saved {self.current_profile.path}{bnote} · Restart {self.current_profile.label} to apply."
)
self._offer_restart_button()
# --- restart Claude Desktop (issue #9) -------------------------------- #
def _offer_restart_button(self):
"""Show the 'Restart Claude Desktop' button after a successful save,
but only when the just-saved profile is Claude Desktop -- restarting
makes no sense for Claude Code, which has no GUI process to bounce."""
if self.current_profile and core.profile_targets_claude_desktop(self.current_profile):
self.restart_btn.show()
else:
self.restart_btn.hide()
def _restart_claude_desktop(self):
self.restart_btn.setEnabled(False)
try:
result = core.restart_claude_desktop()
finally:
self.restart_btn.setEnabled(True)
self.restart_btn.hide()
if result.success:
self.status.setText(f"{self.status.text()} · {result.detail}")
else:
QMessageBox.warning(self, "Restart failed", result.detail)
def _restore_from_backup(self):
if not self.current_profile:
@@ -1935,6 +1970,7 @@ class MainWindow(QMainWindow):
# --- dirty / status -------------------------------------------------- #
def _mark_dirty(self):
self.dirty = True
self.restart_btn.hide()
self._validate()
self._update_status(saved=False)