I18n: Tr()-fixes

This commit is contained in:
Friedemann Kleint
2009-10-12 12:33:12 +02:00
parent 8ccc07a10b
commit b2924aa66b
10 changed files with 62 additions and 47 deletions

View File

@@ -83,5 +83,35 @@ bool AbstractGdbAdapter::isTrkAdapter() const
return false;
}
QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why)
{
return tr("The Gdb process could not be stopped:\n%1").arg(why);
}
QString AbstractGdbAdapter::msgInferiorStopFailed(const QString &why)
{
return tr("Inferior process could not be stopped:\n%1").arg(why);
}
QString AbstractGdbAdapter::msgInferiorStarted()
{
return tr("Inferior started.");
}
QString AbstractGdbAdapter::msgInferiorRunning()
{
return tr("Inferior running.");
}
QString AbstractGdbAdapter::msgAttachedToStoppedInferior()
{
return tr("Attached to stopped inferior.");
}
QString AbstractGdbAdapter::msgConnectRemoteServerFailed(const QString &why)
{
return tr("Connecting to remote server failed:\n%1").arg(why);
}
} // namespace Internal
} // namespace Debugger

View File

@@ -93,6 +93,13 @@ protected:
void showStatusMessage(const QString &msg) const
{ m_engine->showStatusMessage(msg); }
static QString msgGdbStopFailed(const QString &why);
static QString msgInferiorStopFailed(const QString &why);
static QString msgAttachedToStoppedInferior();
static QString msgInferiorStarted();
static QString msgInferiorRunning();
static QString msgConnectRemoteServerFailed(const QString &why);
GdbEngine * const m_engine;
QProcess m_gdbProc;

View File

@@ -107,7 +107,7 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
setState(InferiorStopped);
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Attached to stopped inferior."));
showStatusMessage(msgAttachedToStoppedInferior());
m_engine->updateAll();
} else if (response.resultClass == GdbResultError) {
QString msg = __(response.data.findChild("msg").data());
@@ -155,8 +155,7 @@ void AttachGdbAdapter::handleDetach(const GdbResponse &response)
emit inferiorShutDown();
shutdown(); // re-iterate...
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Inferior process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
setState(InferiorShutdownFailed);
emit inferiorShutdownFailed(msg);
}
@@ -167,8 +166,7 @@ void AttachGdbAdapter::handleExit(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished()
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Gdb process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
emit adapterShutdownFailed(msg);
}
}

View File

@@ -221,8 +221,7 @@ void CoreGdbAdapter::handleExit(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished()
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Gdb process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
emit adapterShutdownFailed(msg);
}
}

View File

@@ -135,7 +135,7 @@ void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
if (response.resultClass == GdbResultRunning) {
QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Inferior started."));
showStatusMessage(msgInferiorStarted());
} else {
QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
QTC_ASSERT(response.resultClass == GdbResultError, /**/);
@@ -219,8 +219,7 @@ void PlainGdbAdapter::handleKill(const GdbResponse &response)
emit inferiorShutDown();
shutdown(); // re-iterate...
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Inferior process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
setState(InferiorShutdownFailed);
emit inferiorShutdownFailed(msg);
}
@@ -231,8 +230,7 @@ void PlainGdbAdapter::handleExit(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished()
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Gdb process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
emit adapterShutdownFailed(msg);
}
}

View File

@@ -212,13 +212,12 @@ void RemoteGdbAdapter::handleTargetRemote(const GdbResponse &record)
if (record.resultClass == GdbResultDone) {
// gdb server will stop the remote application itself.
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Attached to stopped inferior."));
showStatusMessage(msgAttachedToStoppedInferior());
setState(InferiorStopped);
m_engine->continueInferior();
} else if (record.resultClass == GdbResultError) {
// 16^error,msg="hd:5555: Connection timed out."
QString msg = tr("Connecting to remote server failed:\n");
msg += __(record.data.findChild("msg").data());
QString msg = msgConnectRemoteServerFailed(__(record.data.findChild("msg").data()));
setState(InferiorPreparationFailed);
emit inferiorStartFailed(msg);
}
@@ -273,8 +272,7 @@ void RemoteGdbAdapter::handleKill(const GdbResponse &response)
emit inferiorShutDown();
shutdown(); // re-iterate...
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Inferior process could not be stopped:\n") +
__(response.data.findChild("msg").data());
QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
setState(InferiorShutdownFailed);
emit inferiorShutdownFailed(msg);
}
@@ -285,8 +283,7 @@ void RemoteGdbAdapter::handleExit(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// don't set state here, this will be handled in handleGdbFinished()
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Gdb process could not be stopped:\n") +
__(response.data.findChild("msg").data());
QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
emit adapterShutdownFailed(msg);
}
}

View File

@@ -1702,11 +1702,9 @@ void TrkGdbAdapter::handleFirstContinue(const GdbResponse &record)
QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
if (record.resultClass == GdbResultDone) {
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(tr("Inferior running."));
showStatusMessage(msgInferiorRunning());
} else if (record.resultClass == GdbResultError) {
//QString msg = __(record.data.findChild("msg").data());
QString msg1 = tr("Connecting to remote server failed:");
emit inferiorStartFailed(msg1 + record.toString());
emit inferiorStartFailed(msgConnectRemoteServerFailed(record.toString()));
}
}
@@ -2083,8 +2081,7 @@ void TrkGdbAdapter::handleKill(const GdbResponse &response)
emit inferiorShutDown();
shutdown(); // re-iterate...
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Inferior process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
setState(InferiorShutdownFailed);
emit inferiorShutdownFailed(msg);
}
@@ -2096,8 +2093,7 @@ void TrkGdbAdapter::handleExit(const GdbResponse &response)
qDebug() << "EXITED, NO MESSAGE...";
// don't set state here, this will be handled in handleGdbFinished()
} else if (response.resultClass == GdbResultError) {
QString msg = tr("Gdb process could not be stopped:\n") +
__(response.data.findChild("msg").data());
const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
emit adapterShutdownFailed(msg);
}
}