Merge branch 'master' into requirements-checking

This commit is contained in:
Adriaan de Groot 2018-03-06 14:57:17 +01:00
commit a72bdfac52
557 changed files with 27764 additions and 17340 deletions

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
@ -300,6 +300,16 @@ ChoicePage::selectedDevice()
}
void
ChoicePage::hideButtons()
{
m_eraseButton->hide();
m_replaceButton->hide();
m_alongsideButton->hide();
m_somethingElseButton->hide();
}
/**
* @brief ChoicePage::applyDeviceChoice handler for the selected event of the device
* picker. Calls ChoicePage::selectedDevice() to get the current Device*, then
@ -311,7 +321,10 @@ void
ChoicePage::applyDeviceChoice()
{
if ( !selectedDevice() )
{
hideButtons();
return;
}
if ( m_core->isDirty() )
{
@ -342,11 +355,14 @@ ChoicePage::continueApplyDeviceChoice()
// applyDeviceChoice() will be called again momentarily as soon as we handle the
// PartitionCoreModule::reverted signal.
if ( !currd )
{
hideButtons();
return;
}
updateDeviceStatePreview();
// Preview setup done. Now we show/hide choices as needed.
// Preview setup done. Now we show/hide choices as needed.
setupActions();
m_lastSelectedDeviceIndex = m_drivesCombo->currentIndex();
@ -562,7 +578,11 @@ ChoicePage::onLeave()
{
if ( m_bootloaderComboBox.isNull() )
{
m_core->setBootLoaderInstallPath( selectedDevice()->deviceNode() );
auto d_p = selectedDevice();
if ( d_p )
m_core->setBootLoaderInstallPath( d_p->deviceNode() );
else
cDebug() << "WARNING: No device selected for bootloader.";
}
else
{
@ -1156,6 +1176,9 @@ ChoicePage::setupActions()
else
m_deviceInfoWidget->setPartitionTableType( PartitionTable::unknownTableType );
// Manual partitioning is always a possibility
m_somethingElseButton->show();
bool atLeastOneCanBeResized = false;
bool atLeastOneCanBeReplaced = false;
bool atLeastOneIsMounted = false; // Suppress 'erase' if so
@ -1332,18 +1355,16 @@ ChoicePage::updateNextEnabled()
{
bool enabled = false;
auto sm_p = m_beforePartitionBarsView ? m_beforePartitionBarsView->selectionModel() : nullptr;
switch ( m_choice )
{
case NoChoice:
enabled = false;
break;
case Replace:
enabled = m_beforePartitionBarsView->selectionModel()->
currentIndex().isValid();
break;
case Alongside:
enabled = m_beforePartitionBarsView->selectionModel()->
currentIndex().isValid();
enabled = sm_p && sm_p->currentIndex().isValid();
break;
case Erase:
case Manual:

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*
@ -113,8 +113,12 @@ private:
void setupChoices();
QComboBox* createBootloaderComboBox( QWidget* parentButton );
Device* selectedDevice();
void applyDeviceChoice();
void continueApplyDeviceChoice();
/* Change the UI depending on the device selected. */
void hideButtons(); // Hide everything when no device
void applyDeviceChoice(); // Start scanning new device
void continueApplyDeviceChoice(); // .. called after scan
void updateDeviceStatePreview();
void updateActionChoicePreview( ChoicePage::Choice choice );
void setupActions();

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
@ -43,6 +43,8 @@
#include <QDir>
#include <QListWidgetItem>
#include <QPushButton>
#include <QRegularExpression>
#include <QRegularExpressionValidator>
#include <QSet>
static QSet< FileSystem::Type > s_unmountableFS(
@ -66,6 +68,19 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
m_ui->encryptWidget->setText( tr( "En&crypt" ) );
m_ui->encryptWidget->hide();
if (m_device->type() == Device::Disk_Device) {
m_ui->lvNameLabel->hide();
m_ui->lvNameLineEdit->hide();
}
if (m_device->type() == Device::LVM_Device) {
/* LVM logical volume name can consist of: letters numbers _ . - +
* It cannot start with underscore _ and must not be equal to . or .. or any entry in /dev/
* QLineEdit accepts QValidator::Intermediate, so we just disable . at the beginning */
QRegularExpression re(QStringLiteral(R"(^(?!_|\.)[\w\-.+]+)"));
QRegularExpressionValidator *validator = new QRegularExpressionValidator(re, this);
m_ui->lvNameLineEdit->setValidator(validator);
}
QStringList mountPoints = { "/", "/boot", "/home", "/opt", "/usr", "/var" };
if ( PartUtils::isEfiSystem() )
mountPoints << Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
@ -227,6 +242,10 @@ CreatePartitionDialog::createPartition()
);
}
if (m_device->type() == Device::LVM_Device) {
partition->setPartitionPath(m_device->deviceNode() + QStringLiteral("/") + m_ui->lvNameLineEdit->text().trimmed());
}
PartitionInfo::setMountPoint( partition, m_ui->mountPointComboBox->currentText() );
PartitionInfo::setFormat( partition, true );

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>

