From 4daa3f6dac734ae9277159a1ae895006819887e5 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 17 Apr 2014 09:25:03 +0200 Subject: Make threshold slider generate new selections while moving. Add progressbar to export. --- dgedit/mainwindow.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dgedit/mainwindow.cc') diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index 1b82841..8cefa82 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -86,11 +87,13 @@ MainWindow::MainWindow() CanvasTool *listen = g_listen; addTool(toolbar, canvas, listen); threshold = new CanvasToolThreshold(canvas); - addTool(toolbar, canvas, threshold); + canvas->tools.push_back(threshold);//addTool(toolbar, canvas, threshold); tool_selections = new CanvasToolSelections(canvas, selections, selections_preview); connect(threshold, SIGNAL(thresholdChanged(double)), tool_selections, SLOT(thresholdChanged(double))); + connect(threshold, SIGNAL(thresholdChanging(double)), + tool_selections, SLOT(thresholdChanged(double))); connect(&selections, SIGNAL(activeChanged(sel_id_t)), canvas, SLOT(update())); addTool(toolbar, canvas, tool_selections); @@ -217,6 +220,7 @@ void MainWindow::tabChanged(int tabid) tool_selections->setShowPreview(tabid == generateTabId); sorter->setShowPreview(tabid == generateTabId); tool_selections->autoCreateSelectionsPreview(); + threshold->setActive(tabid == generateTabId); } QWidget *MainWindow::createFilesTab() @@ -267,6 +271,8 @@ QWidget *MainWindow::createGenerateTab() connect(threshold, SIGNAL(thresholdChanged(double)), tool_selections, SLOT(autoCreateSelectionsPreview())); + connect(threshold, SIGNAL(thresholdChanging(double)), + tool_selections, SLOT(autoCreateSelectionsPreview())); QPushButton *clearsel = new QPushButton(); clearsel->setText("Clear"); @@ -375,6 +381,12 @@ QWidget *MainWindow::createExportTab() connect(exportsel, SIGNAL(clicked()), this, SLOT(doExport())); l->addWidget(exportsel); + QProgressBar *bar = new QProgressBar(); + connect(extractor, SIGNAL(progressUpdate(int)), bar, SLOT(setValue(int))); + connect(extractor, SIGNAL(setMaximumProgress(int)), + bar, SLOT(setMaximum(int))); + l->addWidget(bar); + l->addStretch(); return w; -- cgit v1.2.3