MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / TasksWidget

Method TasksWidget

AdaptixClient/Source/UI/Widgets/TasksWidget.cpp:54–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54TasksWidget::TasksWidget( AdaptixWidget* w )
55{
56 this->adaptixWidget = w;
57
58 this->createUI();
59
60 taskOutputConsole = new TaskOutputWidget();
61
62 dockWidgetTable = new KDDockWidgets::QtWidgets::DockWidget( + "Tasks:Dock-" + w->GetProfile()->GetProject(), KDDockWidgets::DockWidgetOption_None, KDDockWidgets::LayoutSaverOption::None);
63 dockWidgetTable->setTitle("Tasks");
64 dockWidgetTable->setWidget(this);
65 dockWidgetTable->setIcon(QIcon( ":/icons/job" ), KDDockWidgets::IconPlace::TabBar);
66
67 dockWidgetOutput = new KDDockWidgets::QtWidgets::DockWidget( + "Task Output:Dock-" + w->GetProfile()->GetProject(), KDDockWidgets::DockWidgetOption_None, KDDockWidgets::LayoutSaverOption::None);
68 dockWidgetOutput->setTitle("Task Output");
69 dockWidgetOutput->setWidget(taskOutputConsole);
70 dockWidgetOutput->setIcon(QIcon( ":/icons/job" ), KDDockWidgets::IconPlace::TabBar);
71
72 connect(tableView, &QTableView::customContextMenuRequested, this, &TasksWidget::handleTasksMenu);
73 connect(tableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this](const QItemSelection &selected, const QItemSelection &deselected){
74 Q_UNUSED(selected)
75 Q_UNUSED(deselected)
76 if (!inputFilter->hasFocus())
77 tableView->setFocus();
78 });
79
80 connect(tableView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &TasksWidget::onTableItemSelection);
81 connect(inputFilter, &QLineEdit::textChanged, this, &TasksWidget::onFilterChanged);
82 connect(inputFilter, &QLineEdit::returnPressed, this, [this]() { proxyModel->setTextFilter(inputFilter->text()); });
83 connect(comboAgent, &QComboBox::currentTextChanged, this, &TasksWidget::onFilterChanged);
84 connect(comboType, &QComboBox::currentTextChanged, this, &TasksWidget::onFilterChanged);
85 connect(comboStatus, &QComboBox::currentTextChanged, this, &TasksWidget::onFilterChanged);
86 connect(hideButton, &ClickableLabel::clicked, this, &TasksWidget::toggleSearchPanel);
87
88 shortcutSearch = new QShortcut(QKeySequence("Ctrl+F"), this);
89 shortcutSearch->setContext(Qt::WidgetWithChildrenShortcut);
90 connect(shortcutSearch, &QShortcut::activated, this, &TasksWidget::toggleSearchPanel);
91
92 auto shortcutEsc = new QShortcut(QKeySequence(Qt::Key_Escape), inputFilter);
93 shortcutEsc->setContext(Qt::WidgetShortcut);
94 connect(shortcutEsc, &QShortcut::activated, this, [this]() { searchWidget->setVisible(false); });
95}
96
97TasksWidget::~TasksWidget()
98{

Callers

nothing calls this directly

Calls 12

GetProjectMethod · 0.80
hasFocusMethod · 0.80
setFocusMethod · 0.80
setContextMethod · 0.80
createUIMethod · 0.45
GetProfileMethod · 0.45
setTitleMethod · 0.45
setWidgetMethod · 0.45
setIconMethod · 0.45
setTextFilterMethod · 0.45
textMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected