forked from qt-creator/qt-creator
debugger: change layout of the "Change Display Format..." context submenu
This commit is contained in:
@@ -302,7 +302,6 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
QAction *showUnprintableOctal = 0;
|
||||
QAction *showUnprintableHexadecimal = 0;
|
||||
formatMenu.setTitle(tr("Change Display Format..."));
|
||||
if (true /*idx.isValid() && !alternativeFormats.isEmpty() */) {
|
||||
showUnprintableUnicode =
|
||||
formatMenu.addAction(tr("Treat All Characters as Printable"));
|
||||
showUnprintableUnicode->setCheckable(true);
|
||||
@@ -315,19 +314,19 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
formatMenu.addAction(tr("Show Unprintable Characters as Hexadecimal"));
|
||||
showUnprintableHexadecimal->setCheckable(true);
|
||||
showUnprintableHexadecimal->setChecked(unprintableBase == 16);
|
||||
if (idx.isValid() /*&& !alternativeFormats.isEmpty() */) {
|
||||
const QString spacer = QLatin1String(" ");
|
||||
formatMenu.addSeparator();
|
||||
QAction *dummy = formatMenu.addAction(
|
||||
tr("Change Display for Type \"%1\"").arg(type));
|
||||
tr("Change Display for Type \"%1\":").arg(type));
|
||||
dummy->setEnabled(false);
|
||||
formatMenu.addSeparator();
|
||||
clearTypeFormatAction = formatMenu.addAction(tr("Automatic"));
|
||||
clearTypeFormatAction = formatMenu.addAction(spacer + tr("Automatic"));
|
||||
//clearTypeFormatAction->setEnabled(typeFormat != -1);
|
||||
//clearTypeFormatAction->setEnabled(individualFormat != -1);
|
||||
clearTypeFormatAction->setCheckable(true);
|
||||
clearTypeFormatAction->setChecked(typeFormat == -1);
|
||||
formatMenu.addSeparator();
|
||||
for (int i = 0; i != alternativeFormats.size(); ++i) {
|
||||
const QString format = alternativeFormats.at(i);
|
||||
const QString format = spacer + alternativeFormats.at(i);
|
||||
QAction *act = new QAction(format, &formatMenu);
|
||||
act->setCheckable(true);
|
||||
//act->setEnabled(individualFormat != -1);
|
||||
@@ -338,17 +337,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
}
|
||||
formatMenu.addSeparator();
|
||||
dummy = formatMenu.addAction(
|
||||
tr("Change Display for Object Named \"%1\"").arg(mi0.data().toString()));
|
||||
tr("Change Display for Object Named \"%1\":").arg(mi0.data().toString()));
|
||||
dummy->setEnabled(false);
|
||||
formatMenu.addSeparator();
|
||||
clearIndividualFormatAction
|
||||
= formatMenu.addAction(tr("Use Display Format Based on Type"));
|
||||
= formatMenu.addAction(spacer + tr("Use Display Format Based on Type"));
|
||||
//clearIndividualFormatAction->setEnabled(individualFormat != -1);
|
||||
clearIndividualFormatAction->setCheckable(true);
|
||||
clearIndividualFormatAction->setChecked(effectiveIndividualFormat == -1);
|
||||
formatMenu.addSeparator();
|
||||
for (int i = 0; i != alternativeFormats.size(); ++i) {
|
||||
const QString format = alternativeFormats.at(i);
|
||||
const QString format = spacer + alternativeFormats.at(i);
|
||||
QAction *act = new QAction(format, &formatMenu);
|
||||
act->setCheckable(true);
|
||||
if (i == effectiveIndividualFormat)
|
||||
@@ -357,7 +354,9 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||
individualFormatActions.append(act);
|
||||
}
|
||||
} else {
|
||||
formatMenu.setEnabled(false);
|
||||
QAction *dummy = formatMenu.addAction(
|
||||
tr("Change Display for Type or Item..."));
|
||||
dummy->setEnabled(false);
|
||||
}
|
||||
|
||||
const bool actionsEnabled = engine->debuggerActionsEnabled();
|
||||
|
Reference in New Issue
Block a user