298 Commits (2b4bc7adf47f7b5458f698496c2ad80c9cc4d3fe)

Author SHA1 Message Date
Adriaan de Groot 6bccbcd1f5 [partition] Improve logging of status of choice buttons 7 years ago
Adriaan de Groot 1ffc0bf77d [partition] Allow all the unsafe options
- If the unsafe actions are enabled, but won't be executed,
   allow more unsafe actions like erasing mounted partitions
   and everything.
7 years ago
Adriaan de Groot 8cf3c217f7 Merge branch 'requirements-checking' 7 years ago
Adriaan de Groot 2092ec3c9a [partition] Drop some re-parenting trickery
- Can't re-parent across threads easily
 - If device is made by immutableDeviceCopy(), then it's still owned by the
   PartitionCoreModule; giving it away to the widget is not a good idea.
7 years ago
Dan Simmons 651b52ead9 Fix spelling typo 7 years ago
Adriaan de Groot 2a8960cd0f [partition] Ensure combobox pre-selects consistently
- Match the selected item in the combobox with a given default,
   which should be whatever is selected from the available set of
   choices.
7 years ago
Adriaan de Groot 5f20eedb6e [partition] Use swap-choice member, not the combobox pointer
- Store changes to the selected swap-choice when the combobox changes
 - Use that member instead of dereferencing the combobox

This avoids nullptr crashes when the combobox isn't even created
(e.g. when there is only one swap choice).
7 years ago
Adriaan de Groot a4e6d4cd35 [partition] Rename combo box
- Too much confusion possible between the different members all
   named variations of *SwapChoice*
 - Update copyright years, too
7 years ago
Adriaan de Groot 273461a497 [partition] Be verbose about handling osprober results 7 years ago
Adriaan de Groot 2c6ff26aaa [partition] Reduce warnings 7 years ago
Adriaan de Groot 73c39adf9c Merge branch 'improve-swap-ui' 7 years ago
Adriaan de Groot b913753831 [partition] No need to re-query the current choice 7 years ago
Adriaan de Groot aef61a42bc [partition] Tidy up code
- avoid possible nullptr dereference on connect() if no swap choices
 - group retranslations together
7 years ago
Adriaan de Groot 24422b19bd [partition] Idiomatic connect() usage 7 years ago
Adriaan de Groot fbef117fc8 [partition] Remove unused code 7 years ago
Adriaan de Groot 8ecae75dc8 [partition] Simplify code a little
- Document and make pickOne() more correct
 - Reduce calls to globalStorage(), it doesn't change
7 years ago
Adriaan de Groot e85fedfd41 [partition] Drop comment that doesn't apply anymore 7 years ago
Adriaan de Groot a51a000681 Merge branch 'master' into improve-swap-ui 7 years ago
Arnaud Ferraris 5cacc0ddc6 Merge remote-tracking branch 'upstream/master' into partition-layout 7 years ago
Arnaud Ferraris dfb5412c57 [partition] Preserve current device when going to manual partitioning
Fixes #1043

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
7 years ago
Arnaud Ferraris fcd0e8d362 [partition] Apply partition layout when replacing free space
When chosing the "Replace partition" option, free space is not handled
like any partition. In order to apply the custom partition layout in
that case too, we have to modify the code where "replace free space" is
handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
7 years ago
Arnaud Ferraris ba673b17ee [partition] Add configuration option to disable manual partitioning
In some cases where a custom partition layout is used, use of this
layout is mandatory (this can be the case when using a read-only rootfs
which is updated by block-cpying an image file to it).

For these cases, the user must not be able to change the partition
layout, therefore we have to disable manual partitioning.

In order to stay consistent with current behaviour, manual partitioning
is still enabled by default. It will only be disabled if the partition
module's config file contains the corresponding option set to "false".

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
7 years ago
Arnaud Ferraris 2f14a21456 [partition] Apply custom layout when installing "Alongside"
When choosing "Install alongside another system", the custom partition
layout is applied to the space freed by resizing the selected partition.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
7 years ago
Adriaan de Groot 4973d00ace [partition] Only create drop-down if there is something to select
- Swap choices may be 0 (then choose none), 1 (choose that one)
   or more (currently undecided)
7 years ago
Adriaan de Groot 00df8a9fb1 [partition] Remove unused code
- Swap choice for replace and alongside will happen much, much later.
7 years ago
Adriaan de Groot 2998c27545 [partition] Use configured swap choices in choice page 7 years ago
Adriaan de Groot edc6c64657 [partition] Create swap-combo from a set
- Alternate way to create swap-combobox, using configuration
   values rather than an initializer list.
7 years ago
Adriaan de Groot 988a0a5388 [partition] Changing swap choice also changes preview
- When selecting *erase*, you may be able to change the swap
   settings. If so, changing swap settings should change the
   preview.
7 years ago
Adriaan de Groot 0231619c7c [partition] Refactor slot for change in action
- Let's not go overboard on lambdas,
 - Needed for others that also want to update the partitioning preview
