Commit 589cc43a authored by hjk's avatar hjk

debugger: make context menus of views look more similar

parent f8300260
......@@ -196,13 +196,14 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(deleteAllAction);
menu.addAction(deleteByFileAction);
menu.addSeparator();
menu.addAction(adjustColumnAction);
menu.addAction(alwaysAdjustAction);
menu.addAction(synchronizeAction);
menu.addSeparator();
menu.addAction(breakAtFunctionAction);
menu.addAction(breakAtMainAction);
menu.addSeparator();
menu.addAction(adjustColumnAction);
menu.addAction(alwaysAdjustAction);
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
......
......@@ -136,16 +136,20 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(act6);
menu.addAction(act7);
menu.addSeparator();
menu.addAction(act1);
menu.addAction(act2);
QAction *actAdjustColumnWidths =
menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjustColumnWidth =
menu.addAction(tr("Always adjust column widths to contents"));
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
if (act == act0)
emit reloadModulesRequested();
else if (act == act1)
else if (act == actAdjustColumnWidths)
resizeColumnsToContents();
else if (act == act2)
else if (act == actAlwaysAdjustColumnWidth)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == act3)
emit displaySourceRequested(name);
......
......@@ -161,12 +161,6 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QMenu menu;
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always adjust column widths to contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
QAction *actReload = menu.addAction(tr("Reload register listing"));
QAction *actAlwaysReload = menu.addAction(tr("Always reload register listing"));
actAlwaysReload->setCheckable(true);
......@@ -199,6 +193,13 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
act2->setChecked(base == 2);
menu.addSeparator();
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always adjust column widths to contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
......
......@@ -99,19 +99,8 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
StackFrame frame = model()->data(idx, Qt::UserRole).value<StackFrame>();
QString address = frame.address;
qDebug() << "RECV: " << frame.toToolTip();
QMenu menu;
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always adjust column widths to contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addSeparator();
menu.addAction(theDebuggerAction(ExpandStack));
QAction *actCopyContents = menu.addAction(tr("Copy contents to clipboard"));
......@@ -135,6 +124,15 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always adjust column widths to contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
......
......@@ -82,12 +82,14 @@ void ThreadsWindow::rowActivated(const QModelIndex &index)
void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QMenu menu;
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
QAction *act1 = menu.addAction(tr("Adjust column widths to contents"));
QAction *act2 = menu.addAction(tr("Always adjust column widths to contents"));
act2->setCheckable(true);
act2->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(act1);
menu.addAction(act2);
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
......
......@@ -242,23 +242,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
}
QMenu menu;
QAction *actAdjustColumnWidths =
new QAction(tr("Adjust column widths to contents"), &menu);
QAction *actAlwaysAdjustColumnWidth =
new QAction(tr("Always adjust column widths to contents"), &menu);
actAlwaysAdjustColumnWidth->setCheckable(true);
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
//QAction *actWatchExpressionInWindow
// = theDebuggerAction(WatchExpressionInWindow);
//menu.addAction(actWatchExpressionInWindow);
QAction *actInsertNewWatchItem =
new QAction(tr("Insert new watch item"), &menu);
QAction *actSelectWidgetToWatch =
new QAction(tr("Select widget to watch"), &menu);
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert new watch item"));
QAction *actSelectWidgetToWatch = menu.addAction(tr("Select widget to watch"));
QString address = model()->data(mi0, AddressRole).toString();
QAction *actWatchKnownMemory = 0;
......@@ -268,10 +257,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
else
actWatchKnownMemory =
new QAction(tr("Open memory editor at %1").arg(address), &menu);
menu.addAction(actAdjustColumnWidths);
menu.addAction(actAlwaysAdjustColumnWidth);
menu.addSeparator();
int atype = (m_type == LocalsType) ? WatchExpression : RemoveWatchExpression;
menu.addAction(theDebuggerAction(atype)->updatedAction(exp));
......@@ -284,6 +271,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
menu.addAction(theDebuggerAction(RecheckDebuggingHelpers));
menu.addAction(theDebuggerAction(UseDebuggingHelpers));
menu.addSeparator();
QAction *actAdjustColumnWidths =
menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjustColumnWidth =
menu.addAction(tr("Always adjust column widths to contents"));
actAlwaysAdjustColumnWidth->setCheckable(true);
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
......
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