summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-12-12 18:48:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-12-12 18:48:00 +0000
commit2db498ee242e3170dad946885815f8cb064a3cf0 (patch)
tree5533b1722073eb16a56b42c4da5d3fab63b54b5d /perl-install/common.pm
parentd5a25feeae9a96b7cbae02104321124ed3fda591 (diff)
downloaddrakx-backup-do-not-use-2db498ee242e3170dad946885815f8cb064a3cf0.tar
drakx-backup-do-not-use-2db498ee242e3170dad946885815f8cb064a3cf0.tar.gz
drakx-backup-do-not-use-2db498ee242e3170dad946885815f8cb064a3cf0.tar.bz2
drakx-backup-do-not-use-2db498ee242e3170dad946885815f8cb064a3cf0.tar.xz
drakx-backup-do-not-use-2db498ee242e3170dad946885815f8cb064a3cf0.zip
enable easy screenshot'ing
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 282112275..f39cda588 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -138,6 +138,34 @@ sub group_n_lm {
@l
}
+sub screenshot_dir__and_move {
+ my ($dir1, $dir2) = ("$::o->{prefix}/root", '/tmp/stage2');
+ if (-e $dir1) {
+ if (-e "$dir2/DrakX-screenshots") {
+ cp_af("$dir2/DrakX-screenshots", $dir1);
+ rm_rf("$dir2/DrakX-screenshots");
+ }
+ $dir1;
+ } else {
+ $dir2;
+ }
+}
+
+sub take_screenshot {
+ my ($in) = @_;
+ my $dir = screenshot_dir__and_move() . '/DrakX-screenshots';
+ my $warn;
+ if (!-e $dir) {
+ mkdir $dir or $in->ask_warn('', _("Can't make screenshots before partitioning")), return;
+ $warn = 1;
+ }
+ my $nb = 1;
+ $nb++ while -e "$dir/$nb.png";
+ system("fb2png /dev/fb0 $dir/$nb.png 0");
+
+ $in->ask_warn('', _("Screenshots will be available after install in %s", "/root/DrakX-screenshots")) if $warn;
+}
+
#-######################################################################################
#- Wonderful perl :(
#-######################################################################################