From 8a9c6878a8aa455d5f3571ad15df121ceccdfbdf Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Tue, 5 May 2015 16:43:43 +0200 Subject: Set icon and title left in base class, default values into their attributes initialization --- lib/ManaTools/Module/Users.pm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/ManaTools/Module/Users.pm b/lib/ManaTools/Module/Users.pm index 276a093..0c4b1b0 100644 --- a/lib/ManaTools/Module/Users.pm +++ b/lib/ManaTools/Module/Users.pm @@ -90,6 +90,16 @@ has '+icon' => ( default => File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/manauser.png'), ); +has '+name' => ( + lazy => 1, + builder => '_nameInitializer', +); + +sub _nameInitializer { + my $self = shift; + + return ($self->loc->N("manauser - Mageia Users Management Tool")); +} # main dialog has 'dialog' => ( @@ -247,10 +257,6 @@ my %groupEditLabel; sub BUILD { my $self = shift; - if (! $self->name) { - $self->name ($self->loc->N("manauser - Mageia Users Management Tool")); - } - %userEditLabel = ( user_data => $self->loc->N("User Data"), account_info => $self->loc->N("Account Info"), @@ -2369,10 +2375,10 @@ sub _manageUsersDialog { ## push application title my $appTitle = yui::YUI::app()->applicationTitle(); - ## set new title to get it in dialog - yui::YUI::app()->setApplicationTitle($self->name); - ## set icon if not already set by external launcher - yui::YUI::app()->setApplicationIcon($self->icon); +# ## set new title to get it in dialog +# yui::YUI::app()->setApplicationTitle($self->name); +# ## set icon if not already set by external launcher +# yui::YUI::app()->setApplicationIcon($self->icon); my $factory = yui::YUI::widgetFactory; -- cgit v1.2.1