aboutsummaryrefslogtreecommitdiffstats
path: root/transfugdrake
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-07-31 14:27:24 +0000
committerOlivier Blin <oblin@mandriva.com>2007-07-31 14:27:24 +0000
commitb08b9099cfc8a0c79fb588c3e5c7d98f5cd24752 (patch)
tree3ccdb0a22a1bc4d67644b4a5af74e49cd9385869 /transfugdrake
parent63e57518b73d6d923ca9beb2914cfc6c7c0c5cf6 (diff)
downloadtransfugdrake-b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752.tar
transfugdrake-b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752.tar.gz
transfugdrake-b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752.tar.bz2
transfugdrake-b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752.tar.xz
transfugdrake-b08b9099cfc8a0c79fb588c3e5c7d98f5cd24752.zip
import new interface mockup
Diffstat (limited to 'transfugdrake')
-rwxr-xr-xtransfugdrake175
1 files changed, 175 insertions, 0 deletions
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;
+}