[welcome] Factor out is-this-check-required
While here, make it possible for the "screen" (screen-size) check to be mandatory; there's no reason it shouldn't follow the same logic as all the others (although denying users an install because they have a VGA monitor seems a bit weak).
This commit is contained in:
parent
f4117881cd
commit
cbd4bd9bbe
@ -148,6 +148,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
Calamares::RequirementsList checkEntries;
|
Calamares::RequirementsList checkEntries;
|
||||||
foreach ( const QString& entry, m_entriesToCheck )
|
foreach ( const QString& entry, m_entriesToCheck )
|
||||||
{
|
{
|
||||||
|
const bool required = m_entriesToRequire.contains( entry );
|
||||||
if ( entry == "storage" )
|
if ( entry == "storage" )
|
||||||
{
|
{
|
||||||
checkEntries.append(
|
checkEntries.append(
|
||||||
@ -157,7 +158,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
[ req = m_requiredStorageGiB ]
|
[ req = m_requiredStorageGiB ]
|
||||||
{ return tr( "There is not enough drive space. At least %1 GiB is required." ).arg( req ); },
|
{ return tr( "There is not enough drive space. At least %1 GiB is required." ).arg( req ); },
|
||||||
enoughStorage,
|
enoughStorage,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
else if ( entry == "ram" )
|
else if ( entry == "ram" )
|
||||||
{
|
{
|
||||||
@ -169,7 +170,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
.arg( req );
|
.arg( req );
|
||||||
},
|
},
|
||||||
enoughRam,
|
enoughRam,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
else if ( entry == "power" )
|
else if ( entry == "power" )
|
||||||
{
|
{
|
||||||
@ -177,7 +178,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
[] { return tr( "is plugged in to a power source" ); },
|
[] { return tr( "is plugged in to a power source" ); },
|
||||||
[] { return tr( "The system is not plugged in to a power source." ); },
|
[] { return tr( "The system is not plugged in to a power source." ); },
|
||||||
hasPower,
|
hasPower,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
else if ( entry == "internet" )
|
else if ( entry == "internet" )
|
||||||
{
|
{
|
||||||
@ -185,7 +186,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
[] { return tr( "is connected to the Internet" ); },
|
[] { return tr( "is connected to the Internet" ); },
|
||||||
[] { return tr( "The system is not connected to the Internet." ); },
|
[] { return tr( "The system is not connected to the Internet." ); },
|
||||||
hasInternet,
|
hasInternet,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
else if ( entry == "root" )
|
else if ( entry == "root" )
|
||||||
{
|
{
|
||||||
@ -198,7 +199,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
: tr( "The installer is not running with administrator rights." );
|
: tr( "The installer is not running with administrator rights." );
|
||||||
},
|
},
|
||||||
isRoot,
|
isRoot,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
else if ( entry == "screen" )
|
else if ( entry == "screen" )
|
||||||
{
|
{
|
||||||
@ -211,7 +212,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
: tr( "The screen is too small to display the installer." );
|
: tr( "The screen is too small to display the installer." );
|
||||||
},
|
},
|
||||||
enoughScreen,
|
enoughScreen,
|
||||||
false } );
|
required } );
|
||||||
}
|
}
|
||||||
#ifdef CALAMARES_VERSION_RC
|
#ifdef CALAMARES_VERSION_RC
|
||||||
if ( entry == "false" )
|
if ( entry == "false" )
|
||||||
@ -220,7 +221,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
[] { return tr( "is always false" ); },
|
[] { return tr( "is always false" ); },
|
||||||
[] { return tr( "is always false" ); },
|
[] { return tr( "is always false" ); },
|
||||||
false,
|
false,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
if ( entry == "true" )
|
if ( entry == "true" )
|
||||||
{
|
{
|
||||||
@ -228,7 +229,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
[] { return tr( "is always true" ); },
|
[] { return tr( "is always true" ); },
|
||||||
[] { return tr( "is always true" ); },
|
[] { return tr( "is always true" ); },
|
||||||
true,
|
true,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
if ( entry == "snark" )
|
if ( entry == "snark" )
|
||||||
{
|
{
|
||||||
@ -241,7 +242,7 @@ GeneralRequirements::checkRequirements()
|
|||||||
"The (some mythological beast) has not been checked three times." );
|
"The (some mythological beast) has not been checked three times." );
|
||||||
},
|
},
|
||||||
++snark_count > 3,
|
++snark_count > 3,
|
||||||
m_entriesToRequire.contains( entry ) } );
|
required } );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user