From b7ea2e6e02d95e3131744c4c4f7602741e54a70a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 31 Jul 2007 15:56:01 +0000 Subject: select steps according to detected Windows items --- transfugdrake | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/transfugdrake b/transfugdrake index 7cb7896..170fdf1 100755 --- a/transfugdrake +++ b/transfugdrake @@ -23,6 +23,15 @@ my $bookmarks_migration_type; my $mail_migration_type; my $background_migration_type; +my @step_items = ( + "files", [ "My Documents", "My Music", "My Pictures" ], + "bookmarks", [ "Internet Explorer", "Mozilla Firefox" ], + "mail", [ "Outlook Express" ], + "background", [ "Wallpaper" ], +); +my @steps; +sub next_step { shift(@steps) || 'end' } + my $in = 'interactive'->vnew('su'); my $wiz = wizards->new({ name => N("Migration wizard"), @@ -54,7 +63,9 @@ my $wiz = wizards->new({ ], post => sub { @windows_items = list_windows_items($windows_disk, $windows_user); - 'files'; + @steps = map { $_->[0] } grep { intersection(\@windows_items, $_->[1]) } group_by2(@step_items); + @steps or return 'nothing'; + next_step(); }, }, files => { @@ -72,7 +83,7 @@ my $wiz = wizards->new({ ], post => sub { import_files(); - 'bookmarks'; + next_step(); }, }, bookmarks => { @@ -91,7 +102,7 @@ my $wiz = wizards->new({ ], post => sub { import_bookmarks(); - 'mail'; + next_step(); }, }, mail => { @@ -109,7 +120,7 @@ my $wiz = wizards->new({ ], post => sub { import_mail(); - 'background'; + next_step(); }, }, background => { @@ -125,7 +136,7 @@ my $wiz = wizards->new({ ], post => sub { import_background(); - 'end'; + next_step(); }, }, end => { @@ -136,6 +147,10 @@ my $wiz = wizards->new({ name => N("No Windows installation has been detected."), end => 1, }, + nothing => { + name => N("No documents and settings have been detected."), + end => 1, + }, }, }); -- cgit v1.2.1