7 years ago
Adriaan de Groot c5d707399d Merge branch 'fix-swap-ui' 7 years ago
Adriaan de Groot 8144295e98 [partition] Make new partition flags explicit
Suggested by aliveafter1000: having a default value, and then
filling in the default in one place it is used and not others,
is weird. Instead of dropping the one use, remove the default
value: partition flags are important enough to be explicit.
7 years ago
Adriaan de Groot 417eeedd9f [partition] Calamares is spaced-out enough without extra's 7 years ago
Adriaan de Groot 2a61116b3c [partition] Disable swap choice for replace & alongside 7 years ago
Adriaan de Groot 779542a5d1 Merge branch 'master' into fix-swap-ui 7 years ago
Adriaan de Groot 292bc57523 [partition] Fix build with suitable operator << 7 years ago
Adriaan de Groot b38316365e [partition] Be more verbose about why UI buttons appear 7 years ago
Adriaan de Groot 29bae61610 Merge branch 'master' into fix-swap-ui 7 years ago
Adriaan de Groot e3bf9fc220 [partition] Fix build with KPMCore <= 3.3.0
- Reported by Philip Mueller
7 years ago
Adriaan de Groot d2f4079a18 [partition] Move partitioning options into a class
- As (auto) partitioning grows more options, the parameter
   list becomes more unwieldy. Add some structure to it.
7 years ago
Adriaan de Groot 5136021416 [partition] Move SwapChoice to another namespace
- The choice of swap needs to be handled in more places,
   so make the enum available in the partition module core instead
   of just inside the choice page.
7 years ago
Adriaan de Groot 846e496d76 [partition] Tidy includes 7 years ago
Adriaan de Groot 959cd7b224 [partition] Simplify creation of comboboxes for swap choices 7 years ago
Adriaan de Groot cfa940b35c [partition] Support translations of swap choices
- Introduce enum to indicate what is selected
 - Support translations
 - Fill selections for erase
7 years ago
Adriaan de Groot 7d0451fe69 [partition] Rename Choice -> InstallChoice
- There are more choices to be made (or to come) when partitioning,
   so don't take the most generic term for one enum.
7 years ago
Adriaan de Groot dc492b301c [partition] Drop label on swap-options box 7 years ago
Adriaan de Groot a791818a65 [partition] Add swap drop-down
- This is WIP; the drop-down contents should be customised,
   depending on configuration and the state of the device being
   installed-to.
7 years ago
Caio Carvalho b5a2a5bbdd [partition] Don't show erase button for inactive RAID. 7 years ago
Adriaan de Groot dd8e53dc22 Copyright: update copyright lines on files touched in 2018
Contributions from:
  Adriaan de Groot <groot@kde.org>
  Gabriel Craciunescu <crazy@frugalware.org>
  AlmAck <gluca86@gmail.com>
  Andrius Štikonas <andrius@stikonas.eu>
  Caio Carvalho <caiojcarvalho@gmail.com>
  Raul Rodrigo Segura <raurodse@gmail.com>
7 years ago
Adriaan de Groot 3315df5df1 [modules] Use new convenience logging methods across the board 8 years ago
Adriaan de Groot 05967311de [partition] Be defensive against no device-device-available.
Scenario is this: you have no suitable installation devices on
your system (everything is mounted, or HDD has died), click through
to partition page, where you have all the buttons available, but no
devices in the list. The following actions then cause a crash:

 - clicking "back"
 - clicking any button

Prevent that:
 - you can click "back", but if there is no device selected
   nothing happens to the device state (no nullptr deref,
   and no crash)
 - button code is now more resilient to this scenario
 - buttons are hidden until a device is available, so you
   can't even click on them to trigger the code.
8 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 8 years ago
Adriaan de Groot 31fa9e4251 Clang: fix warnings on partition splitter
- initialize all the fields
 - member-initialization order
 - silence warnings about double<->int
 - drop unused parameter to setSplitPartition
8 years ago
Adriaan de Groot 3e5916157f A mounted partition cannot be resized or replaced
- add check for isMounted()
 - a device with a mounted partition cannot be (entirely) erased

FIXES #639
8 years ago
Adriaan de Groot 851379628c Reduce Qt runtime warnings.
- deleteLater() doesn't like nullptr (produces a warning, but is harmless)
 - reparenting across threads doesn't work, comment on that but leave
   it in, since this may be relevant for memory management.
8 years ago
Adriaan de Groot 7e66499f36 Refactor check for EFI system.
The TODO stands, to delegate this to KPMCore.
8 years ago
Adriaan de Groot 3c3c0f99f8 C++ trickery, part two: shorten code 8 years ago
Adriaan de Groot ee4e4dfccc C++ trickery to make the code shorter to read. 8 years ago
Teo Mrnjavac 6545443b24 Documentation++ 9 years ago
Teo Mrnjavac f4732de975 Always write bootloader path. 9 years ago
Teo Mrnjavac a59a79a816 bootloaderInstallPath only applies if !isEfi. 9 years ago
Teo Mrnjavac f3848cd428 The sender QObject should be in scope so the bootloader path is written.
CAL-388
CAL-417
CAL-441
9 years ago
Teo Mrnjavac 5796b05fda Allow disabling automated LUKS modes. 9 years ago
Teo Mrnjavac c316d22b08 Keep an immutable copy for every scanned Device* to avoid rescans. 9 years ago
Chantara Tith aa10fe982a API Changes, logicalSectorSize -> logicalSize, totalSectors -> totalLogical. 9 years ago
Andrius Štikonas 9f0ca042fe Port away from most cases of Q_FOREACH to C++11 ranged for loop.
In order to avoid deep copies, Qt containers over which we iterate must be const
The remaining unported cases require qAsConst (Qt 5.7) or std::as_const (C++17)
9 years ago
Teo Mrnjavac edeee85cd3 Write reuse Home check box string. 9 years ago
Teo Mrnjavac e6f9714f84 Avoid homePartitionPath going out of scope. 9 years ago
Teo Mrnjavac 90bb64fb17 Pass current index by value. 9 years ago
Teo Mrnjavac aaf85407fb Only look for a separate /home partition if a partition was found. 9 years ago
Teo Mrnjavac 6c6e4a1f88 Write reuseHome to GlobalStorage. 9 years ago
Teo Mrnjavac 8b0b4c73de Add Q_UNUSED where relevant. 9 years ago
Teo Mrnjavac d44a3d831b Warning fixes: avoid C-style casts. 9 years ago
Teo Mrnjavac 30ff216dea Warning fix: implicit cast. 9 years ago
Teo Mrnjavac 90c06bd733 Warning fixage (init list order, lossy cast, Q_UNUSED). 9 years ago
Teo Mrnjavac c1e535a8e8 Hide reuse checkbox on action selection change. 9 years ago
Teo Mrnjavac a17f369cee React to reuse home checkbox by setting /home mount point.
Rearranged Replace workflow a bit: onPartitionReplaceSelected is now
the on choice slot, which in turn calls doReplaceSelectedPartition.
onHomeCheckBoxStateChanged also calls doReplaceSelectedPartition if we
need to redo the Replace task with/without a separate home to keep.
m_reuseHomeCheckBox is hidden by default.
9 years ago
Teo Mrnjavac 2c68802446 Reapply the action choice instead. 9 years ago
Teo Mrnjavac b2b202d190 Do a full revert. 9 years ago
Teo Mrnjavac f1a29033a2 Revert PCM before applying Alongside operation. 9 years ago
Teo Mrnjavac 18742d2afd Ignore encrypt widget if the choice is Manual. 9 years ago
Teo Mrnjavac f5ff716369 Make everything obey the default filesystem type setting. 9 years ago
Teo Mrnjavac 936e7fab7c Initial support for Alongside install with LUKS. 9 years ago
Teo Mrnjavac fd2d24d650 Always show encrypt widget for Replace. 10 years ago
Teo Mrnjavac 4113207e00 Fix next status handling in alongside and replace. 10 years ago
Teo Mrnjavac e84108e234 Add encryption support in PartitionActions::doReplacePartition. 10 years ago
Teo Mrnjavac 6cd1bf6b3d Initial work on having the Replace feature obey the encryption setting. 10 years ago
Teo Mrnjavac a4ab8dad46 Hide encryption widget if not Erase. 10 years ago
Teo Mrnjavac 60dcba8735 Update next state slightly later. 10 years ago
Teo Mrnjavac b792ea0216 Rebuild autopartition proposal when encryption choice changes. 10 years ago
Teo Mrnjavac 0cc9560a99 Hook up EncryptWidget in ChoicePage, plus improve next status handling. 10 years ago
Teo Mrnjavac dacb8f2a94 Make sure we don't hide actions based on osprober. 10 years ago
Chantara Tith fd8c131b26 implement free-space partition replace install 10 years ago
Teo Mrnjavac 83d440f37e Add note. 10 years ago
Teo Mrnjavac 06ebf69afe Initialize all members (fix Coverity defect 98200). 10 years ago
Teo Mrnjavac a0ac9d9f07 Don't dereference nullptr (fix Coverity defect 121863). 10 years ago
Teo Mrnjavac e91d213872 Improve setting ESP. 10 years ago
Teo Mrnjavac e27b9fc295 Handle ESP selector visibility. 10 years ago
Teo Mrnjavac a4831085fb Only override BIOS bootloader install path if there's no UI. 10 years ago
Teo Mrnjavac 7a89b53538 Refactor leave event of ChoicePage, add ESP mount point support.
PVS now calls ChoicePage::onLeave, which in turn runs ChoicePage::
doAlongsideApply and/or sets up the ESP mount point based on the UI
state if it's running in EFI mode and the action is Alongside or
Replace.
If setting up under BIOS, Alongside and Replace always install
the bootloader in the MBR of the current device.
10 years ago
Teo Mrnjavac 485176d70d And always do that, please. 10 years ago