From ef78f909b5a4ee951c792b36e90af15bbf02850c Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 10 Jun 2005 05:09:47 +0000 Subject: not modifying the label when editing is ok --- drakpxelinux.pl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drakpxelinux.pl') diff --git a/drakpxelinux.pl b/drakpxelinux.pl index f55d966..13586a5 100644 --- a/drakpxelinux.pl +++ b/drakpxelinux.pl @@ -283,13 +283,9 @@ sub remove_item { } sub test_similar_label { - my ($newlabel, $oldlabel) = @_; -# if ($newlabel eq $oldlabel) { -# err_dialog(N("hmm.."), N("You should provide a new label name.")) and return 0; -# } els - - if (any { $_->{label} eq $newlabel } @{$pxelinux_conf->{entries}}) { - err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please", $newlabel)) and return 0; + my ($label) = @_; + if (any { $_->{label} eq $label } @{$pxelinux_conf->{entries}}) { + err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please", $label)) and return 0; } else { return 1 } } @@ -537,7 +533,7 @@ sub cell_edited { my $oldlabel = $entry->{label}; my $newlabel = $new_text; - if (test_similar_label($newlabel, $oldlabel) eq "1") { + if ($newlabel ne $oldlabel && test_similar_label($newlabel)) { network::pxe::change_label_in_help($oldlabel, $newlabel); $entry->{label} = $new_text; $model->set($iter, $column, $entry->{label}); -- cgit v1.2.1