diff options
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r-- | drakpxelinux.pl | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl index d9953f8..64b3819 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -873,11 +873,6 @@ sub create_systems_list() { } #- don't let the user modify the "Installed" state $systems->get_column(1)->get_cell_renderers->set_property('mode', 'inert'); - my $col = $systems->get_column(3); # la colonne NOM, colonne numéro 2 - $systems->get_column(3)->signal_connect('clicked', sub { - write_profile_conf($systems); - } - ); $systems->set_column_editable(3, 1); $systems->set_rules_hint(1); return $systems; @@ -896,6 +891,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); update_treeview($pxelinux_conf); }); return $profiles; @@ -991,7 +987,7 @@ sub get_mac_addresses_from_dhcp_log() { 1; #- run callback on next timeout } -my ($profiles_combo, $install_button); +my ($profiles_combo, $install_button, $menu_combo); sub refresh_profiles() { my @profiles = network::pxe::list_profiles($profiles_conf); @@ -1001,6 +997,17 @@ sub refresh_profiles() { @{$profiles->{data}} = @profiles; } +sub refresh_menu { + my ($pxelinux_conf) = @_; + my @menu = network::pxe::list_pxelinux_labels($pxelinux_conf); + mygtk2::gtkset($menu_combo, list => [ '', @menu ]); + my $defaultlabel = $pxelinux_conf->{default}; + $menu_combo->set_text($defaultlabel); + $menu_combo->signal_connect(changed => sub { + $pxelinux_conf->{default} = $menu_combo->get_text; + }); +} + sub add_profile() { my $w = ugtk2->new(N("Deployment center")); my ($entry, $to_install); @@ -1084,19 +1091,6 @@ $treeview->get_selection->set_mode('single'); add_columns($treeview); # labels that list pxe menu entry -my $labelscombo = Gtk2::OptionMenu->new; -#my @labelslist = list_label_pxe; -my $defaultlabel = $pxelinux_conf->{default}; -$labelscombo->entry->set_text($defaultlabel); -$labelscombo->entry->signal_connect("changed", sub { - $pxelinux_conf->{default} = $labelscombo->entry->get_text; -}); - -my @o = network::pxe::list_pxelinux_labels($pxelinux_conf); -$labelscombo->set_popdown_strings("", sort(@o)); -$labelscombo->entry->set_text($defaultlabel); -set_help_tip($labelscombo, 'labels'); - $treeview->signal_connect(button_press_event => sub { my (undef, $event) = @_; my $model = $treeview->get_model; @@ -1182,8 +1176,8 @@ gtkpack($w->{window}, gtknew('VBox', spacing => 0, children => [ write_conf($pxelinux_conf, $treeview); write_profile_conf(); }), - #0, gtknew('Label', text => N("Default boot:")), - #0, $labelscombo, + 0, gtknew('Label', text => N("Default boot:")), + 0, $menu_combo = gtknew('ComboBox'), ]), ]), gtknew('Label', text => N("Systems")), |