And in manual partitioning.

This commit is contained in:
Teo Mrnjavac 2015-12-31 13:56:19 +01:00
parent 093c7b042d
commit 2b862bf431

View File

@ -32,6 +32,7 @@
#include "ui_CreatePartitionTableDialog.h" #include "ui_CreatePartitionTableDialog.h"
#include "utils/Retranslator.h" #include "utils/Retranslator.h"
#include "Branding.h"
// KPMcore // KPMcore
#include <kpmcore/core/device.h> #include <kpmcore/core/device.h>
@ -195,20 +196,8 @@ PartitionPage::onDeleteClicked()
void void
PartitionPage::onRevertClicked() PartitionPage::onRevertClicked()
{ {
ScanningDialog* rescanningDialog = ScanningDialog::run(
new ScanningDialog( tr( "Scanning storage devices..." ), this ); QtConcurrent::run( [ 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 ]
{ {
QMutexLocker locker( &m_revertMutex ); QMutexLocker locker( &m_revertMutex );
@ -216,8 +205,12 @@ PartitionPage::onRevertClicked()
m_core->revertAllDevices(); m_core->revertAllDevices();
m_ui->deviceComboBox->setCurrentIndex( oldIndex ); m_ui->deviceComboBox->setCurrentIndex( oldIndex );
updateFromCurrentDevice(); updateFromCurrentDevice();
} ); } ),
watcher->setFuture( future ); tr( "Scanning storage devices..." ),
tr( "%1 Partitioning" )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ),
this );
} }
void void