forked from qt-creator/qt-creator
Debugger: Use CommonSettings::setLayouter
... instead of a IOptionsPage-derived class. Change-Id: Ica45b1752fc4e6f83e9dfae25c5e9dcd1fd9c9ba Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@ CommonSettings &commonSettings()
|
||||
|
||||
CommonSettings::CommonSettings()
|
||||
{
|
||||
setAutoApply(false);
|
||||
const QString debugModeGroup("DebugMode");
|
||||
|
||||
useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours");
|
||||
@@ -128,6 +129,38 @@ CommonSettings::CommonSettings()
|
||||
"information, it is switched off by default."));
|
||||
useToolTipsInMainEditor.setDefaultValue(true);
|
||||
|
||||
setLayouter([this] {
|
||||
using namespace Layouting;
|
||||
|
||||
Column col1 {
|
||||
useAlternatingRowColors,
|
||||
useAnnotationsInMainEditor,
|
||||
useToolTipsInMainEditor,
|
||||
closeSourceBuffersOnExit,
|
||||
closeMemoryBuffersOnExit,
|
||||
raiseOnInterrupt,
|
||||
breakpointsFullPathByDefault,
|
||||
warnOnReleaseBuilds,
|
||||
Row { maximalStackDepth, st }
|
||||
};
|
||||
|
||||
Column col2 {
|
||||
fontSizeFollowsEditor,
|
||||
switchModeOnExit,
|
||||
showQmlObjectTree,
|
||||
stationaryEditorWhileStepping,
|
||||
forceLoggingToConsole,
|
||||
registerForPostMortem,
|
||||
st
|
||||
};
|
||||
|
||||
return Column {
|
||||
Group { title("Behavior"), Row { col1, col2, st } },
|
||||
sourcePathMap,
|
||||
st
|
||||
};
|
||||
});
|
||||
|
||||
readSettings();
|
||||
}
|
||||
|
||||
@@ -136,53 +169,6 @@ CommonSettings::~CommonSettings()
|
||||
delete registerForPostMortem;
|
||||
}
|
||||
|
||||
|
||||
class CommonOptionsPageWidget : public Core::IOptionsPageWidget
|
||||
{
|
||||
public:
|
||||
explicit CommonOptionsPageWidget()
|
||||
{
|
||||
DebuggerSettings &s = settings();
|
||||
|
||||
setOnApply([&s] {
|
||||
s.page1.apply();
|
||||
s.page1.writeSettings();
|
||||
});
|
||||
|
||||
setOnFinish([&s] { s.page1.finish(); });
|
||||
|
||||
using namespace Layouting;
|
||||
|
||||
Column col1 {
|
||||
s.useAlternatingRowColors,
|
||||
s.useAnnotationsInMainEditor,
|
||||
s.useToolTipsInMainEditor,
|
||||
s.closeSourceBuffersOnExit,
|
||||
s.closeMemoryBuffersOnExit,
|
||||
s.raiseOnInterrupt,
|
||||
s.breakpointsFullPathByDefault,
|
||||
s.warnOnReleaseBuilds,
|
||||
Row { s.maximalStackDepth, st }
|
||||
};
|
||||
|
||||
Column col2 {
|
||||
s.fontSizeFollowsEditor,
|
||||
s.switchModeOnExit,
|
||||
s.showQmlObjectTree,
|
||||
s.stationaryEditorWhileStepping,
|
||||
s.forceLoggingToConsole,
|
||||
s.registerForPostMortem,
|
||||
st
|
||||
};
|
||||
|
||||
Column {
|
||||
Group { title("Behavior"), Row { col1, col2, st } },
|
||||
s.sourcePathMap,
|
||||
st
|
||||
}.attachTo(this);
|
||||
}
|
||||
};
|
||||
|
||||
QString msgSetBreakpointAtFunction(const char *function)
|
||||
{
|
||||
return Tr::tr("Stop when %1() is called").arg(QLatin1String(function));
|
||||
@@ -213,7 +199,7 @@ public:
|
||||
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
||||
setDisplayCategory(Tr::tr("Debugger"));
|
||||
setCategoryIconPath(":/debugger/images/settingscategory_debugger.png");
|
||||
setWidgetCreator([] { return new CommonOptionsPageWidget; });
|
||||
setSettingsProvider([] { return &commonSettings(); });
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -319,7 +319,6 @@ DebuggerSettings::DebuggerSettings() :
|
||||
const QString qmlInspectorGroup = "QML.Inspector";
|
||||
showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop");
|
||||
|
||||
page1.registerAspects(commonSettings());
|
||||
// Page 4
|
||||
page4.registerAspect(&useDebuggingHelpers);
|
||||
page4.registerAspect(&useCodeModel);
|
||||
@@ -358,7 +357,6 @@ DebuggerSettings::DebuggerSettings() :
|
||||
all.registerAspect(&sortStructMembers);
|
||||
|
||||
// Collect all
|
||||
all.registerAspects(page1);
|
||||
all.registerAspects(page4);
|
||||
all.registerAspects(page5);
|
||||
all.registerAspects(page6);
|
||||
|
@@ -119,7 +119,6 @@ public:
|
||||
Utils::BoolAspect showAppOnTop;
|
||||
|
||||
Utils::AspectContainer all; // All
|
||||
Utils::AspectContainer page1; // General
|
||||
Utils::AspectContainer page4; // Locals & Expressions
|
||||
Utils::AspectContainer page5; // CDB
|
||||
Utils::AspectContainer page6; // CDB Paths
|
||||
|
Reference in New Issue
Block a user