From 007ad9abae4994734eb8cf85a29774a7cec60b65 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 9 Sep 2015 19:06:20 +0200 Subject: [PATCH] Add debug information as a tooltip to ViewStepItem if running with -d --- src/calamares/progresstree/ViewStepItem.cpp | 25 ++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/calamares/progresstree/ViewStepItem.cpp b/src/calamares/progresstree/ViewStepItem.cpp index 77ee869d7..d2fff08ca 100644 --- a/src/calamares/progresstree/ViewStepItem.cpp +++ b/src/calamares/progresstree/ViewStepItem.cpp @@ -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( "Debug information" ); + if ( m_step ) + { + toolTip.append( "
Type:\tViewStep" ); + toolTip.append( QString( "
Pretty:\t%1" ).arg( m_step->prettyName() ) ); + toolTip.append( QString( "
Status:\t%1" ).arg( m_step->prettyStatus() ) ); + toolTip.append( QString( "
Source:\t%1" ).arg( + m_step->moduleInstanceKey().isEmpty() ? "built-in" + : m_step->moduleInstanceKey() ) ); + } + else + { + toolTip.append( "
Type:\tDelegate" ); + toolTip.append( QString( "
Pretty:\t%1" ).arg( m_prettyName() ) ); + } + return toolTip; + } if ( role == ProgressTreeModel::ProgressTreeItemCurrentRole ) return m_step ? ( Calamares::ViewManager::instance()->currentStep() == m_step ) :