diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-06-05 23:08:01 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-06-05 23:08:01 +0200 |
commit | bba9db3a0f511d3ace91477cedd8bfec0235872b (patch) | |
tree | d2d70940ece86091b7b80761aecacfb56027df7a | |
parent | 472c077df014fc67116eb879278dd074fff8ceb8 (diff) | |
download | manatools-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar manatools-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.gz manatools-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.bz2 manatools-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.xz manatools-bba9db3a0f511d3ace91477cedd8bfec0235872b.zip |
Hosts now uses AdminPanel::Shared::GUI
-rw-r--r-- | lib/AdminPanel/Module/Hosts.pm | 31 | ||||
-rw-r--r-- | lib/AdminPanel/Module/Services.pm | 2 |
2 files changed, 22 insertions, 11 deletions
diff --git a/lib/AdminPanel/Module/Hosts.pm b/lib/AdminPanel/Module/Hosts.pm index a509b437..3fbb8711 100644 --- a/lib/AdminPanel/Module/Hosts.pm +++ b/lib/AdminPanel/Module/Hosts.pm @@ -28,7 +28,8 @@ use utf8; use Glib; use yui; -use AdminPanel::Shared; +use AdminPanel::Shared qw(trim); +use AdminPanel::Shared::GUI; use AdminPanel::Shared::Hosts; extends qw( AdminPanel::Module ); @@ -65,6 +66,18 @@ has 'cfgHosts' => ( init_arg => undef ); +has 'sh_gui' => ( + is => 'rw', + init_arg => undef, + builder => '_SharedUGUIInitialize' +); + +sub _SharedUGUIInitialize { + my $self = shift(); + + $self->sh_gui(AdminPanel::Shared::GUI->new() ); +} + #============================================================= =head2 start @@ -177,7 +190,7 @@ sub _manipulateHostDialog { my $res = undef; my @hosts_toadd; push @hosts_toadd, $textHostName->value(); - if(trim($textHostAlias->value()) ne ""){ + if(AdminPanel::Shared::trim($textHostAlias->value()) ne ""){ push @hosts_toadd, $textHostAlias->value(); } print "@hosts_toadd\n"; @@ -334,7 +347,7 @@ sub _manageHostsDialog { } elsif ($widget == $remButton) { # implement deletion dialog - if(AdminPanel::Shared::ask_YesOrNo("Confirmation","Are you sure to drop this host?") == 1){ + if($self->sh_gui->ask_YesOrNo({title => "Confirmation", text => "Are you sure to drop this host?"}) == 1){ my $tblItem = yui::toYTableItem($self->table->selectedItem()); # drop the host using the ip $self->cfgHosts->_dropHost($tblItem->cell(0)->label()); @@ -343,15 +356,13 @@ sub _manageHostsDialog { $self->setupTable(); } }elsif ($widget == $aboutButton) { - AdminPanel::Shared::AboutDialog({ + $self->sh_gui->AboutDialog({ name => $appTitle, version => $VERSION, - copyright => "Copyright (c) 2013-2014 by Matteo Pasotti", - license => $AdminPanel::Shared::License, - comments => "Graphical manager for hosts definitions", - website => "http://gitweb.mageia.org/software/adminpanel", - website_label => "Mageia", - authors => "Matteo Pasotti <matteo.pasotti\@gmail.com>" + credits => "Copyright (c) 2013-2014 by Matteo Pasotti", + license => "GPLv2", + description => "Graphical manager for hosts definitions", + authors => "Matteo Pasotti <matteo.pasotti\@gmail.com>" } ); }elsif ($widget == $okButton) { diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm index 2d7ed7c8..365f3e18 100644 --- a/lib/AdminPanel/Module/Services.pm +++ b/lib/AdminPanel/Module/Services.pm @@ -447,7 +447,7 @@ sub _servicePanel { last; } elsif ($widget == $aboutButton) { - my $translators = $self->loc->N("_: Translator(s) name(s) & email(s)\n"); + my $translators = $self->loc->N("_: Translator(s) name(s) & email(s)\n"); $translators =~ s/\</\<\;/g; $translators =~ s/\>/\>\;/g; $self->sh_gui->AboutDialog({ name => $self->name, |