Commit 931f8859 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

debuggercommon: add more UI context marker for strings, fix some style

GIT_SILENT
parent 64a66447
......@@ -39,7 +39,7 @@ using namespace KDevMI;
ProcessSelectionDialog::ProcessSelectionDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Attach to a Process"));
setWindowTitle(i18nc("@title:window", "Attach to a Process"));
m_processList = new KSysGuardProcessList(this);
auto* mainLayout = new QVBoxLayout;
setLayout(mainLayout);
......@@ -59,7 +59,7 @@ ProcessSelectionDialog::ProcessSelectionDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_attachButton = buttonBox->button(QDialogButtonBox::Ok);
m_attachButton->setDefault(true);
m_attachButton->setText(i18n("Attach"));
m_attachButton->setText(i18nc("@action:button", "Attach"));
m_attachButton->setShortcut(Qt::CTRL | Qt::Key_Return);
m_attachButton->setEnabled(false);
......
......@@ -30,7 +30,7 @@ SelectCoreDialog::SelectCoreDialog(QWidget* parent)
{
m_ui.setupUi(this);
setWindowTitle(i18n("Select Core File"));
setWindowTitle(i18nc("@title:window", "Select Core File"));
}
QUrl SelectCoreDialog::executableFile() const
......
......@@ -16,7 +16,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Executable:</string>
<string comment="@label:chooser">Executable:</string>
</property>
<property name="buddy">
<cstring>executableFile</cstring>
......@@ -29,7 +29,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Core file:</string>
<string comment="@label:chooser">Core file:</string>
</property>
<property name="buddy">
<cstring>coreFile</cstring>
......
......@@ -327,7 +327,7 @@ void MIDebugger::processLine(const QByteArray& line)
i18n("The exception is: %1\n"
"The MI response is: %2", QString::fromUtf8(e.what()),
QString::fromLatin1(line)),
i18n("Internal debugger error"));
i18nc("@title:window", "Internal Debugger Error"));
emit exited(true, QString::fromUtf8(e.what()));
}
#endif
......@@ -366,7 +366,7 @@ void MIDebugger::processErrored(QProcess::ProcessError error)
"Because of that the debug session has to be ended.<br>"
"Try to reproduce the crash without KDevelop and report a bug.<br>",
m_debuggerExecutable),
i18n("Debugger crashed"));
i18nc("@title:window", "Debugger Crashed"));
emit userCommandOutput(QStringLiteral("Process crashed\n"));
emit exited(true, i18n("Process crashed"));
......
......@@ -122,8 +122,9 @@ void MIDebuggerPlugin::setupActions()
auto * action = new QAction(this);
action->setIcon(QIcon::fromTheme(QStringLiteral("core")));
action->setText(i18n("Examine Core File with %1", m_displayName));
action->setWhatsThis(i18n("<b>Examine core file</b>"
action->setText(i18nc("@action", "Examine Core File with %1", m_displayName));
action->setWhatsThis(i18nc("@info:whatsthis",
"<b>Examine core file</b>"
"<p>This loads a core file, which is typically created "
"after the application has crashed, e.g. with a "
"segmentation fault. The core file contains an "
......@@ -135,8 +136,9 @@ void MIDebuggerPlugin::setupActions()
#if HAVE_KSYSGUARD
action = new QAction(this);
action->setIcon(QIcon::fromTheme(QStringLiteral("connect_creating")));
action->setText(i18n("Attach to Process with %1", m_displayName));
action->setWhatsThis(i18n("<b>Attach to process</b>"
action->setText(i18nc("@action", "Attach to Process with %1", m_displayName));
action->setWhatsThis(i18nc("@info:whatsthis",
"<b>Attach to process</b>"
"<p>Attaches the debugger to a running process.</p>"));
connect(action, &QAction::triggered, this, &MIDebuggerPlugin::slotAttachProcess);
ac->addAction(QStringLiteral("debug_attach"), action);
......@@ -221,8 +223,9 @@ ContextMenuExtension MIDebuggerPlugin::contextMenuExtension(Context* context, QW
QString squeezed = KStringHandler::csqueeze(contextIdent, 30);
auto* action = new QAction(parent);
action->setText(i18n("Evaluate: %1", squeezed));
action->setWhatsThis(i18n("<b>Evaluate expression</b>"
action->setText(i18nc("@action:inmenu", "Evaluate: %1", squeezed));
action->setWhatsThis(i18nc("@info:whatsthis",
"<b>Evaluate expression</b>"
"<p>Shows the value of the expression under the cursor.</p>"));
connect(action, &QAction::triggered, this, [this, contextIdent](){
emit addWatchVariable(contextIdent);
......@@ -230,8 +233,9 @@ ContextMenuExtension MIDebuggerPlugin::contextMenuExtension(Context* context, QW
menuExt.addAction(ContextMenuExtension::DebugGroup, action);
action = new QAction(parent);
action->setText(i18n("Watch: %1", squeezed));
action->setWhatsThis(i18n("<b>Watch expression</b>"
action->setText(i18nc("@action:inmenu", "Watch: %1", squeezed));
action->setWhatsThis(i18nc("@info:whatsthis",
"<b>Watch expression</b>"
"<p>Adds the expression under the cursor to the Variables/Watch list.</p>"));
connect(action, &QAction::triggered, this, [this, contextIdent](){
emit evaluateExpression(contextIdent);
......
......@@ -62,7 +62,7 @@ void RegistersView::contextMenuEvent(QContextMenuEvent* e)
const QVector<Format> formats = m_modelsManager->formats(group);
if (formats.size() > 1) {
QMenu* m = m_menu->addMenu(i18n("Format"));
QMenu* m = m_menu->addMenu(i18nc("@title:menu", "Format"));
for (Format fmt : formats) {
m->addAction(findAction(Converters::formatToString(fmt)));
}
......@@ -71,7 +71,7 @@ void RegistersView::contextMenuEvent(QContextMenuEvent* e)
const QVector<Mode> modes = m_modelsManager->modes(group);
if (modes.size() > 1) {
QMenu* m = m_menu->addMenu(i18n("Mode"));
QMenu* m = m_menu->addMenu(i18nc("@title:menu", "Mode"));
for (Mode mode : modes) {
m->addAction(findAction(Converters::modeToString(mode)));
}
......@@ -206,7 +206,7 @@ void RegistersView::setupActions()
auto* updateAction = new QAction(this);
updateAction->setShortcut(Qt::Key_U);
updateAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
updateAction->setText(i18n("Update"));
updateAction->setText(i18nc("@action:inmenu", "Update"));
connect(updateAction, &QAction::triggered, this, &RegistersView::updateRegisters);
addAction(updateAction);
m_menu->addAction(updateAction);
......
......@@ -61,32 +61,35 @@ DebuggerConsoleView::DebuggerConsoleView(MIDebuggerPlugin *plugin, QWidget *pare
, m_maxLines(5000)
{
setWindowIcon(QIcon::fromTheme(QStringLiteral("dialog-scripts")));
setWindowTitle(i18n("Debugger Console"));
setWhatsThis(i18n("<b>Debugger Console</b><p>"
setWindowTitle(i18nc("@title:window", "Debugger Console"));
setWhatsThis(i18nc("@info:whatsthis",
"<b>Debugger Console</b><p>"
"Shows all debugger commands being executed. "
"You can also issue any other debugger command while debugging.</p>"));
setupUi();
m_actRepeat = new QAction(QIcon::fromTheme(QStringLiteral("edit-redo")),
i18n("Repeat last command when hit Return"),
QString(),
this);
m_actRepeat->setToolTip(i18nc("@info:tooltip", "Repeat last command when hit Return"));
m_actRepeat->setCheckable(true);
m_actRepeat->setChecked(m_repeatLastCommand);
connect(m_actRepeat, &QAction::toggled, this, &DebuggerConsoleView::toggleRepeat);
m_toolBar->insertAction(m_actCmdEditor, m_actRepeat);
m_actInterrupt = new QAction(QIcon::fromTheme(QStringLiteral("media-playback-pause")),
i18n("Pause execution of the app to enter gdb commands"),
QString(),
this);
m_actInterrupt->setToolTip(i18nc("@info:tooltip", "Pause execution of the app to enter debugger commands"));
connect(m_actInterrupt, &QAction::triggered, this, &DebuggerConsoleView::interruptDebugger);
m_toolBar->insertAction(m_actCmdEditor, m_actInterrupt);
setShowInterrupt(true);
m_actShowInternal = new QAction(i18n("Show Internal Commands"), this);
m_actShowInternal = new QAction(i18nc("@action", "Show Internal Commands"), this);
m_actShowInternal->setCheckable(true);
m_actShowInternal->setChecked(m_showInternalCommands);
m_actShowInternal->setWhatsThis(i18n(
m_actShowInternal->setWhatsThis(i18nc("@info:whatsthis",
"Controls if commands issued internally by KDevelop "
"will be shown or not.<br>"
"This option will affect only future commands, it will not "
......@@ -148,7 +151,7 @@ void DebuggerConsoleView::setupUi()
connect(m_cmdEditor, QOverload<const QString&>::of(&KHistoryComboBox::returnPressed),
this, &DebuggerConsoleView::trySendCommand);
auto label = new QLabel(i18n("&Command:"), this);
auto label = new QLabel(i18nc("@label:listbox", "&Command:"), this);
label->setBuddy(m_cmdEditor);
auto hbox = new QHBoxLayout;
......@@ -170,7 +173,7 @@ void DebuggerConsoleView::setupToolBar()
m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolBar->setFloatable(false);
m_toolBar->setMovable(false);
m_toolBar->setWindowTitle(i18n("%1 Command Bar", windowTitle()));
m_toolBar->setWindowTitle(i18nc("@title:window", "%1 Command Bar", windowTitle()));
m_toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
// remove margins, to make command editor nicely aligned with the output
......
......@@ -11,19 +11,13 @@
</rect>
</property>
<property name="windowTitle">
<string>Debugger Console</string>
<string comment="@title:window">Debugger Console</string>
</property>
<property name="windowIcon">
<iconset theme="dialog-scripts"/>
</property>
<property name="whatsThis">
<string/>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
......@@ -56,10 +50,10 @@
<iconset theme="media-playback-pause"/>
</property>
<property name="text">
<string>Interrupt</string>
<string comment="@action">Interrupt</string>
</property>
<property name="toolTip">
<string>Pause execution of the app to enter gdb commands</string>
<string comment="@info:tooltip">Pause execution of the app to enter debugger commands</string>
</property>
</action>
<action name="actRepeat">
......@@ -73,10 +67,10 @@
<iconset theme="edit-redo"/>
</property>
<property name="text">
<string>Repeat</string>
<string comment="@action">Repeat</string>
</property>
<property name="toolTip">
<string>Repeat last sent command when hit &lt;Return&gt;</string>
<string comment="@info:tooltip">Repeat last sent command when hit &lt;Return&gt;</string>
</property>
</action>
</widget>
......
......@@ -56,7 +56,7 @@ SelectAddressDialog::SelectAddressDialog(QWidget* parent)
: QDialog(parent)
{
m_ui.setupUi(this);
setWindowTitle(i18n("Address Selector"));
setWindowTitle(i18nc("@title:window", "Address Selector"));
connect(m_ui.comboBox, &KHistoryComboBox::editTextChanged,
this, &SelectAddressDialog::validateInput);
......@@ -100,25 +100,25 @@ DisassembleWindow::DisassembleWindow(QWidget *parent, DisassembleWidget* widget)
: QTreeWidget(parent)
{
/*context menu commands */{
m_selectAddrAction = new QAction(i18n("Change &address"), this);
m_selectAddrAction = new QAction(i18nc("@action", "Change &Address"), this);
m_selectAddrAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(m_selectAddrAction, &QAction::triggered, widget, &DisassembleWidget::slotChangeAddress);
m_jumpToLocation = new QAction(QIcon::fromTheme(QStringLiteral("debug-execute-to-cursor")), i18n("&Jump to Cursor"), this);
m_jumpToLocation->setWhatsThis(i18n("Sets the execution pointer to the current cursor position."));
m_jumpToLocation = new QAction(QIcon::fromTheme(QStringLiteral("debug-execute-to-cursor")), i18nc("@action", "&Jump to Cursor"), this);
m_jumpToLocation->setWhatsThis(i18nc("@info:whatsthis", "Sets the execution pointer to the current cursor position."));
connect(m_jumpToLocation,&QAction::triggered, widget, &DisassembleWidget::jumpToCursor);
m_runUntilCursor = new QAction(QIcon::fromTheme(QStringLiteral("debug-run-cursor")), i18n("&Run to Cursor"), this);
m_runUntilCursor->setWhatsThis(i18n("Continues execution until the cursor position is reached."));
m_runUntilCursor = new QAction(QIcon::fromTheme(QStringLiteral("debug-run-cursor")), i18nc("@action", "&Run to Cursor"), this);
m_runUntilCursor->setWhatsThis(i18nc("@info:whatsthis", "Continues execution until the cursor position is reached."));
connect(m_runUntilCursor,&QAction::triggered, widget, &DisassembleWidget::runToCursor);
m_disassemblyFlavorAtt = new QAction(i18n("&AT&&T"), this);
m_disassemblyFlavorAtt->setToolTip(i18n("GDB will use the AT&T disassembly flavor (e.g. mov 0xc(%ebp),%eax)."));
m_disassemblyFlavorAtt = new QAction(i18nc("@option:check", "&AT&&T"), this);
m_disassemblyFlavorAtt->setToolTip(i18nc("@info:tooltip", "GDB will use the AT&T disassembly flavor (e.g. mov 0xc(%ebp),%eax)."));
m_disassemblyFlavorAtt->setData(DisassemblyFlavorATT);
m_disassemblyFlavorAtt->setCheckable(true);
m_disassemblyFlavorIntel = new QAction(i18n("&Intel"), this);
m_disassemblyFlavorIntel->setToolTip(i18n("GDB will use the Intel disassembly flavor (e.g. mov eax, DWORD PTR [ebp+0xc])."));
m_disassemblyFlavorIntel = new QAction(i18nc("@option:check", "&Intel"), this);
m_disassemblyFlavorIntel->setToolTip(i18nc("@info:tooltip", "GDB will use the Intel disassembly flavor (e.g. mov eax, DWORD PTR [ebp+0xc])."));
m_disassemblyFlavorIntel->setData(DisassemblyFlavorIntel);
m_disassemblyFlavorIntel->setCheckable(true);
......@@ -155,7 +155,7 @@ void DisassembleWindow::contextMenuEvent(QContextMenuEvent *e)
popup.addAction(m_selectAddrAction);
popup.addAction(m_jumpToLocation);
popup.addAction(m_runUntilCursor);
QMenu* disassemblyFlavorMenu = popup.addMenu(i18n("Disassembly flavor"));
QMenu* disassemblyFlavorMenu = popup.addMenu(i18nc("@title:menu", "Disassembly Flavor"));
disassemblyFlavorMenu->addAction(m_disassemblyFlavorAtt);
disassemblyFlavorMenu->addAction(m_disassemblyFlavorIntel);
popup.exec(e->globalPos());
......@@ -186,7 +186,7 @@ DisassembleWidget::DisassembleWidget(MIDebuggerPlugin* plugin, QWidget *parent)
m_disassembleWindow = new DisassembleWindow(m_splitter, this);
m_disassembleWindow->setWhatsThis(i18n("<b>Machine code display</b><p>"
m_disassembleWindow->setWhatsThis(i18nc("@info:whatsthis", "<b>Machine code display</b><p>"
"A machine code view into your running "
"executable with the current instruction "
"highlighted. You can step instruction by "
......@@ -200,7 +200,12 @@ DisassembleWidget::DisassembleWidget(MIDebuggerPlugin* plugin, QWidget *parent)
m_disassembleWindow->setUniformRowHeights(true);
m_disassembleWindow->setRootIsDecorated(false);
m_disassembleWindow->setHeaderLabels(QStringList{QString(), i18n("Address"), i18n("Function"), i18n("Instruction")});
m_disassembleWindow->setHeaderLabels(QStringList{
QString(),
i18nc("@title:column", "Address"),
i18nc("@title:column", "Function"),
i18nc("@title:column", "Instruction")
});
m_splitter->setStretchFactor(0, 1);
m_splitter->setContentsMargins(0, 0, 0, 0);
......@@ -219,7 +224,7 @@ DisassembleWidget::DisassembleWidget(MIDebuggerPlugin* plugin, QWidget *parent)
setLayout(topLayout);
setWindowIcon( QIcon::fromTheme(QStringLiteral("system-run"), windowIcon()) );
setWindowTitle(i18n("Disassemble/Registers View"));
setWindowTitle(i18nc("@title:window", "Disassemble/Registers View"));
KDevelop::IDebugController* pDC=KDevelop::ICore::self()->debugController();
Q_ASSERT(pDC);
......
......@@ -11,16 +11,16 @@
</rect>
</property>
<property name="windowTitle">
<string>Address Selector</string>
<string comment="@title:window">Address Selector</string>
</property>
<property name="toolTip">
<string>Select the address to disassemble around</string>
<string comment="@info:tooltip">Select the address to disassemble around</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Select address to disassemble around</string>
<string comment="@label:listbox">Address to disassemble around:</string>
</property>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment