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,29 +196,21 @@ PartitionPage::onDeleteClicked()
void void
PartitionPage::onRevertClicked() PartitionPage::onRevertClicked()
{ {
ScanningDialog* rescanningDialog = ScanningDialog::run(
new ScanningDialog( tr( "Scanning storage devices..." ), this ); QtConcurrent::run( [ this ]
rescanningDialog->show(); {
QMutexLocker locker( &m_revertMutex );
QFutureWatcher< void >* watcher = new QFutureWatcher< void >(); int oldIndex = m_ui->deviceComboBox->currentIndex();
connect( watcher, &QFutureWatcher< void >::finished, m_core->revertAllDevices();
this, [ watcher, rescanningDialog ] m_ui->deviceComboBox->setCurrentIndex( oldIndex );
{ updateFromCurrentDevice();
watcher->deleteLater(); } ),
rescanningDialog->hide(); tr( "Scanning storage devices..." ),
rescanningDialog->deleteLater(); tr( "%1 Partitioning" )
} ); .arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ),
QFuture< void > future = QtConcurrent::run( [ this ] this );
{
QMutexLocker locker( &m_revertMutex );
int oldIndex = m_ui->deviceComboBox->currentIndex();
m_core->revertAllDevices();
m_ui->deviceComboBox->setCurrentIndex( oldIndex );
updateFromCurrentDevice();
} );
watcher->setFuture( future );
} }
void void