Skip to content

Commit

Permalink
Merge branch 'main' into danirabbit/partitioningview-testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Sep 24, 2024
2 parents de53387 + 96efd52 commit 3083fef
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 42 deletions.
1 change: 1 addition & 0 deletions data/installer.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
</description>
<issues>
<issue url="https://github.com/elementary/installer/issues/538">Screen Reader ignores each view’s title text</issue>
<issue url="https://github.com/elementary/installer/issues/539">Second step of VariantWidget not focused</issue>
</issues>
</release>

Expand Down
2 changes: 1 addition & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ src/Widgets/DecryptMenu.vala
src/Widgets/DiskBar.vala
src/Widgets/DiskGrid.vala
src/Widgets/InstallTypeGrid.vala
src/Widgets/PartitionBar.vala
src/Widgets/PartitionBlock.vala
src/Widgets/PartitionMenu.vala
src/Widgets/VariantWidget.vala
6 changes: 5 additions & 1 deletion src/Views/AbstractInstallerView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ public abstract class AbstractInstallerView : Adw.NavigationPage {

content_area = new Gtk.Box (VERTICAL, 24);

var content_clamp = new Adw.Clamp () {
child = content_area
};

var box = new Gtk.Box (HORIZONTAL, 12) {
homogeneous = true,
hexpand = true,
vexpand = true,
};
box.append (title_area);
box.append (content_area);
box.append (content_clamp);

action_box_end = new Gtk.Box (HORIZONTAL, 6) {
halign = END,
Expand Down
3 changes: 0 additions & 3 deletions src/Views/CheckView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,12 @@ public class Installer.CheckView : AbstractInstallerView {
};

var title_label = new Gtk.Label (title) {
hexpand = true,
max_width_chars = 1,
wrap = true,
xalign = 0
};
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);

var description_label = new Gtk.Label (description) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
Expand Down
2 changes: 0 additions & 2 deletions src/Views/DiskView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class Installer.DiskView : AbstractInstallerView {
var install_desc_label = new Gtk.Label (
_("This will erase all data on the selected drive. If you have not backed your data up, you can cancel the installation and use Demo Mode.")
) {
max_width_chars = 45,
wrap = true,
xalign = 0
};
Expand All @@ -70,7 +69,6 @@ public class Installer.DiskView : AbstractInstallerView {
load_spinner.start ();

var load_label = new Gtk.Label (_("Getting the current configuration…")) {
max_width_chars = 45,
wrap = true
};
load_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);
Expand Down
1 change: 0 additions & 1 deletion src/Views/DriversView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
var title_label = new Gtk.Label (title);

var description_label = new Gtk.Label (_("Broadcom® Wi-Fi adapters, NVIDIA® graphics, and some virtual machines may not function properly without additional drivers. Most devices do not require additional drivers.")) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand Down
7 changes: 1 addition & 6 deletions src/Views/EncryptView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class EncryptView : AbstractInstallerView {
var title_label = new Gtk.Label (title);

var details_label = new Gtk.Label (_("Encrypt this device's drive if required for added protection, but be sure you understand:")) {
hexpand = true,
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand Down Expand Up @@ -88,9 +86,7 @@ public class EncryptView : AbstractInstallerView {
var description = new Gtk.Label (
_("If you forget the encryption password, <b>you will not be able to recover data.</b> This is a unique password for this device, not the password for your user account.")
) {
hexpand = true,
margin_bottom = 12,
max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
Expand Down Expand Up @@ -278,9 +274,8 @@ public class EncryptView : AbstractInstallerView {

construct {
label_widget = new Gtk.Label (label) {
halign = END,
hexpand = true,
justify = RIGHT,
max_width_chars = 55,
use_markup = true,
wrap = true,
xalign = 1
Expand Down
4 changes: 0 additions & 4 deletions src/Views/ErrorView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class ErrorView : AbstractInstallerView {

var description_label = new Gtk.Label (_("Installing %s failed, possibly due to a hardware error. The device may not restart properly. You can try the following:").printf (Utils.get_pretty_name ())) {
margin_bottom = 12,
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand All @@ -45,7 +44,6 @@ public class ErrorView : AbstractInstallerView {

var try_label = new Gtk.Label (_("Try the installation again")) {
hexpand = true,
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand All @@ -55,7 +53,6 @@ public class ErrorView : AbstractInstallerView {
};

var launch_label = new Gtk.Label (_("Use Demo Mode and try to manually recover")) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand All @@ -65,7 +62,6 @@ public class ErrorView : AbstractInstallerView {
};

var restart_label = new Gtk.Label (_("Restart the device and boot from another drive")) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand Down
8 changes: 4 additions & 4 deletions src/Views/PartitioningView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ public class Installer.PartitioningView : AbstractInstallerView {

unowned string path = disk.device_path;

var partitions = new Gee.ArrayList<PartitionBar> ();
var partitions = new Gee.ArrayList<PartitionBlock> ();
foreach (unowned InstallerDaemon.Partition part in disk.partitions) {
var partition = new PartitionBar (part, path, sector_size, false, this.set_mount, this.unset_mount, this.mount_is_set);
var partition = new PartitionBlock (part, path, sector_size, false, this.set_mount, this.unset_mount, this.mount_is_set);
partition.decrypted.connect (on_partition_decrypted);
partitions.add (partition);
}
Expand Down Expand Up @@ -229,9 +229,9 @@ public class Installer.PartitioningView : AbstractInstallerView {

unowned string path = disk.device_path;

var partitions = new Gee.ArrayList<PartitionBar> ();
var partitions = new Gee.ArrayList<PartitionBlock> ();
foreach (unowned InstallerDaemon.Partition part in disk.partitions) {
var partition = new PartitionBar (part, path, sector_size, true, this.set_mount, this.unset_mount, this.mount_is_set);
var partition = new PartitionBlock (part, path, sector_size, true, this.set_mount, this.unset_mount, this.mount_is_set);
partition.decrypted.connect (on_partition_decrypted);
partitions.add (partition);
}
Expand Down
3 changes: 0 additions & 3 deletions src/Views/SuccessView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ public class SuccessView : AbstractInstallerView {
var title_label = new Gtk.Label (title);

var primary_label = new Gtk.Label (_("%s has been installed").printf (Utils.get_pretty_name ())) {
hexpand = true,
max_width_chars = 1,
wrap = true,
xalign = 0
};
primary_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);

secondary_label = new Gtk.Label (null) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
Expand Down
1 change: 0 additions & 1 deletion src/Widgets/DecryptMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public class Installer.DecryptMenu: Gtk.Popover {

var secondary_label = new Gtk.Label (_("Enter the partition's encryption password and set a device name for the decrypted partition."));
secondary_label.halign = Gtk.Align.START;
secondary_label.max_width_chars = 50;
secondary_label.selectable = true;
secondary_label.wrap = true;
secondary_label.xalign = 0;
Expand Down
1 change: 0 additions & 1 deletion src/Widgets/DescriptionRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class DescriptionRow : Gtk.Box {

var description_label = new Gtk.Label (description) {
hexpand = true,
max_width_chars = 1, // Make Gtk wrap, but not expand the window
use_markup = true,
wrap = true,
xalign = 0
Expand Down
12 changes: 6 additions & 6 deletions src/Widgets/DiskBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public class Installer.DiskBar: Gtk.Box {
public string disk_name { get; construct; }
public string disk_path { get; construct; }
public uint64 size { get; construct; }
public Gee.ArrayList<PartitionBar> partitions { get; construct; }
public Gee.ArrayList<PartitionBlock> partitions { get; construct; }

private Gtk.Box legend_box;

public DiskBar (string disk_name, string disk_path, uint64 size, Gee.ArrayList<PartitionBar> partitions) {
public DiskBar (string disk_name, string disk_path, uint64 size, Gee.ArrayList<PartitionBlock> partitions) {
Object (
disk_name: disk_name,
disk_path: disk_path,
Expand All @@ -37,7 +37,7 @@ public class Installer.DiskBar: Gtk.Box {
halign = START
};

foreach (PartitionBar p in partitions) {
foreach (PartitionBlock p in partitions) {
add_legend (
p.partition.device_path,
p.get_partition_size () * 512,
Expand All @@ -48,7 +48,7 @@ public class Installer.DiskBar: Gtk.Box {
}

uint64 used = 0;
foreach (PartitionBar partition in partitions) {
foreach (PartitionBlock partition in partitions) {
used += partition.get_partition_size ();
}

Expand Down Expand Up @@ -110,10 +110,10 @@ public class Installer.DiskBar: Gtk.Box {
}

private class PartitionContainer : Gtk.Widget {
public Gee.ArrayList<PartitionBar> partitions { get; construct; }
public Gee.ArrayList<PartitionBlock> partitions { get; construct; }
public uint64 size { get; construct; }

public PartitionContainer (uint64 size, Gee.ArrayList<PartitionBar> partitions) {
public PartitionContainer (uint64 size, Gee.ArrayList<PartitionBlock> partitions) {
Object (
partitions: partitions,
size: size
Expand Down
1 change: 0 additions & 1 deletion src/Widgets/InstallTypeGrid.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class Installer.InstallTypeButton : Gtk.CheckButton {
title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL);

var subtitle_label = new Gtk.Label (subtitle) {
max_width_chars = 1, // Make Gtk wrap, but not expand the window
wrap = true,
xalign = 0
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Authored by: Michael Aaron Murphy <[email protected]>
*/

public class Installer.PartitionBar : Gtk.Box {
public class Installer.PartitionBlock : Adw.Bin {
public signal void decrypted (InstallerDaemon.LuksCredentials credential);

public Icon? icon { get; set; default = null; }
Expand All @@ -17,7 +17,7 @@ public class Installer.PartitionBar : Gtk.Box {
public string? volume_group { get; private set; }
public Gtk.Popover menu { get; private set; }

public PartitionBar (
public PartitionBlock (
InstallerDaemon.Partition partition,
string parent_path,
uint64 sector_size,
Expand Down Expand Up @@ -56,13 +56,11 @@ public class Installer.PartitionBar : Gtk.Box {
volume_group = (partition.filesystem == LVM) ? partition.current_lvm_volume_group : null;

var image = new Gtk.Image () {
hexpand = true,
halign = END,
valign = END
};

append (image);
hexpand = true;
child = image;
tooltip_text = partition.device_path;

add_css_class (partition.filesystem.to_string ());
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/PartitionMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public class Installer.PartitionMenu : Gtk.Popover {
private Gtk.Label custom_label;
private Gtk.Label type_label;
// A reference to the parent which owns this menu.
private PartitionBar partition_bar;
private PartitionBlock partition_bar;

public PartitionMenu (string path, string parent, InstallerDaemon.FileSystem fs,
bool lvm, SetMount set_mount, UnsetMount unset_mount,
MountSetFn mount_set, PartitionBar partition_bar) {
MountSetFn mount_set, PartitionBlock partition_bar) {
this.partition_bar = partition_bar;
original_filesystem = fs;
is_lvm = lvm;
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ vala_files = [
'Widgets/DiskBar.vala',
'Widgets/DiskGrid.vala',
'Widgets/InstallTypeGrid.vala',
'Widgets/PartitionBar.vala',
'Widgets/PartitionBlock.vala',
'Widgets/PartitionMenu.vala',
'Widgets/Terminal.vala',
'Widgets/VariantWidget.vala',
Expand Down

0 comments on commit 3083fef

Please sign in to comment.