home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / perl5 / Debconf / Element / Kde / Progress.pm < prev    next >
Encoding:
Perl POD Document  |  2006-07-24  |  1.3 KB  |  58 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Kde::Progress;
  6. use strict;
  7. use Qt;
  8. use base qw(Debconf::Element::Kde);
  9. use Debconf::Encoding qw(to_Unicode);
  10.  
  11.  
  12. sub start {
  13.     my $this=shift;
  14.     my $description=to_Unicode($this->question->description);
  15.     my $frontend=$this->frontend;
  16.  
  17.     $this->SUPER::create($frontend->frame);
  18.  
  19.     $this->startsect;
  20.     $this->addhelp;
  21.     $this->adddescription;
  22.     my $vbox = Qt::VBoxLayout($this->widget);
  23.  
  24.     $this->progress_bar(Qt::ProgressBar($this->progress_max() - $this->progress_min(), $this->cur->top, $description));
  25.     $this->progress_bar->show;
  26.     $this->progress_bar->setSizePolicy(Qt::SizePolicy(1, 0, 0, 0,
  27.         $this->progress_bar->sizePolicy()->hasHeightForWidth()));
  28.     $this->addwidget($this->progress_bar);
  29.  
  30.     $this->progress_label(Qt::Label($this->cur->top));
  31.     $this->progress_label->show;
  32.     $this->progress_label->setSizePolicy(Qt::SizePolicy(1, 1, 0, 0,
  33.         $this->progress_label->sizePolicy()->hasHeightForWidth()));
  34.     $this->addwidget($this->progress_label);
  35.  
  36.     $this->endsect;
  37. }
  38.  
  39. sub set {
  40.     my $this=shift;
  41.     my $value=shift;
  42.  
  43.     $this->progress_cur($value);
  44.     $this->progress_bar->setProgress($this->progress_cur() - $this->progress_min());
  45. }
  46.  
  47. sub info {
  48.     my $this=shift;
  49.     my $question=shift;
  50.  
  51.     $this->progress_label->setText(to_Unicode($question->description));
  52. }
  53.  
  54. sub stop {
  55. }
  56.  
  57. 1;
  58.