| 52 | |
| 53 | |
| 54 | TasksWidget::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 | |
| 97 | TasksWidget::~TasksWidget() |
| 98 | { |
nothing calls this directly
no test coverage detected