From 093c7b042d44891de71eb6d1f4d73adea5eeb403 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 31 Dec 2015 13:56:11 +0100 Subject: [PATCH] Use it in ChoicePage. --- src/modules/partition/gui/ChoicePage.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 2ce982802..283b3084a 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -434,21 +434,14 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice ) connect( m_beforePartitionBarsView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, [ this ]( const QModelIndex& current, const QModelIndex& previous ) { - ScanningDialog* rescanningDialog = - new ScanningDialog( tr( "Scanning storage devices..." ), this ); - rescanningDialog->show(); - - QFutureWatcher< void >* watcher = new QFutureWatcher< void >(); - connect( watcher, &QFutureWatcher< void >::finished, - this, [ watcher, rescanningDialog ] - { - watcher->deleteLater(); - rescanningDialog->hide(); - rescanningDialog->deleteLater(); - } ); - - QFuture< void > future = QtConcurrent::run( this, &ChoicePage::doReplaceSelectedPartition, current ); - watcher->setFuture( future ); + ScanningDialog::run( QtConcurrent::run( this, + &ChoicePage::doReplaceSelectedPartition, + current ), + tr( "Scanning storage devices..." ), + tr( "%1 Partitioning" ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::ShortProductName ) ), + this ); } ); break; case NoChoice: