summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-07-14 19:21:04 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-07-14 19:21:04 +0000
commit1a21cac00c1449a159d6ff5bb0d87a305d44b7d2 (patch)
tree749dbbc1598e87b69417159f2a9a4f6650b0324c /perl-install
parent24df2ffd61569b0ee249cc592d136ecf8480d0c6 (diff)
downloaddrakx-1a21cac00c1449a159d6ff5bb0d87a305d44b7d2.tar
drakx-1a21cac00c1449a159d6ff5bb0d87a305d44b7d2.tar.gz
drakx-1a21cac00c1449a159d6ff5bb0d87a305d44b7d2.tar.bz2
drakx-1a21cac00c1449a159d6ff5bb0d87a305d44b7d2.tar.xz
drakx-1a21cac00c1449a159d6ff5bb0d87a305d44b7d2.zip
sanitize button layouts:
- use stock items everywhere - use ButtonBoxes everywhere - pack buttons always in the same order and places
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/drakboot4
-rwxr-xr-xperl-install/standalone/drakconnect16
-rwxr-xr-xperl-install/standalone/draksec10
-rw-r--r--perl-install/ugtk2.pm14
4 files changed, 23 insertions, 21 deletions
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
index 7b6f3ea8e..a1dea17f8 100755
--- a/perl-install/standalone/drakboot
+++ b/perl-install/standalone/drakboot
@@ -284,13 +284,13 @@ gtkadd($window,
)
)
),
- gtkadd(gtkset_layout(new Gtk2::HButtonBox, 'end'),
+ gtkadd(Gtk2::HButtonBox->new,
+ gtksignal_connect(Gtk2::Button->new_from_stock('gtk-cancel'), clicked => sub { ugtk2->exit(0) }),
gtksignal_connect(Gtk2::Button->new_from_stock('gtk-ok'), clicked => sub {
Xconfig::various::runlevel($x_mode ? 5 : 3);
updateAutologin();
ugtk2->exit(0);
}),
- gtksignal_connect(Gtk2::Button->new_from_stock('gtk-cancel'), clicked => sub { ugtk2->exit(0) })
)
)
);
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index b92557264..b2a161af8 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -95,14 +95,14 @@ $button_del->signal_connect(clicked => sub {
my $bbox_dialog = new Gtk2::HButtonBox;
$dialog->action_area->add($bbox_dialog);
$bbox_dialog->set_layout('end');
- my $button_ok = new Gtk2::Button(N("OK"));
+ my $button_ok = Gtk2::Button->new_from_stock('gtk-ok');
$button_ok->signal_connect(clicked => sub {
network::netconnect::del_profile($netcnx, $combo_dialog->entry->get_text);
$netcnx->{PROFILE} eq $combo_dialog->entry->get_text and $netcnx->{PROFILE} = "default";
Gtk2->main_quit;
});
$bbox_dialog->add($button_ok);
- my $button_cancel = new Gtk2::Button(N("Cancel"));
+ my $button_cancel = Gtk2::Button->new_from_stock('gtk-cancel');
$button_cancel->signal_connect(clicked => sub { Gtk2->main_quit });
$bbox_dialog->add($button_cancel);
$dialog->show_all;
@@ -122,14 +122,14 @@ $button_new->signal_connect(clicked => sub {
my $bbox_dialog = new Gtk2::HButtonBox;
$dialog->action_area->add($bbox_dialog);
$bbox_dialog->set_layout('end');
- my $button_ok = new Gtk2::Button(N("OK"));
+ my $button_ok = Gtk2::Button->new_from_stock('gtk-ok');
$button_ok->signal_connect(clicked => sub {
network::netconnect::add_profile($netcnx, $entry_dialog->get_text);
$netcnx->{PROFILE} = $entry_dialog->get_text;
Gtk2->main_quit;
});
$bbox_dialog->add($button_ok);
- my $button_cancel = new Gtk2::Button(N("Cancel"));
+ my $button_cancel = Gtk2::Button->new_from_stock('gtk-cancel');
$button_cancel->signal_connect(clicked => sub { Gtk2->main_quit });
$bbox_dialog->add($button_cancel);
$dialog->show_all;
@@ -247,10 +247,10 @@ $button_apply->signal_connect(clicked => \&apply);
$button_apply->set_sensitive(0);
$bbox0->add($button_apply);
-my $button_cancel = new Gtk2::Button(N("Cancel"));
+my $button_cancel = Gtk2::Button->new_from_stock('gtk-cancel');
$button_cancel->signal_connect(clicked => \&quit_global);
$bbox0->add($button_cancel);
-my $button_ok = new Gtk2::Button(N("OK"));
+my $button_ok = Gtk2::Button->new_from_stock('gtk-ok');
$button_ok->signal_connect(clicked => sub {
my $dialog = _create_dialog(N("Please wait"));
$dialog->vbox->pack_start(new Gtk2::Label(N("Please Wait... Applying the configuration")),1,1,20);
@@ -459,7 +459,7 @@ Configure them first by clicking on 'Configure'")),1,1,0);
my $bbox8 = new Gtk2::HButtonBox;
$vbox0->pack_start($bbox8,0,0,10);
$bbox8->set_layout('end');
- my $button_ok = new Gtk2::Button(N("OK"));
+ my $button_ok = Gtk2::Button->new_from_stock('gtk-ok');
$button_ok->signal_connect(clicked => sub {
foreach (0..$#all_cards) {
my @infos = @{$card_tab[2*$_]};
@@ -501,7 +501,7 @@ Create one first by clicking on 'Configure'")),1,1,0);
my $bbox_dialog = new Gtk2::HButtonBox;
$dialog->action_area->add($bbox_dialog);
$bbox_dialog->set_layout('end');
- my $button_ok = new Gtk2::Button(N("OK"));
+ my $button_ok = Gtk2::Button->new_from_stock('gtk-ok');
$button_ok->signal_connect(clicked => sub {
Gtk2->main_quit;
});
diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec
index b049eddf4..39431f6bf 100755
--- a/perl-install/standalone/draksec
+++ b/perl-install/standalone/draksec
@@ -186,7 +186,7 @@ $notebook->append_page(gtkshow(create_scrolled_window(gtkpack_(new Gtk2::VBox(0,
####################### OK CANCEL BUTTONS ##################################
-my $bok = gtksignal_connect(new Gtk2::Button(N("Ok")),
+my $bok = gtksignal_connect(Gtk2::Button->new_from_stock('gtk-ok'),
'clicked' => sub {
my $seclevel_value = $seclevel_entry->entry->get_text;
my $secadmin_check_value = $secadmin_check->get_active;
@@ -237,9 +237,11 @@ my $bcancel = gtksignal_connect(Gtk2::Button->new_from_stock('gtk-cancel'),
'clicked' => sub { ugtk2->exit(0) });
gtkpack_($vbox,
1, gtkshow($notebook),
- 0, gtkadd(gtkadd(gtkshow(new Gtk2::HBox(0, 0)),
- $bok),
- $bcancel));
+ 0, gtkpack(Gtk2::HButtonBox->new,
+ $bcancel,
+ $bok,
+ ),
+ );
$bcancel->can_default(1);
$bcancel->grab_default;
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index a628ded3d..4f7cc68b2 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -377,12 +377,6 @@ sub create_dialog {
$dialog->vbox->pack_start(create_scrolled_window($text, [ 'never', 'automatic' ]), 1, 1, 0);
$text->set_line_wrap(1);
- my $button = Gtk2::Button->new_from_stock('gtk-ok');
- $button->can_default(1);
- $button->signal_connect(clicked => sub { $ret = 1; $dialog->destroy; Gtk2->main_quit });
- $dialog->action_area->pack_start($button, 1, 1, 0);
- $button->grab_default;
-
if ($o_options->{cancel}) {
my $button2 = Gtk2::Button->new_from_stock('gtk-cancel');
$button2->signal_connect(clicked => sub { $ret = 0; $dialog->destroy; Gtk2->main_quit });
@@ -390,6 +384,12 @@ sub create_dialog {
$dialog->action_area->pack_start($button2, 1, 1, 0);
}
+ my $button = Gtk2::Button->new_from_stock('gtk-ok');
+ $button->can_default(1);
+ $button->signal_connect(clicked => sub { $ret = 1; $dialog->destroy; Gtk2->main_quit });
+ $dialog->action_area->pack_start($button, 1, 1, 0);
+ $button->grab_default;
+
$dialog->show_all;
Gtk2->main;
$ret;
@@ -465,7 +465,7 @@ sub create_okcancel {
my $b2 = $cancel && gtksignal_connect($w->{cancel} = Gtk2::Button->new_from_stock($cancel), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk2->main_quit });
gtksignal_connect($w->{wizcancel} = Gtk2::Button->new_from_stock('gtk-cancel'), clicked => sub { die 'wizcancel' }) if $wizard_buttons && !$::isInstall;
my @l = grep { $_ } $wizard_buttons ? (if_(!$::isInstall, $w->{wizcancel}),
- if_(!$::Wizard_no_previous, $b2), $b1) : ($b1, $b2);
+ if_(!$::Wizard_no_previous, $b2), $b1) : ($b2, $b1);
my @l2 = map { gtksignal_connect(Gtk2::Button->new_from_stock($_->[0]), clicked => $_->[1]) } grep { $_->[2] } @other;
my @r2 = map { gtksignal_connect(Gtk2::Button->new_from_stock($_->[0]), clicked => $_->[1]) } grep { !$_->[2] } @other;