Commit e809594f authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Core: Make IOptionsPage::categoryIcon a Utils::Icon



This is necessary for themable + HighDPI icons in the options dialog.

Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae
Reviewed-by: default avatarhjk <hjk@qt.io>
parent c71c00cf
......@@ -45,7 +45,7 @@ AndroidSettingsPage::AndroidSettingsPage(QObject *parent)
setCategory(Constants::ANDROID_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Android",
Constants::ANDROID_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::ANDROID_SETTINGS_CATEGORY_ICON));
setCategoryIcon(Utils::Icon(Constants::ANDROID_SETTINGS_CATEGORY_ICON));
}
QWidget *AndroidSettingsPage::widget()
......
......@@ -179,7 +179,7 @@ TestSettingsPage::TestSettingsPage(const QSharedPointer<TestSettings> &settings)
setDisplayName(tr("General"));
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
setDisplayCategory(tr("Test Settings"));
setCategoryIcon(QLatin1String(":/images/autotest.png"));
setCategoryIcon(Utils::Icon(":/images/autotest.png"));
}
TestSettingsPage::~TestSettingsPage()
......
......@@ -414,7 +414,7 @@ GdbServerProvidersSettingsPage::GdbServerProvidersSettingsPage(QObject *parent)
setCategory(Constants::BAREMETAL_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate(
"BareMetal", Constants::BAREMETAL_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::BAREMETAL_SETTINGS_CATEGORY_ICON));
setCategoryIcon(Utils::Icon(Constants::BAREMETAL_SETTINGS_CATEGORY_ICON));
setId(Constants::GDB_PROVIDERS_SETTINGS_ID);
setDisplayName(tr("GDB Server Providers"));
}
......
......@@ -92,7 +92,7 @@ ArtisticStyleOptionsPage::ArtisticStyleOptionsPage(ArtisticStyleSettings *settin
setDisplayName(tr("Artistic Style"));
setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(Constants::OPTION_CATEGORY_ICON);
setCategoryIcon(Utils::Icon(Constants::OPTION_CATEGORY_ICON));
}
QWidget *ArtisticStyleOptionsPage::widget()
......
......@@ -98,7 +98,7 @@ ClangFormatOptionsPage::ClangFormatOptionsPage(ClangFormatSettings *settings, QO
setDisplayName(tr("Clang Format"));
setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(Constants::OPTION_CATEGORY_ICON);
setCategoryIcon(Utils::Icon(Constants::OPTION_CATEGORY_ICON));
}
QWidget *ClangFormatOptionsPage::widget()
......
......@@ -83,7 +83,7 @@ GeneralOptionsPage::GeneralOptionsPage(GeneralSettings *settings, const QStringL
setDisplayName(tr("General"));
setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(Constants::OPTION_CATEGORY_ICON);
setCategoryIcon(Utils::Icon(Constants::OPTION_CATEGORY_ICON));
}
QWidget *GeneralOptionsPage::widget()
......
......@@ -96,7 +96,7 @@ UncrustifyOptionsPage::UncrustifyOptionsPage(UncrustifySettings *settings, QObje
setDisplayName(tr("Uncrustify"));
setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(Constants::OPTION_CATEGORY_ICON);
setCategoryIcon(Utils::Icon(Constants::OPTION_CATEGORY_ICON));
}
QWidget *UncrustifyOptionsPage::widget()
......
......@@ -71,7 +71,7 @@ public:
"Clang Static Analyzer"));
setCategory("T.Analyzer");
setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer"));
setCategoryIcon(QLatin1String(":/images/analyzer_category.png"));
setCategoryIcon(Utils::Icon(":/images/analyzer_category.png"));
}
QWidget *widget()
......
......@@ -552,7 +552,7 @@ CMakeSettingsPage::CMakeSettingsPage()
setCategory(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
setCategoryIcon(Utils::Icon(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
}
QWidget *CMakeSettingsPage::widget()
......
......@@ -78,7 +78,7 @@
QIcon Core::IOptionsPage::categoryIcon() const
{
return QIcon(m_categoryIcon);
return m_categoryIcon.icon();
}
/*!
......
......@@ -27,6 +27,8 @@
#include <coreplugin/id.h>
#include <utils/icon.h>
#include <QObject>
#include <QStringList>
......@@ -61,13 +63,13 @@ protected:
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setCategory(Id category) { m_category = category; }
void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; }
void setCategoryIcon(const QString &categoryIcon) { m_categoryIcon = categoryIcon; }
void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; }
Id m_id;
Id m_category;
QString m_displayName;
QString m_displayCategory;
QString m_categoryIcon;
Utils::Icon m_categoryIcon;
mutable bool m_keywordsInitialized;
mutable QStringList m_keywords;
......
......@@ -290,7 +290,7 @@ ShortcutSettings::ShortcutSettings(QObject *parent)
setDisplayName(tr("Keyboard"));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
}
QWidget *ShortcutSettings::widget()
......
......@@ -51,7 +51,7 @@ GeneralSettings::GeneralSettings()
setDisplayName(tr("Interface"));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
}
static bool hasQmFilesForLocale(const QString &locale, const QString &creatorTrPath)
......
......@@ -167,7 +167,7 @@ LocatorSettingsPage::LocatorSettingsPage(Locator *plugin)
setDisplayName(QCoreApplication::translate("Locator", Constants::FILTER_OPTIONS_PAGE));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
}
QWidget *LocatorSettingsPage::widget()
......
......@@ -565,7 +565,7 @@ MimeTypeSettings::MimeTypeSettings(QObject *parent)
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core",
Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
}
MimeTypeSettings::~MimeTypeSettings()
......
......@@ -55,7 +55,7 @@ SystemSettings::SystemSettings()
setDisplayName(tr("System"));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
connect(VcsManager::instance(), &VcsManager::configurationChanged,
this, &SystemSettings::updatePath);
......
......@@ -48,7 +48,7 @@ ToolSettings::ToolSettings(QObject *parent) :
setDisplayName(tr("External Tools"));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CORE_ICON));
}
......
......@@ -70,7 +70,7 @@ SettingsPage::SettingsPage(const QSharedPointer<Settings> &settings) :
setCategory(Constants::CPASTER_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("CodePaster",
Constants::CPASTER_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CPASTER_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CPASTER_ICON));
}
SettingsPage::~SettingsPage()
......
......@@ -167,7 +167,7 @@ CppCodeModelSettingsPage::CppCodeModelSettingsPage(QSharedPointer<CppCodeModelSe
setDisplayName(QCoreApplication::translate("CppTools",Constants::CPP_CODE_MODEL_SETTINGS_NAME));
setCategory(Constants::CPP_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("CppTools",Constants::CPP_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CPP_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CPP_ICON));
}
QWidget *CppCodeModelSettingsPage::widget()
......
......@@ -525,7 +525,7 @@ CppCodeStyleSettingsPage::CppCodeStyleSettingsPage(QWidget *parent) :
setDisplayName(QCoreApplication::translate("CppTools", Constants::CPP_CODE_STYLE_SETTINGS_NAME));
setCategory(Constants::CPP_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("CppTools", Constants::CPP_SETTINGS_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CPP_ICON));
setCategoryIcon(Utils::Icon(Constants::SETTINGS_CATEGORY_CPP_ICON));
}
QWidget *CppCodeStyleSettingsPage::widget()
......
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