diff options
author | Angelo Naselli <anaselli@linux.it> | 2015-08-30 11:29:12 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2015-08-30 11:29:12 +0200 |
commit | f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688 (patch) | |
tree | 4b7186410ee557dd4e27cee48a9a571e4996470e /lib | |
parent | 995ca0fed297ecdefdbe3a7455457c43719abf0f (diff) | |
download | manatools-f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688.tar manatools-f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688.tar.gz manatools-f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688.tar.bz2 manatools-f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688.tar.xz manatools-f68aea5c71c2c2a4c23f0f2b98eff3b582c1a688.zip |
Added Type constraint on dialog type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ManaTools/Shared/GUI/Dialog.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ManaTools/Shared/GUI/Dialog.pm b/lib/ManaTools/Shared/GUI/Dialog.pm index 7e91eef8..45fc151f 100644 --- a/lib/ManaTools/Shared/GUI/Dialog.pm +++ b/lib/ManaTools/Shared/GUI/Dialog.pm @@ -74,6 +74,7 @@ use diagnostics; use utf8; with 'ManaTools::Shared::GUI::EventHandlerRole'; +use Moose::Util::TypeConstraints; use yui; use ManaTools::Shared::GUI::Event; @@ -142,9 +143,13 @@ has 'dialog' => ( our $mainDialog = 1; our $popupDialog = 2; +subtype 'DialogType' + => as Int + => where {($_ > 0 && $_<=2)}; + has 'dialogType' => ( is => 'ro', - isa => 'Int', + isa => 'DialogType', required => 1, ); |