Debugger: Add an option to not show the unsupported bp warning

Done-by: Elias Steurer
Task-number: QTCREATORBUG-31455
Change-Id: I9736a2a0a1b4c3a38516b3397068d2ba2b3f455d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2024-08-27 08:13:09 +02:00
parent 640c132c31
commit 83ebffb321
5 changed files with 26 additions and 6 deletions

View File

@@ -45,6 +45,14 @@ CommonSettings::CommonSettings()
Tr::tr("Scrolls the editor only when it is necessary to keep the current line in view, "
"instead of keeping the next statement centered at all times."));
showUnsupportedBreakpointWarning.setSettingsKey(debugModeGroup, "ShowUnsupportedBreakpointWarning");
showUnsupportedBreakpointWarning.setDefaultValue(true);
showUnsupportedBreakpointWarning.setLabelText(
Tr::tr("Show warnings for unsupported breakpoints"));
showUnsupportedBreakpointWarning.setToolTip(
Tr::tr("Shows a warning on debugger start-up when breakpoints are requested "
"which are not supported by the selected debugger engine."));
forceLoggingToConsole.setSettingsKey(debugModeGroup, "ForceLoggingToConsole");
forceLoggingToConsole.setLabelText(Tr::tr("Force logging to console"));
forceLoggingToConsole.setToolTip(
@@ -151,6 +159,7 @@ CommonSettings::CommonSettings()
switchModeOnExit,
showQmlObjectTree,
stationaryEditorWhileStepping,
showUnsupportedBreakpointWarning,
forceLoggingToConsole,
registerForPostMortem,
st

View File

@@ -60,6 +60,7 @@ public:
Utils::BoolAspect showQmlObjectTree{this};
Utils::BoolAspect stationaryEditorWhileStepping{this};
Utils::BoolAspect forceLoggingToConsole{this};
Utils::BoolAspect showUnsupportedBreakpointWarning{this};
SourcePathMapAspect sourcePathMap{this};

View File

@@ -46,6 +46,7 @@ DebuggerSettings::DebuggerSettings() :
showQmlObjectTree{commonSettings().showQmlObjectTree},
stationaryEditorWhileStepping{commonSettings().stationaryEditorWhileStepping},
forceLoggingToConsole{commonSettings().forceLoggingToConsole},
showUnsupportedBreakpointWarning{commonSettings().showUnsupportedBreakpointWarning},
sourcePathMap{commonSettings().sourcePathMap},
registerForPostMortem{*commonSettings().registerForPostMortem},

View File

@@ -32,6 +32,7 @@ public:
Utils::BoolAspect &showQmlObjectTree;
Utils::BoolAspect &stationaryEditorWhileStepping;
Utils::BoolAspect &forceLoggingToConsole;
Utils::BoolAspect &showUnsupportedBreakpointWarning;
Utils::TypedAspect<QMap<QString, QString>> &sourcePathMap;

View File

@@ -617,12 +617,20 @@ void DebuggerRunTool::start()
showMessage(warningMessage, LogWarning);
static bool doNotShowAgain = false;
CheckableMessageBox::information(Core::ICore::dialogParent(),
Tr::tr("Debugger"),
warningMessage,
&doNotShowAgain,
QMessageBox::Ok);
if (settings().showUnsupportedBreakpointWarning()) {
bool doNotAskAgain = false;
CheckableDecider decider(&doNotAskAgain);
CheckableMessageBox::information(
Core::ICore::dialogParent(),
Tr::tr("Debugger"),
warningMessage,
decider,
QMessageBox::Ok);
if (doNotAskAgain) {
settings().showUnsupportedBreakpointWarning.setValue(false);
settings().showUnsupportedBreakpointWarning.writeSettings();
}
}
}
}