diff options
Diffstat (limited to 'perl-install/diskdrake/dav.pm')
| -rw-r--r-- | perl-install/diskdrake/dav.pm | 23 | 
1 files changed, 19 insertions, 4 deletions
| diff --git a/perl-install/diskdrake/dav.pm b/perl-install/diskdrake/dav.pm index 4950b2bb0..9036596b3 100644 --- a/perl-install/diskdrake/dav.pm +++ b/perl-install/diskdrake/dav.pm @@ -1,4 +1,4 @@ -package diskdrake::dav; # $Id$ +package diskdrake::dav;  use diagnostics;  use strict; @@ -33,10 +33,11 @@ points, select \"New\".")) },  sub create {      my ($in, $all_hds) = @_; -    my $dav = { fs_type => 'davfs2' }; +    my $dav = { fs_type => 'davfs2', mntpoint => 'none' };      ask_server($in, $dav, $all_hds) or return;      push @{$all_hds->{davs}}, $dav;      config($in, $dav, $all_hds); +    return;  }  sub config { @@ -45,11 +46,12 @@ sub config {      my $dav = { %$dav_ }; #- working on a local copy so that "Cancel" works      my $action; -    while ($action ne 'Done') { +    my $exit; +    while (!$exit && $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);     +	$exit = $actions{$action}->($in, $dav, $all_hds);          }      %$dav_ = %$dav; #- applying  } @@ -63,6 +65,7 @@ sub actions {       N_("Server") => \&ask_server,       N_("Mount point") => \&mount_point,       N_("Options") => \&options, +     N_("Remove") => \&remove,       N_("Done") => sub {},      );  } @@ -95,11 +98,23 @@ sub ask_server {  sub options {      my ($in, $dav, $all_hds) = @_;      diskdrake::interactive::Options($in, {}, $dav, $all_hds); +    return;  } + +sub remove { +    my ($in, $dav, $all_hds) = @_; +    if ($in->ask_yesorno(N("Warning"), N("Are you sure you want to delete this mount point?"))) { +            @{$all_hds->{davs}} = grep { $_->{mntpoint} ne $dav->{mntpoint} } @{$all_hds->{davs}}; +            return 1; +    } +    return; +} +  sub mount_point {       my ($in, $dav, $all_hds) = @_;      my $proposition = $dav->{device} =~ /(\w+)/ ? "/mnt/$1" : "/mnt/dav";      diskdrake::interactive::Mount_point_raw_hd($in, $dav, $all_hds, $proposition); +    return;  }  sub format_dav_info { | 
