File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/Interface/Application Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,16 @@ void ProvenanceWindow::addProvenanceItem(ProvenanceItemHandle item)
125125 for (int i = provenanceListWidget_->count () - 1 ; i > lastUndoRow_; --i)
126126 delete provenanceListWidget_->takeItem (i);
127127
128+ if (provenanceListWidget_->count () == maxItems_)
129+ {
130+ delete provenanceListWidget_->takeItem (0 );
131+ }
132+ else
133+ {
134+ lastUndoRow_++;
135+ }
136+
128137 new ProvenanceWindowListItem (item, provenanceListWidget_);
129- lastUndoRow_++;
130138 setRedoEnabled (false );
131139 setUndoEnabled (true );
132140
@@ -156,6 +164,7 @@ void ProvenanceWindow::clear()
156164
157165void ProvenanceWindow::setMaxItems (int max)
158166{
167+ maxItems_ = max;
159168 for (int i = 0 ; i < provenanceListWidget_->count () - max; ++i)
160169 {
161170 delete provenanceListWidget_->takeItem (0 );
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ private Q_SLOTS:
6767 void networkModified ();
6868private:
6969 SCIRun::Dataflow::Engine::ProvenanceManagerHandle provenanceManager_;
70- int lastUndoRow_;
70+ int lastUndoRow_, maxItems_{ 10 } ;
7171 const SCIRun::Dataflow::Engine::ProvenanceManagerHandle::element_type::IOType* networkEditor_;
7272
7373 void setUndoEnabled (bool enable);
You can’t perform that action at this time.
0 commit comments