Commit 73ec0c5d authored by Lorenz Haas's avatar Lorenz Haas Committed by David Schulz
Browse files

Beautifier: Add constant for a tool's display name



Change-Id: I9cc50ad06d7515f5fc82394cbfb71e7327e7d9e1
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 0b7312e8
......@@ -69,7 +69,7 @@ ArtisticStyle::~ArtisticStyle()
bool ArtisticStyle::initialize()
{
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ArtisticStyle::MENU_ID);
menu->menu()->setTitle(QLatin1String("Artistic Style"));
menu->menu()->setTitle(QLatin1String(Constants::ArtisticStyle::DISPLAY_NAME));
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
Core::Command *cmd
......@@ -132,7 +132,7 @@ void ArtisticStyle::formatFile()
if (cfgFileName.isEmpty()) {
BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(
QLatin1String("Artistic Style")));
QLatin1String(Constants::ArtisticStyle::DISPLAY_NAME)));
} else {
BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command()
......
......@@ -34,6 +34,7 @@ namespace Beautifier {
namespace Constants {
namespace ArtisticStyle {
const char DISPLAY_NAME[] = "Artistic Style";
const char ACTION_FORMATFILE[] = "ArtisticStyle.FormatFile";
const char MENU_ID[] = "ArtisticStyle.Menu";
const char OPTION_ID[] = "ArtisticStyle";
......
......@@ -52,8 +52,8 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
{
ui->setupUi(this);
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
ui->command->setPromptDialogTitle(
BeautifierPlugin::msgCommandPromptDialogTitle(QLatin1String("Artistic Style")));
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
QLatin1String(Constants::ArtisticStyle::DISPLAY_NAME)));
connect(ui->command, SIGNAL(validChanged(bool)), ui->options, SLOT(setEnabled(bool)));
ui->configurations->setSettings(m_settings);
}
......
......@@ -69,7 +69,7 @@ Uncrustify::~Uncrustify()
bool Uncrustify::initialize()
{
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::Uncrustify::MENU_ID);
menu->menu()->setTitle(QLatin1String("Uncrustify"));
menu->menu()->setTitle(QLatin1String(Constants::Uncrustify::DISPLAY_NAME));
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
Core::Command *cmd
......@@ -126,8 +126,8 @@ void Uncrustify::formatFile()
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
if (cfgFileName.isEmpty()) {
BeautifierPlugin::showError(
BeautifierPlugin::msgCannotGetConfigurationFile(QLatin1String("uncrustify")));
BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(
QLatin1String(Constants::Uncrustify::DISPLAY_NAME)));
} else {
BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command()
......
......@@ -34,6 +34,7 @@ namespace Beautifier {
namespace Constants {
namespace Uncrustify {
const char DISPLAY_NAME[] = "Uncrustify";
const char ACTION_FORMATFILE[] = "Uncrustify.FormatFile";
const char MENU_ID[] = "Uncrustify.Menu";
const char OPTION_ID[] = "Uncrustify";
......
......@@ -52,8 +52,8 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
{
ui->setupUi(this);
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
ui->command->setPromptDialogTitle(
BeautifierPlugin::msgCommandPromptDialogTitle(QLatin1String("Uncrustify")));
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
QLatin1String(Constants::Uncrustify::DISPLAY_NAME)));
connect(ui->command, SIGNAL(validChanged(bool)), ui->options, SLOT(setEnabled(bool)));
ui->configurations->setSettings(m_settings);
}
......
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