diff options
author | Christian Belisle <cbelisle@mandriva.com> | 2001-11-28 03:45:52 +0000 |
---|---|---|
committer | Christian Belisle <cbelisle@mandriva.com> | 2001-11-28 03:45:52 +0000 |
commit | 06411eab97e0c5eaef31c6146933a7da695c1b3b (patch) | |
tree | b4f70bedb8ac2e90bd43936eb39b83a72769550e | |
parent | 0a8e976f6d4f30cbe63c1bf9f6d77d5b39a43b5b (diff) | |
download | transfugdrake-06411eab97e0c5eaef31c6146933a7da695c1b3b.tar transfugdrake-06411eab97e0c5eaef31c6146933a7da695c1b3b.tar.gz transfugdrake-06411eab97e0c5eaef31c6146933a7da695c1b3b.tar.bz2 transfugdrake-06411eab97e0c5eaef31c6146933a7da695c1b3b.tar.xz transfugdrake-06411eab97e0c5eaef31c6146933a7da695c1b3b.zip |
enhanced windows partition check, changed welcome message, enhanced file copy-move.
-rwxr-xr-x | transfugdrake | 92 |
1 files changed, 66 insertions, 26 deletions
diff --git a/transfugdrake b/transfugdrake index b80c64c..70d7694 100755 --- a/transfugdrake +++ b/transfugdrake @@ -3,6 +3,7 @@ # # Yves Duret (yduret at mandrakesoft.com) +# Christian Belisle (cbelisle at mandrakesoft.com) # # Copyright 2001 MandrakeSoft # @@ -13,6 +14,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# ChangeLog +# 01/11/27 - cbelisle@mandrakesoft.com +# - Enhanced the windows partition search algorithm +# - Put another message in the welcome screen (more professional) +# - Enhance the data copying-moving function use lib q(/usr/lib/libDrakX); @@ -24,43 +30,64 @@ use my_gtk qw(:helpers :wrappers :ask); #use netconnect; use detect_devices; -$::isInstall and die "Not supported during install.\n"; +my $i = 0; +my $found = 0; +my @win = ""; +my $version = 0.1; +$::isInstall and die "Not supported during install.\n"; $::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; local $_ = join '', @ARGV; /-h/ and die "usage: transfug [--version]\n"; -/-version/ and die 'transfug '."\n"; +/-version/ and die 'transfugdrake '.$version."\n"; $::isEmbedded or $::isWizard = 1; $::Wizard_pix_up = "wiz_drakgw.png"; $::Wizard_title = _("Transfugdrake"); $::direct = /-direct/; -my $in = interactive::vnew('su'); +# Debug flag +my $debug = 1; -if (1) {$win="/mnt/prout";} -elsif (-e "/mnt/windows") {$win="/mnt/windows";} -elsif (-e "/mnt/win_c") {$win="/mnt/win_c";} -else { - print "no windows partitions ?\n"; - $in->ask_warn(_("No windows(c)(r)(tm) on your system!"), - _("No windows on your system. Please install windows first!")); - quit_global($in); - } +# Application initialization +my $in = interactive::vnew(su); -begin: +# Get folder listing in /mnt +my @mnt_dir_folder = split("\n", `ls /mnt/`); + +# Look in the array if we have a windows partition +my $folders_count = 1; +while(@mnt_dir_folder[$folders_count] ne "") { + if(@mnt_dir_folder[$folders_count] =~ /win/) { + push(@win,"/mnt/".@mnt_dir_folder[$folders_count]); + $found = 1; + if($debug) { print "- Found windows partition at /mnt/@mnt_dir_folder[$folders_count]\n"; } + } + $folders_count++; +} + +# If nothing is found, print an error and exit. +if(!$found) { + print "- No windows partitions\n"; + $in->ask_warn(_("Can't find windows!"), + _("Sorry, I can't find windows. Maybe it's not installed, or your windows partition is not mounted on Mandrake.")); + quit_global($in); +} #- ********************************** #- * 0th step: verify if we are already set up +begin: - $::Wizard_no_previous = 1; +$::Wizard_no_previous = 1; #- ********************************** -#- * 1st step: detect/setup +#- * 1st step: Welcome message step_1: +# TODO: Put a bigger message with some instructions and agreement +if($debug) { print "- Printing welcome message and waiting for user response\n"; } $::direct or $in->ask_okcancel(_("Transfug"), _("Welcome to TransfugDrake! In this wizard, you will be able to transfer documents, @@ -70,28 +97,37 @@ email and address books from Microsoft Windows to Mandrake Linux."), 1) or quit_ #- ********************************** #- * 2nd step: win files step_2: +# TODO Get windows listing in a listbox and home listing in another listbox (gftp like) +# Automatic configuration +if($debug) { print "- Beginning automatic configuration\n"; } $wait_configuring = $in->wait_message(_("Configuring..."), - _("Configuring scripts, installing software, starting servers...")); -#sleep(2); + _("Finding all documents on your Windows partition. Can take several minutes.")); + +# Find documents. +if($debug) { print "-- Finding .doc files\n"; } +#$output = `find @win[0] -name *.doc`; +$output = `find /home/cbelisle -name *.mp3`; + undef $wait_configuring; - + +if($debug) { print "- Ready to copy or link all the documents, waiting for user decision\n"; } $::direct or $in->ask_okcancel(_("Transfug"), _(" Do you want to copy all the c:\\My Documents to one of your user home ?"), 1) or goto step_3; +if($debug) { print " - Linking $win/My Documents in $ENV{HOME}\n"; } + # translators need to accord My Documents.. - link(_("$win/My Documents"), $ENV{HOME}); +link(_("@win[0]/My Documents"), $ENV{HOME}); #- ******************************* -#- * 3rd step: mail from win +#- * 3rd step: mail from windows step_3: $::direct or $in->ask_okcancel(_("Transfug"), -_("Kick windows out of your life. - -We will bring back your Outlook Mailboxes to a standard unix mbox"), 1) or quit_global($in, 0); +_("We will bring back your Outlook Mailboxes to a standard unix mbox"), 1) or quit_global($in, 0); mkdir "$ENV{HOME}/Mail" unless (-e "$ENV{HOME}/Mail"); $oe5onwin98="$win/WINDOWS/Application Data/Identities/{424975E0-8577-11D4-A891-989048140B20}/Microsoft/Outlook Express"; @@ -113,9 +149,13 @@ if (-e $oe5onwin98) { } #- ******************************* -#- * 4th step: mail from win +#- * 4th step: address book from windows step_4: $::direct or $in->ask_okcancel(_("Transfug"), -_("You kicked windows out of your life. +_("We will migrate your windows address book to mandrake"), 1) or quit_global($in, 0); -You no more need to reboot your system.."), 1) or quit_global($in, 0); +#- ******************************* +#- * 5th step: finish +step_5: +$::direct or $in->ask_okcancel(_("Transfugdrake"), +_("The migration of all of your Windows data is finished."), 1) or quit_global($in, 0); |