aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-06-05 23:08:01 +0200
committerAngelo Naselli <anaselli@linux.it>2014-06-05 23:08:01 +0200
commitbba9db3a0f511d3ace91477cedd8bfec0235872b (patch)
treed2d70940ece86091b7b80761aecacfb56027df7a /lib
parent472c077df014fc67116eb879278dd074fff8ceb8 (diff)
downloadcolin-keep-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar
colin-keep-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.gz
colin-keep-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.bz2
colin-keep-bba9db3a0f511d3ace91477cedd8bfec0235872b.tar.xz
colin-keep-bba9db3a0f511d3ace91477cedd8bfec0235872b.zip
Hosts now uses AdminPanel::Shared::GUI
Diffstat (limited to 'lib')
-rw-r--r--lib/AdminPanel/Module/Hosts.pm31
-rw-r--r--lib/AdminPanel/Module/Services.pm2
2 files changed, 22 insertions, 11 deletions
diff --git a/lib/AdminPanel/Module/Hosts.pm b/lib/AdminPanel/Module/Hosts.pm
index a509b43..3fbb871 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 &lt;matteo.pasotti\@gmail.com&gt;"
}
);
}elsif ($widget == $okButton) {
diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm
index 2d7ed7c..365f3e1 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/\</\&lt\;/g;
$translators =~ s/\>/\&gt\;/g;
$self->sh_gui->AboutDialog({ name => $self->name,