From a3b7290f37a05e45cc61953cd15ebcc1f3842f3e Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jbache@trolltech.com> Date: Tue, 23 Mar 2010 14:49:02 +0100 Subject: [PATCH] Improved statusbar output for the debugger mode * We now consistently avoid punctuation when possible * Renamed usage of "Inferior" and "Program" to "Application" for increased readability * Fixed inconsistent spacing in front of statusbar label Reviewed-by:hjk --- src/plugins/debugger/debuggermanager.cpp | 7 +++--- src/plugins/debugger/debuggerplugin.cpp | 1 + .../debugger/gdb/abstractgdbadapter.cpp | 8 +++---- src/plugins/debugger/gdb/gdbengine.cpp | 22 +++++++++---------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 097a61f54e9..a1cef83dc5f 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -266,6 +266,7 @@ struct DebuggerManagerPrivate /// Views DebuggerMainWindow *m_mainWindow; + QLabel *m_statusLabel; QDockWidget *m_breakDock; @@ -769,7 +770,7 @@ void DebuggerManager::showStatusMessage(const QString &msg0, int timeout) showDebuggerOutput(LogStatus, msg0); QString msg = msg0; msg.replace(QLatin1Char('\n'), QString()); - d->m_statusLabel->setText(QLatin1String(" ") + msg); + d->m_statusLabel->setText(msg); if (timeout > 0) { d->m_statusTimer->setSingleShot(true); d->m_statusTimer->start(timeout); @@ -782,7 +783,7 @@ void DebuggerManager::showStatusMessage(const QString &msg0, int timeout) void DebuggerManager::notifyInferiorStopped() { setState(InferiorStopped); - showStatusMessage(tr("Stopped."), 5000); + showStatusMessage(tr("Stopped"), 5000); } void DebuggerManager::notifyInferiorRunning() @@ -794,7 +795,7 @@ void DebuggerManager::notifyInferiorRunning() void DebuggerManager::notifyInferiorExited() { setState(DebuggerNotReady); - showStatusMessage(tr("Exited."), 5000); + showStatusMessage(tr("Exited"), 5000); } void DebuggerManager::notifyInferiorPidChanged(qint64 pid) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 053dc51a0e8..2dad7377ff6 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1006,6 +1006,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess m_manager->threadsWindow(), SIGNAL(threadSelected(int))); hbox->addWidget(threadBox); + hbox->addSpacerItem(new QSpacerItem(4, 0)); hbox->addWidget(m_manager->statusLabel(), 10); diff --git a/src/plugins/debugger/gdb/abstractgdbadapter.cpp b/src/plugins/debugger/gdb/abstractgdbadapter.cpp index c1a7364a6c5..ea154722be0 100644 --- a/src/plugins/debugger/gdb/abstractgdbadapter.cpp +++ b/src/plugins/debugger/gdb/abstractgdbadapter.cpp @@ -76,22 +76,22 @@ QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why) QString AbstractGdbAdapter::msgInferiorStopFailed(const QString &why) { - return tr("Inferior process could not be stopped:\n%1").arg(why); + return tr("Application process could not be stopped:\n%1").arg(why); } QString AbstractGdbAdapter::msgInferiorStarted() { - return tr("Inferior started."); + return tr("Application started"); } QString AbstractGdbAdapter::msgInferiorRunning() { - return tr("Inferior running."); + return tr("Application running"); } QString AbstractGdbAdapter::msgAttachedToStoppedInferior() { - return tr("Attached to stopped inferior."); + return tr("Attached to stopped application"); } QString AbstractGdbAdapter::msgConnectRemoteServerFailed(const QString &why) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index c98713de370..237802c6f91 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -423,7 +423,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) // symbols-loaded="0" QByteArray id = result.findChild("id").data(); if (!id.isEmpty()) - showStatusMessage(tr("Library %1 loaded.").arg(_(id)), 1000); + showStatusMessage(tr("Library %1 loaded").arg(_(id)), 1000); int progress = m_progress->progressValue(); m_progress->setProgressValue(qMin(70, progress + 1)); invalidateSourcesList(); @@ -432,7 +432,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) // target-name="/usr/lib/libdrm.so.2", // host-name="/usr/lib/libdrm.so.2" QByteArray id = result.findChild("id").data(); - showStatusMessage(tr("Library %1 unloaded.").arg(_(id)), 1000); + showStatusMessage(tr("Library %1 unloaded").arg(_(id)), 1000); invalidateSourcesList(); } else if (asyncClass == "thread-group-created") { // Archer has "{id="28902"}" @@ -446,20 +446,20 @@ void GdbEngine::handleResponse(const QByteArray &buff) } else if (asyncClass == "thread-created") { //"{id="1",group-id="28902"}" QByteArray id = result.findChild("id").data(); - showStatusMessage(tr("Thread %1 created.").arg(_(id)), 1000); + showStatusMessage(tr("Thread %1 created").arg(_(id)), 1000); } else if (asyncClass == "thread-group-exited") { // Archer has "{id="28902"}" QByteArray id = result.findChild("id").data(); - showStatusMessage(tr("Thread group %1 exited.").arg(_(id)), 1000); + showStatusMessage(tr("Thread group %1 exited").arg(_(id)), 1000); } else if (asyncClass == "thread-exited") { //"{id="1",group-id="28902"}" QByteArray id = result.findChild("id").data(); QByteArray groupid = result.findChild("group-id").data(); - showStatusMessage(tr("Thread %1 in group %2 exited.") + showStatusMessage(tr("Thread %1 in group %2 exited") .arg(_(id)).arg(_(groupid)), 1000); } else if (asyncClass == "thread-selected") { QByteArray id = result.findChild("id").data(); - showStatusMessage(tr("Thread %1 selected.").arg(_(id)), 1000); + showStatusMessage(tr("Thread %1 selected").arg(_(id)), 1000); //"{id="2"}" #if defined(Q_OS_MAC) } else if (asyncClass == "shlibs-updated") { @@ -1161,13 +1161,13 @@ void GdbEngine::handleStopResponse(const GdbMi &data) setState(InferiorStopped); QString msg; if (reason == "exited") { - msg = tr("Program exited with exit code %1.") + msg = tr("Application exited with exit code %1") .arg(_(data.findChild("exit-code").toString())); } else if (reason == "exited-signalled" || reason == "signal-received") { - msg = tr("Program exited after receiving signal %1.") + msg = tr("Application exited after receiving signal %1") .arg(_(data.findChild("signal-name").toString())); } else { - msg = tr("Program exited normally."); + msg = tr("Application exited normally"); } showStatusMessage(msg); setState(InferiorShuttingDown); @@ -1380,7 +1380,7 @@ void GdbEngine::handleStop1(const GdbMi &data) showMessageBox(QMessageBox::Information, tr("Signal received"), msg); if (!name.isEmpty() && !meaning.isEmpty()) - reasontr = tr("Stopped: %1 by signal %2.") + reasontr = tr("Stopped: %1 by signal %2") .arg(_(meaning)).arg(_(name)); } } @@ -3288,7 +3288,7 @@ void GdbEngine::rebuildWatchModel() if (theDebuggerBoolSetting(LogTimeStamps)) showDebuggerInput(LogMisc, currentTime()); showDebuggerInput(LogStatus, _("<Rebuild Watchmodel %1>").arg(count)); - showStatusMessage(tr("Finished retrieving data."), 400); + showStatusMessage(tr("Finished retrieving data"), 400); manager()->watchHandler()->endCycle(); showToolTip(); } -- GitLab