aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaarten Vanraes <alien@mageia.org>2016-05-09 00:20:36 +0200
committerMaarten Vanraes <alien@mageia.org>2016-05-09 00:20:36 +0200
commit14f4701faac6ed5d25076428989c2f0f335b9816 (patch)
tree8a66205fe2d4e48f8c1cd8be85aeb9e8eb812af3 /lib
parent4ccaefd924024f642fe07a83542240ce7921f029 (diff)
downloadmanatools-14f4701faac6ed5d25076428989c2f0f335b9816.tar
manatools-14f4701faac6ed5d25076428989c2f0f335b9816.tar.gz
manatools-14f4701faac6ed5d25076428989c2f0f335b9816.tar.bz2
manatools-14f4701faac6ed5d25076428989c2f0f335b9816.tar.xz
manatools-14f4701faac6ed5d25076428989c2f0f335b9816.zip
Module: add a title attribute
Diffstat (limited to 'lib')
-rw-r--r--lib/ManaTools/Module.pm29
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/ManaTools/Module.pm b/lib/ManaTools/Module.pm
index b1a237cb..ee2a8bb9 100644
--- a/lib/ManaTools/Module.pm
+++ b/lib/ManaTools/Module.pm
@@ -74,6 +74,33 @@ has 'name' => (
#=============================================================
+=head2 title
+
+ title attribute defines the Module title, override this
+ attribute by using
+ has '+title' => (
+ ...
+ )
+ into your module implementation.
+
+=cut
+
+#=============================================================
+has 'title' => (
+ is => 'rw',
+ isa => 'Str',
+ lazy => 1,
+ builder => '_titleInitializer',
+);
+
+sub _titleInitializer {
+ my $self = shift;
+
+ return ($self->loc->N("%s - Management Tool", $self->name()));
+}
+
+#=============================================================
+
=head2 launch
launch attribute defines the Module as external command
@@ -211,7 +238,7 @@ sub BUILD {
my $self = shift;
## set title
- yui::YUI::app()->setApplicationTitle($self->name) if $self->name;
+ yui::YUI::app()->setApplicationTitle($self->title) if $self->title;
## set icon
yui::YUI::app()->setApplicationIcon($self->icon) if $self->icon;
}