forked from qt-creator/qt-creator
InfoBar: Enable resetting globally suppressed warnings
Change-Id: Id3f7a7f9794ac0cd2ef42107ce01f073a090de48 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -29,13 +29,14 @@
|
|||||||
|
|
||||||
#include "generalsettings.h"
|
#include "generalsettings.h"
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
|
#include "icore.h"
|
||||||
|
#include "infobar.h"
|
||||||
|
#include "editormanager/editormanager.h"
|
||||||
|
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/qtcolorbutton.h>
|
#include <utils/qtcolorbutton.h>
|
||||||
#include <utils/consoleprocess.h>
|
#include <utils/consoleprocess.h>
|
||||||
#include <utils/unixutils.h>
|
#include <utils/unixutils.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
@@ -139,6 +140,8 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
|
|
||||||
connect(m_page->resetColorButton, SIGNAL(clicked()),
|
connect(m_page->resetColorButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetInterfaceColor()));
|
this, SLOT(resetInterfaceColor()));
|
||||||
|
connect(m_page->resetWarningsButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(resetWarnings()));
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
connect(m_page->resetTerminalButton, SIGNAL(clicked()),
|
connect(m_page->resetTerminalButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetTerminal()));
|
this, SLOT(resetTerminal()));
|
||||||
@@ -202,6 +205,12 @@ void GeneralSettings::resetInterfaceColor()
|
|||||||
m_page->colorButton->setColor(StyleHelper::DEFAULT_BASE_COLOR);
|
m_page->colorButton->setColor(StyleHelper::DEFAULT_BASE_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralSettings::resetWarnings()
|
||||||
|
{
|
||||||
|
Core::InfoBar::clearGloballySuppressed();
|
||||||
|
QMessageBox::information(0, tr("Reset warnings"), tr("Done"));
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralSettings::resetTerminal()
|
void GeneralSettings::resetTerminal()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void resetInterfaceColor();
|
void resetInterfaceColor();
|
||||||
|
void resetWarnings();
|
||||||
void resetLanguage();
|
void resetLanguage();
|
||||||
void showHelpForFileBrowser();
|
void showHelpForFileBrowser();
|
||||||
void resetFileBrowser();
|
void resetFileBrowser();
|
||||||
|
|||||||
@@ -107,6 +107,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QPushButton" name="resetWarningsButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset warnings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -146,6 +146,12 @@ void InfoBar::initializeGloballySuppressed()
|
|||||||
globallySuppressed.insert(Id(id.toLatin1()));
|
globallySuppressed.insert(Id(id.toLatin1()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InfoBar::clearGloballySuppressed()
|
||||||
|
{
|
||||||
|
globallySuppressed.clear();
|
||||||
|
ICore::settings()->setValue(QLatin1String(C_SUPPRESSED_WARNINGS), QStringList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InfoBarDisplay::InfoBarDisplay(QObject *parent)
|
InfoBarDisplay::InfoBarDisplay(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
static void globallySuppressInfo(Id id);
|
static void globallySuppressInfo(Id id);
|
||||||
static void initializeGloballySuppressed();
|
static void initializeGloballySuppressed();
|
||||||
|
static void clearGloballySuppressed();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
|
|||||||
Reference in New Issue
Block a user