aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Belisle <cbelisle@mandriva.com>2002-01-22 20:22:28 +0000
committerChristian Belisle <cbelisle@mandriva.com>2002-01-22 20:22:28 +0000
commita2ad41c3a6617d5c2425f886ae2341b1c9f237f4 (patch)
tree702d774fc68eff0a4606d475de8280e169e9ade6
parentbe49492dded3039cac904a851ebd215f336fc83e (diff)
downloadtransfugdrake-a2ad41c3a6617d5c2425f886ae2341b1c9f237f4.tar
transfugdrake-a2ad41c3a6617d5c2425f886ae2341b1c9f237f4.tar.gz
transfugdrake-a2ad41c3a6617d5c2425f886ae2341b1c9f237f4.tar.bz2
transfugdrake-a2ad41c3a6617d5c2425f886ae2341b1c9f237f4.tar.xz
transfugdrake-a2ad41c3a6617d5c2425f886ae2341b1c9f237f4.zip
Add previous button. Fix tasks order.
-rwxr-xr-xtransfugdrake27
1 files changed, 20 insertions, 7 deletions
diff --git a/transfugdrake b/transfugdrake
index 776226f..24e2ca3 100755
--- a/transfugdrake
+++ b/transfugdrake
@@ -31,6 +31,8 @@ use transfugdrake;
## Variables
my $version = 0.3; # Version number
my $debug = 1; # Debug flag
+my $windowsxp = 0; # Flag to know if we have win xp
+my $laststep = "";
# Array used to locate the documents.
my @documents_folders =
@@ -87,6 +89,7 @@ by migrating your documents, mails and address books"), 1) or quit_global($in, 0
step_1:
if($debug) { print "- Getting Windows Configuration\n"; }
my ($win_partition, $win_fstype, $win_mountpoint) = transfugdrake::get_windows_config($in);
+$laststep = "step_1";
#- **********************************
#- * 2nd step: Windows User Chooser
@@ -108,6 +111,9 @@ if($document_location eq "") {
if($debug) { print "-- Looking which Windows version we have\n"; }
+# Initialize the users array
+@users = ();
+
if($document_location eq $win_mountpoint.'/'.$documents_folders[0]) {
# For 95-98, go see in the address books folder to get the users
if($debug) { print "--- Windows 95/98 found\n"; }
@@ -128,6 +134,7 @@ elsif($document_location eq $win_mountpoint.'/'.$documents_folders[1]) {
if($debug) { print "--- Windows XP found\n"; }
$in->ask_warn(_("No mail migration available"),
_("Warning: Windows XP detected. No mail migration available yet for your Windows version."));
+ $windowsxp = 1;
opendir YREP, $document_location or die "unable to opendir: $!\n";
my @tmp_user_array = readdir YREP;
closedir YREP;
@@ -140,11 +147,11 @@ elsif($document_location eq $win_mountpoint.'/'.$documents_folders[1]) {
}
}
-
+$::Wizard_no_previous = 0;
my $chosen_user = $in->ask_from_list(_("Transfugdrake"),
_("You have the following users in Windows. Which one do you want to use for migration?"),
-[ @users ], $users[0]) or quit_global($in, 0);
-
+[ @users ], $users[0]) or goto step_0;
+$laststep = "step_2";
#- **********************************
#- * 3rd step: Task Chooser
@@ -183,6 +190,7 @@ _("Welcome to TransfugDrake! You are now able to ease\n the step Windows-Linux w
if($chosen_task eq "Copy files and folders from your Windows partition") { goto step_4; }
#if($chosen_task eq "Migrate address book from Windows (not implemented yet)") { goto step_7; }
if($chosen_task eq "Migrate your mail messages from Windows (Outlook Express 4.5 & 5 ONLY)") { goto step_6; }
+$laststep = "step_3";
#- **********************************
#- * 4th step: Copy Windows Files
@@ -190,6 +198,7 @@ step_4:
if($debug) { print "- Ready to copy all the documents, waiting for user response\n"; }
copy_documents($document_location, $ENV{HOME});
+$laststep = "step_4";
#- ******************************
#- * 5th step: redo if needed
@@ -199,11 +208,13 @@ if($in->ask_yesorno(_("Transfugdrake"),
_("Do you want to copy other files from another folder?"), 1)) {
goto step_2;
}
+$laststep = "step_5";
#- *******************************
#- * 4th step: mail from windows
step_6:
+if ($windowsxp) { goto step_8; }
$::direct or $in->ask_okcancel(_("Transfug"),
_("We will bring back your Outlook Mailboxes to a standard unix mbox\n
NB: This feature works only with Outlook Express 4.5 and 5"), 1) or goto step_7;
@@ -225,6 +236,8 @@ if (-e $oe5onwin98) {
`transfug_oe \"$oe5onwin98/$i\" \"$ENV{HOME}/Mail/$i\"`;
}
}
+$laststep = "step_6";
+
#- *******************************
#- * 6th step: address book from windows
# In XP, address book is located in /Document and Settings/user/Appli Data/Microsoft/Address Book/
@@ -236,8 +249,9 @@ if (-e $oe5onwin98) {
#- *******************************
#- * 8th step: finish
step_8:
+$::Wizard_no_previous = 0;
$::direct or $in->ask_okcancel(_("Transfugdrake"),
-_("The migration of all of your Windows data is finished."), 1) or quit_global($in, 0);
+_("The migration of all of your Windows data is finished."), 1) or goto $laststep;
#- *******************************
#- FUNCTIONS
@@ -247,7 +261,6 @@ sub detect_partition {
my @win;
# TODO TODO TODO TODO TODO TODO TODO TODO
- # - Get partitions directly by devfs
# - Print partition type beside the partition
# - Mount the partition the user want.
# - Detect partition as user, and ask root passwd only when needed
@@ -301,15 +314,15 @@ sub copy_documents {
mkdir("$dest/win_backup");
$dest .= "/win_backup";
+ $::Wizard_no_previous = 1;
if(!($in->ask_yesorno(_("Transfugdrake"),
- _("Do you want to copy all the content of\n \"$source\" to \"$dest\"?"), 1))) {
+ _("Do you want to copy all the content of\n \"$source\" to\n \"$dest\"?"), 1))) {
goto step_5;
}
$wait_configuring = $in->wait_message(_("Copying files..."),
_("Copying all files from $source to $dest. This may take several minutes."));
$source =~ s/\ /\\ /g;
- print "prout: $source\n";
system("cp -R $source $dest");
undef $wait_configuring;
}