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
|
class QTCREATOR_UTILS_EXPORT AbstractProcess
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractProcess() {}
|
AbstractProcess();
|
||||||
virtual ~AbstractProcess() {}
|
virtual ~AbstractProcess();
|
||||||
|
|
||||||
QString workingDirectory() const { return m_workingDir; }
|
QString workingDirectory() const;
|
||||||
void setWorkingDirectory(const QString &dir) { m_workingDir = dir; }
|
void setWorkingDirectory(const QString &dir);
|
||||||
|
|
||||||
void setEnvironment(const Environment &env) { m_environment = env; }
|
void setEnvironment(const Environment &env);
|
||||||
Environment environment() const { return m_environment; }
|
Environment environment() const;
|
||||||
|
|
||||||
virtual bool start(const QString &program, const QString &args) = 0;
|
virtual bool start(const QString &program, const QString &args) = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
virtual qint64 applicationPID() const = 0;
|
virtual qint64 applicationPID() const = 0;
|
||||||
virtual int exitCode() const = 0;
|
virtual int exitCode() const = 0;
|
||||||
|
|
||||||
|
static QString msgWinCannotRetrieveDebuggingOutput();
|
||||||
|
|
||||||
//signals:
|
//signals:
|
||||||
virtual void processMessage(const QString &error, bool isError) = 0;
|
virtual void processMessage(const QString &error, bool isError) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ QT += network
|
|||||||
SOURCES += $$PWD/environment.cpp \
|
SOURCES += $$PWD/environment.cpp \
|
||||||
$$PWD/environmentmodel.cpp \
|
$$PWD/environmentmodel.cpp \
|
||||||
$$PWD/qtcprocess.cpp \
|
$$PWD/qtcprocess.cpp \
|
||||||
|
$$PWD/abstractprocess.cpp \
|
||||||
$$PWD/reloadpromptutils.cpp \
|
$$PWD/reloadpromptutils.cpp \
|
||||||
$$PWD/stringutils.cpp \
|
$$PWD/stringutils.cpp \
|
||||||
$$PWD/filesearch.cpp \
|
$$PWD/filesearch.cpp \
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include <projectexplorer/applicationlauncher.h>
|
#include <projectexplorer/applicationlauncher.h>
|
||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
#include <utils/abstractprocess.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -291,10 +292,8 @@ bool QmlEngine::canDisplayTooltip() const
|
|||||||
void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/)
|
void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/)
|
||||||
{
|
{
|
||||||
static QString qddserver = QLatin1String("QDeclarativeDebugServer: ");
|
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) {
|
if (index != -1) {
|
||||||
QString status = msg;
|
QString status = msg;
|
||||||
status.remove(0, index + qddserver.length()); // chop of 'QDeclarativeDebugServer: '
|
status.remove(0, index + qddserver.length()); // chop of 'QDeclarativeDebugServer: '
|
||||||
@@ -339,7 +338,7 @@ void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/)
|
|||||||
|
|
||||||
infoBox->show();
|
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 ...
|
// we won't get debugging output, so just try to connect ...
|
||||||
d->m_adapter.beginConnection();
|
d->m_adapter.beginConnection();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "consoleprocess.h"
|
#include "consoleprocess.h"
|
||||||
|
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
#include <utils/winutils.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
@@ -131,13 +132,14 @@ void WinGuiProcess::run()
|
|||||||
&si, m_pid);
|
&si, m_pid);
|
||||||
|
|
||||||
if (!started) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dbgInterface) {
|
if (!dbgInterface) {
|
||||||
// Text is dublicated in qmlengine.cpp
|
// Text is filtered in qmlengine.cpp
|
||||||
emit receivedDebugOutput(tr("Cannot retrieve debugging output!"), true);
|
emit receivedDebugOutput(Utils::AbstractProcess::msgWinCannotRetrieveDebuggingOutput(), true);
|
||||||
WaitForSingleObject(m_pid->hProcess, INFINITE);
|
WaitForSingleObject(m_pid->hProcess, INFINITE);
|
||||||
} else {
|
} else {
|
||||||
LPSTR message;
|
LPSTR message;
|
||||||
|
|||||||
Reference in New Issue
Block a user