summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-28 12:31:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-28 12:31:38 +0000
commit0bf26233b2d8462a32162b32e77cced0fc90e13e (patch)
tree2c42be0dc165096373c0733ac32f792ec6f4346b
parentc9e1918760165314996e15654a842eafd280e7b1 (diff)
downloaddrakx-0bf26233b2d8462a32162b32e77cced0fc90e13e.tar
drakx-0bf26233b2d8462a32162b32e77cced0fc90e13e.tar.gz
drakx-0bf26233b2d8462a32162b32e77cced0fc90e13e.tar.bz2
drakx-0bf26233b2d8462a32162b32e77cced0fc90e13e.tar.xz
drakx-0bf26233b2d8462a32162b32e77cced0fc90e13e.zip
add "Mount" and "Unmount"
-rw-r--r--perl-install/diskdrake/dav.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/perl-install/diskdrake/dav.pm b/perl-install/diskdrake/dav.pm
index 13f6e09fa..ad06f958c 100644
--- a/perl-install/diskdrake/dav.pm
+++ b/perl-install/diskdrake/dav.pm
@@ -42,9 +42,9 @@ sub config {
my $dav = { %$dav_ }; #- working on a local copy so that "Cancel" works
- my %actions = my @actions = actions();
my $action;
while ($action ne 'Done') {
+ my %actions = my @actions = actions($dav);
$action = $in->ask_from_list_('', format_dav_info($dav),
[ map { $_->[0] } group_by2 @actions ], 'Done') or return;
$actions{$action}->($in, $dav, $all_hds);
@@ -53,7 +53,11 @@ sub config {
}
sub actions {
+ my ($dav) = @_;
+
(
+ if_($dav && $dav->{isMounted}, __("Unmount") => sub { try('Unmount', @_) }),
+ if_($dav && $dav->{mntpoint} && !$dav->{isMounted}, __("Mount") => sub { try('Mount', @_) }),
__("Server") => \&ask_server,
__("Mount point") => \&mount_point,
__("Options") => \&options,
@@ -61,6 +65,15 @@ sub actions {
);
}
+sub try {
+ my ($name, $in, $dav) = @_;
+ my $f = $diskdrake::interactive::{$name} or die "unknown function $name";
+ eval { $f->($in, {}, $dav) };
+ if (my $err = $@) {
+ $in->ask_warn(_("Error"), formatError($err));
+ }
+}
+
sub ask_server {
my ($in, $dav, $all_hds) = @_;