~cjwatson/debconf/dbus

« back to all changes in this revision

Viewing changes to Debconf/Element/Gnome/Multiselect.pm

  • Committer: joey
  • Date: 2004-01-05 05:16:58 UTC
  • Revision ID: vcs-imports@canonical.com-20040105051658-f686b6d8049b4381
   * Port of the gnome frontend to GNOME2 libs:
   * Debconf/Frontend/Gnome.pm, Debconf/Element/Gnome.pm,
     Debconf/Element/Gnome/*.pm:
     - fixed debian logo exibition
   * Makefile, debian-logo.png, debian-logo.xpm:
     - use a png instead of a xpm to have a cuter interface =P
   * Above changes from Gustavo Noronha Silva. Closes: #225503
   * Fix broken fallback from noninteractive frontend in dpkg-reconfgure.
     Closes: #226205

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
package Debconf::Element::Gnome::Multiselect;
10
10
use strict;
11
 
use Gtk;
12
 
use Gnome;
 
11
use Gtk2;
 
12
use utf8;
13
13
use base qw(Debconf::Element::Gnome Debconf::Element::Multiselect);
14
14
 
15
15
sub init {
17
17
        my @choices = $this->question->choices_split;
18
18
        my %default=map { $_ => 1 } $this->translate_default;
19
19
 
 
20
 
 
21
        my $j = 0;
 
22
        for ($j = 0; $j <= $#choices; $j++) {
 
23
            $choices[$j] = $choices[$j];
 
24
        }
 
25
 
20
26
        $this->SUPER::init(@_);
21
27
        $this->multiline(1);
22
28
 
23
29
        $this->adddescription;
24
30
 
25
 
        $this->widget(Gtk::ScrolledWindow->new);
 
31
        $this->widget(Gtk2::ScrolledWindow->new);
26
32
        $this->widget->show;
27
33
        $this->widget->set_policy('automatic', 'automatic');
28
34
        
29
35
        # TODO: isn't there a gtk multiselct list box that could be used
30
36
        # instead of all these checkboxes?
31
37
        my @buttons;
32
 
        my $vbox = Gtk::VBox->new(0, 0);
 
38
        my $vbox = Gtk2::VBox->new(0, 0);
33
39
        for (my $i=0; $i <= $#choices; $i++) {
34
 
            $buttons[$i] = Gtk::CheckButton->new($choices[$i]);
 
40
            $buttons[$i] = Gtk2::CheckButton->new($choices[$i]);
35
41
            $buttons[$i]->show;
36
42
            $buttons[$i]->set_active($default{$choices[$i]} ? 1 : 0);
37
43
            $vbox->pack_start($buttons[$i], 0, 0, 0);
76
82
=head1 AUTHOR
77
83
 
78
84
Eric Gillespie <epg@debian.org>
 
85
Gustavo Noronha Silva <kov@debian.org>
79
86
 
80
87
=cut
81
88