diff --git a/proc/edit_proc.cgi b/proc/edit_proc.cgi index f43ceadef..eb340c039 100755 --- a/proc/edit_proc.cgi +++ b/proc/edit_proc.cgi @@ -44,17 +44,8 @@ if (&indexof($pinfo{nice}, @nice_range) < 0) { print $pinfo{nice}; } else { - print " \n"; + print &nice_selector("nice", $pinfo{nice}); + print &ui_submit($text{'edit_change'}); } print " \n"; $i = 0; diff --git a/proc/proc-lib.pl b/proc/proc-lib.pl index e211df11e..798e19cdf 100644 --- a/proc/proc-lib.pl +++ b/proc/proc-lib.pl @@ -215,8 +215,8 @@ else { } } elsif ($sel == 0) { - # nothing to read. maybe the process is done, and a subprocess - # is hanging things up + # nothing to read. maybe the process is done, and a + # subprocess is hanging things up last if (!kill(0, $pid)); } if ($_[7] && time() - $start > $_[7]) { @@ -570,5 +570,18 @@ else { } } +# nice_selector(name, value) +# Returns a menu for selecting a nice level +sub nice_selector +{ +local ($name, $value) = @_; +local $l = scalar(@nice_range); +return &ui_select($name, $value, + [ map { [ $_, $_.($_ == $nice_range[0] ? " ($text{'edit_prihigh'})" : + $_ == 0 ? " ($text{'edit_pridef'})" : + $_ == $nice_range[$l-1] ? " ($text{'edit_prilow'})" : + "") ] } @nice_range ]); +} + 1;