2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2012-10-05 12:27:27 +02:00
|
|
|
|
|
|
|
|
#include "removetaskhandler.h"
|
|
|
|
|
|
|
|
|
|
#include "task.h"
|
|
|
|
|
#include "taskhub.h"
|
|
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
|
2014-10-13 22:37:28 +03:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
namespace Internal {
|
2012-10-05 12:27:27 +02:00
|
|
|
|
2021-12-13 12:06:11 +01:00
|
|
|
void RemoveTaskHandler::handle(const Tasks &tasks)
|
2012-10-05 12:27:27 +02:00
|
|
|
{
|
2021-12-13 12:06:11 +01:00
|
|
|
for (const Task &task : tasks)
|
|
|
|
|
TaskHub::removeTask(task);
|
2012-10-05 12:27:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QAction *RemoveTaskHandler::createAction(QObject *parent) const
|
|
|
|
|
{
|
|
|
|
|
QAction *removeAction = new QAction(tr("Remove", "Name of the action triggering the removetaskhandler"), parent);
|
2014-03-13 09:55:53 +01:00
|
|
|
removeAction->setToolTip(tr("Remove task from the task list."));
|
2020-03-09 10:30:41 +01:00
|
|
|
removeAction->setShortcuts({QKeySequence::Delete, QKeySequence::Backspace});
|
2012-10-05 14:37:05 +02:00
|
|
|
removeAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
2012-10-05 12:27:27 +02:00
|
|
|
return removeAction;
|
|
|
|
|
}
|
2014-10-13 22:37:28 +03:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|