summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/configtaskhandler.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-06-20 15:02:34 +0200
committerTobias Hunger <tobias.hunger@digia.com>2014-06-23 15:04:16 +0200
commit71df641046f4d0b708ace17aa0f98846b2e89049 (patch)
tree74cc2fd77bc8c03a473ed64d4ab6c72541e12a9d /src/plugins/projectexplorer/configtaskhandler.cpp
parent4eb2908c44033f884b82560360440ebb3269af63 (diff)
downloadqt-creator-71df641046f4d0b708ace17aa0f98846b2e89049.tar.gz
TaskHandler: Add task handler that let's you jump into the configuration
... wire it up so that "No compiler found in kit" gets you to the kits page. Change-Id: Ie7b34d285a6d2eef81ccd5fdc86d91bcd0254515 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/configtaskhandler.cpp')
-rw-r--r--src/plugins/projectexplorer/configtaskhandler.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/configtaskhandler.cpp b/src/plugins/projectexplorer/configtaskhandler.cpp
new file mode 100644
index 0000000000..30c7c58b60
--- /dev/null
+++ b/src/plugins/projectexplorer/configtaskhandler.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include "configtaskhandler.h"
+
+#include "task.h"
+#include "taskhub.h"
+
+#include <coreplugin/icore.h>
+
+#include <QAction>
+
+#include <utils/qtcassert.h>
+
+using namespace ProjectExplorer::Internal;
+
+ConfigTaskHandler::ConfigTaskHandler(const Task &pattern, Core::Id group, Core::Id page) :
+ m_pattern(pattern),
+ m_targetGroup(group),
+ m_targetPage(page)
+{ }
+
+bool ConfigTaskHandler::canHandle(const ProjectExplorer::Task &task) const
+{
+ return task.description == m_pattern.description
+ && task.category == m_pattern.category;
+}
+
+void ConfigTaskHandler::handle(const ProjectExplorer::Task &task)
+{
+ Q_UNUSED(task);
+ Core::ICore::showOptionsDialog(m_targetGroup, m_targetPage);
+}
+
+QAction *ConfigTaskHandler::createAction(QObject *parent) const
+{
+ QAction *action = new QAction(Core::ICore::msgShowOptionsDialog(), parent);
+ action->setToolTip(Core::ICore::msgShowOptionsDialogToolTip());
+ return action;
+}