Some code was copied and adapted from PartitionActions.cpp. For full
compliance, it is best to copy the copyright holders list from this file
to PartitionLayout.cpp.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
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>
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>
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>
This patches add new methods to both PartitionLayout and
PartitionCoreModule classes which apply the partition layout to the
available drive space.
In addition, the partition creation code from PartitioinActions is
removed to call the newly created methods instead, thus applying the
custom partition layout when the "Erase whole disk" and "Replace
partition" choices are selected.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
As we move some of the partition creation code away from
PartitionActions, we will need the bytesToSectors function. Rather than
copying it, we export it in the PartitionActions namespace, so that
other classes can use it.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
In order to keep the partition layout during calamares' execution, we
add a PartitionLayout object instance to PartitionCoreModule. This class
will therefore be used to initialize the PartitionLayout object and
interact with it thoughout the program's execution.
When no partition layout is present in the config file, we initialize
the layout with a single ext4 partition mounted on '/', as it was
previously done.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
In order to use a custom partition layout in the partition module, we
need to write this layout in the module's config file, and store it into
a dedicated object.
As it doesn't look appropriate to extend an existing class with layout
information, we create a new PartitionLayout class, which will be used
to parse the layout from the config file and keep it in memory.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This basically means we talk about localization in the respective
localized variant. e.g. "German (Germany)" ➡ "Deutsch (Deutschland)".
If geoip lookup failed or isn't configured for whatever reason it's a
stretch to expect the user to know english enough to find their own
language. Preferring the localized strings resolves this issue.
Additionally this happens to bypass #712 respectively
https://bugreports.qt.io/browse/QTBUG-34287
as the native names are properly spelled. So, as long as Qt has localized
names the names will also be properly spelled.
- Add automatic tooling to retrieve translation stats and
output new CMake variable settings.
- If there are i18n language selection warnings, stop CMake.