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 / Select.pm < prev    next >
Encoding:
Perl POD Document  |  2006-07-24  |  964 b   |  45 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Kde::Select;
  6. use strict;
  7. use Qt;
  8. use base qw(Debconf::Element::Kde Debconf::Element::Select);
  9. use Debconf::Encoding qw(to_Unicode);
  10.  
  11.  
  12. sub create {
  13.     my $this=shift;
  14.     
  15.     my $default=$this->translate_default;
  16.     my @choices=map { to_Unicode($_) } $this->question->choices_split;
  17.     
  18.     $this->SUPER::create(@_);
  19.     $this->startsect;
  20.     $this->widget(Qt::ComboBox($this->cur->top));
  21.     $this->widget->show;
  22.     $this->widget->insertStringList(\@choices, 0);
  23.     if (defined($default) and length($default) != 0) {
  24.         $this->widget->setCurrentText(to_Unicode($default));
  25.     }
  26.     $this->addhelp;
  27.     my $b = $this->addhbox;
  28.     $b->addWidget($this->description);
  29.     $b->addWidget($this->widget);
  30.     $this->endsect;
  31. }
  32.  
  33.  
  34. sub value {
  35.     my $this=shift;
  36.     
  37.     my @choices=$this->question->choices_split;
  38.     return $this->translate_to_C_uni($this->widget->currentText());
  39. }
  40.  
  41. *visible = \&Debconf::Element::Select::visible;
  42.  
  43.  
  44. 1
  45.