|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
@ -38,6 +38,7 @@
|
|
|
|
|
#include <QFormLayout>
|
|
|
|
|
#include <QListView>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QMutexLocker>
|
|
|
|
|
|
|
|
|
|
EraseDiskPage::EraseDiskPage( QWidget* parent )
|
|
|
|
|
: QWidget( parent )
|
|
|
|
|
@ -103,6 +104,9 @@ EraseDiskPage::init( PartitionCoreModule* core )
|
|
|
|
|
if ( dev )
|
|
|
|
|
doAutopartition( dev );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
connect( m_core, &PartitionCoreModule::isDirtyChanged,
|
|
|
|
|
this, &EraseDiskPage::updatePreviews );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -187,11 +191,27 @@ EraseDiskPage::doAutopartition( Device* dev )
|
|
|
|
|
PartitionInfo::setFormat( rootPartition, true );
|
|
|
|
|
m_core->createPartition( dev, rootPartition );
|
|
|
|
|
|
|
|
|
|
updatePreviews();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
m_core->dumpQueue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
EraseDiskPage::updatePreviews()
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker( &EraseDiskPage::m_previewsMutex );
|
|
|
|
|
|
|
|
|
|
cDebug() << "Updating partitioning preview widgets.";
|
|
|
|
|
qDeleteAll( m_previewFrame->children() );
|
|
|
|
|
m_previewFrame->layout()->deleteLater();
|
|
|
|
|
|
|
|
|
|
if ( m_drivesView->selectionModel()->currentIndex() == QModelIndex() )
|
|
|
|
|
{
|
|
|
|
|
cDebug() << "No disk selected, bailing out.";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFormLayout* layout = new QFormLayout;
|
|
|
|
|
m_previewFrame->setLayout( layout );
|
|
|
|
|
layout->setMargin( 0 );
|
|
|
|
|
@ -213,6 +233,4 @@ EraseDiskPage::doAutopartition( Device* dev )
|
|
|
|
|
info.partitionModelAfter->setParent( m_previewFrame );
|
|
|
|
|
layout->addRow( tr( "After:" ), preview );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_core->dumpQueue();
|
|
|
|
|
}
|
|
|
|
|
|