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

Method contextMenuEvent

src/plugins/console/consolewidget.cpp:82–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void ConsoleWidget::contextMenuEvent(QContextMenuEvent *event)
83{
84 if (nullptr == d->menu) {
85 d->menu = new DMenu(this);
86 d->menu->setParent(this);
87 d->menu->addAction(d->consoleCopy);
88 d->menu->addAction(d->consolePaste);
89 d->menu->addAction(d->showInputWidget);
90 d->menu->addAction(d->enterCurrentPath);
91 }
92 if (selectedText().isEmpty()) {
93 d->consoleCopy->setEnabled(false);
94 } else {
95 d->consoleCopy->setEnabled(true);
96 }
97
98 if (d->prjService->getActiveProjectInfo().isEmpty())
99 d->enterCurrentPath->setEnabled(false);
100 else
101 d->enterCurrentPath->setEnabled(true);
102
103 d->menu->exec(event->globalPos());
104}
105
106void ConsoleWidget::updateColorScheme(DGuiApplicationHelper::ColorType themetype)
107{

Callers

nothing calls this directly

Calls 5

addActionMethod · 0.45
isEmptyMethod · 0.45
setEnabledMethod · 0.45
getActiveProjectInfoMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected