forked from qt-creator/qt-creator
MinimizableInfoBars: Move to Utils
Change-Id: I6b42948c4bddaa396122b845c5c1e2aa70d8aaad Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -88,6 +88,8 @@ add_qtc_library(Utils
|
|||||||
macroexpander.cpp macroexpander.h
|
macroexpander.cpp macroexpander.h
|
||||||
mapreduce.h
|
mapreduce.h
|
||||||
mimeutils.h
|
mimeutils.h
|
||||||
|
minimizableinfobars.cpp
|
||||||
|
minimizableinfobars.h
|
||||||
multitextcursor.cpp multitextcursor.h
|
multitextcursor.cpp multitextcursor.h
|
||||||
namevaluedictionary.cpp namevaluedictionary.h
|
namevaluedictionary.cpp namevaluedictionary.h
|
||||||
namevaluedictionary.cpp namevaluedictionary.h
|
namevaluedictionary.cpp namevaluedictionary.h
|
||||||
|
@@ -216,6 +216,11 @@ void InfoBar::initialize(QSettings *settings)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSettings *InfoBar::settings()
|
||||||
|
{
|
||||||
|
return m_settings;
|
||||||
|
}
|
||||||
|
|
||||||
void InfoBar::clearGloballySuppressed()
|
void InfoBar::clearGloballySuppressed()
|
||||||
{
|
{
|
||||||
globallySuppressed.clear();
|
globallySuppressed.clear();
|
||||||
|
@@ -124,6 +124,7 @@ public:
|
|||||||
static bool anyGloballySuppressed();
|
static bool anyGloballySuppressed();
|
||||||
|
|
||||||
static void initialize(QSettings *settings);
|
static void initialize(QSettings *settings);
|
||||||
|
static QSettings *settings();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2017 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator.
|
** This file is part of Qt Creator.
|
||||||
@@ -23,23 +23,18 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "cppminimizableinfobars.h"
|
#include "minimizableinfobars.h"
|
||||||
|
|
||||||
|
#include "qtcassert.h"
|
||||||
|
#include "qtcsettings.h"
|
||||||
|
#include "utilsicons.h"
|
||||||
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <utils/infobar.h>
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
#include <utils/utilsicons.h>
|
|
||||||
|
|
||||||
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
||||||
const bool kShowInInfoBarDefault = true;
|
const bool kShowInInfoBarDefault = true;
|
||||||
|
|
||||||
using namespace Core;
|
namespace Utils {
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
namespace CppEditor {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
MinimizableInfoBars::MinimizableInfoBars(InfoBar &infoBar)
|
MinimizableInfoBars::MinimizableInfoBars(InfoBar &infoBar)
|
||||||
: m_infoBar(infoBar)
|
: m_infoBar(infoBar)
|
||||||
@@ -147,13 +142,15 @@ void MinimizableInfoBars::showInfoBar(const Id &id)
|
|||||||
|
|
||||||
bool MinimizableInfoBars::showInInfoBar(const Id &id) const
|
bool MinimizableInfoBars::showInInfoBar(const Id &id) const
|
||||||
{
|
{
|
||||||
return ICore::settings()->value(settingsKey(id), kShowInInfoBarDefault).toBool();
|
return InfoBar::settings()->value(settingsKey(id), kShowInInfoBarDefault).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show)
|
void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show)
|
||||||
{
|
{
|
||||||
ICore::settings()->setValueWithDefault(settingsKey(id), show, kShowInInfoBarDefault);
|
QtcSettings::setValueWithDefault(InfoBar::settings(),
|
||||||
|
settingsKey(id),
|
||||||
|
show,
|
||||||
|
kShowInInfoBarDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Utils
|
||||||
} // namespace CppEditor
|
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator.
|
** This file is part of Qt Creator.
|
||||||
@@ -25,8 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/id.h>
|
#include "utils_global.h"
|
||||||
#include <utils/infobar.h>
|
|
||||||
|
#include "id.h"
|
||||||
|
#include "infobar.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
@@ -34,10 +36,9 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
namespace CppEditor {
|
namespace Utils {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class MinimizableInfoBars : public QObject
|
class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -73,5 +74,4 @@ private:
|
|||||||
QHash<Utils::Id, Utils::InfoBarEntry> m_infoEntries;
|
QHash<Utils::Id, Utils::InfoBarEntry> m_infoEntries;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Utils
|
||||||
} // namespace CppEditor
|
|
@@ -182,6 +182,8 @@ Project {
|
|||||||
"macroexpander.h",
|
"macroexpander.h",
|
||||||
"mapreduce.h",
|
"mapreduce.h",
|
||||||
"mimeutils.h",
|
"mimeutils.h",
|
||||||
|
"minimizableinfobars.cpp",
|
||||||
|
"minimizableinfobars.h",
|
||||||
"multitextcursor.cpp",
|
"multitextcursor.cpp",
|
||||||
"multitextcursor.h",
|
"multitextcursor.h",
|
||||||
"namevaluedictionary.cpp",
|
"namevaluedictionary.cpp",
|
||||||
|
@@ -60,7 +60,6 @@ add_qtc_plugin(CppEditor
|
|||||||
cpplocalsymbols.cpp cpplocalsymbols.h
|
cpplocalsymbols.cpp cpplocalsymbols.h
|
||||||
cpplocatordata.cpp cpplocatordata.h
|
cpplocatordata.cpp cpplocatordata.h
|
||||||
cpplocatorfilter.cpp cpplocatorfilter.h
|
cpplocatorfilter.cpp cpplocatorfilter.h
|
||||||
cppminimizableinfobars.cpp cppminimizableinfobars.h
|
|
||||||
cppmodelmanager.cpp cppmodelmanager.h
|
cppmodelmanager.cpp cppmodelmanager.h
|
||||||
cppmodelmanagersupport.cpp cppmodelmanagersupport.h
|
cppmodelmanagersupport.cpp cppmodelmanagersupport.h
|
||||||
cppoutline.cpp cppoutline.h
|
cppoutline.cpp cppoutline.h
|
||||||
|
@@ -138,8 +138,6 @@ QtcPlugin {
|
|||||||
"cpplocatordata.h",
|
"cpplocatordata.h",
|
||||||
"cpplocatorfilter.cpp",
|
"cpplocatorfilter.cpp",
|
||||||
"cpplocatorfilter.h",
|
"cpplocatorfilter.h",
|
||||||
"cppminimizableinfobars.cpp",
|
|
||||||
"cppminimizableinfobars.h",
|
|
||||||
"cppmodelmanager.cpp",
|
"cppmodelmanager.cpp",
|
||||||
"cppmodelmanager.h",
|
"cppmodelmanager.h",
|
||||||
"cppmodelmanagersupport.cpp",
|
"cppmodelmanagersupport.cpp",
|
||||||
|
@@ -413,7 +413,7 @@ QFuture<CursorInfo> CppEditorDocument::cursorInfo(const CursorInfoParams ¶ms
|
|||||||
return processor()->cursorInfo(params);
|
return processor()->cursorInfo(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MinimizableInfoBars &CppEditorDocument::minimizableInfoBars() const
|
const Utils::MinimizableInfoBars &CppEditorDocument::minimizableInfoBars() const
|
||||||
{
|
{
|
||||||
return m_minimizableInfoBars;
|
return m_minimizableInfoBars;
|
||||||
}
|
}
|
||||||
|
@@ -27,13 +27,13 @@
|
|||||||
|
|
||||||
#include "baseeditordocumentprocessor.h"
|
#include "baseeditordocumentprocessor.h"
|
||||||
#include "cppcompletionassistprovider.h"
|
#include "cppcompletionassistprovider.h"
|
||||||
#include "cppminimizableinfobars.h"
|
|
||||||
#include "cppmodelmanager.h"
|
#include "cppmodelmanager.h"
|
||||||
#include "cppparsecontext.h"
|
#include "cppparsecontext.h"
|
||||||
#include "cppsemanticinfo.h"
|
#include "cppsemanticinfo.h"
|
||||||
#include "editordocumenthandle.h"
|
#include "editordocumenthandle.h"
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
#include <utils/minimizableinfobars.h>
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
|
|
||||||
void scheduleProcessDocument();
|
void scheduleProcessDocument();
|
||||||
|
|
||||||
const MinimizableInfoBars &minimizableInfoBars() const;
|
const Utils::MinimizableInfoBars &minimizableInfoBars() const;
|
||||||
ParseContextModel &parseContextModel();
|
ParseContextModel &parseContextModel();
|
||||||
|
|
||||||
QFuture<CursorInfo> cursorInfo(const CursorInfoParams ¶ms);
|
QFuture<CursorInfo> cursorInfo(const CursorInfoParams ¶ms);
|
||||||
@@ -135,7 +135,7 @@ private:
|
|||||||
// (Un)Registration in CppModelManager
|
// (Un)Registration in CppModelManager
|
||||||
QScopedPointer<CppEditorDocumentHandle> m_editorDocumentHandle;
|
QScopedPointer<CppEditorDocumentHandle> m_editorDocumentHandle;
|
||||||
|
|
||||||
MinimizableInfoBars m_minimizableInfoBars;
|
Utils::MinimizableInfoBars m_minimizableInfoBars;
|
||||||
ParseContextModel m_parseContextModel;
|
ParseContextModel m_parseContextModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -39,7 +39,6 @@
|
|||||||
#include "cppfunctiondecldeflink.h"
|
#include "cppfunctiondecldeflink.h"
|
||||||
#include "cpphighlighter.h"
|
#include "cpphighlighter.h"
|
||||||
#include "cpplocalrenaming.h"
|
#include "cpplocalrenaming.h"
|
||||||
#include "cppminimizableinfobars.h"
|
|
||||||
#include "cppmodelmanager.h"
|
#include "cppmodelmanager.h"
|
||||||
#include "cpppreprocessordialog.h"
|
#include "cpppreprocessordialog.h"
|
||||||
#include "cppsemanticinfo.h"
|
#include "cppsemanticinfo.h"
|
||||||
|
Reference in New Issue
Block a user