From 0fd0e9a1af955734affba3208b4f7b5737916d6c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 10 Jun 2022 01:00:27 +0200 Subject: [PATCH] [welcome] Add debugging checks slow-false and slow-true --- .../welcome/checker/GeneralRequirements.cpp | 18 ++++++++++++++++++ src/modules/welcome/welcome.conf | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp index 5f0124ef6..0c467124f 100644 --- a/src/modules/welcome/checker/GeneralRequirements.cpp +++ b/src/modules/welcome/checker/GeneralRequirements.cpp @@ -228,6 +228,15 @@ GeneralRequirements::checkRequirements() false, required } ); } + if ( entry == "slow-false" ) + { + sleep(3); + checkEntries.append( { entry, + [] { return tr( "is always false (slowly)" ); }, + [] { return tr( "The computer says no (slowly)." ); }, + false, + required } ); + } if ( entry == "true" ) { checkEntries.append( { entry, @@ -236,6 +245,15 @@ GeneralRequirements::checkRequirements() true, required } ); } + if ( entry == "slow-true" ) + { + sleep(3); + checkEntries.append( { entry, + [] { return tr( "is always true (slowly)" ); }, + [] { return tr( "The computer says yes (slowly)." ); }, + true, + required } ); + } if ( entry == "snark" ) { static unsigned int snark_count = 0; diff --git a/src/modules/welcome/welcome.conf b/src/modules/welcome/welcome.conf index b86231c3f..90bf9d115 100644 --- a/src/modules/welcome/welcome.conf +++ b/src/modules/welcome/welcome.conf @@ -67,9 +67,13 @@ requirements: # # Note that the last three checks are for testing-purposes only, # and shouldn't be used in production (they are only available - # when building Calamares in development mode): + # when building Calamares in development mode). There are five + # special checks: # - *false* is a check that is always false (unsatisfied) # - *true* is a check that is always true (satisfied) + # - *slow-false* takes 3 seconds, and then is false; use this one to + # show off the waiting-spinner before the first results come in + # - *slow-true* takes 3 seconds, and then is true # - *snark* is a check that is only satisfied once it has been checked # at least three times ("what I tell you three times is true"). check: