mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
[partition] Preserve current device when going to manual partitioning
Fixes #1043 Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
c9930788f7
commit
dfb5412c57
5 changed files with 40 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
* Copyright 2019, Collabora Ltd
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1523,3 +1524,16 @@ ChoicePage::updateSwapChoicesTr(QComboBox* box)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ChoicePage::lastSelectedDeviceIndex()
|
||||||
|
{
|
||||||
|
return m_lastSelectedDeviceIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChoicePage::setLastSelectedDeviceIndex( int index )
|
||||||
|
{
|
||||||
|
m_lastSelectedDeviceIndex = index;
|
||||||
|
m_drivesCombo->setCurrentIndex( m_lastSelectedDeviceIndex );
|
||||||
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
* Copyright 2019, Collabora Ltd
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -97,6 +98,9 @@ public:
|
||||||
*/
|
*/
|
||||||
void applyActionChoice( ChoicePage::InstallChoice choice );
|
void applyActionChoice( ChoicePage::InstallChoice choice );
|
||||||
|
|
||||||
|
int lastSelectedDeviceIndex();
|
||||||
|
void setLastSelectedDeviceIndex( int index );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void nextStatusChanged( bool );
|
void nextStatusChanged( bool );
|
||||||
void actionChosen();
|
void actionChosen();
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
* Copyright 2018, Andrius Štikonas <andrius@stikonas.eu>
|
* Copyright 2018, Andrius Štikonas <andrius@stikonas.eu>
|
||||||
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
||||||
|
* Copyright 2019, Collabora Ltd
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -609,3 +610,15 @@ PartitionPage::getCurrentUsedMountpoints()
|
||||||
|
|
||||||
return mountPoints;
|
return mountPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
PartitionPage::selectedDeviceIndex()
|
||||||
|
{
|
||||||
|
return m_ui->deviceComboBox->currentIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PartitionPage::selectDeviceByIndex ( int index )
|
||||||
|
{
|
||||||
|
m_ui->deviceComboBox->setCurrentIndex( index );
|
||||||
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
*
|
*
|
||||||
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
||||||
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
* Copyright 2019, Collabora Ltd
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -46,6 +47,9 @@ public:
|
||||||
|
|
||||||
void onRevertClicked();
|
void onRevertClicked();
|
||||||
|
|
||||||
|
int selectedDeviceIndex();
|
||||||
|
void selectDeviceByIndex( int index );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer< Ui_PartitionPage > m_ui;
|
QScopedPointer< Ui_PartitionPage > m_ui;
|
||||||
PartitionCoreModule* m_core;
|
PartitionCoreModule* m_core;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
||||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
* Copyright 2019, Collabora Ltd
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -286,6 +287,7 @@ PartitionViewStep::next()
|
||||||
if ( m_choicePage->currentChoice() == ChoicePage::Manual )
|
if ( m_choicePage->currentChoice() == ChoicePage::Manual )
|
||||||
{
|
{
|
||||||
m_widget->setCurrentWidget( m_manualPartitionPage );
|
m_widget->setCurrentWidget( m_manualPartitionPage );
|
||||||
|
m_manualPartitionPage->selectDeviceByIndex( m_choicePage->lastSelectedDeviceIndex() );
|
||||||
if ( m_core->isDirty() )
|
if ( m_core->isDirty() )
|
||||||
m_manualPartitionPage->onRevertClicked();
|
m_manualPartitionPage->onRevertClicked();
|
||||||
}
|
}
|
||||||
|
@ -315,7 +317,10 @@ void
|
||||||
PartitionViewStep::back()
|
PartitionViewStep::back()
|
||||||
{
|
{
|
||||||
if ( m_widget->currentWidget() != m_choicePage )
|
if ( m_widget->currentWidget() != m_choicePage )
|
||||||
|
{
|
||||||
m_widget->setCurrentWidget( m_choicePage );
|
m_widget->setCurrentWidget( m_choicePage );
|
||||||
|
m_choicePage->setLastSelectedDeviceIndex( m_manualPartitionPage->selectedDeviceIndex() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue