From b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 31 Jul 2007 14:27:24 +0000 Subject: import new interface mockup --- transfugdrake | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100755 transfugdrake (limited to 'transfugdrake') diff --git a/transfugdrake b/transfugdrake new file mode 100755 index 0000000..a2a368a --- /dev/null +++ b/transfugdrake @@ -0,0 +1,175 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); +use strict; +use warnings; +use standalone; +use wizards; +use interactive; +use common; + +my %distrib = distrib(); +my @linux_users = list_users(); +my @windows_users = list_windows_users(); +my %windows_bookmarks = list_windows_bookmarks(); +my %windows_mail = list_windows_mail(); + +my $linux_user; +my $windows_user; +my $files_migration_type; +my $bookmarks_migration_type; +my $mail_migration_type; +my $background_migration_type; + +my $in = 'interactive'->vnew('su'); +my $wiz = wizards->new({ + name => N("Migration wizard"), + pages => { + welcome => { + name => N("This wizard will help you to import Windows documents and settings in your %s distribution.", $distrib{system}) . "\n" . N("It allows two differents migration methods: you can either import all documents and settings by copying them, or share them between operating systems."), + post => sub { + $linux_user = @linux_users == 1 && $linux_users[0]; + $windows_user = @windows_users == 1 && $windows_users[0]; + !$linux_user || !$windows_user ? 'users' : 'files'; + }, + }, + users => { + name => N("Multiple users have been detected, please select a user in the list below."), + data => [ + { + label => N("Windows user"), + type => 'combo', + val => \$linux_user, + list => \@linux_users, + }, + { + label => N("Linux user"), + type => 'combo', + val => \$windows_user, + list => \@windows_users, + }, + ], + next => 'files', + }, + files => { + name => N("You can migrate Windows documents to your home directory. Documents can be imported by copying them, or they can be shared with the other operating system"), + data => [ + { type => 'list', + val => \$files_migration_type, + list => [ + N("Import documents (recommended)"), + N("Share documents"), + N("Skip step"), + ], + }, + ], + post => sub { + import_files(); + 'bookmarks'; + }, + }, + bookmarks => { + name => N("You can migrate browser bookmarks."), + data => [ + { type => 'list', + val => \$bookmarks_migration_type, + list => [ + N("Import bookmarks (recommended)"), + if_(member('firefox', keys %windows_bookmarks), + N("Share bookmarks")), + N("Skip step"), + ], + }, + ], + post => sub { + import_bookmarks(); + 'mail'; + }, + }, + mail => { + name => N("You can migrate mail bookmarks."), + data => [ + { type => 'list', + val => \$mail_migration_type, + list => [ + N("Import mail (recommended)"), + if_(member('thunderbird', keys %windows_mail), + N("Share mail")), + N("Skip step"), + ], + }, + ], + post => sub { + import_mail(); + 'background'; + }, + }, + background => { + name => N("You can migrate your desktop background."), + data => [ + { type => 'list', + val => \$background_migration_type, + list => [ + N("Use Mandriva background"), + N("Import background"), + ], + }, + ], + post => sub { + import_background(); + 'end'; + }, + }, + end => { + name => N("Congratulations, your migration is now completed!"), + end => 1, + }, + }, +}); + +$wiz->process($in); + +sub list_windows_users { + my ($win_prefix) = @_; + qw(john alice); +} + +sub import_files { + my ($win_prefix) = @_; + my $_w = $in->wait_message('', N("Migration of documents in progress")); + sleep 1; +} + +sub list_windows_bookmarks { + my ($win_prefix) = @_; + ( + 'iexplore' => [ 'a', 'b' ], + 'firefox' => [ 'c', 'd', 'e' ], + ); +} + +sub import_bookmarks { + my ($win_prefix) = @_; + my $_w = $in->wait_message('', N("Migration of bookmarks in progress")); + sleep 1; +} + +sub list_windows_mail { + my ($win_prefix) = @_; + ( + 'outlook' => [ 'a', 'b' ], + 'thunderbird' => [ 'c', 'd', 'e' ], + ); +} + +sub import_mail { + my ($win_prefix) = @_; + my $_w = $in->wait_message('', N("Migration of mail in progress")); + sleep 1; +} + +sub import_background { + my ($win_prefix) = @_; + my $_w = $in->wait_message('', N("Migration of background in progress")); + sleep 1; +} -- cgit v1.2.1