From 53ae9c05ba6dbdaecdf6613577522c124ddb2170 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Wed, 30 Dec 2015 15:27:35 +0100 Subject: fixed icon and title --- lib/ManaTools/Module/Services.pm | 28 +++++++++++----------------- scripts/manaservice | 9 +-------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/ManaTools/Module/Services.pm b/lib/ManaTools/Module/Services.pm index fc73587f..20864c67 100644 --- a/lib/ManaTools/Module/Services.pm +++ b/lib/ManaTools/Module/Services.pm @@ -78,6 +78,17 @@ has '+icon' => ( default => File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/manaservice.png'), ); +has '+name' => ( + lazy => 1, + builder => '_nameInitializer', +); + +sub _nameInitializer { + my $self = shift; + + return ($self->loc->N("Services and daemons")); +}; + has '_services' => ( traits => ['Array'], is => 'rw', @@ -181,10 +192,6 @@ our $VERSION = '1.0.0'; sub BUILD { my $self = shift; - if (! $self->name) { - $self->name ($self->loc->N("adminService")); - } - $self->loadServices(); } @@ -208,14 +215,6 @@ sub BUILD { sub start { my $self = shift; -# if ($EUID != 0) { -# $self->sh_gui->warningMsgBox({ -# title => $self->name, -# text => $self->loc->N("root privileges required"), -# }); -# return; -# } - $self->_servicePanel(); }; @@ -351,11 +350,6 @@ sub _servicePanel { 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); - my $mageiaPlugin = "mga"; my $factory = yui::YUI::widgetFactory; my $mgaFactory = yui::YExternalWidgets::externalWidgetFactory($mageiaPlugin); diff --git a/scripts/manaservice b/scripts/manaservice index 6029562f..6e9a2b49 100755 --- a/scripts/manaservice +++ b/scripts/manaservice @@ -21,14 +21,7 @@ use strict; use ManaTools::Module::Services; use ManaTools::Shared::Locales; -my $locale_dir = ManaTools::Shared::custom_locale_dir();; -my $loc = ManaTools::Shared::Locales->new( - domain_name => 'manatools', - dir_name => $locale_dir, -); - -my $serviceMan = ManaTools::Module::Services->new({icon => "/usr/share/mcc/themes/default/service-mdk.png", - name => $loc->N("Services and daemons"),}); +my $serviceMan = ManaTools::Module::Services->new(); $serviceMan->start(); 1; -- cgit v1.2.1