From 8840d2e825437e1a7f195b2c7d1ede62683806d3 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 22 Aug 2024 12:59:21 +0200 Subject: [PATCH] Add persistent do not show again to settings --- src/plugins/debugger/commonoptionspage.cpp | 8 ++++++++ src/plugins/debugger/commonoptionspage.h | 1 + src/plugins/debugger/debuggeractions.cpp | 1 + src/plugins/debugger/debuggeractions.h | 1 + src/plugins/debugger/debuggerruncontrol.cpp | 17 +++++++++++------ 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index b7c56541b82..283cb409a2e 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -45,6 +45,13 @@ 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.setLabelText(Tr::tr("Show unsupported Breakpoint Warning")); + showUnsupportedBreakpointWarning.setToolTip( + Tr::tr("Shows a warning when there are breakpoint" + "present, that the debugger does not support.")); + showUnsupportedBreakpointWarning.setDefaultValue(true); + forceLoggingToConsole.setSettingsKey(debugModeGroup, "ForceLoggingToConsole"); forceLoggingToConsole.setLabelText(Tr::tr("Force logging to console")); forceLoggingToConsole.setToolTip( @@ -151,6 +158,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..8b9797c2ced 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -617,12 +617,17 @@ 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); + settings().showUnsupportedBreakpointWarning.setValue(!doNotAskAgain); + } } } -- 2.42.0.windows.1