Commit d6b12213 authored by Alessandro Portale's avatar Alessandro Portale

ProjectExplorer: Use constants for compile_warning.png and _error

Instead of repeating strings like
   ":/projectexplorer/images/compile_warning.png" all over the code,
we should use constants for it.

Change-Id: I91b36838d6da0a2332381e433788e796948d26db
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 75c14dab
......@@ -165,7 +165,7 @@ void AndroidManifestEditorWidget::initializePage()
m_packageNameWarning->setVisible(false);
m_packageNameWarningIcon = new QLabel;
m_packageNameWarningIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
m_packageNameWarningIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
m_packageNameWarningIcon->setVisible(false);
m_packageNameWarningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
......
......@@ -33,6 +33,7 @@
#include <utils/detailswidget.h>
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/kitinformation.h>
......@@ -91,7 +92,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
: Utils::DetailsWidget(parent)
{
setSummaryText(QLatin1String("<b>Android has not been configured. Create Android kits.</b>"));
setIcon(QIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")));
setIcon(QIcon(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
//detailsWidget->setState(Utils::DetailsWidget::NoSummary);
QWidget *mainWidget = new QWidget(this);
setWidget(mainWidget);
......
......@@ -29,6 +29,7 @@
#include "avddialog.h"
#include "androidconfigurations.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <QMessageBox>
......@@ -52,7 +53,7 @@ AvdDialog::AvdDialog(int minApiLevel, const QString &targetArch, const AndroidCo
QRegExp rx(QLatin1String("\\S+"));
QRegExpValidator v(rx, 0);
m_avdDialog.nameLineEdit->setValidator(&v);
m_avdDialog.warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
m_avdDialog.warningIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
updateApiLevelComboBox();
......
......@@ -32,6 +32,7 @@
#include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <proparser/prowriter.h>
#include <QComboBox>
#include <QFormLayout>
......@@ -110,7 +111,7 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
m_sourceDirectoryWarning->setWordWrap(true);
m_warningIcon = new QLabel(this);
m_warningIcon->setVisible(false);
m_warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
m_warningIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_ERROR)));
m_warningIcon->setWordWrap(true);
m_warningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
......
......@@ -86,7 +86,7 @@ void BareMetalRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
{
QHBoxLayout * const hl = new QHBoxLayout;
hl->addStretch();
d->disabledIcon.setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
d->disabledIcon.setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
hl->addWidget(&d->disabledIcon);
d->disabledReason.setVisible(false);
hl->addWidget(&d->disabledReason);
......
......@@ -85,8 +85,8 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation
m_errorIcon->setAlignment(Qt::AlignRight);
m_warningIcon->setAlignment(Qt::AlignRight);
m_errorIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
m_warningIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
m_errorIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_ERROR)));
m_warningIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
m_contentWidget->hide();
......
......@@ -73,7 +73,7 @@ void DesktopDeviceConfigurationWidget::initGui()
m_ui->freePortsLineEdit->setPlaceholderText(
QString::fromLatin1("eg: %1-%2").arg(DESKTOP_PORT_START).arg(DESKTOP_PORT_END));
m_ui->portsWarningLabel->setPixmap(
QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
m_ui->portsWarningLabel->setToolTip(QLatin1String("<font color=\"red\">")
+ tr("You will need at least one port for QML debugging.")
+ QLatin1String("</font>"));
......
......@@ -32,6 +32,7 @@
#include "kit.h"
#include "kitmanagerconfigwidget.h"
#include "kitmanager.h"
#include "projectexplorerconstants.h"
#include <utils/qtcassert.h>
......@@ -155,8 +156,8 @@ int KitModel::columnCount(const QModelIndex &parent) const
QVariant KitModel::data(const QModelIndex &index, int role) const
{
static QIcon warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png"));
static QIcon errorIcon(QLatin1String(":/projectexplorer/images/compile_error.png"));
static QIcon warningIcon(QString::fromLatin1(ProjectExplorer::Constants::ICON_WARNING));
static QIcon errorIcon(QString::fromLatin1(ProjectExplorer::Constants::ICON_ERROR));
if (!index.isValid() || index.column() != 0)
return QVariant();
......
......@@ -162,6 +162,8 @@ const char ICON_DEBUG_SMALL[] = ":/projectexplorer/images/debugger_start_sma
const char ICON_STOP[] = ":/projectexplorer/images/stop.png";
const char ICON_STOP_SMALL[] = ":/projectexplorer/images/stop_small.png";
const char ICON_WINDOW[] = ":/projectexplorer/images/window.png";
const char ICON_WARNING[] = ":/projectexplorer/images/compile_warning.png";
const char ICON_ERROR[] = ":/projectexplorer/images/compile_error.png";
// Mime types
const char C_SOURCE_MIMETYPE[] = "text/x-csrc";
......
......@@ -29,6 +29,7 @@
#include "task.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h>
namespace ProjectExplorer
......@@ -38,9 +39,9 @@ static QString taskTypeIcon(Task::TaskType t)
{
switch (t) {
case Task::Warning:
return QLatin1String(":/projectexplorer/images/compile_warning.png");
return QLatin1String(ProjectExplorer::Constants::ICON_WARNING);
case Task::Error:
return QLatin1String(":/projectexplorer/images/compile_error.png");
return QLatin1String(ProjectExplorer::Constants::ICON_ERROR);
case Task::Unknown:
break;
}
......
......@@ -30,6 +30,7 @@
#include "taskhub.h"
#include <coreplugin/ioutputpane.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;
......@@ -84,8 +85,8 @@ void TaskMark::clicked()
}
TaskHub::TaskHub()
: m_errorIcon(QLatin1String(":/projectexplorer/images/compile_error.png")),
m_warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png"))
: m_errorIcon(QLatin1String(ProjectExplorer::Constants::ICON_ERROR)),
m_warningIcon(QLatin1String(ProjectExplorer::Constants::ICON_WARNING))
{
m_instance = this;
qRegisterMetaType<ProjectExplorer::Task>("ProjectExplorer::Task");
......
......@@ -262,7 +262,7 @@ TaskWindow::TaskWindow() : d(new TaskWindowPrivate)
d->m_listview->setContextMenuPolicy(Qt::ActionsContextMenu);
d->m_filterWarningsButton = createFilterButton(
QIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")),
QIcon(QLatin1String(Constants::ICON_WARNING)),
tr("Show Warnings"), this, SLOT(setShowWarnings(bool)));
d->m_categoriesButton = new QToolButton;
......
......@@ -338,7 +338,7 @@ QbsRunConfigurationWidget::QbsRunConfigurationWidget(QbsRunConfiguration *rc, QW
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
m_disabledIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
......
......@@ -190,7 +190,7 @@ DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQm
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
m_disabledIcon->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
......
......@@ -41,6 +41,7 @@
#include <utils/pathchooser.h>
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QMessageBox>
#include <QFileDialog>
......@@ -51,7 +52,7 @@
namespace Qnx {
namespace Internal {
static QIcon invalidConfigIcon(QLatin1String(":/projectexplorer/images/compile_error.png"));
static QIcon invalidConfigIcon(QString::fromLatin1(ProjectExplorer::Constants::ICON_ERROR));
BlackBerryNDKSettingsWidget::BlackBerryNDKSettingsWidget(QWidget *parent) :
QWidget(parent),
......
......@@ -35,6 +35,7 @@
#include "qnxconstants.h"
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QGridLayout>
#include <QLabel>
......@@ -86,7 +87,7 @@ BlackBerryPotentialKitWidget::BlackBerryPotentialKitWidget(QWidget *parent)
: Utils::DetailsWidget(parent)
{
setSummaryText(tr("<b>BlackBerry has not been configured. Create BlackBerry kits.</b>"));
setIcon(QIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")));
setIcon(QIcon(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
QWidget *mainWidget = new QWidget(this);
setWidget(mainWidget);
......
......@@ -106,8 +106,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
, m_versionUi(new Internal::Ui::QtVersionInfo())
, m_debuggingHelperUi(new Internal::Ui::DebuggingHelper())
, m_infoBrowser(new QTextBrowser)
, m_invalidVersionIcon(QLatin1String(":/projectexplorer/images/compile_error.png"))
, m_warningVersionIcon(QLatin1String(":/projectexplorer/images/compile_warning.png"))
, m_invalidVersionIcon(QLatin1String(ProjectExplorer::Constants::ICON_ERROR))
, m_warningVersionIcon(QLatin1String(ProjectExplorer::Constants::ICON_WARNING))
, m_configurationWidget(0)
, m_autoItem(0)
, m_manualItem(0)
......
......@@ -30,6 +30,7 @@
#include "genericlinuxdeviceconfigurationwidget.h"
#include "ui_genericlinuxdeviceconfigurationwidget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/portlist.h>
#include <utils/fancylineedit.h>
#include <ssh/sshconnection.h>
......@@ -179,7 +180,7 @@ void GenericLinuxDeviceConfigurationWidget::initGui()
m_ui->machineTypeValueLabel->setText(tr("Physical Device"));
else
m_ui->machineTypeValueLabel->setText(tr("Emulator"));
m_ui->portsWarningLabel->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
m_ui->portsWarningLabel->setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_ERROR)));
m_ui->portsWarningLabel->setToolTip(QLatin1String("<font color=\"red\">")
+ tr("You will need at least one port.") + QLatin1String("</font>"));
m_ui->keyFileLineEdit->setExpectedKind(PathChooser::File);
......
......@@ -105,7 +105,7 @@ void RemoteLinuxRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
{
QHBoxLayout * const hl = new QHBoxLayout;
hl->addStretch();
d->disabledIcon.setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
d->disabledIcon.setPixmap(QPixmap(QLatin1String(ProjectExplorer::Constants::ICON_WARNING)));
hl->addWidget(&d->disabledIcon);
d->disabledReason.setVisible(false);
hl->addWidget(&d->disabledReason);
......
......@@ -52,10 +52,6 @@ const char ICON_INFO[] = ":/todoplugin/images/info.png";
// Dummy, needs to be changed
const char ICON_TODO[] = ":/todoplugin/images/todo.png";
const char ICON_WARNING[] = ":/projectexplorer/images/compile_warning.png";
const char ICON_ERROR[] = ":/projectexplorer/images/compile_error.png";
// Settings entries
const char SETTINGS_GROUP[] = "TodoPlugin";
const char SCANNING_SCOPE[] = "ScanningScope";
......
......@@ -34,6 +34,8 @@
#include "constants.h"
#include "lineparser.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <QColorDialog>
namespace Todo {
......@@ -91,13 +93,13 @@ void KeywordDialog::setupListWidget(const QString &selectedIcon)
item->setData(Qt::UserRole, infoIconName);
ui->listWidget->addItem(item);
const QString warningIconName = QLatin1String(Constants::ICON_WARNING);
const QString warningIconName = QLatin1String(ProjectExplorer::Constants::ICON_WARNING);
item = new QListWidgetItem(QIcon(warningIconName),
QLatin1String("warning"));
item->setData(Qt::UserRole, warningIconName);
ui->listWidget->addItem(item);
const QString errorIconName = QLatin1String(Constants::ICON_ERROR);
const QString errorIconName = QLatin1String(ProjectExplorer::Constants::ICON_ERROR);
item = new QListWidgetItem(QIcon(errorIconName),
QLatin1String("error"));
item->setData(Qt::UserRole, errorIconName);
......
......@@ -31,6 +31,8 @@
#include "settings.h"
#include "constants.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <QSettings>
namespace Todo {
......@@ -98,7 +100,7 @@ void Settings::setDefault()
Keyword keyword;
keyword.name = QLatin1String("TODO");
keyword.iconResource = QLatin1String(Constants::ICON_WARNING);
keyword.iconResource = QLatin1String(ProjectExplorer::Constants::ICON_WARNING);
keyword.color = QColor(QLatin1String(Constants::COLOR_TODO_BG));
keywords.append(keyword);
......@@ -108,17 +110,17 @@ void Settings::setDefault()
keywords.append(keyword);
keyword.name = QLatin1String("FIXME");
keyword.iconResource = QLatin1String(Constants::ICON_ERROR);
keyword.iconResource = QLatin1String(ProjectExplorer::Constants::ICON_ERROR);
keyword.color = QColor(QLatin1String(Constants::COLOR_FIXME_BG));
keywords.append(keyword);
keyword.name = QLatin1String("BUG");
keyword.iconResource = QLatin1String(Constants::ICON_ERROR);
keyword.iconResource = QLatin1String(ProjectExplorer::Constants::ICON_ERROR);
keyword.color = QColor(QLatin1String(Constants::COLOR_BUG_BG));
keywords.append(keyword);
keyword.name = QLatin1String("WARNING");
keyword.iconResource = QLatin1String(Constants::ICON_WARNING);
keyword.iconResource = QLatin1String(ProjectExplorer::Constants::ICON_WARNING);
keyword.color = QColor(QLatin1String(Constants::COLOR_WARNING_BG));
keywords.append(keyword);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment