MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / start

Method start

src/plugins/debugger/debuggerplugin.cpp:31–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31bool DebuggerPlugin::start()
32{
33 auto &ctx = dpfInstance.serviceContext();
34 windowService = ctx.service<WindowService>(WindowService::name());
35 if (!windowService) {
36 qCritical() << "Failed, can't found window service";
37 abort();
38 }
39
40 DebuggerService *debuggerService = ctx.service<DebuggerService>(DebuggerService::name());
41 if (!debuggerService) {
42 qCritical() << "Failed, can't found debugger service";
43 abort();
44 }
45
46 debugManager->initialize(windowService, debuggerService);
47
48 if (windowService->addNavigationItem) {
49 QAction *action = new QAction(MWNA_DEBUG, this);
50 action->setIcon(QIcon::fromTheme("debug-navigation"));
51 auto *actionImpl = new AbstractAction(action);
52 windowService->addNavigationItem(actionImpl, Priority::high);
53 windowService->registerWidgetToMode(mainWindow, new AbstractWidget(debugManager->getDebugMainPane()), CM_DEBUG, Position::Left, true, true);
54 windowService->bindWidgetToNavigation(mainWindow, actionImpl);
55 windowService->setDockHeaderName(mainWindow, tr("debug"));
56 auto localsPaneImpl = new AbstractWidget(debugManager->getLocalsPane());
57 QString variablesPane = tr("Variables Watcher");
58 windowService->addWidgetRightspace(variablesPane, localsPaneImpl, "");
59 connect(action, &QAction::triggered, this, [=]() {
60 if (debugManager->getRunState() != AbstractDebugger::kNoRun)
61 windowService->showWidgetAtRightspace(variablesPane);
62 }, Qt::DirectConnection);
63 connect(debugManager, &DebugManager::debugStarted, this, [=](){
64 uiController.doSwitch(MWNA_DEBUG);
65 windowService->showWidgetAtRightspace(variablesPane);
66 uiController.switchContext(tr("&Application Output"));
67 }, Qt::DirectConnection);
68 }
69
70 return true;
71}
72
73dpf::Plugin::ShutdownFlag DebuggerPlugin::stop()
74{

Callers

nothing calls this directly

Calls 12

abortFunction · 0.85
connectFunction · 0.85
addNavigationItemMethod · 0.80
registerWidgetToModeMethod · 0.80
nameFunction · 0.50
initializeMethod · 0.45
setIconMethod · 0.45
getDebugMainPaneMethod · 0.45
setDockHeaderNameMethod · 0.45
getLocalsPaneMethod · 0.45
getRunStateMethod · 0.45

Tested by

no test coverage detected