Commit 4e7f2f8d authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Fixed translation glitches.

parent 6195035b
...@@ -115,11 +115,11 @@ QProcess *CMakeManager::createXmlFile(const QStringList &arguments, const QStrin ...@@ -115,11 +115,11 @@ QProcess *CMakeManager::createXmlFile(const QStringList &arguments, const QStrin
cmake->setProcessChannelMode(QProcess::MergedChannels); cmake->setProcessChannelMode(QProcess::MergedChannels);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QString generator = "-GCodeBlocks - MinGW Makefiles"; const QString generator = QLatin1String("-GCodeBlocks - MinGW Makefiles");
#else // Q_OS_WIN #else // Q_OS_WIN
QString generator = "-GCodeBlocks - Unix Makefiles"; const QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
#endif // Q_OS_WIN #endif // Q_OS_WIN
QString srcdir = buildDirectory.exists("CMakeCache.txt") ? QString(".") : sourceDirectory; const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? QString(QLatin1Char('.')) : sourceDirectory;
qDebug()<<cmakeExecutable()<<srcdir<<arguments<<generator; qDebug()<<cmakeExecutable()<<srcdir<<arguments<<generator;
cmake->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator); cmake->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
return cmake; return cmake;
...@@ -132,8 +132,8 @@ QString CMakeManager::findCbpFile(const QDir &directory) ...@@ -132,8 +132,8 @@ QString CMakeManager::findCbpFile(const QDir &directory)
// so this method below could find the wrong cbp file, if the user changes the project() // so this method below could find the wrong cbp file, if the user changes the project()
// 2name // 2name
foreach (const QString &cbpFile , directory.entryList()) { foreach (const QString &cbpFile , directory.entryList()) {
if (cbpFile.endsWith(".cbp")) if (cbpFile.endsWith(QLatin1String(".cbp")))
return directory.path() + "/" + cbpFile; return directory.path() + QLatin1Char('/') + cbpFile;
} }
return QString::null; return QString::null;
} }
...@@ -142,14 +142,14 @@ QString CMakeManager::findCbpFile(const QDir &directory) ...@@ -142,14 +142,14 @@ QString CMakeManager::findCbpFile(const QDir &directory)
QString CMakeManager::qtVersionForQMake(const QString &qmakePath) QString CMakeManager::qtVersionForQMake(const QString &qmakePath)
{ {
QProcess qmake; QProcess qmake;
qmake.start(qmakePath, QStringList()<<"--version"); qmake.start(qmakePath, QStringList(QLatin1String("--version")));
if (!qmake.waitForFinished()) if (!qmake.waitForFinished())
return false; return false;
QString output = qmake.readAllStandardOutput(); QString output = qmake.readAllStandardOutput();
QRegExp regexp("(QMake version|Qmake version:)[\\s]*([\\d.]*)"); QRegExp regexp(QLatin1String("(QMake version|Qmake version:)[\\s]*([\\d.]*)"));
regexp.indexIn(output); regexp.indexIn(output);
if (regexp.cap(2).startsWith("2.")) { if (regexp.cap(2).startsWith(QLatin1String("2."))) {
QRegExp regexp2("Using Qt version[\\s]*([\\d\\.]*)"); QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"));
regexp2.indexIn(output); regexp2.indexIn(output);
return regexp2.cap(1); return regexp2.cap(1);
} }
...@@ -176,17 +176,17 @@ void CMakeRunner::run(QFutureInterface<void> &fi) ...@@ -176,17 +176,17 @@ void CMakeRunner::run(QFutureInterface<void> &fi)
QString executable = m_executable; QString executable = m_executable;
m_mutex.unlock(); m_mutex.unlock();
QProcess cmake; QProcess cmake;
cmake.start(executable, QStringList()<<"--help"); cmake.start(executable, QStringList(QLatin1String("--help")));
cmake.waitForFinished(); cmake.waitForFinished();
QString response = cmake.readAll(); QString response = cmake.readAll();
QRegExp versionRegexp("^cmake version ([*\\d\\.]*)-(|patch (\\d*))(|\\r)\\n"); QRegExp versionRegexp(QLatin1String("^cmake version ([*\\d\\.]*)-(|patch (\\d*))(|\\r)\\n"));
versionRegexp.indexIn(response); versionRegexp.indexIn(response);
m_mutex.lock(); m_mutex.lock();
m_supportsQtCreator = response.contains("QtCreator"); m_supportsQtCreator = response.contains(QLatin1String("QtCreator"));
m_version = versionRegexp.cap(1); m_version = versionRegexp.cap(1);
if (!versionRegexp.capturedTexts().size()>3) if (!versionRegexp.capturedTexts().size()>3)
m_version += "." + versionRegexp.cap(3); m_version += QLatin1Char('.') + versionRegexp.cap(3);
m_cacheUpToDate = true; m_cacheUpToDate = true;
m_mutex.unlock(); m_mutex.unlock();
fi.reportFinished(); fi.reportFinished();
...@@ -243,15 +243,15 @@ CMakeSettingsPage::CMakeSettingsPage() ...@@ -243,15 +243,15 @@ CMakeSettingsPage::CMakeSettingsPage()
{ {
Core::ICore *core = Core::ICore::instance(); Core::ICore *core = Core::ICore::instance();
QSettings * settings = core->settings(); QSettings * settings = core->settings();
settings->beginGroup("CMakeSettings"); settings->beginGroup(QLatin1String("CMakeSettings"));
m_cmakeRunner.setExecutable(settings->value("cmakeExecutable").toString()); m_cmakeRunner.setExecutable(settings->value(QLatin1String("cmakeExecutable")).toString());
settings->endGroup(); settings->endGroup();
} }
QString CMakeSettingsPage::findCmakeExecutable() const QString CMakeSettingsPage::findCmakeExecutable() const
{ {
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
return env.searchInPath("cmake"); return env.searchInPath(QLatin1String("cmake"));
} }
QString CMakeSettingsPage::id() const QString CMakeSettingsPage::id() const
...@@ -280,7 +280,7 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent) ...@@ -280,7 +280,7 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent)
QFormLayout *fl = new QFormLayout(w); QFormLayout *fl = new QFormLayout(w);
m_pathchooser = new Core::Utils::PathChooser(w); m_pathchooser = new Core::Utils::PathChooser(w);
m_pathchooser->setExpectedKind(Core::Utils::PathChooser::Command); m_pathchooser->setExpectedKind(Core::Utils::PathChooser::Command);
fl->addRow("CMake executable", m_pathchooser); fl->addRow(tr("CMake executable"), m_pathchooser);
m_pathchooser->setPath(cmakeExecutable()); m_pathchooser->setPath(cmakeExecutable());
return w; return w;
} }
...@@ -288,8 +288,8 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent) ...@@ -288,8 +288,8 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent)
void CMakeSettingsPage::saveSettings() const void CMakeSettingsPage::saveSettings() const
{ {
QSettings *settings = Core::ICore::instance()->settings(); QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup("CMakeSettings"); settings->beginGroup(QLatin1String("CMakeSettings"));
settings->setValue("cmakeExecutable", m_cmakeRunner.executable()); settings->setValue(QLatin1String("cmakeExecutable"), m_cmakeRunner.executable());
settings->endGroup(); settings->endGroup();
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<item> <item>
<widget class="QCheckBox" name="saveBeforeBuildCheckBox"> <widget class="QCheckBox" name="saveBeforeBuildCheckBox">
<property name="text"> <property name="text">
<string>Automatically save all Files before building</string> <string>Automatically save all files before building</string>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -96,6 +96,19 @@ QDebug operator<<(QDebug dgb, const WelcomeMode::WelcomePageData &d) ...@@ -96,6 +96,19 @@ QDebug operator<<(QDebug dgb, const WelcomeMode::WelcomePageData &d)
return dgb; return dgb;
} }
// Format a title + ruler for projects/session labels
static inline QString devTitleLabel(const QString &text)
{
QString rc = QLatin1String(
"<html><head><style type=\"text/css\">p, li { white-space: pre-wrap; }</style></head>"
"<body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">"
"<p style=\" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"
"<span style=\" font-size:x-large; color:#555555;\">");
rc += text;
rc += QLatin1String("</span></p><hr/></body></html>");
return rc;
}
// --- WelcomeMode // --- WelcomeMode
WelcomeMode::WelcomeMode() : WelcomeMode::WelcomeMode() :
m_d(new WelcomeModePrivate) m_d(new WelcomeModePrivate)
...@@ -108,6 +121,8 @@ WelcomeMode::WelcomeMode() : ...@@ -108,6 +121,8 @@ WelcomeMode::WelcomeMode() :
m_d->rssFetcher = new RSSFetcher(8, this); m_d->rssFetcher = new RSSFetcher(8, this);
m_d->m_welcomePage = new QWidget(m_d->m_widget); m_d->m_welcomePage = new QWidget(m_d->m_widget);
m_d->ui.setupUi(m_d->m_welcomePage); m_d->ui.setupUi(m_d->m_welcomePage);
m_d->ui.projTitleLabel->setText(devTitleLabel(tr("Projects")));
m_d->ui.titleLabel->setText(devTitleLabel(tr("Sessions")));
m_d->ui.sessTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.sessTreeWidget->viewport()->setAutoFillBackground(false);
m_d->ui.projTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.projTreeWidget->viewport()->setAutoFillBackground(false);
m_d->ui.newsTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.newsTreeWidget->viewport()->setAutoFillBackground(false);
......
...@@ -475,14 +475,6 @@ p, li { white-space: pre-wrap; } ...@@ -475,14 +475,6 @@ p, li { white-space: pre-wrap; }
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QLabel" name="titleLabel"> <widget class="QLabel" name="titleLabel">
<property name="text">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:x-large; color:#555555;&quot;&gt;Sessions&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
...@@ -597,14 +589,6 @@ p, li { white-space: pre-wrap; } ...@@ -597,14 +589,6 @@ p, li { white-space: pre-wrap; }
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="projTitleLabel"> <widget class="QLabel" name="projTitleLabel">
<property name="text">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:x-large; color:#555555;&quot;&gt;Projects&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
......
...@@ -1726,7 +1726,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd) ...@@ -1726,7 +1726,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd)
void FakeVimHandler::Private::handleExCommand(const QString &cmd0) void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
{ {
QString cmd = cmd0; QString cmd = cmd0;
if (cmd.startsWith("%")) if (cmd.startsWith(QLatin1Char('%')))
cmd = "1,$" + cmd.mid(1); cmd = "1,$" + cmd.mid(1);
int beginLine = -1; int beginLine = -1;
...@@ -1822,7 +1822,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ...@@ -1822,7 +1822,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
enterCommandMode(); enterCommandMode();
showBlackMessage(tr("\"%1\" %2L, %3C") showBlackMessage(tr("\"%1\" %2L, %3C")
.arg(m_currentFileName).arg(data.count('\n')).arg(data.size())); .arg(m_currentFileName).arg(data.count('\n')).arg(data.size()));
} else if (cmd.startsWith("!")) { } else if (cmd.startsWith(QLatin1Char('!'))) {
selectRange(beginLine, endLine); selectRange(beginLine, endLine);
QString command = cmd.mid(1).trimmed(); QString command = cmd.mid(1).trimmed();
QString text = removeSelectedText(); QString text = removeSelectedText();
...@@ -1838,15 +1838,14 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ...@@ -1838,15 +1838,14 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
setPosition(firstPositionInLine(beginLine)); setPosition(firstPositionInLine(beginLine));
enterCommandMode(); enterCommandMode();
//qDebug() << "FILTER: " << command; //qDebug() << "FILTER: " << command;
showBlackMessage(tr("%1 lines filtered").arg(text.count('\n'))); showBlackMessage(tr("%n lines filtered", 0, text.count('\n')));
} else if (cmd.startsWith(">")) { } else if (cmd.startsWith(QLatin1Char('>'))) {
m_anchor = firstPositionInLine(beginLine); m_anchor = firstPositionInLine(beginLine);
setPosition(firstPositionInLine(endLine)); setPosition(firstPositionInLine(endLine));
shiftRegionRight(1); shiftRegionRight(1);
leaveVisualMode(); leaveVisualMode();
enterCommandMode(); enterCommandMode();
showBlackMessage(tr("%1 lines >ed %2 time") showBlackMessage(tr("%n lines >ed %1 time", 0, (endLine - beginLine + 1)).arg(1));
.arg(endLine - beginLine + 1).arg(1));
} else if (cmd == "red" || cmd == "redo") { // :redo } else if (cmd == "red" || cmd == "redo") { // :redo
redo(); redo();
enterCommandMode(); enterCommandMode();
......
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