Files
qt-creator/src/plugins/coreplugin/mainwindow.h
Eike Ziller 2db21dc201 Split general settings page in two
It was too crowded to add anything to it. Split it into "interface" and
"system" related pages.

Change-Id: I2aa7984de4d672ca000e991b0cfb32a3f706c988
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-09-01 10:48:12 +00:00

204 lines
5.8 KiB
C++

/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** 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 The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/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 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "icontext.h"
#include "icore.h"
#include <utils/appmainwindow.h>
#include <utils/dropsupport.h>
#include <QMap>
#include <QColor>
QT_BEGIN_NAMESPACE
class QSettings;
class QPrinter;
class QToolButton;
QT_END_NAMESPACE
namespace Core {
class StatusBarWidget;
class EditorManager;
class ExternalToolManager;
class DocumentManager;
class HelpManager;
class IDocument;
class IWizardFactory;
class JsExpander;
class MessageManager;
class ModeManager;
class ProgressManager;
class NavigationWidget;
class RightPaneWidget;
class SettingsDatabase;
class VcsManager;
namespace Internal {
class FancyTabWidget;
class GeneralSettings;
class ProgressManagerPrivate;
class ShortcutSettings;
class ToolSettings;
class MimeTypeSettings;
class StatusBarManager;
class VersionDialog;
class WindowSupport;
class SystemEditor;
class SystemSettings;
class MainWindow : public Utils::AppMainWindow
{
Q_OBJECT
public:
MainWindow();
~MainWindow();
bool init(QString *errorMessage);
void extensionsInitialized();
void aboutToShutdown();
IContext *contextObject(QWidget *widget);
void addContextObject(IContext *context);
void removeContextObject(IContext *context);
IDocument *openFiles(const QStringList &fileNames,
ICore::OpenFilesFlags flags,
const QString &workingDirectory = QString());
inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; }
virtual QPrinter *printer() const;
IContext * currentContextObject() const;
QStatusBar *statusBar() const;
void updateAdditionalContexts(const Context &remove, const Context &add);
void setSuppressNavigationWidget(bool suppress);
void setOverrideColor(const QColor &color);
signals:
void newItemDialogRunningChanged();
public slots:
void openFileWith();
void exit();
bool showOptionsDialog(Id page = Id(), QWidget *parent = 0);
bool showWarningWithOptions(const QString &title, const QString &text,
const QString &details = QString(),
Id settingsId = Id(),
QWidget *parent = 0);
protected:
virtual void closeEvent(QCloseEvent *event);
private slots:
void openFile();
void aboutToShowRecentFiles();
void setFocusToEditor();
void saveAll();
void aboutQtCreator();
void aboutPlugins();
void updateFocusWidget(QWidget *old, QWidget *now);
void setSidebarVisible(bool visible);
void destroyVersionDialog();
void openDroppedFiles(const QList<Utils::DropSupport::FileSpec> &files);
void restoreWindowState();
void newItemDialogFinished();
private:
void updateContextObject(const QList<IContext *> &context);
void updateContext();
void registerDefaultContainers();
void registerDefaultActions();
void readSettings();
void writeSettings();
ICore *m_coreImpl;
Context m_additionalContexts;
SettingsDatabase *m_settingsDatabase;
mutable QPrinter *m_printer;
WindowSupport *m_windowSupport;
EditorManager *m_editorManager;
ExternalToolManager *m_externalToolManager;
MessageManager *m_messageManager;
ProgressManagerPrivate *m_progressManager;
JsExpander *m_jsExpander;
VcsManager *m_vcsManager;
StatusBarManager *m_statusBarManager;
ModeManager *m_modeManager;
HelpManager *m_helpManager;
FancyTabWidget *m_modeStack;
NavigationWidget *m_navigationWidget;
RightPaneWidget *m_rightPaneWidget;
StatusBarWidget *m_outputView;
VersionDialog *m_versionDialog;
QList<IContext *> m_activeContext;
QMap<QWidget *, IContext *> m_contextWidgets;
GeneralSettings *m_generalSettings;
SystemSettings *m_systemSettings;
ShortcutSettings *m_shortcutSettings;
ToolSettings *m_toolSettings;
MimeTypeSettings *m_mimeTypeSettings;
SystemEditor *m_systemEditor;
// actions
QAction *m_focusToEditor;
QAction *m_newAction;
QAction *m_openAction;
QAction *m_openWithAction;
QAction *m_saveAllAction;
QAction *m_exitAction;
QAction *m_optionsAction;
QAction *m_toggleSideBarAction;
QAction *m_toggleModeSelectorAction;
QAction *m_themeAction;
QToolButton *m_toggleSideBarButton;
QColor m_overrideColor;
};
} // namespace Internal
} // namespace Core
#endif // MAINWINDOW_H