summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-06 18:13:33 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-06 18:13:33 +0000
commit5320424408a1f8c45e2e8341cfefcf56ef68c6f4 (patch)
tree77f43d92b7805f4504a2936500d65fcabfa10147
parent00e25abb96d92c0d5ec3f42e0741d6a74e440f99 (diff)
downloadcontrol-center-5320424408a1f8c45e2e8341cfefcf56ef68c6f4.tar
control-center-5320424408a1f8c45e2e8341cfefcf56ef68c6f4.tar.gz
control-center-5320424408a1f8c45e2e8341cfefcf56ef68c6f4.tar.bz2
control-center-5320424408a1f8c45e2e8341cfefcf56ef68c6f4.tar.xz
control-center-5320424408a1f8c45e2e8341cfefcf56ef68c6f4.zip
- (warn_on_startup) factorize code warning because there's a running
program - previous button: complain if a tool is currently starting
-rwxr-xr-xcontrol-center28
1 files changed, 19 insertions, 9 deletions
diff --git a/control-center b/control-center
index 64d4b0b7..25c983f5 100755
--- a/control-center
+++ b/control-center
@@ -285,7 +285,7 @@ my @tree =
# main window :
-my ($timeout, %check_boxes, $exp_frame, $emb_socket);
+my ($timeout, %check_boxes, $exp_frame, $emb_socket, $page_id);
my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), $default_width, $default_heigth);
$window_global->resize($h{WIDTH}, $h{HEIGTH});
@@ -528,7 +528,11 @@ gtkadd($window_global,
),
0, my $buttons = gtkadd(gtkset_layout(Gtk2::HButtonBox->new, 'end'),
gtksignal_connect(my $previous = Gtk2::Button->new(N("Previous")),
- clicked => sub { set_page(0) }),
+ clicked => sub {
+ $page_id = 0;
+ warn_on_startup();
+ },
+ ),
),
)
);
@@ -605,13 +609,8 @@ foreach (@tree) {
# FIXME: the following code is currently useless:
# should we provide a way to kill buggy embedded programs ?
return if $left_locked;
- if ($pending_app) {
- return if !splash_warning(N("The modifications done in the current module won't be saved."), 1);
- kill_children();
- child_just_exited();
- }
-
- set_page($my_index+1);
+ $page_id = $my_index + 1;
+ warn_on_startup();
},
}
);
@@ -728,6 +727,17 @@ sub group_by3 {
@l;
}
+sub warn_on_startup {
+ if ($pending_app) {
+ return if !splash_warning(N("The modifications done in the current module won't be saved."), 1);
+ kill_children();
+ child_just_exited();
+ }
+
+ set_page($page_id);
+}
+
+
#-------------------------------------------------------------
# socket/plug managment