~cjwatson/debconf/dbus

« back to all changes in this revision

Viewing changes to Debconf/Element/Gnome.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;
10
10
use strict;
11
 
use Gtk;
 
11
use utf8;
 
12
use Gtk2;
12
13
use Debconf::Gettext;
13
14
use base qw(Debconf::Element);
14
15
 
41
42
sub init {
42
43
        my $this=shift;
43
44
 
44
 
        $this->hbox(Gtk::HBox->new(0, 10));
 
45
        $this->hbox(Gtk2::VBox->new(0, 10));
45
46
 
46
 
        $this->line1(Gtk::HBox->new(0, 10));
 
47
        $this->hline1(Gtk2::HBox->new(0, 10));
 
48
        $this->hline1->show;
 
49
        $this->line1(Gtk2::VBox->new(0, 10));
47
50
        $this->line1->show;
48
 
        $this->line2(Gtk::HBox->new(0, 10));
 
51
        $this->line1->pack_end ($this->hline1, 1, 1, 0);
 
52
 
 
53
        $this->hline2(Gtk2::HBox->new(0, 10));
 
54
        $this->hline2->show;
 
55
        $this->line2(Gtk2::VBox->new(0, 10));
49
56
        $this->line2->show;
 
57
        $this->line2->pack_end ($this->hline2, 1, 1, 0);
50
58
 
51
 
        $this->vbox(Gtk::VBox->new(0, 5));
 
59
        $this->vbox(Gtk2::VBox->new(0, 5));
52
60
        $this->vbox->pack_start($this->line1, 0, 0, 0);
53
61
        $this->vbox->pack_start($this->line2, 1, 1, 0);
54
62
        $this->vbox->show;
73
81
        my $widget=shift;
74
82
 
75
83
        if ($this->multiline == 0) {
76
 
            $this->line1->pack_start($widget, 1, 1, 0);
 
84
            $this->hline1->pack_start($widget, 1, 1, 0);
77
85
        }
78
86
        else {
79
 
            $this->line2->pack_start($widget, 1, 1, 0);
 
87
            $this->hline2->pack_start($widget, 1, 1, 0);
80
88
        }
81
89
}
82
90
 
89
97
sub adddescription {
90
98
        my $this=shift;
91
99
 
92
 
        my $label=Gtk::Label->new($this->question->description);
 
100
        my $label=Gtk2::Label->new($this->question->description);
93
101
        $label->show;
94
102
        $this->line1->pack_start($label, 0, 0, 0);
95
103
}
106
114
        my $text = shift;
107
115
        my $callback = shift;
108
116
 
109
 
        my $button = Gtk::Button->new_with_label($text);
 
117
        my $button = Gtk2::Button->new_with_label($text);
110
118
        $button->show;
111
119
        $button->signal_connect("clicked", $callback);
112
120
 
113
 
        my $vbox = Gtk::VBox->new(0, 0);
 
121
        my $vbox = Gtk2::VBox->new(0, 0);
114
122
        $vbox->show;
115
123
        $vbox->pack_start($button, 1, 0, 0);
116
 
        $this->line1->pack_end($vbox, 0, 0, 0);
 
124
        $this->hline1->pack_end($vbox, 0, 0, 0);
117
125
}
118
126
 
119
127
=item addhelp
130
138
        return unless length $help;
131
139
 
132
140
        $this->addbutton(gettext("Help"), sub {
133
 
                my $dialog = Gnome::Dialog->new(gettext("Help"), "Button_Ok");
134
 
                my $label = Gtk::Label->new($help);
135
 
                $label->set_line_wrap(1);
136
 
                $label->show;
137
 
                $dialog->vbox->add($label);
 
141
                my $dialog = Gtk2::MessageDialog->new(undef, "modal", "info",
 
142
                                                      "close", $help);
138
143
                $dialog->run;
139
 
                $dialog->close;
 
144
                $dialog->destroy;
140
145
        });
141
146
}
142
147
 
159
164
=head1 AUTHOR
160
165
 
161
166
Eric Gillespie <epg@debian.org>
 
167
Gustavo Noronha Silva <kov@debian.org>
162
168
 
163
169
=cut
164
170