2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-12-02 17:43:14 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-12-02 17:43:14 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-12-02 17:43:14 +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.
|
2010-12-02 17:43:14 +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
|
|
|
****************************************************************************/
|
2010-12-02 17:43:14 +01:00
|
|
|
|
2013-03-12 11:48:25 +01:00
|
|
|
#ifndef DEBUGGERMAINWINDOW_H
|
|
|
|
|
#define DEBUGGERMAINWINDOW_H
|
2010-12-02 17:43:14 +01:00
|
|
|
|
|
|
|
|
#include "debugger_global.h"
|
2016-02-29 18:15:36 +01:00
|
|
|
#include "analyzer/analyzerbase_global.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/id.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/fancymainwindow.h>
|
|
|
|
|
#include <utils/statuslabel.h>
|
|
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
#include <QSet>
|
|
|
|
|
|
|
|
|
|
#include <functional>
|
2016-03-01 07:51:06 +01:00
|
|
|
#include <initializer_list>
|
2016-02-29 18:15:36 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QComboBox;
|
|
|
|
|
class QStackedWidget;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Analyzer {
|
|
|
|
|
|
|
|
|
|
class ANALYZER_EXPORT Perspective
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-03-02 14:39:20 +01:00
|
|
|
enum OperationType { SplitVertical, SplitHorizontal, AddToTab, Raise };
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-02 14:39:20 +01:00
|
|
|
class ANALYZER_EXPORT Operation
|
2016-03-01 07:51:06 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2016-03-02 14:39:20 +01:00
|
|
|
Operation() = default;
|
|
|
|
|
Operation(Core::Id dockId, Core::Id existing, OperationType operationType,
|
2016-03-01 07:51:06 +01:00
|
|
|
bool visibleByDefault = true,
|
|
|
|
|
Qt::DockWidgetArea area = Qt::BottomDockWidgetArea);
|
|
|
|
|
|
2016-02-29 18:15:36 +01:00
|
|
|
Core::Id dockId;
|
2016-03-01 07:51:06 +01:00
|
|
|
Core::Id existing;
|
2016-03-02 14:39:20 +01:00
|
|
|
OperationType operationType;
|
2016-02-29 18:15:36 +01:00
|
|
|
bool visibleByDefault;
|
|
|
|
|
Qt::DockWidgetArea area;
|
|
|
|
|
};
|
|
|
|
|
|
2016-03-01 07:51:06 +01:00
|
|
|
Perspective() = default;
|
2016-03-02 14:39:20 +01:00
|
|
|
Perspective(std::initializer_list<Operation> operations);
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-02 14:39:20 +01:00
|
|
|
void addOperation(const Operation &operation);
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-02 14:39:20 +01:00
|
|
|
QVector<Operation> operations() const { return m_operations; }
|
2016-03-01 07:51:06 +01:00
|
|
|
QVector<Core::Id> docks() const { return m_docks; }
|
2016-02-29 18:15:36 +01:00
|
|
|
|
|
|
|
|
private:
|
2016-03-01 07:51:06 +01:00
|
|
|
QVector<Core::Id> m_docks;
|
2016-03-02 14:39:20 +01:00
|
|
|
QVector<Operation> m_operations;
|
2016-02-29 18:15:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Analyzer
|
2010-12-02 17:43:14 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
2014-12-12 15:33:16 +01:00
|
|
|
|
2013-04-23 17:24:40 +02:00
|
|
|
// DebuggerMainWindow dock widget names
|
|
|
|
|
const char DOCKWIDGET_BREAK[] = "Debugger.Docks.Break";
|
|
|
|
|
const char DOCKWIDGET_MODULES[] = "Debugger.Docks.Modules";
|
|
|
|
|
const char DOCKWIDGET_REGISTER[] = "Debugger.Docks.Register";
|
|
|
|
|
const char DOCKWIDGET_OUTPUT[] = "Debugger.Docks.Output";
|
|
|
|
|
const char DOCKWIDGET_SNAPSHOTS[] = "Debugger.Docks.Snapshots";
|
|
|
|
|
const char DOCKWIDGET_STACK[] = "Debugger.Docks.Stack";
|
|
|
|
|
const char DOCKWIDGET_SOURCE_FILES[] = "Debugger.Docks.SourceFiles";
|
|
|
|
|
const char DOCKWIDGET_THREADS[] = "Debugger.Docks.Threads";
|
|
|
|
|
const char DOCKWIDGET_WATCHERS[] = "Debugger.Docks.LocalsAndWatchers";
|
2016-03-01 07:51:06 +01:00
|
|
|
|
|
|
|
|
const char CppPerspectiveId[] = "Debugger.Perspective.Cpp";
|
|
|
|
|
const char QmlPerspectiveId[] = "Debugger.Perspective.Qml";
|
2010-12-02 17:43:14 +01:00
|
|
|
|
2016-02-29 18:15:36 +01:00
|
|
|
class MainWindowBase : public Utils::FancyMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MainWindowBase();
|
|
|
|
|
~MainWindowBase() override;
|
|
|
|
|
|
|
|
|
|
QComboBox *toolBox() const { return m_toolBox; }
|
|
|
|
|
QStackedWidget *controlsStack() const { return m_controlsStackWidget; }
|
2016-03-02 13:23:30 +01:00
|
|
|
Utils::StatusLabel *statusLabel() const { return m_statusLabel; }
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-01 07:51:06 +01:00
|
|
|
void registerPerspective(Core::Id perspectiveId, const Analyzer::Perspective &perspective);
|
|
|
|
|
void registerToolbar(Core::Id perspectiveId, QWidget *widget);
|
|
|
|
|
QDockWidget *registerDockWidget(Core::Id dockId, QWidget *widget);
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-01 07:51:06 +01:00
|
|
|
void saveCurrentPerspective();
|
|
|
|
|
void closeCurrentPerspective();
|
|
|
|
|
void resetCurrentPerspective();
|
|
|
|
|
void restorePerspective(Core::Id perspectiveId);
|
2016-02-29 18:15:36 +01:00
|
|
|
|
2016-03-02 13:23:30 +01:00
|
|
|
void showStatusMessage(const QString &message, int timeoutMS);
|
2016-02-29 18:15:36 +01:00
|
|
|
|
|
|
|
|
QString lastSettingsName() const;
|
|
|
|
|
void setLastSettingsName(const QString &lastSettingsName);
|
|
|
|
|
|
2016-03-01 07:51:06 +01:00
|
|
|
Core::Id currentPerspectiveId() const;
|
2016-02-29 18:15:36 +01:00
|
|
|
|
|
|
|
|
private:
|
2016-03-01 07:51:06 +01:00
|
|
|
void loadPerspectiveHelper(Core::Id perspectiveId, bool fromStoredSettings = true);
|
|
|
|
|
|
|
|
|
|
Core::Id m_currentPerspectiveId;
|
2016-02-29 18:15:36 +01:00
|
|
|
QString m_lastSettingsName;
|
|
|
|
|
QComboBox *m_toolBox;
|
|
|
|
|
QStackedWidget *m_controlsStackWidget;
|
2016-03-02 13:23:30 +01:00
|
|
|
Utils::StatusLabel *m_statusLabel;
|
2016-02-29 18:15:36 +01:00
|
|
|
QHash<Core::Id, QDockWidget *> m_dockForDockId;
|
2016-03-01 07:51:06 +01:00
|
|
|
QHash<Core::Id, QWidget *> m_toolbarForPerspectiveId;
|
|
|
|
|
QHash<Core::Id, Analyzer::Perspective> m_perspectiveForPerspectiveId;
|
2016-02-29 18:15:36 +01:00
|
|
|
|
|
|
|
|
// list of dock widgets to prevent memory leak
|
|
|
|
|
typedef QPointer<QDockWidget> DockPtr;
|
|
|
|
|
QList<DockPtr> m_dockWidgets;
|
|
|
|
|
};
|
|
|
|
|
|
2016-02-29 12:11:18 +01:00
|
|
|
} // namespace Internal
|
2010-12-02 17:43:14 +01:00
|
|
|
} // namespace Debugger
|
|
|
|
|
|
2013-03-12 11:48:25 +01:00
|
|
|
#endif // DEBUGGERMAINWINDOW_H
|