forked from qt-creator/qt-creator
debugger: make user visible strings translatable
This commit is contained in:
@@ -85,15 +85,15 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QModelIndex index = indexAt(ev->pos());
|
QModelIndex index = indexAt(ev->pos());
|
||||||
QAction *act0 = new QAction("Delete breakpoint", &menu);
|
QAction *act0 = new QAction(tr("Delete breakpoint"), &menu);
|
||||||
act0->setEnabled(index.isValid());
|
act0->setEnabled(index.isValid());
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
QAction *act3 = new QAction("Edit condition...", &menu);
|
QAction *act3 = new QAction(tr("Edit condition..."), &menu);
|
||||||
act0->setEnabled(index.isValid());
|
act0->setEnabled(index.isValid());
|
||||||
QAction *act4 = new QAction("Syncronize breakpoints", &menu);
|
QAction *act4 = new QAction(tr("Syncronize breakpoints"), &menu);
|
||||||
|
|
||||||
menu.addAction(act0);
|
menu.addAction(act0);
|
||||||
menu.addAction(act3);
|
menu.addAction(act3);
|
||||||
|
@@ -96,16 +96,7 @@ QString DebuggerSettings::dump()
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebuggerSettings *DebuggerSettings::instance()
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Debugger specific actions and settings
|
|
||||||
//
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
DebuggerSettings *theDebuggerSettings()
|
|
||||||
{
|
{
|
||||||
static DebuggerSettings *instance = 0;
|
static DebuggerSettings *instance = 0;
|
||||||
if (instance)
|
if (instance)
|
||||||
@@ -117,18 +108,18 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(SettingsDialog, item);
|
instance->insertItem(SettingsDialog, item);
|
||||||
item->setText(QObject::tr("Debugger properties..."));
|
item->setText(tr("Debugger properties..."));
|
||||||
|
|
||||||
//
|
//
|
||||||
// View
|
// View
|
||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AdjustColumnWidths, item);
|
instance->insertItem(AdjustColumnWidths, item);
|
||||||
item->setText(QObject::tr("Adjust column widths to contents"));
|
item->setText(tr("Adjust column widths to contents"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AlwaysAdjustColumnWidths, item);
|
instance->insertItem(AlwaysAdjustColumnWidths, item);
|
||||||
item->setText(QObject::tr("Always adjust column widths to contents"));
|
item->setText(tr("Always adjust column widths to contents"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -136,15 +127,15 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(WatchExpression, item);
|
instance->insertItem(WatchExpression, item);
|
||||||
item->setTextPattern(QObject::tr("Watch expression \"%1\""));
|
item->setTextPattern(tr("Watch expression \"%1\""));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(RemoveWatchExpression, item);
|
instance->insertItem(RemoveWatchExpression, item);
|
||||||
item->setTextPattern(QObject::tr("Remove watch expression \"%1\""));
|
item->setTextPattern(tr("Remove watch expression \"%1\""));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(WatchExpressionInWindow, item);
|
instance->insertItem(WatchExpressionInWindow, item);
|
||||||
item->setTextPattern(QObject::tr("Watch expression \"%1\" in separate window"));
|
item->setTextPattern(tr("Watch expression \"%1\" in separate window"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AssignValue, item);
|
instance->insertItem(AssignValue, item);
|
||||||
@@ -154,11 +145,11 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(ExpandItem, item);
|
instance->insertItem(ExpandItem, item);
|
||||||
item->setText(QObject::tr("Expand item"));
|
item->setText(tr("Expand item"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(CollapseItem, item);
|
instance->insertItem(CollapseItem, item);
|
||||||
item->setText(QObject::tr("Collapse item"));
|
item->setText(tr("Collapse item"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// DebuggingHelper
|
// DebuggingHelper
|
||||||
@@ -167,7 +158,7 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
instance->insertItem(UseDebuggingHelpers, item);
|
instance->insertItem(UseDebuggingHelpers, item);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
item->setSettingsKey("DebugMode", "UseDebuggingHelper");
|
item->setSettingsKey("DebugMode", "UseDebuggingHelper");
|
||||||
item->setText(QObject::tr("Use Debugging Helper"));
|
item->setText(tr("Use Debugging Helper"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
|
|
||||||
@@ -183,19 +174,19 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(DebugDebuggingHelpers, item);
|
instance->insertItem(DebugDebuggingHelpers, item);
|
||||||
item->setSettingsKey("DebugMode", "DebugDebuggingHelpers");
|
item->setSettingsKey("DebugMode", "DebugDebuggingHelpers");
|
||||||
item->setText(QObject::tr("Debug debugging helper"));
|
item->setText(tr("Debug debugging helper"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
|
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Recheck debugging helper availability"));
|
item->setText(tr("Recheck debugging helper availability"));
|
||||||
instance->insertItem(RecheckDebuggingHelpers, item);
|
instance->insertItem(RecheckDebuggingHelpers, item);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Breakpoints
|
// Breakpoints
|
||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Syncronize breakpoints"));
|
item->setText(tr("Syncronize breakpoints"));
|
||||||
instance->insertItem(SynchronizeBreakpoints, item);
|
instance->insertItem(SynchronizeBreakpoints, item);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -206,7 +197,7 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
registerFormatGroup->setExclusive(true);
|
registerFormatGroup->setExclusive(true);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Hexadecimal"));
|
item->setText(tr("Hexadecimal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatHexadecimal");
|
item->setSettingsKey("DebugMode", "FormatHexadecimal");
|
||||||
item->setChecked(true);
|
item->setChecked(true);
|
||||||
@@ -214,35 +205,35 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Decimal"));
|
item->setText(tr("Decimal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatDecimal");
|
item->setSettingsKey("DebugMode", "FormatDecimal");
|
||||||
instance->insertItem(FormatDecimal, item);
|
instance->insertItem(FormatDecimal, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Octal"));
|
item->setText(tr("Octal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatOctal");
|
item->setSettingsKey("DebugMode", "FormatOctal");
|
||||||
instance->insertItem(FormatOctal, item);
|
instance->insertItem(FormatOctal, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Binary"));
|
item->setText(tr("Binary"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatBinary");
|
item->setSettingsKey("DebugMode", "FormatBinary");
|
||||||
instance->insertItem(FormatBinary, item);
|
instance->insertItem(FormatBinary, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Raw"));
|
item->setText(tr("Raw"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatRaw");
|
item->setSettingsKey("DebugMode", "FormatRaw");
|
||||||
instance->insertItem(FormatRaw, item);
|
instance->insertItem(FormatRaw, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Natural"));
|
item->setText(tr("Natural"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatNatural");
|
item->setSettingsKey("DebugMode", "FormatNatural");
|
||||||
instance->insertItem(FormatNatural, item);
|
instance->insertItem(FormatNatural, item);
|
||||||
@@ -266,13 +257,13 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "AutoQuit");
|
item->setSettingsKey("DebugMode", "AutoQuit");
|
||||||
item->setText(QObject::tr("Automatically quit debugger"));
|
item->setText(tr("Automatically quit debugger"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(AutoQuit, item);
|
instance->insertItem(AutoQuit, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "UseToolTips");
|
item->setSettingsKey("DebugMode", "UseToolTips");
|
||||||
item->setText(QObject::tr("Use tooltips when debugging"));
|
item->setText(tr("Use tooltips when debugging"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(UseToolTips, item);
|
instance->insertItem(UseToolTips, item);
|
||||||
|
|
||||||
@@ -283,13 +274,13 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "ListSourceFiles");
|
item->setSettingsKey("DebugMode", "ListSourceFiles");
|
||||||
item->setText(QObject::tr("List source files"));
|
item->setText(tr("List source files"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ListSourceFiles, item);
|
instance->insertItem(ListSourceFiles, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "SkipKnownFrames");
|
item->setSettingsKey("DebugMode", "SkipKnownFrames");
|
||||||
item->setText(QObject::tr("Skip known frames"));
|
item->setText(tr("Skip known frames"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(SkipKnownFrames, item);
|
instance->insertItem(SkipKnownFrames, item);
|
||||||
|
|
||||||
@@ -315,29 +306,35 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
instance->insertItem(MaximalStackDepth, item);
|
instance->insertItem(MaximalStackDepth, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Reload full stack"));
|
item->setText(tr("Reload full stack"));
|
||||||
instance->insertItem(ExpandStack, item);
|
instance->insertItem(ExpandStack, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Execute line"));
|
item->setText(tr("Execute line"));
|
||||||
instance->insertItem(ExecuteCommand, item);
|
instance->insertItem(ExecuteCommand, item);
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DebuggerActions
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SavedAction *theDebuggerAction(int code)
|
SavedAction *theDebuggerAction(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code);
|
return DebuggerSettings::instance()->item(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool theDebuggerBoolSetting(int code)
|
bool theDebuggerBoolSetting(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code)->value().toBool();
|
return DebuggerSettings::instance()->item(code)->value().toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString theDebuggerStringSetting(int code)
|
QString theDebuggerStringSetting(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code)->value().toString();
|
return DebuggerSettings::instance()->item(code)->value().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -50,6 +50,8 @@ public:
|
|||||||
|
|
||||||
QString dump();
|
QString dump();
|
||||||
|
|
||||||
|
static DebuggerSettings *instance();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readSettings(QSettings *settings);
|
void readSettings(QSettings *settings);
|
||||||
void writeSettings(QSettings *settings);
|
void writeSettings(QSettings *settings);
|
||||||
@@ -121,7 +123,6 @@ enum DebuggerActionCode
|
|||||||
};
|
};
|
||||||
|
|
||||||
// singleton access
|
// singleton access
|
||||||
DebuggerSettings *theDebuggerSettings();
|
|
||||||
Core::Utils::SavedAction *theDebuggerAction(int code);
|
Core::Utils::SavedAction *theDebuggerAction(int code);
|
||||||
|
|
||||||
// convienience
|
// convienience
|
||||||
|
@@ -498,8 +498,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
|
|
||||||
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
||||||
|
|
||||||
|
// FIXME: make this a global action
|
||||||
m_breakpointMarginAction = new QAction(this);
|
m_breakpointMarginAction = new QAction(this);
|
||||||
m_breakpointMarginAction->setText("Toggle Breakpoint");
|
m_breakpointMarginAction->setText(tr("Toggle Breakpoint"));
|
||||||
//m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
//m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
||||||
connect(m_breakpointMarginAction, SIGNAL(triggered()),
|
connect(m_breakpointMarginAction, SIGNAL(triggered()),
|
||||||
this, SLOT(breakpointMarginActionTriggered()));
|
this, SLOT(breakpointMarginActionTriggered()));
|
||||||
@@ -976,7 +977,7 @@ void DebuggerPlugin::writeSettings() const
|
|||||||
QTC_ASSERT(m_manager->mainWindow(), return);
|
QTC_ASSERT(m_manager->mainWindow(), return);
|
||||||
|
|
||||||
QSettings *s = settings();
|
QSettings *s = settings();
|
||||||
theDebuggerSettings()->writeSettings(s);
|
DebuggerSettings::instance()->writeSettings(s);
|
||||||
s->beginGroup(QLatin1String("DebugMode"));
|
s->beginGroup(QLatin1String("DebugMode"));
|
||||||
s->setValue("State", m_manager->mainWindow()->saveState());
|
s->setValue("State", m_manager->mainWindow()->saveState());
|
||||||
s->setValue("Locked", m_toggleLockedAction->isChecked());
|
s->setValue("Locked", m_toggleLockedAction->isChecked());
|
||||||
@@ -986,7 +987,7 @@ void DebuggerPlugin::writeSettings() const
|
|||||||
void DebuggerPlugin::readSettings()
|
void DebuggerPlugin::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = settings();
|
QSettings *s = settings();
|
||||||
theDebuggerSettings()->readSettings(s);
|
DebuggerSettings::instance()->readSettings(s);
|
||||||
|
|
||||||
QString defaultCommand("gdb");
|
QString defaultCommand("gdb");
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
|
@@ -121,13 +121,11 @@ QVariant DisassemblerModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
int role) const
|
int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
switch (section) {
|
||||||
QT_TR_NOOP("Address"),
|
case 1: return DisassemblerHandler::tr("Address");
|
||||||
QT_TR_NOOP("Symbol"),
|
case 2: return DisassemblerHandler::tr("Symbol");
|
||||||
QT_TR_NOOP("Mnemonic"),
|
case 3: return DisassemblerHandler::tr("Mnemonic");
|
||||||
};
|
};
|
||||||
if (section < 3)
|
|
||||||
return tr(headers[section]);
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "disassemblerwindow.h"
|
#include "disassemblerwindow.h"
|
||||||
|
#include "debuggeractions.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -68,24 +69,23 @@ void DisassemblerWindow::resizeEvent(QResizeEvent *ev)
|
|||||||
void DisassemblerWindow::contextMenuEvent(QContextMenuEvent *ev)
|
void DisassemblerWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
//QTreeWidgetItem *item = itemAt(ev->pos());
|
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
|
// FIXME: make this a SavedAction
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
QAction *act3 = new QAction("Reload disassembler listing", &menu);
|
QAction *act3 = new QAction(tr("Reload disassembler listing"), &menu);
|
||||||
QAction *act4 = new QAction("Always reload disassembler listing", &menu);
|
QAction *act4 = new QAction(tr("Always reload disassembler listing"), &menu);
|
||||||
act4->setCheckable(true);
|
act4->setCheckable(true);
|
||||||
act4->setChecked(m_alwaysReloadContents);
|
act4->setChecked(m_alwaysReloadContents);
|
||||||
//if (item) {
|
|
||||||
// menu.addAction(act0);
|
|
||||||
// menu.addSeparator();
|
|
||||||
//}
|
|
||||||
menu.addAction(act3);
|
menu.addAction(act3);
|
||||||
//menu.addAction(act4);
|
//menu.addAction(act4);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(act1);
|
menu.addAction(act1);
|
||||||
menu.addAction(act2);
|
menu.addAction(act2);
|
||||||
|
menu.addSeparator();
|
||||||
|
menu.addAction(theDebuggerAction(SettingsDialog));
|
||||||
|
|
||||||
QAction *act = menu.exec(ev->globalPos());
|
QAction *act = menu.exec(ev->globalPos());
|
||||||
|
|
||||||
|
@@ -1534,7 +1534,7 @@ int GdbEngine::currentFrame() const
|
|||||||
|
|
||||||
bool GdbEngine::startDebugger()
|
bool GdbEngine::startDebugger()
|
||||||
{
|
{
|
||||||
debugMessage(theDebuggerSettings()->dump());
|
debugMessage(DebuggerSettings::instance()->dump());
|
||||||
QStringList gdbArgs;
|
QStringList gdbArgs;
|
||||||
|
|
||||||
if (m_gdbProc.state() != QProcess::NotRunning) {
|
if (m_gdbProc.state() != QProcess::NotRunning) {
|
||||||
@@ -2727,7 +2727,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (!hasLetterOrNumber(exp)) {
|
if (!hasLetterOrNumber(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"'" + exp + "' contains no identifier");
|
tr("'%1' contains no identifier").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2750,8 +2750,8 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (hasSideEffects(exp)) {
|
if (hasSideEffects(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cowardly refusing to evaluate expression '" + exp
|
tr("Cowardly refusing to evaluate expression '%1' "
|
||||||
+ "' with potential side effects");
|
"with potential side effects").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2763,7 +2763,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
qDebug() << "THIS IN ROW " << i;
|
qDebug() << "THIS IN ROW " << i;
|
||||||
if (m_currentLocals.childAt(i).type.startsWith(exp)) {
|
if (m_currentLocals.childAt(i).type.startsWith(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
exp + ": type of current 'this'");
|
tr("%1: type of current 'this'").arg(exp));
|
||||||
qDebug() << " TOOLTIP CRASH SUPPRESSED";
|
qDebug() << " TOOLTIP CRASH SUPPRESSED";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3329,7 +3329,7 @@ void GdbEngine::updateWatchModel2()
|
|||||||
"(" + data->type + ") " + data->exp + " = " + data->value);
|
"(" + data->type + ") " + data->exp + " = " + data->value);
|
||||||
} else {
|
} else {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cannot evaluate expression: " + m_toolTipExpression);
|
tr("Cannot evaluate expression: %1").arg(m_toolTipExpression));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,10 +75,8 @@ QVariant RegisterHandler::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0: return reg.name;
|
||||||
return reg.name;
|
case 1: return reg.value;
|
||||||
case 1:
|
|
||||||
return reg.value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (role == Qt::TextColorRole && reg.changed && index.column() == 1)
|
if (role == Qt::TextColorRole && reg.changed && index.column() == 1)
|
||||||
@@ -90,12 +88,10 @@ QVariant RegisterHandler::headerData(int section, Qt::Orientation orientation,
|
|||||||
int role) const
|
int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
switch (section) {
|
||||||
QT_TR_NOOP("Name"),
|
case 0: return tr("Name");
|
||||||
QT_TR_NOOP("Value"),
|
case 1: return tr("Value");
|
||||||
};
|
};
|
||||||
if (section < 2)
|
|
||||||
return tr(headers[section]);
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@@ -81,15 +81,15 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
//QString format = model()->property(PROPERTY_REGISTER_FORMAT).toString();
|
//QString format = model()->property(PROPERTY_REGISTER_FORMAT).toString();
|
||||||
//qDebug() << "FORMAT: " << format;
|
//qDebug() << "FORMAT: " << format;
|
||||||
|
|
||||||
actions[Adjust] = menu.addAction("Adjust column widths to contents");
|
actions[Adjust] = menu.addAction(tr("Adjust column widths to contents"));
|
||||||
|
|
||||||
actions[AlwaysAdjust] = menu.addAction("Always adjust column widths to contents");
|
actions[AlwaysAdjust] = menu.addAction(tr("Always adjust column widths to contents"));
|
||||||
actions[AlwaysAdjust]->setCheckable(true);
|
actions[AlwaysAdjust]->setCheckable(true);
|
||||||
actions[AlwaysAdjust]->setChecked(m_alwaysResizeColumnsToContents);
|
actions[AlwaysAdjust]->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
|
|
||||||
actions[Reload] = menu.addAction("Reload register listing");
|
actions[Reload] = menu.addAction(tr("Reload register listing"));
|
||||||
|
|
||||||
actions[AlwaysReload] = menu.addAction("Always reload register listing");
|
actions[AlwaysReload] = menu.addAction(tr("Always reload register listing"));
|
||||||
actions[AlwaysReload]->setCheckable(true);
|
actions[AlwaysReload]->setCheckable(true);
|
||||||
actions[AlwaysReload]->setChecked(m_alwaysReloadContents);
|
actions[AlwaysReload]->setChecked(m_alwaysReloadContents);
|
||||||
|
|
||||||
|
@@ -489,8 +489,8 @@ void ScriptEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (hasSideEffects(exp)) {
|
if (hasSideEffects(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cowardly refusing to evaluate expression '" + exp
|
tr("Cowardly refusing to evaluate expression '%1' "
|
||||||
+ "' with potential side effects");
|
"with potential side effects").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -232,7 +232,7 @@ QVariant ThreadsHandler::data(const QModelIndex &index, int role) const
|
|||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
} else if (role == Qt::ToolTipRole) {
|
} else if (role == Qt::ToolTipRole) {
|
||||||
return "Thread: " + QString::number(m_threads.at(index.row()).id);
|
return tr("Thread: %1").arg(m_threads.at(index.row()).id);
|
||||||
} else if (role == Qt::DecorationRole && index.column() == 0) {
|
} else if (role == Qt::DecorationRole && index.column() == 0) {
|
||||||
// Return icon that indicates whether this is the active stack frame
|
// Return icon that indicates whether this is the active stack frame
|
||||||
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
|
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
|
||||||
@@ -244,11 +244,8 @@ QVariant ThreadsHandler::data(const QModelIndex &index, int role) const
|
|||||||
QVariant ThreadsHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant ThreadsHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
|
||||||
QT_TR_NOOP("Thread ID"),
|
|
||||||
};
|
|
||||||
if (section < 1)
|
if (section < 1)
|
||||||
return tr(headers[section]);
|
return tr("Thread ID");
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@@ -293,7 +293,7 @@ static QList<WatchData> initialSet()
|
|||||||
root.state = 0;
|
root.state = 0;
|
||||||
root.level = 0;
|
root.level = 0;
|
||||||
root.row = 0;
|
root.row = 0;
|
||||||
root.name = QLatin1String("Root");
|
root.name = WatchHandler::tr("Root");
|
||||||
root.parentIndex = -1;
|
root.parentIndex = -1;
|
||||||
root.childIndex.append(1);
|
root.childIndex.append(1);
|
||||||
root.childIndex.append(2);
|
root.childIndex.append(2);
|
||||||
@@ -302,7 +302,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData local;
|
WatchData local;
|
||||||
local.iname = QLatin1String("local");
|
local.iname = QLatin1String("local");
|
||||||
local.name = QLatin1String("Locals");
|
local.name = WatchHandler::tr("Locals");
|
||||||
local.state = 0;
|
local.state = 0;
|
||||||
local.level = 1;
|
local.level = 1;
|
||||||
local.row = 0;
|
local.row = 0;
|
||||||
@@ -311,7 +311,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData tooltip;
|
WatchData tooltip;
|
||||||
tooltip.iname = QLatin1String("tooltip");
|
tooltip.iname = QLatin1String("tooltip");
|
||||||
tooltip.name = QLatin1String("Tooltip");
|
tooltip.name = WatchHandler::tr("Tooltip");
|
||||||
tooltip.state = 0;
|
tooltip.state = 0;
|
||||||
tooltip.level = 1;
|
tooltip.level = 1;
|
||||||
tooltip.row = 1;
|
tooltip.row = 1;
|
||||||
@@ -320,7 +320,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData watch;
|
WatchData watch;
|
||||||
watch.iname = QLatin1String("watch");
|
watch.iname = QLatin1String("watch");
|
||||||
watch.name = QLatin1String("Watchers");
|
watch.name = WatchHandler::tr("Watchers");
|
||||||
watch.state = 0;
|
watch.state = 0;
|
||||||
watch.level = 1;
|
watch.level = 1;
|
||||||
watch.row = 2;
|
watch.row = 2;
|
||||||
@@ -711,13 +711,13 @@ void WatchHandler::rebuildModel()
|
|||||||
dummy.row = 0;
|
dummy.row = 0;
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
dummy.iname = QLatin1String("local.dummy");
|
dummy.iname = QLatin1String("local.dummy");
|
||||||
dummy.name = QLatin1String("<No Locals>");
|
dummy.name = tr("<No Locals>");
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
dummy.iname = QLatin1String("tooltip.dummy");
|
dummy.iname = QLatin1String("tooltip.dummy");
|
||||||
dummy.name = QLatin1String("<No Tooltip>");
|
dummy.name = tr("<No Tooltip>");
|
||||||
} else {
|
} else {
|
||||||
dummy.iname = QLatin1String("watch.dummy");
|
dummy.iname = QLatin1String("watch.dummy");
|
||||||
dummy.name = QLatin1String("<No Watchers>");
|
dummy.name = tr("<No Watchers>");
|
||||||
}
|
}
|
||||||
dummy.level = 2;
|
dummy.level = 2;
|
||||||
dummy.parentIndex = i;
|
dummy.parentIndex = i;
|
||||||
|
@@ -164,8 +164,8 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev)
|
|||||||
void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
else if (act == act2)
|
else if (act == act2)
|
||||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||||
else if (act == act3)
|
else if (act == act3)
|
||||||
theDebuggerAction(WatchExpression)->trigger("<Edit>");
|
theDebuggerAction(WatchExpression)->trigger(tr("<Edit>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchWindow::resizeColumnsToContents()
|
void WatchWindow::resizeColumnsToContents()
|
||||||
|
Reference in New Issue
Block a user