Core: Gui: DAGView: using pending icon and showing valid status for tool tip

This commit is contained in:
blobfish 2015-07-15 09:35:42 -04:00 committed by Stefan Tröger
parent e6f77dc067
commit 78f3e9786b
4 changed files with 16 additions and 5 deletions

View File

@ -126,6 +126,8 @@ Model::Model(QObject *parentIn, const Gui::Document &documentIn) : QGraphicsScen
passPixmap = passIcon.pixmap(iconSize, iconSize);
QIcon failIcon(Gui::BitmapFactory().pixmap("dagViewFail"));
failPixmap = failIcon.pixmap(iconSize, iconSize);
QIcon pendingIcon(Gui::BitmapFactory().pixmap("dagViewPending"));
pendingPixmap = pendingIcon.pixmap(iconSize, iconSize);
renameAction = new QAction(this);
renameAction->setText(tr("Rename"));
@ -844,19 +846,25 @@ void Model::updateStates()
(*theGraph)[currentVertex].lastVisibleState = currentVisibilityState;
}
FeatureState currentFeatureState = (record.DObject->isError()) ? FeatureState::Fail : FeatureState::Pass;
FeatureState currentFeatureState = FeatureState::Pass;
if (record.DObject->isError())
currentFeatureState = FeatureState::Fail;
else if ((record.DObject->mustExecute() == 1))
currentFeatureState = FeatureState::Pending;
if (currentFeatureState != (*theGraph)[currentVertex].lastFeatureState)
{
if (currentFeatureState == FeatureState::Pass)
{
(*theGraph)[currentVertex].stateIcon->setPixmap(passPixmap);
(*theGraph)[currentVertex].stateIcon->setToolTip(QString());
}
else
{
(*theGraph)[currentVertex].stateIcon->setPixmap(failPixmap);
(*theGraph)[currentVertex].stateIcon->setToolTip(QString::fromAscii(record.DObject->getStatusString()));
if (currentFeatureState == FeatureState::Fail)
(*theGraph)[currentVertex].stateIcon->setPixmap(failPixmap);
else
(*theGraph)[currentVertex].stateIcon->setPixmap(pendingPixmap);
}
(*theGraph)[currentVertex].stateIcon->setToolTip(QString::fromAscii(record.DObject->getStatusString()));
(*theGraph)[currentVertex].lastFeatureState = currentFeatureState;
}
}

View File

@ -149,6 +149,7 @@ namespace Gui
QPixmap visiblePixmapDisabled;
QPixmap passPixmap;
QPixmap failPixmap;
QPixmap pendingPixmap;
QAction *renameAction;
QAction *editingFinishedAction;

View File

@ -57,7 +57,8 @@ namespace Gui
{
None = 0, //<! not determined.
Pass, //<! feature updated ok.
Fail //<! feature failed to update.
Fail, //<! feature failed to update.
Pending //<! feature is pending an update.
};
//limit of column width? boost::dynamic_bitset?

View File

@ -105,6 +105,7 @@
<file>dagViewVisible.svg</file>
<file>dagViewPass.svg</file>
<file>dagViewFail.svg</file>
<file>dagViewPending.svg</file>
<file>Part_Measure_Clear_All.svg</file>
<file>Part_Measure_Toggle_All.svg</file>
<file>spaceball_button.svg</file>