From 83ebffb321d7d0a227018561f3b75f54ad6721bc Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 27 Aug 2024 08:13:09 +0200 Subject: [PATCH] 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 --- src/plugins/debugger/commonoptionspage.cpp | 9 +++++++++ src/plugins/debugger/commonoptionspage.h | 1 + src/plugins/debugger/debuggeractions.cpp | 1 + src/plugins/debugger/debuggeractions.h | 1 + src/plugins/debugger/debuggerruncontrol.cpp | 20 ++++++++++++++------ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index b7c56541b82..4c270d72d65 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -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 diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 8edf64bdf84..d8ba963cd12 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -60,6 +60,7 @@ public: Utils::BoolAspect showQmlObjectTree{this}; Utils::BoolAspect stationaryEditorWhileStepping{this}; Utils::BoolAspect forceLoggingToConsole{this}; + Utils::BoolAspect showUnsupportedBreakpointWarning{this}; SourcePathMapAspect sourcePathMap{this}; diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 1110c4e5593..0bf63efca26 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -46,6 +46,7 @@ DebuggerSettings::DebuggerSettings() : showQmlObjectTree{commonSettings().showQmlObjectTree}, stationaryEditorWhileStepping{commonSettings().stationaryEditorWhileStepping}, forceLoggingToConsole{commonSettings().forceLoggingToConsole}, + showUnsupportedBreakpointWarning{commonSettings().showUnsupportedBreakpointWarning}, sourcePathMap{commonSettings().sourcePathMap}, registerForPostMortem{*commonSettings().registerForPostMortem}, diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index a9dbafff94e..c0eff56d090 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -32,6 +32,7 @@ public: Utils::BoolAspect &showQmlObjectTree; Utils::BoolAspect &stationaryEditorWhileStepping; Utils::BoolAspect &forceLoggingToConsole; + Utils::BoolAspect &showUnsupportedBreakpointWarning; Utils::TypedAspect> &sourcePathMap; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index f4f1405953e..075447efccf 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -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(); + } + } } }