diff options
author | Matteo Pasotti <matteo@mageia.org> | 2013-01-09 16:40:23 +0000 |
---|---|---|
committer | Matteo Pasotti <matteo@mageia.org> | 2013-01-09 16:40:23 +0000 |
commit | 5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6 (patch) | |
tree | 0279f7b29f4a41aa6adc05cf017dc79c14e323b2 /AdminPanel/Shared.pm | |
parent | 7deb546103eea4647985d5ec7bcbc97d1b0d886b (diff) | |
download | colin-keep-5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6.tar colin-keep-5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6.tar.gz colin-keep-5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6.tar.bz2 colin-keep-5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6.tar.xz colin-keep-5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6.zip |
- rpmdragora: fixed warn_about_user_mode call
- rpmdragora.pm: interactive_msg now returns ask_YesOrOk() return value
- Shared.pm: ask_ routines now return boolean rather than string
- Shared.pm: added missing module requirement (common from libDrakX)
- init.pm: warn_about_user_mode rewritten to return boolean
Diffstat (limited to 'AdminPanel/Shared.pm')
-rw-r--r-- | AdminPanel/Shared.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/AdminPanel/Shared.pm b/AdminPanel/Shared.pm index dce5061..6f4f703 100644 --- a/AdminPanel/Shared.pm +++ b/AdminPanel/Shared.pm @@ -22,6 +22,8 @@ package AdminPanel::Shared; use strict; use warnings; use diagnostics; +use lib qw(/usr/lib/libDrakX); +use common; use yui; use base qw(Exporter); @@ -100,7 +102,7 @@ sub ask_OkCancel { if ($eventType == $yui::YEvent::WidgetEvent) { # widget selected my $widget = $event->widget(); - $retVal = ($widget == $okButton); + $retVal = ($widget == $okButton) ? 1 : 0; } destroy $msg_box; @@ -110,7 +112,7 @@ sub ask_OkCancel { sub ask_YesOrNo { my ($title, $text) = @_; - my $retVal = "No"; + my $retVal = 0; my $factory = yui::YUI::widgetFactory; my $msg_box = $factory->createPopupDialog($yui::YDialogNormalColor); @@ -124,8 +126,8 @@ sub ask_YesOrNo { $align = $factory->createRight($layout); my $hbox = $factory->createHBox($align); - my $yesButton = $factory->createPushButton($hbox, "Yes"); - my $noButton = $factory->createPushButton($hbox, "No"); + my $yesButton = $factory->createPushButton($hbox, N("Yes")); + my $noButton = $factory->createPushButton($hbox, N("No")); my $event = $msg_box->waitForEvent(); @@ -134,7 +136,7 @@ sub ask_YesOrNo { if ($eventType == $yui::YEvent::WidgetEvent) { # widget selected my $widget = $event->widget(); - $retVal = ($widget == $yesButton) ? "Yes" : "No"; + $retVal = ($widget == $yesButton) ? 1 : 0; } destroy $msg_box; @@ -174,10 +176,10 @@ sub trim { shows a dialog with two buttons (Yes/No) -=head3 return value(string) +=head3 return bool =head2 ask_OkCancel shows a dialog with to buttons (Ok/Cancel) -=head3 return value(string) +=head3 return bool |