summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-12-20 09:34:51 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-12-20 09:34:51 +0000
commita11c66d2c9176941c9243b0cb26f65030ec3bf4f (patch)
tree3f656ed69b0815649b429a48478cc5b758ab8287
parent1f1ca4840ba88ad1a6b52c5ac9e278b52119ce7a (diff)
downloadcontrol-center-a11c66d2c9176941c9243b0cb26f65030ec3bf4f.tar
control-center-a11c66d2c9176941c9243b0cb26f65030ec3bf4f.tar.gz
control-center-a11c66d2c9176941c9243b0cb26f65030ec3bf4f.tar.bz2
control-center-a11c66d2c9176941c9243b0cb26f65030ec3bf4f.tar.xz
control-center-a11c66d2c9176941c9243b0cb26f65030ec3bf4f.zip
simplify splash_warning() by reusing new_dialog()
-rwxr-xr-xcontrol-center9
1 files changed, 3 insertions, 6 deletions
diff --git a/control-center b/control-center
index 216f00f2..8a4c570e 100755
--- a/control-center
+++ b/control-center
@@ -743,9 +743,7 @@ sub quit_global {
sub splash_warning {
my ($label, $cancel_button) = @_;
my $ret;
- my $window = Gtk2::Dialog->new;
- $window->set_position('center-on-parent');
- $window->set_border_width(10);
+ my $window = new_dialog(N("Warning"), 1);
gtkpack__($window->action_area,
gtkadd(Gtk2::HButtonBox->new,
@@ -758,21 +756,20 @@ sub splash_warning {
Gtk2::Label->new($label),
);
$window->show_all;
- $window->set_modal(1);
Gtk2->main;
$window->destroy;
$ret;
}
sub new_dialog {
- my ($title) = @_;
+ my ($title, $no_button) = @_;
my $dialog = Gtk2::Dialog->new;
$dialog->set_transient_for($window_global);
$dialog->set_position('center-on-parent');
$dialog->set_border_width(10);
$dialog->set_title($title);
$dialog->action_area->pack_start(gtkadd(Gtk2::HButtonBox->new,
- gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { $dialog->destroy })),0,0,0);
+ gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { $dialog->destroy })),0,0,0) unless $no_button;
gtkset_modal($dialog, 1);
}