[partition] Improve logging of status of choice buttons

This commit is contained in:
Adriaan de Groot 2019-04-04 17:37:37 +02:00
parent b5a997d11e
commit 6bccbcd1f5

View file

@ -1228,7 +1228,7 @@ ChoicePage::setupActions()
if ( currentDevice->type() == Device::Type::SoftwareRAID_Device && if ( currentDevice->type() == Device::Type::SoftwareRAID_Device &&
static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive ) static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive )
{ {
cDebug() << ".. part of an inactive RAID device"; cDebug() << Logger::SubEntry() << "part of an inactive RAID device";
isInactiveRAID = true; isInactiveRAID = true;
} }
#endif #endif
@ -1238,17 +1238,17 @@ ChoicePage::setupActions()
{ {
if ( PartUtils::canBeResized( *it ) ) if ( PartUtils::canBeResized( *it ) )
{ {
cDebug() << ".. contains resizable" << it; cDebug() << Logger::SubEntry() << "contains resizable" << it;
atLeastOneCanBeResized = true; atLeastOneCanBeResized = true;
} }
if ( PartUtils::canBeReplaced( *it ) ) if ( PartUtils::canBeReplaced( *it ) )
{ {
cDebug() << ".. contains replaceable" << it; cDebug() << Logger::SubEntry() << "contains replaceable" << it;
atLeastOneCanBeReplaced = true; atLeastOneCanBeReplaced = true;
} }
if ( (*it)->isMounted() ) if ( (*it)->isMounted() )
{ {
cDebug() << ".. contains mounted" << it; cDebug() << Logger::SubEntry() << "contains mounted (un-eraseable)" << it;
atLeastOneIsMounted = true; atLeastOneIsMounted = true;
} }
} }
@ -1372,12 +1372,18 @@ ChoicePage::setupActions()
if ( atLeastOneCanBeReplaced ) if ( atLeastOneCanBeReplaced )
m_replaceButton->show(); m_replaceButton->show();
else else
{
cDebug() << "Replace button suppressed because none can be replaced.";
force_uncheck( m_grp, m_replaceButton ); force_uncheck( m_grp, m_replaceButton );
}
if ( atLeastOneCanBeResized ) if ( atLeastOneCanBeResized )
m_alongsideButton->show(); m_alongsideButton->show();
else else
{
cDebug() << "Alongside button suppressed because none can be resized.";
force_uncheck( m_grp, m_alongsideButton ); force_uncheck( m_grp, m_alongsideButton );
}
if ( !atLeastOneIsMounted && !isInactiveRAID ) if ( !atLeastOneIsMounted && !isInactiveRAID )
m_eraseButton->show(); // None mounted m_eraseButton->show(); // None mounted