|
|
@ -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 >();
|
|
|
|
|
|
|
|
connect( watcher, &QFutureWatcher< void >::finished,
|
|
|
|
int oldIndex = m_ui->deviceComboBox->currentIndex();
|
|
|
|
this, [ watcher, rescanningDialog ]
|
|
|
|
m_core->revertAllDevices();
|
|
|
|
{
|
|
|
|
m_ui->deviceComboBox->setCurrentIndex( oldIndex );
|
|
|
|
watcher->deleteLater();
|
|
|
|
updateFromCurrentDevice();
|
|
|
|
rescanningDialog->hide();
|
|
|
|
} ),
|
|
|
|
rescanningDialog->deleteLater();
|
|
|
|
tr( "Scanning storage devices..." ),
|
|
|
|
} );
|
|
|
|
tr( "%1 Partitioning" )
|
|
|
|
|
|
|
|
.arg( Calamares::Branding::instance()->
|
|
|
|
QFuture< void > future = QtConcurrent::run( [ this ]
|
|
|
|
string( Calamares::Branding::ShortProductName ) ),
|
|
|
|
{
|
|
|
|
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
|
|
|
|