11#include " diffviewwidget.h"
22
33#include < QAction>
4+ #include < QDoubleSpinBox>
45#include < QLabel>
56#include < QMenu>
67#include < QProgressBar>
78
89#include < kddockwidgets/DockWidget.h>
910#include < kddockwidgets/MainWindow.h>
1011
12+ #include " diffviewproxy.h"
1113#include " dockwidgetsetup.h"
1214#include " filterandzoomstack.h"
1315#include " models/treemodel.h"
@@ -31,11 +33,13 @@ DiffViewWidget::DiffViewWidget(QWidget* parent)
3133 , m_timelineA(new TimeLineWidget(m_parserA, m_filterMenu, m_filterAndZoomStackA, this ))
3234 , m_timelineB(new TimeLineWidget(m_parserB, m_filterMenu, m_filterAndZoomStackB, this ))
3335{
36+ auto diffProxy = new DiffViewProxy (this );
37+ diffProxy->setSourceModel (m_model);
38+
3439 ui->setupUi (this );
35- ui->diffTreeView ->setModel (m_model);
36- ui->bottomUpVerticalLayout ->addWidget (m_contents);
3740
38- ResultsUtil::setupTreeView (ui->diffTreeView , ui->diffSearch , m_model);
41+ ResultsUtil::setupTreeView (ui->diffTreeView , ui->diffSearch , diffProxy, DiffViewModel::InitialSortColumn,
42+ DiffViewModel::SortRole);
3943 ResultsUtil::setupCostDelegate<DiffViewModel>(m_model, ui->diffTreeView );
4044
4145 auto dockify = [](QWidget* widget, const QString& id, const QString& title, const QString& shortcut) {
@@ -51,6 +55,20 @@ DiffViewWidget::DiffViewWidget(QWidget* parent)
5155 m_timelineDockB = dockify (m_timelineB, QStringLiteral (" timelineb" ), tr (" Timeline B" ), tr (" Ctrl+B" ));
5256 m_timelineDockA->addDockWidgetAsTab (m_timelineDockB);
5357
58+ auto costThreshold = new QDoubleSpinBox (this );
59+ costThreshold->setDecimals (2 );
60+ costThreshold->setMinimum (0 );
61+ costThreshold->setMaximum (99.90 );
62+ costThreshold->setPrefix (tr (" Cost Threshold: " ));
63+ costThreshold->setSuffix (QStringLiteral (" %" ));
64+ costThreshold->setValue (0.01 );
65+ costThreshold->setSingleStep (0.01 );
66+ connect (costThreshold, static_cast <void (QDoubleSpinBox::*)(double )>(&QDoubleSpinBox::valueChanged), this ,
67+ [diffProxy](double threshold) { diffProxy->setThreshhold (threshold); });
68+
69+ ui->bottomUpVerticalLayout ->addWidget (costThreshold);
70+ ui->bottomUpVerticalLayout ->addWidget (m_contents);
71+
5472 auto repositionFilterBusyIndicator = [this ] {
5573 auto geometry = m_filterBusyIndicator->geometry ();
5674 geometry.setWidth (width () / 2 );
0 commit comments