Add debug information as a tooltip to ViewStepItem if running with -d

main
Teo Mrnjavac 9 years ago
parent 490875cdb4
commit 007ad9abae

@ -19,6 +19,7 @@
#include "ViewStepItem.h"
#include "ProgressTreeModel.h"
#include "Settings.h"
#include "ViewManager.h"
#include "viewpages/ViewStep.h"
@ -54,7 +55,29 @@ ViewStepItem::data( int role ) const
if ( role == ProgressTreeModel::ProgressTreeItemRole )
return this;
if ( role == Qt::DisplayRole )
return m_step ? m_step->prettyName() : m_prettyName();
{
return m_step ? m_step->prettyName()
: m_prettyName();
}
if ( Calamares::Settings::instance()->debugMode() && role == Qt::ToolTipRole )
{
QString toolTip( "<b>Debug information</b>" );
if ( m_step )
{
toolTip.append( "<br/>Type:\tViewStep" );
toolTip.append( QString( "<br/>Pretty:\t%1" ).arg( m_step->prettyName() ) );
toolTip.append( QString( "<br/>Status:\t%1" ).arg( m_step->prettyStatus() ) );
toolTip.append( QString( "<br/>Source:\t%1" ).arg(
m_step->moduleInstanceKey().isEmpty() ? "built-in"
: m_step->moduleInstanceKey() ) );
}
else
{
toolTip.append( "<br/>Type:\tDelegate" );
toolTip.append( QString( "<br/>Pretty:\t%1" ).arg( m_prettyName() ) );
}
return toolTip;
}
if ( role == ProgressTreeModel::ProgressTreeItemCurrentRole )
return m_step ?
( Calamares::ViewManager::instance()->currentStep() == m_step ) :

Loading…
Cancel
Save