forked from qt-creator/qt-creator
Beautifier: edit UI text
Make error message wording more consistent. Fix some punctuation and grammar issues. Change-Id: I21298fea201ff51635d4b6fa9f57445bc94dd0db Reviewed-by: Lorenz Haas <lykurg@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -177,7 +177,7 @@ void AbstractSettings::save()
|
|||||||
const QString path = m_styleDir.absolutePath();
|
const QString path = m_styleDir.absolutePath();
|
||||||
if (!(m_styleDir.mkpath(path)
|
if (!(m_styleDir.mkpath(path)
|
||||||
&& m_styleDir.cd(path))) {
|
&& m_styleDir.cd(path))) {
|
||||||
BeautifierPlugin::showError(tr("Failed to save styles. %1 does not exist.").arg(path));
|
BeautifierPlugin::showError(tr("Cannot save styles. %1 does not exist.").arg(path));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,13 +197,13 @@ void AbstractSettings::save()
|
|||||||
|
|
||||||
Utils::FileSaver saver(styleFileName(iStyles.key()));
|
Utils::FileSaver saver(styleFileName(iStyles.key()));
|
||||||
if (saver.hasError()) {
|
if (saver.hasError()) {
|
||||||
BeautifierPlugin::showError(tr("Could not open file \"%1\": %2.")
|
BeautifierPlugin::showError(tr("Cannot open file \"%1\": %2.")
|
||||||
.arg(saver.fileName())
|
.arg(saver.fileName())
|
||||||
.arg(saver.errorString()));
|
.arg(saver.errorString()));
|
||||||
} else {
|
} else {
|
||||||
saver.write(iStyles.value().toLocal8Bit());
|
saver.write(iStyles.value().toLocal8Bit());
|
||||||
if (!saver.finalize()) {
|
if (!saver.finalize()) {
|
||||||
BeautifierPlugin::showError(tr("Error while saving file \"%1\": %2.")
|
BeautifierPlugin::showError(tr("Cannot save file \"%1\": %2.")
|
||||||
.arg(saver.fileName())
|
.arg(saver.fileName())
|
||||||
.arg(saver.errorString()));
|
.arg(saver.errorString()));
|
||||||
}
|
}
|
||||||
@@ -275,7 +275,7 @@ void AbstractSettings::readDocumentation()
|
|||||||
createDocumentationFile();
|
createDocumentationFile();
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
BeautifierPlugin::showError(tr("Could not open documentation file \"%1\".").arg(filename));
|
BeautifierPlugin::showError(tr("Cannot open documentation file \"%1\".").arg(filename));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ void AbstractSettings::readDocumentation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (xml.hasError()) {
|
if (xml.hasError()) {
|
||||||
BeautifierPlugin::showError(tr("Could not read documentation file \"%1\". Error: %2.")
|
BeautifierPlugin::showError(tr("Cannot read documentation file \"%1\": %2.")
|
||||||
.arg(filename).arg(xml.errorString()));
|
.arg(filename).arg(xml.errorString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ void ArtisticStyle::formatFile()
|
|||||||
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
|
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
|
||||||
|
|
||||||
if (cfgFileName.isEmpty()) {
|
if (cfgFileName.isEmpty()) {
|
||||||
BeautifierPlugin::showError(tr("Could not get configuration file for Artistic Style."));
|
BeautifierPlugin::showError(tr("Cannot get configuration file for Artistic Style."));
|
||||||
} else {
|
} else {
|
||||||
BeautifierPlugin::formatCurrentFile(QStringList()
|
BeautifierPlugin::formatCurrentFile(QStringList()
|
||||||
<< m_settings->command()
|
<< m_settings->command()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="useCustomStyle">
|
<widget class="QCheckBox" name="useCustomStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use selfdefined style:</string>
|
<string>Use self-defined style:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
|
|||||||
sourceFile.setAutoRemove(true);
|
sourceFile.setAutoRemove(true);
|
||||||
sourceFile.write(text.toUtf8());
|
sourceFile.write(text.toUtf8());
|
||||||
if (!sourceFile.finalize()) {
|
if (!sourceFile.finalize()) {
|
||||||
showError(tr("Couldn't create temporary file %1: %2.")
|
showError(tr("Cannot create temporary file \"%1\": %2.")
|
||||||
.arg(sourceFile.fileName()).arg(sourceFile.errorString()));
|
.arg(sourceFile.fileName()).arg(sourceFile.errorString()));
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
|
|||||||
const QString processProgram = command.takeFirst();
|
const QString processProgram = command.takeFirst();
|
||||||
process.start(processProgram, command);
|
process.start(processProgram, command);
|
||||||
if (!process.waitForFinished()) {
|
if (!process.waitForFinished()) {
|
||||||
showError(tr("Failed to call %1 or an error occurred.").arg(processProgram));
|
showError(tr("Cannot call %1 or some other error occurred.").arg(processProgram));
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
const QByteArray output = process.readAllStandardError();
|
const QByteArray output = process.readAllStandardError();
|
||||||
@@ -148,7 +148,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
|
|||||||
// Read text back
|
// Read text back
|
||||||
Utils::FileReader reader;
|
Utils::FileReader reader;
|
||||||
if (!reader.fetch(sourceFile.fileName(), QIODevice::Text)) {
|
if (!reader.fetch(sourceFile.fileName(), QIODevice::Text)) {
|
||||||
showError(tr("Couldn't read file %1: %2.")
|
showError(tr("Cannot read file \"%1\": %2.")
|
||||||
.arg(sourceFile.fileName()).arg(reader.errorString()));
|
.arg(sourceFile.fileName()).arg(reader.errorString()));
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="formatEntireFileFallback">
|
<widget class="QCheckBox" name="formatEntireFileFallback">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Format entire file if no text was selected. (For action "Format Selected Text")</string>
|
<string>Format entire file if no text was selected. (For action Format Selected Text)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void ClangFormatSettings::createDocumentationFile() const
|
|||||||
const QString options = line.right(line.size() - firstSpace).trimmed();
|
const QString options = line.right(line.size() - firstSpace).trimmed();
|
||||||
const QString text = QLatin1String("<p><span class=\"option\">") + keyword
|
const QString text = QLatin1String("<p><span class=\"option\">") + keyword
|
||||||
+ QLatin1String("</span> <span class=\"param\">") + options
|
+ QLatin1String("</span> <span class=\"param\">") + options
|
||||||
+ QLatin1String("</span></p><p>") + tr("Yet no description available.")
|
+ QLatin1String("</span></p><p>") + tr("No description available.")
|
||||||
+ QLatin1String("</p>");
|
+ QLatin1String("</p>");
|
||||||
stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY));
|
stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY));
|
||||||
stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword);
|
stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword);
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ void Uncrustify::formatFile()
|
|||||||
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
|
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
|
||||||
|
|
||||||
if (cfgFileName.isEmpty()) {
|
if (cfgFileName.isEmpty()) {
|
||||||
BeautifierPlugin::showError(tr("Could not get configuration file for uncrustify."));
|
BeautifierPlugin::showError(tr("Cannot get configuration file for uncrustify."));
|
||||||
} else {
|
} else {
|
||||||
BeautifierPlugin::formatCurrentFile(QStringList()
|
BeautifierPlugin::formatCurrentFile(QStringList()
|
||||||
<< m_settings->command()
|
<< m_settings->command()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="useCustomStyle">
|
<widget class="QCheckBox" name="useCustomStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use selfdefined style:</string>
|
<string>Use self-defined style:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user