From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH installer v5 09/23] gui: network: factor out name pinning into advanced options dialog
Date: Fri, 6 Nov 2026 14:10:38 +0100 [thread overview]
Message-ID: <20261106131058.804870-10-c.heiss@proxmox.com> (raw)
In-Reply-To: <20261106131058.804870-1-c.heiss@proxmox.com>
This dialog can now be easily extended with additional frames for other,
advanced network-related options.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Changes v4 -> v5:
* no changes
Changes v3 -> v4:
* don't expand checkbox and grid, which resulted in unnecessary padding
and dialog size
Changes v2 -> v3:
* moved shuffling around of create_label_widget_grid() definition to
next commit (thanks Lukas S.!)
Changes v1 -> v2:
* no changes
proxinstall | 125 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 81 insertions(+), 44 deletions(-)
diff --git a/proxinstall b/proxinstall
index 51efe79..9c1e5ac 100755
--- a/proxinstall
+++ b/proxinstall
@@ -349,34 +349,26 @@ my $create_basic_grid = sub {
return $grid;
};
-my sub create_network_interface_pin_view {
- my ($done_cb) = @_;
+my sub create_network_interface_pin_frame {
+ my ($on_enable_changed) = @_;
- my $dialog = Gtk3::Dialog->new();
- $dialog->set_title('Interface Name Pinning Options');
- $dialog->add_button('_OK', 'ok');
+ my $frame = Gtk3::Frame->new('Interface Name Pinning');
- my $content = $dialog->get_content_area();
+ my $vbox = Gtk3::Box->new('vertical', 5);
+ $frame->add($vbox);
+ $vbox->set_margin_start(10);
+ $vbox->set_margin_end(10);
+ $vbox->set_margin_top(5);
+ $vbox->set_margin_bottom(5);
- my $hbox = Gtk3::Box->new('horizontal', 0);
- $content->pack_start($hbox, 1, 1, 5);
+ my $enable_checkbox = Gtk3::CheckButton->new('Pin network interface names');
+ $enable_checkbox->set_active($gtk_state->{network_pinning_enabled});
+ $vbox->pack_start($enable_checkbox, 1, 0, 5);
my $grid = Gtk3::Grid->new();
$grid->set_column_spacing(10);
$grid->set_row_spacing(10);
-
- # make the list scrollable, in case there are lots of interfaces
- my $scrolled_window = Gtk3::ScrolledWindow->new();
- $scrolled_window->set_hexpand(1);
- $scrolled_window->set_propagate_natural_height(1);
-
- $scrolled_window->add($grid);
- $scrolled_window->set_policy('never', 'automatic');
- $scrolled_window->set_min_content_height(200);
- $scrolled_window->set_margin_start(10);
- $scrolled_window->set_margin_end(10);
-
- $hbox->pack_start($scrolled_window, 1, 0, 5);
+ $vbox->pack_start($grid, 1, 1, 5);
my $interfaces = Proxmox::Install::RunEnv::get()->{network}->{interfaces};
my $mapping = Proxmox::Install::Config::get_network_interface_pin_map();
@@ -412,24 +404,83 @@ my sub create_network_interface_pin_view {
$inputs->{ $iface->{mac} } = $input;
}
- $hbox->show_all();
+ my $set_sensitive = sub {
+ my ($active) = @_;
+ $grid->foreach(sub {
+ $_[0]->set_sensitive($active);
+ });
+ };
+
+ $set_sensitive->($gtk_state->{network_pinning_enabled});
+ $enable_checkbox->signal_connect(
+ toggled => sub {
+ my $active = !!$enable_checkbox->get_active();
+
+ $gtk_state->{network_pinning_enabled} = $active;
+ $set_sensitive->($active);
+
+ $on_enable_changed->($active);
+ },
+ );
+
+ my $on_done = sub {
+ if (!$enable_checkbox->get_active()) {
+ Proxmox::Install::Config::set_network_interface_pin_map();
+ return;
+ }
+
+ my %new_mapping = map { $_ => $inputs->{$_}->get_text() } keys %$inputs;
+
+ validate_link_pin_map(\%new_mapping);
+ Proxmox::Install::Config::set_network_interface_pin_map(\%new_mapping);
+ };
+
+ return ($frame, $on_done);
+}
+
+my sub create_network_advanced_options_view {
+ my ($done_cb) = @_;
+
+ my $dialog = Gtk3::Dialog->new();
+ $dialog->set_title('Management Network Options');
+ $dialog->add_button('_OK', 'ok');
+
+ my $content = $dialog->get_content_area();
+
+ my $scrolled_window = Gtk3::ScrolledWindow->new();
+ $scrolled_window->set_hexpand(1);
+ $scrolled_window->set_vexpand(1);
+ $scrolled_window->set_propagate_natural_height(1);
+ $scrolled_window->set_policy('never', 'automatic');
+ $scrolled_window->set_min_content_height(200);
+
+ my $hbox = Gtk3::Box->new('vertical', 0);
+
+ my ($pin_frame, $pin_on_done) = create_network_interface_pin_frame(sub {});
+
+ $hbox->pack_start($pin_frame, 0, 0, 10);
+
+ $scrolled_window->add($hbox);
+ $content->pack_start($scrolled_window, 1, 1, 10);
+
+ my $inputs = {};
$dialog->signal_connect(
response => sub {
- my %new_mapping = map { $_ => $inputs->{$_}->get_text() } keys %$inputs;
-
- eval { validate_link_pin_map(\%new_mapping); };
+ eval {
+ $pin_on_done->();
+ };
if ($@) {
Proxmox::UI::message($@, $dialog);
return;
}
- Proxmox::Install::Config::set_network_interface_pin_map(\%new_mapping);
$dialog->destroy();
$done_cb->();
},
);
+ $dialog->show_all();
$dialog->run();
}
@@ -522,21 +573,10 @@ sub create_ipconf_view {
$device_cb->set_active($active);
};
- my $name_pin_opts_button = Gtk3::Button->new('Options');
- $name_pin_opts_button->set_sensitive($gtk_state->{network_pinning_enabled});
- $name_pin_opts_button->signal_connect(
+ my $advanced_opts_button = Gtk3::Button->new('Advanced Options');
+ $advanced_opts_button->signal_connect(
clicked => sub {
- create_network_interface_pin_view($refresh_device_cb);
- },
- );
-
- my $name_pin_checkbox = Gtk3::CheckButton->new('Pin network interface names');
- $name_pin_checkbox->set_active($gtk_state->{network_pinning_enabled});
- $name_pin_checkbox->signal_connect(
- toggled => sub {
- $name_pin_opts_button->set_sensitive(!!$name_pin_checkbox->get_active());
- $gtk_state->{network_pinning_enabled} = !!$name_pin_checkbox->get_active();
- $refresh_device_cb->();
+ create_network_advanced_options_view($refresh_device_cb);
},
);
@@ -661,8 +701,7 @@ sub create_ipconf_view {
$grid->attach($dns_label, 0, 4, 1, 1);
$grid->attach($ipconf_entry_dns, 1, 4, 2, 1);
- $grid->attach($name_pin_checkbox, 1, 5, 1, 1);
- $grid->attach($name_pin_opts_button, 2, 5, 1, 1);
+ $grid->attach($advanced_opts_button, 1, 5, 2, 1);
$gtk_state->{inbox}->show_all;
set_next(
@@ -730,8 +769,6 @@ sub create_ipconf_view {
}
Proxmox::Install::Config::set_dns($dns_ip);
- $gtk_state->{network_pinning_enabled} = !!$name_pin_checkbox->get_active();
-
#print STDERR "TEST $ipaddress/$netmask $gateway_ip $dns_ip\n";
$step_number++;
--
2.56.0
next prev parent reply other threads:[~2026-11-06 13:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 13:10 [PATCH installer v5 00/23] fix #2164: add bond and vlan setup across all installers Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 01/23] install: run make tidy Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 02/23] tree-wide: use `MacAddress` type instead of string for MAC addresses Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 03/23] install: factor out ifupdown2 config generation into own subroutine Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 04/23] install: do not rely on interface name map to be fully populated Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 05/23] install: config: add option for setting up bond on management interface Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 06/23] install: config: add option for setting up vlan " Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 07/23] install: network: set up management bond if requested Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 08/23] install: network: set up vlan on management interface " Christoph Heiss
2026-11-06 13:10 ` Christoph Heiss [this message]
2026-11-06 13:10 ` [PATCH installer v5 10/23] gui: network: add bond setup options to advanced options dialog Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 11/23] gui: network: add vlan setup options to advanced network dialog Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 12/23] auto: pass through management network bond options to low-level installer Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 13/23] auto: pass through management network vlan " Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 14/23] tui: drop long obsolete comment about logo formatting Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 15/23] tui: views: add widget for displaying a group of checkboxes Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 16/23] tui: network: factor out name pinning into advanced options dialog Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 17/23] tui: network: match form label style when enabling/disabling elements Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 18/23] tui: network: add bond setup options to advanced network dialog Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 19/23] tui: network: add vlan " Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 20/23] gui: network: split advanced options dialog into tabs Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 21/23] tui: " Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 22/23] gui: network: list bond member candidates sharing a MAC address once Christoph Heiss
2026-11-06 13:10 ` [PATCH installer v5 23/23] tui: " Christoph Heiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106131058.804870-10-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.