summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS4
-rw-r--r--perl-install/any.pm22
-rw-r--r--perl-install/install/NEWS4
-rw-r--r--perl-install/interactive/gtk.pm7
4 files changed, 35 insertions, 2 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 4d9c32674..cf1c3f561 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,7 @@
+- added the ability to add up/down buttons in add_modify_remove list
+ of interactive
+- drakboot :
+ o user is now able to re-order bootloader entries
- diskdrake
o never pass username/password as options with davfs2
o store credentials in davfs2 secret file before mounting
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 595c2af9e..70a112ec3 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -597,6 +597,26 @@ sub setupBootloader__entries {
1;
};
+ my $Up = sub {
+ my ($e) = @_;
+ my @entries = @{$b->{entries}};
+ my ($index) = grep { $entries[$_]->{label} eq $e->{label} } 0..$#entries;
+ if ($index > 0) {
+ (@{$b->{entries}}->[$index - 1], @{$b->{entries}}->[$index]) = (@{$b->{entries}}->[$index], @{$b->{entries}}->[$index - 1]);
+ }
+ 1;
+ };
+
+ my $Down = sub {
+ my ($e) = @_;
+ my @entries = @{$b->{entries}};
+ my ($index) = grep { $entries[$_]->{label} eq $e->{label} } 0..$#entries;
+ if ($index < $#entries) {
+ (@{$b->{entries}}->[$index + 1], @{$b->{entries}}->[$index]) = (@{$b->{entries}}->[$index], @{$b->{entries}}->[$index + 1]);
+ }
+ 1;
+ };
+
my @prev_entries = @{$b->{entries}};
if ($in->ask_from__add_modify_remove(N("Bootloader Configuration"),
N("Here are the entries on your boot menu so far.
@@ -607,7 +627,7 @@ You can create additional entries or change the existing ones."), [ {
($b->{default} eq $e->{label} ? "  * " : "   ") . "$e->{label} ($e->{kernel_or_dev})" :
translate($e);
}, list => $b->{entries},
- } ], Add => $Add, Modify => $Modify, Remove => $Remove)) {
+ } ], Add => $Add, Modify => $Modify, Remove => $Remove, Up => $Up, Down => $Down)) {
1;
} else {
@{$b->{entries}} = @prev_entries;
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 870911820..4b2938f6e 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,7 @@
+- added the ability to add up/down buttons in add_modify_remove list
+ of interactive
+- drakboot :
+ o user is now able to re-order bootloader entries
- 2010.1 logo
- adduserdrake
o now use password weakness display
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index e6ad4aaff..e48933dbe 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -450,9 +450,14 @@ sub create_widget {
$e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];
if (my $actions = $e->{add_modify_remove}) {
+ my @buttons = ( N_("Add"), N_("Modify"), N_("Remove"));
+ # Add Up/Down buttons if their actions are defined
+ foreach (qw(Up Down)) {
+ push @buttons, N_($_) if ($actions->{$_});
+ }
my @buttons = map {
{ kind => lc $_, action => $actions->{$_}, button => Gtk2::Button->new(translate($_)) };
- } N_("Add"), N_("Modify"), N_("Remove");
+ } @buttons;
my $modify = find { $_->{kind} eq 'modify' } @buttons;
my $do_action = sub {