From 6a1aced5d62a6754ef134821a3663cccd46963c8 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Mon, 5 Sep 2005 14:25:31 +0000 Subject: fix default boot for each profile --- drakpxelinux.pl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drakpxelinux.pl b/drakpxelinux.pl index ea81c55..3f0fa50 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -64,6 +64,7 @@ network::network::read_net_conf($net); my $sys_wizard_pxe = "/etc/sysconfig/drak_pxe"; my ($interface) = cat_($sys_wizard_pxe) =~ /INTERFACE=(.*)/; $interface ||= $net->{net_interface}; +link_default_path(); my $help = "" . N("PXE Label: the name to be displayed in the PXE menu (an ASCII word/number)") . "\n" . @@ -942,7 +943,7 @@ sub create_profiles_list() { $profiles->get_selection->set_mode('browse'); $profiles->get_selection->signal_connect(changed => sub { my $pxelinux_conf = get_pxelinux_conf_from_profile(); - #refresh_menu($pxelinux_conf, $treeview); + refresh_menu(); update_treeview($pxelinux_conf); }); return $profiles; @@ -1050,8 +1051,8 @@ sub refresh_profiles() { @{$profiles->{data}} = @profiles; } -sub refresh_menu { - my ($pxelinux_conf, $treeview) = @_; +sub refresh_menu() { + my $pxelinux_conf = get_pxelinux_conf_from_profile(); my @menu = network::pxe::list_pxelinux_labels($pxelinux_conf); mygtk2::gtkset($menu_combo, list => [ '', @menu ]); my $defaultlabel = $pxelinux_conf->{default}; @@ -1062,9 +1063,13 @@ sub refresh_menu { } else { $c++ } } $menu_combo->signal_connect(changed => sub { - #my $pxelinux_conf = get_selected_profile; - $pxelinux_conf->{default} = $menu_combo->get_active_text; - $pxelinux_conf and write_conf($pxelinux_conf, $treeview); + my $model_profiles = $profiles->get_model; + my $iter = $profiles->get_selection->get_selected; + ($config_file, $help_file) = network::pxe::get_pxelinux_profile_path($model_profiles->get($iter, 0), 'boot'); + my $new_default = $menu_combo->get_active_text; + substInFile { + s/DEFAULT.*/DEFAULT $new_default/; + } $config_file; }); } @@ -1288,7 +1293,6 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [ ); add_local_profil_entry(); -link_default_path(); add_configured_mac_addresses(); get_mac_addresses_from_dhcp_log(); update_systems_data_from_file(); -- cgit v1.2.1