forked from qt-creator/qt-creator
L10n: Fix duplicated messages.
Remove duplicated message, fix WinGuiProcess' messages.
This commit is contained in:
75
src/libs/utils/abstractprocess.cpp
Normal file
75
src/libs/utils/abstractprocess.cpp
Normal file
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user