diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-01 16:45:41 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-01 16:47:03 +0100 |
commit | b850cc4db032a374b69f1b84e8d7457fa29bf8b2 (patch) | |
tree | 3cfc5c48da30d05a455e69179310da0a353bccc0 /src | |
parent | fa4dc9ffa663c56c145edc056de8a3d231e6d611 (diff) | |
download | qt-creator-b850cc4db032a374b69f1b84e8d7457fa29bf8b2.tar.gz |
L10n: Fix duplicated messages.
Remove duplicated message, fix WinGuiProcess' messages.
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/utils/abstractprocess.cpp | 75 | ||||
-rw-r--r-- | src/libs/utils/abstractprocess.h | 14 | ||||
-rw-r--r-- | src/libs/utils/utils-lib.pri | 1 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 7 | ||||
-rw-r--r-- | src/plugins/projectexplorer/winguiprocess.cpp | 8 |
5 files changed, 92 insertions, 13 deletions
diff --git a/src/libs/utils/abstractprocess.cpp b/src/libs/utils/abstractprocess.cpp new file mode 100644 index 0000000000..dadae6826a --- /dev/null +++ b/src/libs/utils/abstractprocess.cpp @@ -0,0 +1,75 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "abstractprocess.h" + +#include <QtCore/QCoreApplication> + +namespace Utils { + +AbstractProcess::AbstractProcess() +{ +} + +AbstractProcess::~AbstractProcess() +{ +} + +QString AbstractProcess::workingDirectory() const +{ + return m_workingDir; +} + +void AbstractProcess::setWorkingDirectory(const QString &dir) +{ + m_workingDir = dir; +} + +void AbstractProcess::setEnvironment(const Environment &env) +{ + m_environment = env; +} + +Environment AbstractProcess::environment() const +{ + return m_environment; +} + +QString AbstractProcess::msgWinCannotRetrieveDebuggingOutput() +{ + return QCoreApplication::translate("Utils::AbstractProcess", "Cannot retrieve debugging output."); +} + +} // namespace Utils + + diff --git a/src/libs/utils/abstractprocess.h b/src/libs/utils/abstractprocess.h index 36e30adf92..499ddd6db5 100644 --- a/src/libs/utils/abstractprocess.h +++ b/src/libs/utils/abstractprocess.h @@ -45,14 +45,14 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT AbstractProcess { public: - AbstractProcess() {} - virtual ~AbstractProcess() {} + AbstractProcess(); + virtual ~AbstractProcess(); - QString workingDirectory() const { return m_workingDir; } - void setWorkingDirectory(const QString &dir) { m_workingDir = dir; } + QString workingDirectory() const; + void setWorkingDirectory(const QString &dir); - void setEnvironment(const Environment &env) { m_environment = env; } - Environment environment() const { return m_environment; } + void setEnvironment(const Environment &env); + Environment environment() const; virtual bool start(const QString &program, const QString &args) = 0; virtual void stop() = 0; @@ -61,6 +61,8 @@ public: virtual qint64 applicationPID() const = 0; virtual int exitCode() const = 0; + static QString msgWinCannotRetrieveDebuggingOutput(); + //signals: virtual void processMessage(const QString &error, bool isError) = 0; diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 00041b7818..00106c8b4e 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -10,6 +10,7 @@ QT += network SOURCES += $$PWD/environment.cpp \ $$PWD/environmentmodel.cpp \ $$PWD/qtcprocess.cpp \ + $$PWD/abstractprocess.cpp \ $$PWD/reloadpromptutils.cpp \ $$PWD/stringutils.cpp \ $$PWD/filesearch.cpp \ diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 4b0494cdb9..099fcd491a 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -55,6 +55,7 @@ #include <projectexplorer/applicationlauncher.h> #include <utils/environment.h> +#include <utils/abstractprocess.h> #include <utils/qtcassert.h> #include <coreplugin/icore.h> @@ -291,10 +292,8 @@ bool QmlEngine::canDisplayTooltip() const void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/) { static QString qddserver = QLatin1String("QDeclarativeDebugServer: "); - //: Must be the same translation as the one in WinGuiProcess - static QString cannotRetrieve = tr("Cannot retrieve debugging output!"); - int index = msg.indexOf(qddserver); + const int index = msg.indexOf(qddserver); if (index != -1) { QString status = msg; status.remove(0, index + qddserver.length()); // chop of 'QDeclarativeDebugServer: ' @@ -339,7 +338,7 @@ void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/) infoBox->show(); } - } else if (msg.contains(cannotRetrieve)) { + } else if (msg.contains(Utils::AbstractProcess::msgWinCannotRetrieveDebuggingOutput())) { // we won't get debugging output, so just try to connect ... d->m_adapter.beginConnection(); } diff --git a/src/plugins/projectexplorer/winguiprocess.cpp b/src/plugins/projectexplorer/winguiprocess.cpp index 4c5deedd09..94ce64938f 100644 --- a/src/plugins/projectexplorer/winguiprocess.cpp +++ b/src/plugins/projectexplorer/winguiprocess.cpp @@ -35,6 +35,7 @@ #include "consoleprocess.h" #include <utils/qtcprocess.h> +#include <utils/winutils.h> #include <QtCore/QDir> @@ -131,13 +132,14 @@ void WinGuiProcess::run() &si, m_pid); if (!started) { - emit processMessage(tr("The process could not be started!"), true); + emit processMessage(tr("The process could not be started: %1"). + arg(Utils::winErrorMessage(GetLastError())), true); break; } if (!dbgInterface) { - // Text is dublicated in qmlengine.cpp - emit receivedDebugOutput(tr("Cannot retrieve debugging output!"), true); + // Text is filtered in qmlengine.cpp + emit receivedDebugOutput(Utils::AbstractProcess::msgWinCannotRetrieveDebuggingOutput(), true); WaitForSingleObject(m_pid->hProcess, INFINITE); } else { LPSTR message; |