aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-08-30 15:30:15 +0200
committerAngelo Naselli <anaselli@linux.it>2015-08-30 15:30:15 +0200
commitf1f2d9626af2f6104d8b90bcb16aac5e2f7295a9 (patch)
treeb2f74ecee04e81e700fc5bc271d51d8aaadafdbf
parent71988e806a7aedc8aeb34022fbb64ac477ebbf6b (diff)
downloadmanatools-f1f2d9626af2f6104d8b90bcb16aac5e2f7295a9.tar
manatools-f1f2d9626af2f6104d8b90bcb16aac5e2f7295a9.tar.gz
manatools-f1f2d9626af2f6104d8b90bcb16aac5e2f7295a9.tar.bz2
manatools-f1f2d9626af2f6104d8b90bcb16aac5e2f7295a9.tar.xz
manatools-f1f2d9626af2f6104d8b90bcb16aac5e2f7295a9.zip
Added event_timeout rw attribute to GUI::Dialog to allow manage $yui::YEvent::TimeoutEvent
-rw-r--r--Changes2
-rw-r--r--lib/ManaTools/Shared/GUI/Dialog.pm15
2 files changed, 16 insertions, 1 deletions
diff --git a/Changes b/Changes
index ab0cbd14..16c05190 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+ - Added event_timeout rw attribute to GUI::Dialog to allow
+ manage $yui::YEvent::TimeoutEvent
- Fixed ExtTab to be both EventRole and Event, which means
it captures WidgetEvents for itself and processes
the Events for it's own children as well, the ExtTab
diff --git a/lib/ManaTools/Shared/GUI/Dialog.pm b/lib/ManaTools/Shared/GUI/Dialog.pm
index 45fc151f..428130af 100644
--- a/lib/ManaTools/Shared/GUI/Dialog.pm
+++ b/lib/ManaTools/Shared/GUI/Dialog.pm
@@ -23,6 +23,8 @@ my $dlg = ManaTools::Shared::GUI::Dialog->new(
$ManaTools::Shared::GUI::Dialog::cancelButton,
$ManaTools::Shared::GUI::Dialog::okButton,
],
+ event_timeout => 0, # optional nd rw timeout in msec during the waitForEvent()
+ # needs a ManaTools::Shared::GUI::Event to manage the $yui::YEvent::TimeoutEvent
layout => sub { my $self = shift; my $layoutstart = shift; my $dlg = $self->dialog(); my $info = $self->info(); ... $self->addWidget('button1', $button, sub{...}, $backendItem1); },
restoreValues => sub { my $self = shift; $info = {}; ...; return $info },
result => sub { my $self = shift; ... },
@@ -140,6 +142,17 @@ has 'dialog' => (
},
);
+subtype 'TimeoutType'
+ => as Int
+ => where {($_ >= 0)};
+
+has 'event_timeout' => (
+ is => 'rw',
+ isa => 'TimeoutType',
+ lazy => 1,
+ default => 0,
+);
+
our $mainDialog = 1;
our $popupDialog = 2;
@@ -406,7 +419,7 @@ sub call {
# main loop
while(1) {
- my $yevent = $ydialog->waitForEvent(1000);
+ my $yevent = $ydialog->waitForEvent($self->event_timeout);
last if (!$self->processEvents($yevent));
}