View file

@ -146,6 +146,16 @@
</spacer>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lvNameLabel">
<property name="text">
<string>LVM LV name</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="lvNameLineEdit"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mountPointLabel">
<property name="text">
<string>&amp;Mount Point:</string>
@ -155,7 +165,7 @@
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="QComboBox" name="mountPointComboBox">
<property name="editable">
<bool>true</bool>
@ -165,21 +175,21 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<widget class="QLabel" name="labelMountPoint">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Flags:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QListWidget" name="m_listFlags">
<property name="alternatingRowColors">
<bool>true</bool>
@ -192,7 +202,7 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
@ -119,7 +119,7 @@ PartitionPage::~PartitionPage()
void
PartitionPage::updateButtons()
{
bool create = false, edit = false, del = false;
bool create = false, createTable = false, edit = false, del = false;
QModelIndex index = m_ui->partitionTreeView->currentIndex();
if ( index.isValid() )
@ -141,11 +141,18 @@ PartitionPage::updateButtons()
edit = !isFree && !isExtended;
del = !isFree;
}
if ( m_ui->deviceComboBox->currentIndex() >= 0 )
{
QModelIndex deviceIndex = m_core->deviceModel()->index( m_ui->deviceComboBox->currentIndex(), 0 );
if ( m_core->deviceModel()->deviceForIndex( deviceIndex )->type() != Device::LVM_Device )
createTable = true;
}
m_ui->createButton->setEnabled( create );
m_ui->editButton->setEnabled( edit );
m_ui->deleteButton->setEnabled( del );
m_ui->newPartitionTableButton->setEnabled( m_ui->deviceComboBox->currentIndex() >= 0 );
m_ui->newPartitionTableButton->setEnabled( createTable );
}
void

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
@ -410,7 +410,7 @@ PartitionViewStep::onLeave()
.arg( *Calamares::Branding::ShortProductName )
.arg( espMountPoint );
}
else if ( esp && !esp->activeFlags().testFlag( PartitionTable::FlagEsp ) )
else if ( esp && !PartUtils::isEfiBootable( esp ) )
{
message = tr( "EFI system partition flag not set" );
description = tr( "An EFI system partition is necessary to start %1."

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
*

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
@ -20,6 +20,8 @@
#ifndef REPLACEWIDGET_H
#define REPLACEWIDGET_H
#include "utils/CalamaresUtilsGui.h"
#include <QWidget>
#include <QScopedPointer>
@ -28,11 +30,6 @@ class QComboBox;
class PartitionCoreModule;
class Partition;
namespace CalamaresUtils
{
enum ImageType : int;
}
class ReplaceWidget : public QWidget
{
Q_OBJECT

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>

View file

@ -1,4 +1,4 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*