From e996c2ca413a4c88283f7ff2511ce51816b0d3c6 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 27 Dec 2005 12:55:19 +0000 Subject: don't allow to go on if no device is selected (thanks to Sylvie \o/) --- tools/draklive | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/draklive b/tools/draklive index 1ad600567..b2245b0d7 100755 --- a/tools/draklive +++ b/tools/draklive @@ -714,11 +714,18 @@ sub copy_wizard { } delete $devices{$_->{rootDevice}} foreach @available_devices; unshift @available_devices, map { $devices{$_} } sort keys %devices; + undef $device; }, data => [ { type => 'list', allow_empty_list => 1, val => \$device, , list => \@available_devices, format => sub { $_[0]->{formatted_name} } }, { text => N("Format selected device"), val => \$format, type => 'bool' } ], + complete => sub { + unless (defined $device) { + $in->ask_warn(N("Error"), N("You must select a device!")); + return 1; + } + }, post => sub { my $media = { media => { storage => $storage, device => '/dev/' . $device->{device} } }; format_device($live, $media) if $format; -- cgit v1.2.1