2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-07-15 10:29:38 +02:00
|
|
|
#include "buildstep.h"
|
2019-03-01 15:18:40 +01:00
|
|
|
#include "projectexplorersettings.h"
|
|
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <coreplugin/ioutputpane.h>
|
2010-06-30 16:39:32 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QHash>
|
2015-04-20 17:13:45 +02:00
|
|
|
#include <QPair>
|
2019-03-01 15:18:40 +01:00
|
|
|
#include <QPointer>
|
2010-06-30 16:39:32 +02:00
|
|
|
|
2010-01-25 15:09:16 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QPlainTextEdit;
|
2010-07-13 16:36:37 +02:00
|
|
|
class QTextCharFormat;
|
2012-03-28 22:23:03 +02:00
|
|
|
class QToolButton;
|
2010-01-25 15:09:16 +01:00
|
|
|
QT_END_NAMESPACE
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2018-11-16 08:59:57 +02:00
|
|
|
namespace Utils { class OutputFormatter; }
|
2013-09-03 06:47:17 +03:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
|
|
|
|
class BuildManager;
|
2010-06-30 16:39:32 +02:00
|
|
|
class Task;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-06-30 16:39:32 +02:00
|
|
|
class ShowOutputTaskHandler;
|
2010-06-25 10:41:49 +02:00
|
|
|
class CompileOutputTextEdit;
|
2010-06-30 16:39:32 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class CompileOutputWindow : public Core::IOutputPane
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2016-02-02 18:26:51 +01:00
|
|
|
explicit CompileOutputWindow(QAction *cancelBuildAction);
|
|
|
|
|
~CompileOutputWindow() override;
|
|
|
|
|
|
|
|
|
|
QWidget *outputWidget(QWidget *) override;
|
|
|
|
|
QList<QWidget *> toolBarWidgets() const override;
|
|
|
|
|
QString displayName() const override { return tr("Compile Output"); }
|
|
|
|
|
int priorityInStatusBar() const override;
|
|
|
|
|
void clearContents() override;
|
|
|
|
|
void visibilityChanged(bool visible) override;
|
|
|
|
|
bool canFocus() const override;
|
|
|
|
|
bool hasFocus() const override;
|
|
|
|
|
void setFocus() override;
|
|
|
|
|
|
|
|
|
|
bool canNext() const override;
|
|
|
|
|
bool canPrevious() const override;
|
|
|
|
|
void goToNext() override;
|
|
|
|
|
void goToPrev() override;
|
|
|
|
|
bool canNavigate() const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
void appendText(const QString &text, BuildStep::OutputFormat format);
|
2009-04-30 12:50:52 +02:00
|
|
|
|
2015-04-20 17:13:45 +02:00
|
|
|
void registerPositionOf(const Task &task, int linkedOutputLines, int skipLines);
|
2010-06-30 16:39:32 +02:00
|
|
|
bool knowsPositionOf(const Task &task);
|
|
|
|
|
void showPositionOf(const Task &task);
|
|
|
|
|
|
2013-09-03 06:47:17 +03:00
|
|
|
void flush();
|
|
|
|
|
|
2019-03-01 15:18:40 +01:00
|
|
|
const CompileOutputSettings &settings() const { return m_settings; }
|
|
|
|
|
void setSettings(const CompileOutputSettings &settings);
|
|
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2019-03-01 15:18:40 +01:00
|
|
|
void loadSettings();
|
|
|
|
|
void storeSettings() const;
|
2016-09-26 23:40:25 +02:00
|
|
|
void updateFromSettings();
|
2011-04-14 10:39:09 +02:00
|
|
|
|
2010-06-25 10:41:49 +02:00
|
|
|
CompileOutputTextEdit *m_outputWindow;
|
2015-04-20 17:13:45 +02:00
|
|
|
QHash<unsigned int, QPair<int, int>> m_taskPositions;
|
2016-02-02 18:26:51 +01:00
|
|
|
ShowOutputTaskHandler *m_handler;
|
2012-03-28 22:23:03 +02:00
|
|
|
QToolButton *m_cancelBuildButton;
|
2019-03-12 10:18:14 +01:00
|
|
|
QToolButton * const m_settingsButton;
|
2018-11-16 08:59:57 +02:00
|
|
|
Utils::OutputFormatter *m_formatter;
|
2019-03-01 15:18:40 +01:00
|
|
|
CompileOutputSettings m_settings;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CompileOutputSettingsPage : public Core::IOptionsPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CompileOutputSettingsPage();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QWidget *widget() override;
|
|
|
|
|
void apply() override;
|
|
|
|
|
void finish() override;
|
|
|
|
|
|
|
|
|
|
class SettingsWidget;
|
|
|
|
|
QPointer<SettingsWidget> m_widget;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|