summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakconnect
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-13 17:45:11 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-13 17:45:11 +0000
commit9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060 (patch)
tree3aed7a3f5417d4bdd2a37a4c82c5a8969a814a43 /perl-install/standalone/drakconnect
parent0ba56cce3e0255f0ed2dec02f158f37b718c0e61 (diff)
downloaddrakx-backup-do-not-use-9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060.tar
drakx-backup-do-not-use-9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060.tar.gz
drakx-backup-do-not-use-9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060.tar.bz2
drakx-backup-do-not-use-9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060.tar.xz
drakx-backup-do-not-use-9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060.zip
sanitize buttons through reusing create_okcancel()
Diffstat (limited to 'perl-install/standalone/drakconnect')
-rwxr-xr-xperl-install/standalone/drakconnect47
1 files changed, 24 insertions, 23 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 69e5a0237..45b08ba47 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -203,17 +203,7 @@ sub manage {
my $notebook = Gtk2::Notebook->new;
$notebook->set_property('show-tabs', 0);
$notebook->set_property('show-border', 0);
-
my $apply_button;
- $apply_button = gtksignal_connect(Gtk2::Button->new(N("Apply")),
- clicked => sub { save($netc, $netcnx, $intf, $gui, $apply_button) });
-
- each_index {
- my $interface = $_;
- $gui->{$interface}{index} = $::i;
- build_notebook($window, $netc, $intf->{$interface}, $gui->{$interface}, $interface, $apply_button);
- $notebook->append_page(gtkpack(Gtk2::VBox->new(0,0), $gui->{$interface}{notebook}));
- } (sort keys %$intf);
$window->{rwindow}->add(gtkpack_(Gtk2::VBox->new,
0, $interface_menu = gtksignal_connect(Gtk2::OptionMenu->new,
@@ -223,20 +213,31 @@ sub manage {
},
),
1, $notebook,
- 0, gtkpack(Gtk2::HButtonBox->new,
- gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { $window->destroy;
- Gtk2->main_quit }),
- gtksignal_connect(Gtk2::Button->new(N("Help")), clicked => sub {}),
- $apply_button,
- gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub {
- if ($apply_button->get_property('sensitive')) {
- save($netc, $netcnx, $intf, $gui, $apply_button);
- $window->destroy;
- Gtk2->main_quit;
- }
- }),
+ 0, create_okcancel(my $oc =
+ {
+ cancel_clicked => sub { $window->destroy; Gtk2->main_quit },
+ ok_clicked => sub {
+ if ($apply_button->get_property('sensitive')) {
+ save($netc, $netcnx, $intf, $gui, $apply_button);
+ $window->destroy;
+ Gtk2->main_quit;
+ }
+ },
+ },
+ undef, undef, '',
+ [ N("Help"), sub { exec("drakhelp --id internet-connection") unless fork() } ],
+ [ N("Apply"), sub { save($netc, $netcnx, $intf, $gui, $apply_button) } ],
+ ),
),
- ));
+ );
+ $apply_button = $oc->{buttons}{N("Apply")};
+ each_index {
+ my $interface = $_;
+ $gui->{$interface}{index} = $::i;
+ build_notebook($window, $netc, $intf->{$interface}, $gui->{$interface}, $interface, $apply_button);
+ $notebook->append_page(gtkpack(Gtk2::VBox->new(0,0), $gui->{$interface}{notebook}));
+ } (sort keys %$intf);
+
$interface_menu->set_popdown_strings(sort keys %$intf);
$apply_button->set_sensitive(0);