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