aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-03-16 18:16:50 +0100
committerAngelo Naselli <anaselli@linux.it>2015-03-16 18:16:50 +0100
commitfc9772f1f03684e8dab50ff77d2c46c5e0309c7b (patch)
tree375b76cf80e5d816eb48a4badf3bb949199ef220 /lib
parent825922057a21a9b09c60edf4b44535d7fd49926d (diff)
downloadcolin-keep-fc9772f1f03684e8dab50ff77d2c46c5e0309c7b.tar
colin-keep-fc9772f1f03684e8dab50ff77d2c46c5e0309c7b.tar.gz
colin-keep-fc9772f1f03684e8dab50ff77d2c46c5e0309c7b.tar.bz2
colin-keep-fc9772f1f03684e8dab50ff77d2c46c5e0309c7b.tar.xz
colin-keep-fc9772f1f03684e8dab50ff77d2c46c5e0309c7b.zip
Moved to namespace to ManaTools
Diffstat (limited to 'lib')
-rw-r--r--lib/AdminPanel/Category.pm12
-rw-r--r--lib/AdminPanel/ConfigReader.pm26
-rw-r--r--lib/AdminPanel/MainDisplay.pm64
-rw-r--r--lib/AdminPanel/Module.pm16
-rw-r--r--lib/AdminPanel/Module/AdminMouse.pm100
-rw-r--r--lib/AdminPanel/Module/Clock.pm22
-rw-r--r--lib/AdminPanel/Module/DisplayManager.pm18
-rw-r--r--lib/AdminPanel/Module/Firewall.pm48
-rw-r--r--lib/AdminPanel/Module/Hosts.pm20
-rw-r--r--lib/AdminPanel/Module/LogViewer.pm26
-rw-r--r--lib/AdminPanel/Module/Proxy.pm16
-rw-r--r--lib/AdminPanel/Module/Services.pm24
-rw-r--r--lib/AdminPanel/Module/Users.pm34
-rw-r--r--lib/AdminPanel/Privileges.pm10
-rw-r--r--lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm32
-rw-r--r--lib/AdminPanel/Rpmdragora/formatting.pm8
-rw-r--r--lib/AdminPanel/Rpmdragora/gui.pm56
-rw-r--r--lib/AdminPanel/Rpmdragora/gurpm.pm12
-rw-r--r--lib/AdminPanel/Rpmdragora/icon.pm8
-rw-r--r--lib/AdminPanel/Rpmdragora/init.pm18
-rw-r--r--lib/AdminPanel/Rpmdragora/open_db.pm6
-rw-r--r--lib/AdminPanel/Rpmdragora/pkg.pm42
-rw-r--r--lib/AdminPanel/Rpmdragora/rpmnew.pm14
-rw-r--r--lib/AdminPanel/SettingsReader.pm22
-rw-r--r--lib/AdminPanel/Shared.pm24
-rw-r--r--lib/AdminPanel/Shared/Firewall.pm2
-rw-r--r--lib/AdminPanel/Shared/GUI.pm22
-rw-r--r--lib/AdminPanel/Shared/Hosts.pm2
-rw-r--r--lib/AdminPanel/Shared/JournalCtl.pm10
-rw-r--r--lib/AdminPanel/Shared/Locales.pm40
-rw-r--r--lib/AdminPanel/Shared/Proxy.pm12
-rw-r--r--lib/AdminPanel/Shared/RunProgram.pm16
-rw-r--r--lib/AdminPanel/Shared/Services.pm36
-rw-r--r--lib/AdminPanel/Shared/Shorewall.pm42
-rw-r--r--lib/AdminPanel/Shared/TimeZone.pm20
-rw-r--r--lib/AdminPanel/Shared/Users.pm38
-rw-r--r--lib/AdminPanel/rpmdragora.pm40
37 files changed, 479 insertions, 479 deletions
diff --git a/lib/AdminPanel/Category.pm b/lib/AdminPanel/Category.pm
index 5448f1a..4ef7fa7 100644
--- a/lib/AdminPanel/Category.pm
+++ b/lib/AdminPanel/Category.pm
@@ -1,24 +1,24 @@
# vim: set et ts=4 sw=4:
# Copyright 2012 Steven Tucker
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
#Class Category
-package AdminPanel::Category;
+package ManaTools::Category;
use strict;
use warnings;
@@ -56,7 +56,7 @@ sub new {
icon => 0,
modules => [],
};
- bless $self, 'AdminPanel::Category';
+ bless $self, 'ManaTools::Category';
$self->{name} = $newName;
$self->{icon} = $newIcon;
diff --git a/lib/AdminPanel/ConfigReader.pm b/lib/AdminPanel/ConfigReader.pm
index 1c905c9..792dc0e 100644
--- a/lib/AdminPanel/ConfigReader.pm
+++ b/lib/AdminPanel/ConfigReader.pm
@@ -1,24 +1,24 @@
# vim: set et ts=4 sw=4:
# Copyright 2012 Steven Tucker
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
#Class ConfigReader
-package AdminPanel::ConfigReader;
+package ManaTools::ConfigReader;
use strict;
use warnings;
@@ -28,7 +28,7 @@ use Data::Dumper;
sub new {
my ($class, $fileName) = @_;
-
+
my $self = {
data => 0,
catLen => 0,
@@ -37,8 +37,8 @@ sub new {
currMod => 0,
placeHolder => 0,
};
- bless $self, 'AdminPanel::ConfigReader';
-
+ bless $self, 'ManaTools::ConfigReader';
+
my $xml = new XML::Simple (KeyAttr=>[]);
$self->{data} = $xml->XMLin($fileName);
if (ref($self->{data}->{category}) eq "HASH") {
@@ -50,7 +50,7 @@ sub new {
}
$self->{catLen} = scalar(@{$self->{data}->{category}});
$self->{currCat} = -1;
-
+
if(ref(@{$self->{data}->{category}}[0]->{module}) eq "ARRAY") {
$self->{modLen} = scalar(@{@{$self->{data}->{category}}[0]->{module}});
} else {
@@ -63,7 +63,7 @@ sub new {
sub hasNextCat {
my ($self) = @_;
-
+
if($self->{currCat} + 1 >= $self->{catLen}) {
return 0;
}
@@ -72,12 +72,12 @@ sub hasNextCat {
sub getNextCat {
my ($self) = @_;
-
+
$self->{currCat}++;
if($self->{currCat} >= $self->{catLen}) {
return 0;
}
-
+
# Reset the Module Count and Mod length for new Category
$self->{currMod} = -1;
if(ref(@{$self->{data}->{category}}[$self->{currCat}]->{module}) eq "ARRAY") {
@@ -87,7 +87,7 @@ sub getNextCat {
}
my $tmp = @{$self->{data}->{category}}[$self->{currCat}];
-
+
return $tmp;
}
diff --git a/lib/AdminPanel/MainDisplay.pm b/lib/AdminPanel/MainDisplay.pm
index f7c959b..19d0a7f 100644
--- a/lib/AdminPanel/MainDisplay.pm
+++ b/lib/AdminPanel/MainDisplay.pm
@@ -1,32 +1,32 @@
# vim: set et ts=4 sw=4:
# Copyright 2012 Steven Tucker
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
-package AdminPanel::MainDisplay;
+package ManaTools::MainDisplay;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::MainDisplay - class for AdminPaneol main window
+ManaTools::MainDisplay - class for AdminPaneol main window
=head1 SYNOPSIS
- $mainDisplay = new AdminPanel::MainDisplay();
+ $mainDisplay = new ManaTools::MainDisplay();
$mainDisplay->start();
$mainDisplay->destroy();
@@ -44,7 +44,7 @@ exported
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::MainDisplay
+perldoc ManaTools::MainDisplay
=head1 SEE ALSO
@@ -59,18 +59,18 @@ Steven Tucker
Copyright (C) 2012, Steven Tucker
Copyright (C) 2014, Angelo Naselli.
-AdminPanel is free software: you can redistribute it and/or modify
+ManaTools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
-AdminPanel is distributed in the hope that it will be useful,
+ManaTools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
=head1 FUNCTIONS
@@ -89,13 +89,13 @@ our $VERSION = '1.0.0';
use strict;
use warnings;
use diagnostics;
-use AdminPanel::SettingsReader;
-use AdminPanel::ConfigReader;
-use AdminPanel::Category;
-use AdminPanel::Module;
-use AdminPanel::Shared;
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
+use ManaTools::SettingsReader;
+use ManaTools::ConfigReader;
+use ManaTools::Category;
+use ManaTools::Module;
+use ManaTools::Shared;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
use File::ShareDir ':ALL';
use yui;
@@ -137,10 +137,10 @@ sub new {
loc => 0,
replacePoint => 0,
};
- bless $self, 'AdminPanel::MainDisplay';
+ bless $self, 'ManaTools::MainDisplay';
## Default values
- $self->{name} = "Administration panel";
+ $self->{name} = "Mana-tools panel";
$self->{categories} = [];
$self->{confDir} = "/etc/mpan",
$self->{title} = "mpan",
@@ -164,7 +164,7 @@ sub new {
}
# TODO localize
- $self->{loc} = AdminPanel::Shared::Locales->new(domain_name => 'libDrakX-standalone');
+ $self->{loc} = ManaTools::Shared::Locales->new(domain_name => 'libDrakX-standalone');
$self->setupGui();
return $self;
@@ -177,12 +177,12 @@ sub _showAboutDialog {
my $translators = $self->{loc}->N("_: Translator(s) name(s) & email(s)\n");
$translators =~ s/\</\&lt\;/g;
$translators =~ s/\>/\&gt\;/g;
- my $sh_gui = AdminPanel::Shared::GUI->new();
+ my $sh_gui = ManaTools::Shared::GUI->new();
$sh_gui->AboutDialog({ name => $self->{name},
- version => $AdminPanel::MainDisplay::VERSION,
+ version => $ManaTools::MainDisplay::VERSION,
credits => $self->{loc}->N("Copyright (C) %s Mageia community", '2013-2015'),
license => $self->{loc}->N("GPLv2"),
- description => $self->{loc}->N("mpan is the administration panel that collects all the utilities."),
+ description => $self->{loc}->N("mpan is the mana-tools panel that collects all the utilities."),
authors => $self->{loc}->N("<h3>Developers</h3>
<ul><li>%s</li>
<li>%s</li>
@@ -311,7 +311,7 @@ sub setupGui {
yui::YUI::app()->setApplicationTitle($self->{name});
my $icon = defined($self->{settings}->{icon}) ?
$self->{settings}->{icon} :
- File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/mageia.png');
+ File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/mageia.png');
yui::YUI::app()->setApplicationIcon($icon);
@@ -363,7 +363,7 @@ sub setupGui {
#logo from settings
my $logofile = defined($self->{settings}->{logo}) ?
$self->{settings}->{logo} :
- File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/logo_mageia.png');
+ File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/logo_mageia.png');
my $logo = $self->{factory}->createImage($self->{leftPane}, $logofile);
$logo->setAutoScale(1);
@@ -378,7 +378,7 @@ sub setupGui {
$self->{aboutButton}->setStretchable(0, 1);
$self->{exitButton} = $self->{factory}->createPushButton($self->{leftPane}, "&Quit");
- my $quitIcon = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/quit.png');
+ my $quitIcon = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/quit.png');
$self->{exitButton}->setIcon($quitIcon);
$self->{exitButton}->setStretchable(0, 1);
}
@@ -446,7 +446,7 @@ sub _loadSettings {
my $fileName = "$self->{confDir}/settings.conf";
die "Configuration file missing" if (! -e $fileName);
if (!$self->{settings} || $force_load) {
- $self->{settings} = new AdminPanel::SettingsReader($fileName);
+ $self->{settings} = new ManaTools::SettingsReader($fileName);
}
}
@@ -567,7 +567,7 @@ sub _loadCategories {
my $currCategory;
foreach $fileName (@categoryFiles) {
- my $inFile = new AdminPanel::ConfigReader($fileName);
+ my $inFile = new ManaTools::ConfigReader($fileName);
my $tmpCat;
my $tmp;
my $hasNextCat = $inFile->hasNextCat();
@@ -575,7 +575,7 @@ sub _loadCategories {
$tmp = $inFile->getNextCat();
$tmpCat = $self->_getCategory($tmp->{title});
if (!$tmpCat) {
- $tmpCat = new AdminPanel::Category($tmp->{title}, $tmp->{icon});
+ $tmpCat = new ManaTools::Category($tmp->{title}, $tmp->{icon});
}
$self->_loadCategory($tmpCat);
$hasNextCat = $inFile->hasNextCat();
@@ -589,7 +589,7 @@ sub _loadCategories {
if (exists $tmp->{title}) {
if (not $currCategory->moduleLoaded($tmp->{title})) {
- $tmpMod = AdminPanel::Module->create(name => $tmp->{title},
+ $tmpMod = ManaTools::Module->create(name => $tmp->{title},
icon => $tmp->{icon},
launch => $tmp->{launcher}
);
@@ -597,7 +597,7 @@ sub _loadCategories {
}
elsif (exists $tmp->{class}) {
if (not $currCategory->moduleLoaded(-CLASS => $tmp->{class})) {
- $tmpMod = AdminPanel::Module->create(-CLASS => $tmp->{class});
+ $tmpMod = ManaTools::Module->create(-CLASS => $tmp->{class});
}
}
if ($tmpMod) {
diff --git a/lib/AdminPanel/Module.pm b/lib/AdminPanel/Module.pm
index cd8c64e..1e13d92 100644
--- a/lib/AdminPanel/Module.pm
+++ b/lib/AdminPanel/Module.pm
@@ -1,24 +1,24 @@
# vim: set et ts=4 sw=4:
# Copyright 2012 Steven Tucker
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
#Class Module
-package AdminPanel::Module;
+package ManaTools::Module;
use Moose;
@@ -48,7 +48,7 @@ sub create {
my $obj;
if ( exists $params{-CLASS} ) {
my $driver = $params{-CLASS};
-
+
eval {
my $pkg = $driver;
$pkg =~ s/::/\//g;
@@ -62,7 +62,7 @@ sub create {
}
}
else {
- $obj = new AdminPanel::Module(@_);
+ $obj = new ManaTools::Module(@_);
}
return $obj;
}
@@ -153,7 +153,7 @@ sub start {
my $err = yui::YUI::app()->runInTerminal( $self->{launch} . " --ncurses");
if ($err == -1) {
system($self->{launch});
- }
+ }
}
}
diff --git a/lib/AdminPanel/Module/AdminMouse.pm b/lib/AdminPanel/Module/AdminMouse.pm
index 071a8f3..279fb76 100644
--- a/lib/AdminPanel/Module/AdminMouse.pm
+++ b/lib/AdminPanel/Module/AdminMouse.pm
@@ -1,27 +1,27 @@
# vim: set et ts=4 sw=4:
#*****************************************************************************
-#
+#
# Copyright (c) 2013 - 2015 Angelo Naselli <anaselli@linux.it>
# from drakx services
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
+#
#*****************************************************************************
# NOTE this module has not been ported and does not work
# TODO porting it if it is really needed nowadays
-package AdminPanel::Module::AdminMouse;
+package ManaTools::Module::AdminMouse;
#leaving them atm
use lib qw(/usr/lib/libDrakX);
@@ -34,19 +34,19 @@ use modules;
use mouse;
use c;
-use AdminPanel::Shared;
+use ManaTools::Shared;
use yui;
use Moose;
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
default => "/usr/share/mcc/themes/default/mousedrake-mdk.png",
);
has '+name' => (
- default => N("AdminMouse"),
+ default => N("AdminMouse"),
);
sub start {
@@ -57,7 +57,7 @@ sub start {
sub _getUntranslatedName {
my ($self, $name, $list) = @_;
-
+
foreach my $n (@{$list}) {
my @names = split(/\|/, $n);
for (my $lev=0; $lev < scalar(@names); $lev++) {
@@ -73,23 +73,23 @@ sub _getUntranslatedName {
sub _adminMouseDialog {
my $self = shift;
-
+
my $datavalue = "TEST";
-
+
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 $factory = yui::YUI::widgetFactory;
-
+
my $dialog = $factory->createMainDialog;
my $vbox = $factory->createVBox( $dialog );
my $frame = $factory->createFrame ($vbox, N("Please choose your type of mouse."));
my $treeWidget = $factory->createTree($frame, "");
-
+
my $modules_conf = modules::any_conf->read;
my $mouse = mouse::read();
@@ -98,17 +98,17 @@ sub _adminMouseDialog {
my $probed_mouse = mouse::detect($modules_conf);
$mouse = $probed_mouse if !$mouse->{Protocol} || !$probed_mouse->{unsafe};
}
-
+
if (!$mouse || !$::auto) {
$mouse ||= mouse::fullname2mouse('Universal|Any PS/2 & USB mice');
-
+
my $prev = my $fullname = $mouse->{type} . '|' . $mouse->{name};
my $selected = $mouse->{name};
-
- my $fullList = { list => [ mouse::_fullnames() ], items => [], separator => '|', val => \$fullname,
+
+ my $fullList = { list => [ mouse::_fullnames() ], items => [], separator => '|', val => \$fullname,
format => sub { join('|', map { translate($_) } split('\|', $_[0])) } } ;
- my $i;
-
+ my $i;
+
my $itemColl = new yui::YItemCollection;
my @items;
for ($i=0; $i<scalar(@{$fullList->{list}}); $i++) {
@@ -118,37 +118,37 @@ sub _adminMouseDialog {
}
if ($i == 0 || $names[0] ne $items[0]->{label}) {
if ($i != 0) {
- $itemColl->push($items[0]->{item});
+ $itemColl->push($items[0]->{item});
push @{$fullList->{items}}, $items[-1]->{item};;
}
- @items = undef;
+ @items = undef;
my $item = new yui::YTreeItem ($names[0]);
-
+
if ($selected eq $self->_getUntranslatedName($item->label(), $fullList->{list})) {
$item->setSelected(1) ;
$item->setOpen(1);
- my $parent = $item;
+ my $parent = $item;
while($parent = $parent->parent()) {
- $parent->setOpen(1);
+ $parent->setOpen(1);
}
}
$item->DISOWN();
@items = ({item => $item, label => $names[0], level => 0});
for (my $lev=1; $lev < scalar(@names); $lev++) {
$item = new yui::YTreeItem ($items[$lev-1]->{item}, $names[$lev]);
-
+
if ($selected eq $self->_getUntranslatedName($item->label(), $fullList->{list})) {
$item->setSelected(1) ;
$item->setOpen(1);
- my $parent = $item;
+ my $parent = $item;
while($parent = $parent->parent()) {
- $parent->setOpen(1);
+ $parent->setOpen(1);
}
}
$item->DISOWN();
if ($lev < scalar(@names)-1) {
push @items, {item => $item, label => $names[$lev], level => $lev};
- }
+ }
}
}
else {
@@ -159,7 +159,7 @@ sub _adminMouseDialog {
if ($items[$it]->{label} eq $names[$lev] && $items[$it]->{level} == $lev) {
$prevItem = $it;
last;
- }
+ }
}
if ($it == scalar(@items)) {
my $item = new yui::YTreeItem ($items[$prevItem]->{item}, $names[$lev]);
@@ -167,13 +167,13 @@ sub _adminMouseDialog {
if ($selected eq $self->_getUntranslatedName($item->label(), $fullList->{list})) {
$item->setSelected(1) ;
$item->setOpen(1);
- my $parent = $item;
+ my $parent = $item;
while($parent = $parent->parent()) {
- $parent->setOpen(1);
+ $parent->setOpen(1);
}
}
$item->DISOWN();
- push @items, {item => $item, label => $names[$lev], level => $lev};
+ push @items, {item => $item, label => $names[$lev], level => $lev};
}
}
}
@@ -193,7 +193,7 @@ sub _adminMouseDialog {
while(1) {
my $event = $dialog->waitForEvent();
my $eventType = $event->eventType();
-
+
#event type checking
if ($eventType == $yui::YEvent::CancelEvent) {
last;
@@ -206,12 +206,12 @@ sub _adminMouseDialog {
last;
}
elsif ($widget == $aboutButton) {
- my $license = translate($AdminPanel::Shared::License);
- AdminPanel::Shared::AboutDialog(
+ my $license = translate($ManaTools::Shared::License);
+ ManaTools::Shared::AboutDialog(
{ name => N("AdminMouse"),
- version => $self->VERSION,
+ version => $self->VERSION,
copyright => N("Copyright (C) %s Mageia community", '2014'),
- license => $license,
+ license => $license,
comments => N("AdminMouse is the Mageia mouse management tool \n(from the original idea of Mandriva mousedrake)."),
website => 'http://www.mageia.org',
website_label => N("Mageia"),
@@ -224,13 +224,13 @@ sub _adminMouseDialog {
elsif ($widget == $okButton) {
my $continue = 1;
my $selectedItem = $treeWidget->selectedItem();
-
+
my $it=$selectedItem;
my $fullname = $self->_getUntranslatedName($it->label(), $fullList->{list});
while($it = yui::toYTreeItem($it)->parent()) {
$fullname = join("|", $self->_getUntranslatedName($it->label(), $fullList->{list}), $fullname);
}
-
+
if ($fullname ne $prev) {
my $mouse_ = mouse::fullname2mouse($fullname, device => $mouse->{device});
if ($fullname =~ /evdev/) {
@@ -238,16 +238,16 @@ sub _adminMouseDialog {
}
%$mouse = %$mouse_;
}
-
+
if ($mouse->{nbuttons} < 3 ) {
- $mouse->{Emulate3Buttons} = AdminPanel::Shared::ask_YesOrNo('', N("Emulate third button?"));
+ $mouse->{Emulate3Buttons} = ManaTools::Shared::ask_YesOrNo('', N("Emulate third button?"));
}
if ($mouse->{type} eq 'serial') {
my @list = ();
foreach (detect_devices::serialPorts()) {
push @list, detect_devices::serialPort2text($_);
}
- my $choice = AdminPanel::Shared::ask_fromList(N("Mouse Port"),
+ my $choice = ManaTools::Shared::ask_fromList(N("Mouse Port"),
N("Please choose which serial port your mouse is connected to."),
\@list);
if ( !$choice ) {
@@ -257,24 +257,24 @@ sub _adminMouseDialog {
$mouse->{device} = $choice;
}
}
-
+
if ($continue) {
last;
}
}
}
}
-
+
}
# TODO manage write conf without interactive things
# mouse::write_conf($in->do_pkgs, $modules_conf, $mouse, 1);
system('systemctl', 'try-restart', 'gpm.service') if -e '/usr/lib/systemd/system/gpm.service';
-
- AdminPanel::Shared::infoMsgBox(N("Not implemented yet: configuration is not changed"));
-
+
+ ManaTools::Shared::infoMsgBox(N("Not implemented yet: configuration is not changed"));
+
$dialog->destroy();
-
+
#restore old application title
yui::YUI::app()->setApplicationTitle($appTitle);
}
diff --git a/lib/AdminPanel/Module/Clock.pm b/lib/AdminPanel/Module/Clock.pm
index 22fa059..f2bb5c0 100644
--- a/lib/AdminPanel/Module/Clock.pm
+++ b/lib/AdminPanel/Module/Clock.pm
@@ -1,14 +1,14 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Module::Clock;
+package ManaTools::Module::Clock;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Module::Clock - This module aims to configure system clock and time
+ManaTools::Module::Clock - This module aims to configure system clock and time
=head1 SYNOPSIS
- my $clockSettings = AdminPanel::Module::Clock->new();
+ my $clockSettings = ManaTools::Module::Clock->new();
$clockSettings->start();
=head1 DESCRIPTION
@@ -19,7 +19,7 @@ Long_description
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Module::Clock
+perldoc ManaTools::Module::Clock
=head1 SEE ALSO
@@ -54,15 +54,15 @@ use Moose;
use diagnostics;
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::TimeZone;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::TimeZone;
use Time::Piece;
use yui;
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
### TODO icon
has '+icon' => (
@@ -79,7 +79,7 @@ sub _localeInitialize {
my $self = shift;
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -93,7 +93,7 @@ has 'sh_gui' => (
sub _SharedGUIInitialize {
my $self = shift;
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
has 'sh_tz' => (
@@ -105,7 +105,7 @@ has 'sh_tz' => (
sub _SharedTimeZoneInitialize {
my $self = shift;
- $self->sh_tz(AdminPanel::Shared::TimeZone->new() );
+ $self->sh_tz(ManaTools::Shared::TimeZone->new() );
}
diff --git a/lib/AdminPanel/Module/DisplayManager.pm b/lib/AdminPanel/Module/DisplayManager.pm
index 1f6c054..39aa617 100644
--- a/lib/AdminPanel/Module/DisplayManager.pm
+++ b/lib/AdminPanel/Module/DisplayManager.pm
@@ -18,7 +18,7 @@
#
#*****************************************************************************
-package AdminPanel::Module::DisplayManager;
+package ManaTools::Module::DisplayManager;
use Modern::Perl '2011';
use autodie;
@@ -28,9 +28,9 @@ use English;
use utf8;
use yui;
-use AdminPanel::Shared qw(trim apcat);
-use AdminPanel::Shared::GUI;
-# use AdminPanel::Shared::DisplayManager;
+use ManaTools::Shared qw(trim apcat);
+use ManaTools::Shared::GUI;
+# use ManaTools::Shared::DisplayManager;
# TODROP but provides network::network
use lib qw(/usr/lib/libDrakX);
@@ -38,7 +38,7 @@ use network::network;
use MDK::Common::System qw(getVarsFromSh addVarsInSh);
use MDK::Common::Func qw(find);
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
@@ -120,14 +120,14 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'drakdm') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'drakdm') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui( AdminPanel::Shared::GUI->new() );
+ $self->sh_gui( ManaTools::Shared::GUI->new() );
}
#=============================================================
@@ -189,7 +189,7 @@ sub ask_for_X_restart {
sub _manageProxyDialog {
my $self = shift;
- ## TODO fix for adminpanel
+ ## TODO fix for manatools
my $appTitle = yui::YUI::app()->applicationTitle();
my $appIcon = yui::YUI::app()->applicationIcon();
## set new title to get it in dialog
@@ -280,7 +280,7 @@ sub _manageProxyDialog {
}
);
}elsif ($widget == $okButton) {
- my $current_choice = AdminPanel::Shared::trim($rb_group->currentButton()->label());
+ my $current_choice = ManaTools::Shared::trim($rb_group->currentButton()->label());
$current_choice =~s/\&//g;
addVarsInSh($self->conffile, { DISPLAYMANAGER => lc($current_choice) } );
$self->ask_for_X_restart();
diff --git a/lib/AdminPanel/Module/Firewall.pm b/lib/AdminPanel/Module/Firewall.pm
index 8158dc2..2ac56a5 100644
--- a/lib/AdminPanel/Module/Firewall.pm
+++ b/lib/AdminPanel/Module/Firewall.pm
@@ -18,7 +18,7 @@
#
#*****************************************************************************
-package AdminPanel::Module::Firewall;
+package ManaTools::Module::Firewall;
use Modern::Perl '2011';
use autodie;
@@ -27,11 +27,11 @@ use Moose::Autobox;
use utf8;
use yui;
-use AdminPanel::Shared qw(trim);
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Firewall;
-use AdminPanel::Shared::Shorewall;
-use AdminPanel::Shared::Services;
+use ManaTools::Shared qw(trim);
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Firewall;
+use ManaTools::Shared::Shorewall;
+use ManaTools::Shared::Services;
use MDK::Common::Func qw(if_ partition);
use MDK::Common::System qw(getVarsFromSh);
@@ -42,7 +42,7 @@ use MDK::Common::File qw(substInFile output_with_perm);
use List::Util qw(any);
use List::MoreUtils qw(uniq);
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
default => "/usr/share/icons/manawall.png",
@@ -147,14 +147,14 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'drakx-net') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'drakx-net') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
sub _initAllServers {
@@ -441,8 +441,8 @@ sub get_conf {
my $self = shift();
my ($disabled, $o_ports) = @_;
my $possible_servers = undef;
- my $conf = AdminPanel::Shared::Shorewall::read_();
- my $shorewall = (AdminPanel::Shared::Shorewall::get_config_file('zones', '') && $conf);
+ my $conf = ManaTools::Shared::Shorewall::read_();
+ my $shorewall = (ManaTools::Shared::Shorewall::get_config_file('zones', '') && $conf);
if ($o_ports) {
return ($disabled, $self->from_ports($o_ports));
@@ -477,7 +477,7 @@ sub set_ifw {
my ($enabled, $rules, $ports) = @_;
if ($enabled)
{
- my $ports_by_proto = AdminPanel::Shared::Shorewall::ports_by_proto($ports);
+ my $ports_by_proto = ManaTools::Shared::Shorewall::ports_by_proto($ports);
output_with_perm("$::prefix/etc/ifw/rules", 0644,
(map { ". /etc/ifw/rules.d/$_\n" } @$rules),
map {
@@ -493,8 +493,8 @@ sub set_ifw {
substInFile {
undef $_ if m!^INCLUDE /etc/ifw/rules|^iptables -I INPUT 2 -j Ifw!;
} "$::prefix/etc/shorewall/start";
- AdminPanel::Shared::Shorewall::set_in_file('start', $enabled, "INCLUDE /etc/ifw/start", "INCLUDE /etc/ifw/rules", "iptables -I INPUT 1 -j Ifw");
- AdminPanel::Shared::Shorewall::set_in_file('stop', $enabled, "iptables -D INPUT -j Ifw", "INCLUDE /etc/ifw/stop");
+ ManaTools::Shared::Shorewall::set_in_file('start', $enabled, "INCLUDE /etc/ifw/start", "INCLUDE /etc/ifw/rules", "iptables -I INPUT 1 -j Ifw");
+ ManaTools::Shared::Shorewall::set_in_file('stop', $enabled, "iptables -D INPUT -j Ifw", "INCLUDE /etc/ifw/stop");
}
#=============================================================
@@ -972,7 +972,7 @@ Have a look at /etc/services for information.");
$self->unlisted([]);
}
my $invalid_ports = check_ports_syntax($txtPortsList->value());
- if(AdminPanel::Shared::trim($invalid_ports) eq '')
+ if(ManaTools::Shared::trim($invalid_ports) eq '')
{
if($txtPortsList->value() =~m/\s+/g)
{
@@ -984,9 +984,9 @@ Have a look at /etc/services for information.");
}
else
{
- if(AdminPanel::Shared::trim($txtPortsList->value()) ne '')
+ if(ManaTools::Shared::trim($txtPortsList->value()) ne '')
{
- push(@{$self->unlisted()}, AdminPanel::Shared::trim($txtPortsList->value()));
+ push(@{$self->unlisted()}, ManaTools::Shared::trim($txtPortsList->value()));
}
}
$retval = 1;
@@ -1021,12 +1021,12 @@ sub get_zones {
my $confref = shift();
my $disabled = shift();
my $conf = ${$confref};
- my $interfacesfile = AdminPanel::Shared::Shorewall::get_config_file('interfaces', $conf->{version} || '');
+ my $interfacesfile = ManaTools::Shared::Shorewall::get_config_file('interfaces', $conf->{version} || '');
network::network::read_net_conf($self->net());
#- find all interfaces but alias interfaces
my @all_intf = grep { !/:/ } uniq(keys(%{$self->net()->{ifcfg}}), detect_devices::get_net_interfaces());
my %net_zone = map { $_ => undef } @all_intf;
- $net_zone{$_} = 1 foreach AdminPanel::Shared::Shorewall::get_net_zone_interfaces($interfacesfile, $self->net(), \@all_intf);
+ $net_zone{$_} = 1 foreach ManaTools::Shared::Shorewall::get_net_zone_interfaces($interfacesfile, $self->net(), \@all_intf);
# if firewall/shorewall is not disabled (i.e. everything has been allowed)
# then ask for network interfaces to protect
@@ -1099,13 +1099,13 @@ sub set_ports {
if (!$disabled || -x "$::prefix/sbin/shorewall") {
# $do_pkgs->ensure_files_are_installed([ [ qw(shorewall shorewall) ], [ qw(shorewall-ipv6 shorewall6) ] ], $::isInstall) or return;
- my $conf = AdminPanel::Shared::Shorewall::read_();
+ my $conf = ManaTools::Shared::Shorewall::read_();
if(!$self->get_zones(\$conf,$disabled))
{
# Cancel button has been pressed, aborting
return 0;
}
- my $shorewall = (AdminPanel::Shared::Shorewall::get_config_file('zones', '') && $conf);
+ my $shorewall = (ManaTools::Shared::Shorewall::get_config_file('zones', '') && $conf);
if (!$shorewall) {
print ("unable to read shorewall configuration, skipping installation");
return 0;
@@ -1118,7 +1118,7 @@ sub set_ports {
print ($disabled ? "disabling shorewall" : "configuring shorewall to allow ports: $ports");
# NOTE: the 2nd param is undef in this case!
- if(!AdminPanel::Shared::Shorewall::write_($shorewall))
+ if(!ManaTools::Shared::Shorewall::write_($shorewall))
{
# user action request
my $action = $self->sh_gui->ask_fromList({
@@ -1129,7 +1129,7 @@ sub set_ports {
list => [ "keep", "drop"],
default => "keep",
});
- AdminPanel::Shared::Shorewall::write_($shorewall,$action);
+ ManaTools::Shared::Shorewall::write_($shorewall,$action);
return 1;
}
}
@@ -1189,7 +1189,7 @@ sub start {
$self->set_ports($disabled, $ports, $self->log_net_drop()) or return;
# restart mandi
- my $services = AdminPanel::Shared::Services->new();
+ my $services = ManaTools::Shared::Services->new();
$services->is_service_running("mandi") and $services->restart("mandi");
# restarting services if needed
diff --git a/lib/AdminPanel/Module/Hosts.pm b/lib/AdminPanel/Module/Hosts.pm
index 90aa452..faae3f0 100644
--- a/lib/AdminPanel/Module/Hosts.pm
+++ b/lib/AdminPanel/Module/Hosts.pm
@@ -18,7 +18,7 @@
#
#*****************************************************************************
-package AdminPanel::Module::Hosts;
+package ManaTools::Module::Hosts;
use Modern::Perl '2011';
use autodie;
@@ -28,11 +28,11 @@ use utf8;
use Glib;
use yui;
-use AdminPanel::Shared qw(trim);
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Hosts;
+use ManaTools::Shared qw(trim);
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Hosts;
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
@@ -82,14 +82,14 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'drakx-net') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'drakx-net') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
#=============================================================
@@ -293,7 +293,7 @@ sub _manipulateHostDialog {
my $res = undef;
my @hosts_toadd;
push @hosts_toadd, $textHostName->value();
- if(AdminPanel::Shared::trim($textHostAlias->value()) ne ""){
+ if(ManaTools::Shared::trim($textHostAlias->value()) ne ""){
push @hosts_toadd, $textHostAlias->value();
}
if($boolEdit == 0){
@@ -405,7 +405,7 @@ sub setupTable {
sub _manageHostsDialog {
my $self = shift;
- ## TODO fix for adminpanel
+ ## TODO fix for manatools
my $appTitle = yui::YUI::app()->applicationTitle();
my $appIcon = yui::YUI::app()->applicationIcon();
## set new title to get it in dialog
@@ -439,7 +439,7 @@ sub _manageHostsDialog {
$self->table($factory->createTable($leftContent,$tableHeader));
# initialize Config::Hosts
- $self->cfgHosts(AdminPanel::Shared::Hosts->new());
+ $self->cfgHosts(ManaTools::Shared::Hosts->new());
$self->setupTable();
my $rightContent = $factory->createRight($hbox_content);
diff --git a/lib/AdminPanel/Module/LogViewer.pm b/lib/AdminPanel/Module/LogViewer.pm
index 130bef3..e009c1c 100644
--- a/lib/AdminPanel/Module/LogViewer.pm
+++ b/lib/AdminPanel/Module/LogViewer.pm
@@ -1,14 +1,14 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Module::LogViewer;
+package ManaTools::Module::LogViewer;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Module::LogViewer - Log viewer
+ManaTools::Module::LogViewer - Log viewer
=head1 SYNOPSIS
-my $logViewer = AdminPanel::Module::LogViewer->new();
+my $logViewer = ManaTools::Module::LogViewer->new();
$logViewer->start();
=head1 DESCRIPTION
@@ -21,7 +21,7 @@ file.
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Module::::LogViewer
+perldoc ManaTools::Module::::LogViewer
=head1 AUTHOR
@@ -53,10 +53,10 @@ use Moose;
use diagnostics;
use open OUT => ':utf8';
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::Services;
-use AdminPanel::Shared::JournalCtl;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::Services;
+use ManaTools::Shared::JournalCtl;
use POSIX qw/strftime floor/;
@@ -66,7 +66,7 @@ use File::HomeDir qw(home);
use yui;
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
### TODO icon
has '+icon' => (
@@ -83,7 +83,7 @@ sub _localeInitialize {
my $self = shift;
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -96,7 +96,7 @@ has 'sh_gui' => (
sub _SharedUGUIInitialize {
my $self = shift;
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
=head1 VERSION
@@ -261,7 +261,7 @@ sub _logViewerPanel {
my $itemCollection = new yui::YItemCollection;
yui::YUI::app()->busyCursor();
- my $serv = AdminPanel::Shared::Services->new();
+ my $serv = ManaTools::Shared::Services->new();
my ($l, $active_services) = $serv->services();
foreach (@{$active_services}) {
@@ -510,7 +510,7 @@ sub _save {
sub _search {
my ($self, $log_opts) = @_;
- my $log = AdminPanel::Shared::JournalCtl->new(%{$log_opts});
+ my $log = ManaTools::Shared::JournalCtl->new(%{$log_opts});
my $all = $log->getLog();
return $all;
diff --git a/lib/AdminPanel/Module/Proxy.pm b/lib/AdminPanel/Module/Proxy.pm
index 5d0165c..ff2af3e 100644
--- a/lib/AdminPanel/Module/Proxy.pm
+++ b/lib/AdminPanel/Module/Proxy.pm
@@ -18,7 +18,7 @@
#
#*****************************************************************************
-package AdminPanel::Module::Proxy;
+package ManaTools::Module::Proxy;
use Modern::Perl '2011';
use autodie;
@@ -28,16 +28,16 @@ use English;
use utf8;
use yui;
-use AdminPanel::Shared qw(trim);
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Proxy;
+use ManaTools::Shared qw(trim);
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Proxy;
# TODROP but provides network::network
use lib qw(/usr/lib/libDrakX);
use network::network;
use MDK::Common::System qw(getVarsFromSh);
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
@@ -89,14 +89,14 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'drakx-net') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'drakx-net') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui( AdminPanel::Shared::GUI->new() );
+ $self->sh_gui( ManaTools::Shared::GUI->new() );
}
#=============================================================
@@ -243,7 +243,7 @@ sub validate {
sub _manageProxyDialog {
my $self = shift;
- ## TODO fix for adminpanel
+ ## TODO fix for manatools
my $appTitle = yui::YUI::app()->applicationTitle();
my $appIcon = yui::YUI::app()->applicationIcon();
## set new title to get it in dialog
diff --git a/lib/AdminPanel/Module/Services.pm b/lib/AdminPanel/Module/Services.pm
index 53c3aae..dca0c0c 100644
--- a/lib/AdminPanel/Module/Services.pm
+++ b/lib/AdminPanel/Module/Services.pm
@@ -1,17 +1,17 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Module::Services;
+package ManaTools::Module::Services;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Module::Services - This module aims to manage service
+ManaTools::Module::Services - This module aims to manage service
with GUI
=head1 SYNOPSIS
- my $serviceMan = AdminPanel::Module::Services->new();
+ my $serviceMan = ManaTools::Module::Services->new();
$serviceMan->start();
=head1 DESCRIPTION
@@ -26,11 +26,11 @@ AdminPanel::Module::Services - This module aims to manage service
You can find documentation for this module with the perldoc command:
- perldoc AdminPanel::Module::Services
+ perldoc ManaTools::Module::Services
=head1 SEE ALSO
- AdminPanel::Module
+ ManaTools::Module
=head1 AUTHOR
@@ -64,14 +64,14 @@ use MDK::Common::String qw(formatAlaTeX);
use MDK::Common::DataStructure qw(member);
use yui;
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::Services;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::Services;
use File::Basename;
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
default => "/usr/share/mcc/themes/default/service-mdk.png",
@@ -132,7 +132,7 @@ has 'sh_gui' => (
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
has 'sh_services' => (
@@ -145,7 +145,7 @@ has 'sh_services' => (
sub _SharedServicesInitialize {
my $self = shift();
- $self->sh_services(AdminPanel::Shared::Services->new() );
+ $self->sh_services(ManaTools::Shared::Services->new() );
}
@@ -159,7 +159,7 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
diff --git a/lib/AdminPanel/Module/Users.pm b/lib/AdminPanel/Module/Users.pm
index 1be39d1..2ef9066 100644
--- a/lib/AdminPanel/Module/Users.pm
+++ b/lib/AdminPanel/Module/Users.pm
@@ -1,17 +1,17 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Module::Users;
+package ManaTools::Module::Users;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Module::Users - This module aims to manage service
+ManaTools::Module::Users - This module aims to manage service
with GUI
=head1 SYNOPSIS
- my $userManager = AdminPanel::Module::Users->new();
+ my $userManager = ManaTools::Module::Users->new();
$userManager->start();
=head1 DESCRIPTION
@@ -24,11 +24,11 @@ AdminPanel::Module::Users - This module aims to manage service
You can find documentation for this module with the perldoc command:
- perldoc AdminPanel::Module::Users
+ perldoc ManaTools::Module::Users
=head1 SEE ALSO
- AdminPanel::Module
+ ManaTools::Module
=head1 AUTHOR
@@ -77,14 +77,14 @@ use Sys::Syslog;
use Glib;
use English;
use yui;
-use AdminPanel::Shared;
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::Users;
+use ManaTools::Shared;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::Users;
use MDK::Common::DataStructure qw(member);
use feature 'state';
-extends qw( AdminPanel::Module );
+extends qw( ManaTools::Module );
has '+icon' => (
default => "/usr/share/icons/userdrake.png",
@@ -146,7 +146,7 @@ has 'sh_users' => (
sub _SharedUsersInitialize {
my $self = shift();
- $self->sh_users(AdminPanel::Shared::Users->new() );
+ $self->sh_users(ManaTools::Shared::Users->new() );
}
has 'sh_gui' => (
@@ -158,7 +158,7 @@ has 'sh_gui' => (
sub _SharedUGUIInitialize {
my $self = shift();
- $self->sh_gui(AdminPanel::Shared::GUI->new() );
+ $self->sh_gui(ManaTools::Shared::GUI->new() );
}
has 'loc' => (
@@ -172,7 +172,7 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'userdrake') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'userdrake') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -714,7 +714,7 @@ sub _buildUserData {
my $weakness = undef;
if (yui::YUI::app()->hasImageSupport()) {
$factory->createHSpacing($hbox, 2.0);
- my $file = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Blank16x16.png');
+ my $file = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Blank16x16.png');
$weakness = $factory->createImage($hbox, $file);
}
else {
@@ -1954,9 +1954,9 @@ sub _checkWeaknessPassword {
my $strongp = $self->sh_users->strongPassword($password);
if (yui::YUI::app()->hasImageSupport()) {
- my $file = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Warning_Shield_Grey16x16.png');
+ my $file = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Warning_Shield_Grey16x16.png');
if ($strongp) {
- $file = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Checked_Shield_Green16x16.png');
+ $file = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Checked_Shield_Green16x16.png');
}
$weakness_widget->setImage($file);
}
@@ -2381,7 +2381,7 @@ sub _manageUsersDialog {
return;
}
- ## TODO fix for adminpanel
+ ## TODO fix for manatools
my $pixdir = '/usr/share/userdrake/pixmaps/';
## push application title
my $appTitle = yui::YUI::app()->applicationTitle();
diff --git a/lib/AdminPanel/Privileges.pm b/lib/AdminPanel/Privileges.pm
index 4352c5c..5833900 100644
--- a/lib/AdminPanel/Privileges.pm
+++ b/lib/AdminPanel/Privileges.pm
@@ -1,22 +1,22 @@
# vim: set et ts=4 sw=4:
# Copyright 2012-2015 Matteo Pasotti
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
-package AdminPanel::Privileges;
+package ManaTools::Privileges;
use strict;
use warnings;
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
index 741525b..c756964 100644
--- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
+++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::edit_urpm_sources;
+package ManaTools::Rpmdragora::edit_urpm_sources;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -35,13 +35,13 @@ use MDK::Common::File qw(cat_ output);
use MDK::Common::DataStructure qw(member put_in_hash uniq);
use MDK::Common::Various qw(to_bool);
-use AdminPanel::Shared;
-use AdminPanel::Shared::Locales;
-use AdminPanel::rpmdragora;
-use AdminPanel::Rpmdragora::init;
-use AdminPanel::Rpmdragora::open_db;
-use AdminPanel::Rpmdragora::formatting;
-use AdminPanel::Shared::GUI;
+use ManaTools::Shared;
+use ManaTools::Shared::Locales;
+use ManaTools::rpmdragora;
+use ManaTools::Rpmdragora::init;
+use ManaTools::Rpmdragora::open_db;
+use ManaTools::Rpmdragora::formatting;
+use ManaTools::Shared::GUI;
use URPM::Signature;
use urpm::media;
use urpm::download;
@@ -65,7 +65,7 @@ my %col = (
},
);
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
sub get_medium_type {
my ($medium) = @_;
@@ -142,7 +142,7 @@ sub easy_add_callback_with_mirror() {
#- cooker and community don't have update sources
my $want_base_distro = _want_base_distro();
defined $want_base_distro or return 0;
- my $distro = $AdminPanel::rpmdragora::mageia_release;
+ my $distro = $ManaTools::rpmdragora::mageia_release;
my ($mirror) = choose_mirror($urpm, message =>
$loc->N("This will attempt to install all official sources corresponding to your
distribution (%s).\n
@@ -1302,7 +1302,7 @@ sub keys_callback() {
};
my $add_key = sub {
- my $sh_gui = AdminPanel::Shared::GUI->new();
+ my $sh_gui = ManaTools::Shared::GUI->new();
my $item = $mediaTbl->selectedItem();
if ($item) {
$current_medium = $item->label();
@@ -1331,7 +1331,7 @@ sub keys_callback() {
};
my $remove_key = sub {
- my $sh_gui = AdminPanel::Shared::GUI->new();
+ my $sh_gui = ManaTools::Shared::GUI->new();
my $keyItem = $keyTbl->selectedItem();
my $mediaItem = $mediaTbl->selectedItem();
if ($keyItem && $mediaItem) {
@@ -1467,7 +1467,7 @@ sub readMedia {
## NOTE anaselli: next lines add check icon to cells, but they are 8x8, a dimension should
## be evaluated by font size, so disabled atm
# my $cell = $item->cell(0); # Checked
-# my $checkedIcon = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Check_8x8.png');
+# my $checkedIcon = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Check_8x8.png');
#
# $cell->setIconName($checkedIcon) if (!$_->{ignore});
# $cell = $item->cell(1); # Updates
@@ -1675,8 +1675,8 @@ sub mainwindow() {
$hbox = $factory->createHBox( $vbox_commands );
## TODO icon and label for ncurses
- my $upIcon = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Up_16x16.png');
- my $downIcon = File::ShareDir::dist_file(AdminPanel::Shared::distName(), 'images/Down_16x16.png');
+ my $upIcon = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Up_16x16.png');
+ my $downIcon = File::ShareDir::dist_file(ManaTools::Shared::distName(), 'images/Down_16x16.png');
my $upButton = $factory->createPushButton($factory->createHBox($hbox), $loc->N("Up"));
my $downButton = $factory->createPushButton($factory->createHBox($hbox), $loc->N("Down"));
$upButton->setIcon($upIcon);
@@ -1725,7 +1725,7 @@ sub mainwindow() {
my $translators = $loc->N("_: Translator(s) name(s) & email(s)\n");
$translators =~ s/\</\&lt\;/g;
$translators =~ s/\>/\&gt\;/g;
- my $sh_gui = AdminPanel::Shared::GUI->new();
+ my $sh_gui = ManaTools::Shared::GUI->new();
$sh_gui->AboutDialog({ name => "Rpmdragora",
version => $VERSION,
credits => $loc->N("Copyright (C) %s Mageia community", '2013-2014'),
diff --git a/lib/AdminPanel/Rpmdragora/formatting.pm b/lib/AdminPanel/Rpmdragora/formatting.pm
index da429a5..83a960a 100644
--- a/lib/AdminPanel/Rpmdragora/formatting.pm
+++ b/lib/AdminPanel/Rpmdragora/formatting.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::formatting;
+package ManaTools::Rpmdragora::formatting;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -30,8 +30,8 @@ use strict;
use utf8;
use POSIX qw(strftime);
use MDK::Common::Various qw(internal_error);
-use AdminPanel::Shared::Locales;
-use AdminPanel::rpmdragora;
+use ManaTools::Shared::Locales;
+use ManaTools::rpmdragora;
use urpm::msg;
@@ -56,7 +56,7 @@ our @EXPORT = qw(
urpm_name
);
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
sub escape_text_for_TextView_markup_format {
my ($str) = @_;
diff --git a/lib/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm
index b244c95..0cf0882 100644
--- a/lib/AdminPanel/Rpmdragora/gui.pm
+++ b/lib/AdminPanel/Rpmdragora/gui.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::gui;
+package ManaTools::Rpmdragora::gui;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -42,16 +42,16 @@ use MDK::Common::String qw(formatAlaTeX);
use MDK::Common::Math qw(sum);
use MDK::Common::System qw(list_passwd);
-use AdminPanel::rpmdragora;
-use AdminPanel::Rpmdragora::open_db;
-use AdminPanel::Rpmdragora::formatting;
-use AdminPanel::Rpmdragora::init;
-use AdminPanel::Rpmdragora::icon qw(get_icon_path);
-use AdminPanel::Rpmdragora::pkg;
-use AdminPanel::Shared;
-use AdminPanel::Shared::GUI;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::RunProgram qw(get_stdout raw);
+use ManaTools::rpmdragora;
+use ManaTools::Rpmdragora::open_db;
+use ManaTools::Rpmdragora::formatting;
+use ManaTools::Rpmdragora::init;
+use ManaTools::Rpmdragora::icon qw(get_icon_path);
+use ManaTools::Rpmdragora::pkg;
+use ManaTools::Shared;
+use ManaTools::Shared::GUI;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::RunProgram qw(get_stdout raw);
use yui;
use feature 'state';
use Carp;
@@ -97,8 +97,8 @@ our @EXPORT = qw(
setInfoOnWidget
);
-my $loc = AdminPanel::rpmdragora::locale();
-my $shared_gui = AdminPanel::Shared::GUI->new() ;
+my $loc = ManaTools::rpmdragora::locale();
+my $shared_gui = ManaTools::Shared::GUI->new() ;
our ($descriptions, %filters, @filtered_pkgs, %filter_methods, $force_displaying_group, $force_rebuild, @initial_selection, $pkgs, $size_free, $size_selected, $urpm);
our ($results_ok, $results_none) = ($loc->N("Search results"), $loc->N("Search results (none)"));
@@ -340,21 +340,21 @@ sub _format_pkg_simplifiedinfo {
#push @$s, [ build_expander($pkg, $loc->N("Files:"), 'files', sub { files_format($pkg->{files}) }) ];
my $files_link = format_link(format_field($loc->N("Files:")), $hidden_info{files} );
if ($options->{files}) {
- my $wait = AdminPanel::rpmdragora::wait_msg();
+ my $wait = ManaTools::rpmdragora::wait_msg();
if (!$pkg->{files}) {
extract_header($pkg, $urpm, 'files', $installed_version);
}
my $files = $pkg->{files} ? files_format($pkg->{files}) : $loc->N("(Not available)");
utf8::encode($files);
$files_link .= "\n\n" . $files;
- AdminPanel::rpmdragora::remove_wait_msg($wait);
+ ManaTools::rpmdragora::remove_wait_msg($wait);
}
push @$s, join("\n", $files_link, "\n");
#push @$s, [ build_expander($pkg, $loc->N("Changelog:"), 'changelog', sub { $pkg->{changelog} }, $installed_version) ];
my $changelog_link = format_link(format_field($loc->N("Changelog:")), $hidden_info{changelog} );
if ($options->{changelog}) {
- my $wait = AdminPanel::rpmdragora::wait_msg();
+ my $wait = ManaTools::rpmdragora::wait_msg();
my @changelog = $pkg->{changelog} ? @{$pkg->{changelog}} : ( $loc->N("(Not available)") );
if (!$pkg->{changelog} || !scalar @{$pkg->{changelog}} ) {
# my ($pkg, $label, $type, $get_data, $o_installed_version) = @_;
@@ -365,7 +365,7 @@ sub _format_pkg_simplifiedinfo {
$changelog_link .= "<br />&nbsp;&nbsp;&nbsp;" . join("<br />&nbsp;&nbsp;&nbsp;", @changelog);
$changelog_link =~ s|\n||g;
- AdminPanel::rpmdragora::remove_wait_msg($wait);
+ ManaTools::rpmdragora::remove_wait_msg($wait);
}
push @$s, join("\n\n", $changelog_link, "\n");
@@ -943,7 +943,7 @@ sub fast_toggle {
interactive_msg($loc->N("Warning"), $loc->N("The \"%s\" package is in urpmi skip list.\nDo you want to select it anyway?", $name), yesno => 1) or return '';
$urpm_obj->set_flag_skip(0);
}
- if ($AdminPanel::Rpmdragora::pkg::need_restart && !$priority_up_alread_warned) {
+ if ($ManaTools::Rpmdragora::pkg::need_restart && !$priority_up_alread_warned) {
$priority_up_alread_warned = 1;
interactive_msg($loc->N("Warning"), '<b>' . $loc->N("Rpmdragora or one of its priority dependencies needs to be updated first. Rpmdragora will then restart.") . '</b>' . "\n\n");
}
@@ -1093,7 +1093,7 @@ sub pkgs_provider {
},
all_updates => sub {
# potential "updates" from media not tagged as updates:
- if (!$options{pure_updates} && !$AdminPanel::Rpmdragora::pkg::need_restart) {
+ if (!$options{pure_updates} && !$ManaTools::Rpmdragora::pkg::need_restart) {
[ @{$h->{updates}},
difference2([ grep { is_updatable($_) } @{$h->{installable}} ], $h->{backports}) ];
} else {
@@ -1311,14 +1311,14 @@ sub deps_msg {
if (!$item) {
#URL emitted or at least a ref into RichText widget
my $url = yui::toYMenuEvent($event)->id ();
- if (AdminPanel::Rpmdragora::gui::info_details($url, $info_options) ) {
+ if (ManaTools::Rpmdragora::gui::info_details($url, $info_options) ) {
$item = $pkgList->selectedItem();
my $pkg = $item->label();
- AdminPanel::Rpmdragora::gui::setInfoOnWidget($pkg, $infoBox, $info_options);
+ ManaTools::Rpmdragora::gui::setInfoOnWidget($pkg, $infoBox, $info_options);
}
else {
# default it's really a URL
- AdminPanel::Rpmdragora::gui::run_browser($url);
+ ManaTools::Rpmdragora::gui::run_browser($url);
}
}
}
@@ -1515,7 +1515,7 @@ sub do_action__real {
$urpm->{fatal}(1, $loc->N("Error: %s appears to be mounted read-only.", $urpm::sys::mountpoint));
return 1;
}
- if (!$AdminPanel::Rpmdragora::pkg::need_restart && !is_there_selected_packages()) {
+ if (!$ManaTools::Rpmdragora::pkg::need_restart && !is_there_selected_packages()) {
interactive_msg($loc->N("You need to select some packages first."), $loc->N("You need to select some packages first."));
return 1;
}
@@ -1533,7 +1533,7 @@ Do you really want to install all the selected packages?"), yesno => 1)
my $res = $callback_action->($urpm, $pkgs);
if (!$res) {
$force_rebuild = 1;
- pkgs_provider($options->{tree_mode}, MDK::Common::Func::if_($AdminPanel::Rpmdragora::pkg::probe_only_for_updates, pure_updates => 1), skip_updating_mu => 1);
+ pkgs_provider($options->{tree_mode}, MDK::Common::Func::if_($ManaTools::Rpmdragora::pkg::probe_only_for_updates, pure_updates => 1), skip_updating_mu => 1);
reset_search();
$size_selected = 0;
(undef, $size_free) = MDK::Common::System::df('/usr');
@@ -1583,7 +1583,7 @@ sub _build_tree {
push @{$pkg_by_group_hash->{$grp}}, $pkg;
}
- my $tree_hash = AdminPanel::Shared::pathList2hash({
+ my $tree_hash = ManaTools::Shared::pathList2hash({
paths => \@groups,
separator => '|',
});
@@ -1665,7 +1665,7 @@ or you already installed all of them."));
# inlining part of MDK::Common::Data::difference2():
my %l; @l{map { $_->[0] } @_} = ();
my @pkgs_times = ('rpm', '-q', '--qf', '%{name}-%{version}-%{release}.%{arch} %{installtime}\n',
- map { chomp_($_) } AdminPanel::Shared::RunProgram::get_stdout('urpmi_rpm-find-leaves'));
+ map { chomp_($_) } ManaTools::Shared::RunProgram::get_stdout('urpmi_rpm-find-leaves'));
sort { $b->[1] <=> $a->[1] } grep { exists $l{$_->[0]} } map { chomp; [ split ] } run_rpm(@pkgs_times);
},
flat => sub { no locale; sort { uc($a->[0]) cmp uc($b->[0]) } @_ },
@@ -1736,7 +1736,7 @@ sub run_help_callback {
my (undef, $url) = @_;
my ($user) = grep { $_->[2] eq $ENV{USERHELPER_UID} } list_passwd();
local $ENV{HOME} = $user->[7] if $user && $ENV{USERHELPER_UID};
- AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url);
+ ManaTools::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url);
}
#=============================================================
@@ -1759,7 +1759,7 @@ sub run_browser {
my ($user) = grep { $_->[2] eq $ENV{USERHELPER_UID} } MDK::Common::System::list_passwd();
local $ENV{HOME} = $user->[7] if $user && $ENV{USERHELPER_UID};
- AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url);
+ ManaTools::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'www-browser', $url);
}
#=============================================================
diff --git a/lib/AdminPanel/Rpmdragora/gurpm.pm b/lib/AdminPanel/Rpmdragora/gurpm.pm
index 39a2b95..20cac6e 100644
--- a/lib/AdminPanel/Rpmdragora/gurpm.pm
+++ b/lib/AdminPanel/Rpmdragora/gurpm.pm
@@ -1,22 +1,22 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::gurpm;
+package ManaTools::Rpmdragora::gurpm;
#============================================================= -*-perl-*-
=head1 NAME
- AdminPanel::Rpmdragora::gurpm - Module that shows the urpmi
+ ManaTools::Rpmdragora::gurpm - Module that shows the urpmi
progress status
=head1 SYNOPSIS
my %option = (title => "Urpmi action ivoked", text => "Please wait", );
- my $gurpmi = AdminPanel::Rpmdragora::gurpm->new(%option);
+ my $gurpmi = ManaTools::Rpmdragora::gurpm->new(%option);
$gurpmi->progress(45);
#add to an existing dialog
%option = (title => "Urpmi action ivoked", text => "Please wait", main_dialog => $dialog, parent => $parent_container);
- $gurpmi = AdminPanel::Rpmdragora::gurpm->new(%option);
+ $gurpmi = ManaTools::Rpmdragora::gurpm->new(%option);
$gurpmi->progress(20);
=head1 DESCRIPTION
@@ -29,12 +29,12 @@ package AdminPanel::Rpmdragora::gurpm;
You can find documentation for this module with the perldoc command:
- perldoc AdminPanel::Rpmdragora::gurpm
+ perldoc ManaTools::Rpmdragora::gurpm
=head1 AUTHOR
Angelo Naselli <anaselli@linux.it>
-
+
Matteo Pasotti <matteo.pasotti@gmail.com>
=head1 COPYRIGHT and LICENSE
diff --git a/lib/AdminPanel/Rpmdragora/icon.pm b/lib/AdminPanel/Rpmdragora/icon.pm
index c253d67..6c3887d 100644
--- a/lib/AdminPanel/Rpmdragora/icon.pm
+++ b/lib/AdminPanel/Rpmdragora/icon.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::icon;
+package ManaTools::Rpmdragora::icon;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -28,10 +28,10 @@ package AdminPanel::Rpmdragora::icon;
use strict;
-use AdminPanel::rpmdragora;
-use AdminPanel::Shared::Locales;
+use ManaTools::rpmdragora;
+use ManaTools::Shared::Locales;
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
use Exporter;
our @ISA = qw(Exporter);
diff --git a/lib/AdminPanel/Rpmdragora/init.pm b/lib/AdminPanel/Rpmdragora/init.pm
index 7acdec6..f6d570d 100644
--- a/lib/AdminPanel/Rpmdragora/init.pm
+++ b/lib/AdminPanel/Rpmdragora/init.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::init;
+package ManaTools::Rpmdragora::init;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -33,8 +33,8 @@ BEGIN { $::no_global_argv_parsing = 1 }
require urpm::args;
use MDK::Common::Various qw(chomp_);
-use AdminPanel::Privileges;
-use AdminPanel::Shared::Locales;
+use ManaTools::Privileges;
+use ManaTools::Shared::Locales;
use Exporter;
our @ISA = qw(Exporter);
@@ -51,7 +51,7 @@ our @EXPORT = qw(init
our @ARGV_copy = @ARGV;
BEGIN { #- we want to run this code before the Gtk->init of the use-my_gtk
- my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake');
+ my $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake');
my $basename = sub { local $_ = shift; s|/*\s*$||; s|.*/||; $_ };
any { /^--?h/ } @ARGV and do {
@@ -153,22 +153,22 @@ if ($MODE eq 'remove') {
$default_list_mode = 'all_updates';
}
-$MODE eq 'update' || $rpmdragora_options{'run-as-root'} and AdminPanel::Privileges::is_root_capability_required();
+$MODE eq 'update' || $rpmdragora_options{'run-as-root'} and ManaTools::Privileges::is_root_capability_required();
$::noborderWhenEmbedded = 1;
-require AdminPanel::rpmdragora;
+require ManaTools::rpmdragora;
-our $changelog_first = $AdminPanel::rpmdragora::changelog_first_config->[0];
+our $changelog_first = $ManaTools::rpmdragora::changelog_first_config->[0];
$changelog_first = 1 if $rpmdragora_options{'changelog-first'};
sub warn_about_user_mode() {
- my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake');
+ my $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake');
my $title = $loc->N("Running in user mode");
my $msg = $loc->N("You are launching this program as a normal user.\n".
"You will not be able to perform modifications on the system,\n".
"but you may still browse the existing database.");
- if(($EUID != 0) and (!AdminPanel::rpmdragora::interactive_msg($title, $msg))) {
+ if(($EUID != 0) and (!ManaTools::rpmdragora::interactive_msg($title, $msg))) {
return 0;
}
return 1;
diff --git a/lib/AdminPanel/Rpmdragora/open_db.pm b/lib/AdminPanel/Rpmdragora/open_db.pm
index ded4bfc..7bfa7bf 100644
--- a/lib/AdminPanel/Rpmdragora/open_db.pm
+++ b/lib/AdminPanel/Rpmdragora/open_db.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::open_db;
+package ManaTools::Rpmdragora::open_db;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -31,7 +31,7 @@ use Sys::Syslog;
use MDK::Common::File qw(cat_ mkdir_p);
use MDK::Common::Func;
-use AdminPanel::rpmdragora;
+use ManaTools::rpmdragora;
use URPM;
use urpm;
use urpm::args;
@@ -51,7 +51,7 @@ our @EXPORT = qw(fast_open_urpmi_db
open_urpmi_db
);
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
# because rpm blocks some signals when rpm DB is opened, we don't keep open around:
diff --git a/lib/AdminPanel/Rpmdragora/pkg.pm b/lib/AdminPanel/Rpmdragora/pkg.pm
index 16f2711..ba0b18b 100644
--- a/lib/AdminPanel/Rpmdragora/pkg.pm
+++ b/lib/AdminPanel/Rpmdragora/pkg.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::pkg;
+package ManaTools::Rpmdragora::pkg;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -38,13 +38,13 @@ use MDK::Common::Various qw(chomp_);
use POSIX qw(_exit ceil);
use URPM;
use utf8;
-use AdminPanel::rpmdragora;
-use AdminPanel::Rpmdragora::open_db;
-use AdminPanel::Rpmdragora::gurpm;
-use AdminPanel::Rpmdragora::formatting;
-use AdminPanel::Rpmdragora::rpmnew;
-use AdminPanel::Shared::RunProgram qw(run get_stdout);
-use AdminPanel::rpmdragora;
+use ManaTools::rpmdragora;
+use ManaTools::Rpmdragora::open_db;
+use ManaTools::Rpmdragora::gurpm;
+use ManaTools::Rpmdragora::formatting;
+use ManaTools::Rpmdragora::rpmnew;
+use ManaTools::Shared::RunProgram qw(run get_stdout);
+use ManaTools::rpmdragora;
use urpm;
use urpm::lock;
use urpm::install;
@@ -56,7 +56,7 @@ use urpm::args qw();
use urpm::util;
use Carp;
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
use Exporter;
our @ISA = qw(Exporter);
@@ -94,7 +94,7 @@ sub run_rpm {
foreach (qw(LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL)) {
local $ENV{$_} = $ENV{$_} . '.UTF-8' if $ENV{$_} && $ENV{$_} !~ /UTF-8/;
}
- my @l = map { ensure_utf8($_); $_ } AdminPanel::Shared::RunProgram::get_stdout(@_);
+ my @l = map { ensure_utf8($_); $_ } ManaTools::Shared::RunProgram::get_stdout(@_);
wantarray() ? @l : join('', @l);
}
@@ -143,7 +143,7 @@ sub extract_header {
$bar_id = statusbar_msg($loc->N("Getting '%s' from XML meta-data...", $xml_info), 0);
my $_gurpm_clean_guard = MDK::Common::Func::before_leaving { undef $gurpm };
if (my $xml_info_file = eval { urpm::media::any_xml_info($urpm, $medium, $xml_info, undef, sub {
- $gurpm ||= AdminPanel::Rpmdragora::gurpm->new(
+ $gurpm ||= ManaTools::Rpmdragora::gurpm->new(
text => $loc->N("Please wait"),
);
download_callback($gurpm, @_)
@@ -287,7 +287,7 @@ all of them are currently disabled. You should run the Software
Media Manager to enable at least one (check it in the \"%s\"
column).
-Then, restart \"%s\".", $loc->N("Enabled"), $AdminPanel::rpmdragora::myname_update));
+Then, restart \"%s\".", $loc->N("Enabled"), $ManaTools::rpmdragora::myname_update));
return (-1);
}
my ($mirror) = choose_mirror($urpm, transient => $w->{real_window} || $::main_window,
@@ -305,7 +305,7 @@ $loc->N("You may also choose your desired mirror manually: to do so,
launch the Software Media Manager, and then add a `Security
updates' medium.
-Then, restart %s.", $AdminPanel::rpmdragora::myname_update)), return (-1);
+Then, restart %s.", $ManaTools::rpmdragora::myname_update)), return (-1);
add_distrib_update_media($urpm, $mirror, only_updates => 0);
}
return 0;
@@ -407,7 +407,7 @@ sub get_updates_list {
);
my %common_opts = (
- callback_choices => \&AdminPanel::Rpmdragora::gui::callback_choices,
+ callback_choices => \&ManaTools::Rpmdragora::gui::callback_choices,
priority_upgrade => $urpm->{options}{'priority-upgrade'},
);
@@ -428,7 +428,7 @@ sub get_updates_list {
if ($probe_only_for_updates && !$need_restart) {
@$requested_strict = sort map {
urpm_name($_);
- } $urpm->resolve_requested($db, $state, $requested, callback_choices => \&AdminPanel::Rpmdragora::gui::callback_choices);
+ } $urpm->resolve_requested($db, $state, $requested, callback_choices => \&ManaTools::Rpmdragora::gui::callback_choices);
if (my @l = grep { $state->{selected}{$_->id} }
urpm::select::_priority_upgrade_pkgs($urpm, $urpm->{options}{'priority-upgrade'})) {
@@ -459,7 +459,7 @@ sub get_pkgs {
myexit (-1) if (warn_about_media($w, %options) == -1);
- my $gurpm = AdminPanel::Rpmdragora::gurpm->new(
+ my $gurpm = ManaTools::Rpmdragora::gurpm->new(
text => $loc->N("Please wait"),
);
my $_gurpm_clean_guard = MDK::Common::Func::before_leaving { undef $gurpm };
@@ -706,7 +706,7 @@ sub perform_parallel_install {
my @pkgs = map { MDK::Common::Func::if_($_->flag_requested, urpm_name($_)) } @{$urpm->{depslist}};
my @error_msgs;
- my $res = !AdminPanel::Shared::RunProgram::run('urpmi', '2>', \@error_msgs, '-v', '--X', '--parallel', $group, @pkgs);
+ my $res = !ManaTools::Shared::RunProgram::run('urpmi', '2>', \@error_msgs, '-v', '--X', '--parallel', $group, @pkgs);
if ($res) {
$$statusbar_msg_id = statusbar_msg(
@@ -770,7 +770,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
urpm::select::resolve_dependencies(
$urpm, $state, $requested,
rpmdb => $::env && "$::env/rpmdb.cz",
- callback_choices => \&AdminPanel::Rpmdragora::gui::callback_choices,
+ callback_choices => \&ManaTools::Rpmdragora::gui::callback_choices,
);
statusbar_msg_remove($bar_id);
@@ -819,7 +819,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
# select packages to uninstall for !update mode:
perform_removal($urpm, { map { $_ => $pkgs->{$_} } @to_remove }) if !$probe_only_for_updates;
- $gurpm = AdminPanel::Rpmdragora::gurpm->new(
+ $gurpm = ManaTools::Rpmdragora::gurpm->new(
text => $loc->N("Please wait"),
title => $loc->N("Initializing..."),
);
@@ -993,7 +993,7 @@ you may now inspect some in order to take actions:"),
#- added --previous-priority-upgrade to allow checking if yet if
#- priority-upgrade list has changed. and make sure we don't uselessly restart
my @argv = ('--previous-priority-upgrade=' . $urpm->{options}{'priority-upgrade'},
- grep { !/^--no-priority-upgrade$|--previous-priority-upgrade=/ } @AdminPanel::Rpmdragora::init::ARGV_copy);
+ grep { !/^--no-priority-upgrade$|--previous-priority-upgrade=/ } @ManaTools::Rpmdragora::init::ARGV_copy);
# remove "--emmbedded <id>" from argv:
my $i = 0;
foreach (@argv) {
@@ -1032,7 +1032,7 @@ sub perform_removal {
my ($urpm, $pkgs) = @_;
my @toremove = map { MDK::Common::Func::if_($pkgs->{$_}{selected}, $pkgs->{$_}{urpm_name}) } keys %$pkgs;
return if !@toremove;
- my $gurpm = AdminPanel::Rpmdragora::gurpm->new(
+ my $gurpm = ManaTools::Rpmdragora::gurpm->new(
text => $loc->N("Please wait")
);
my $_gurpm_clean_guard = MDK::Common::Func::before_leaving { undef $gurpm };
diff --git a/lib/AdminPanel/Rpmdragora/rpmnew.pm b/lib/AdminPanel/Rpmdragora/rpmnew.pm
index 8cc4576..659c0b2 100644
--- a/lib/AdminPanel/Rpmdragora/rpmnew.pm
+++ b/lib/AdminPanel/Rpmdragora/rpmnew.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Rpmdragora::rpmnew;
+package ManaTools::Rpmdragora::rpmnew;
#*****************************************************************************
#
# Copyright (c) 2002 Guillaume Cottenceau
@@ -32,11 +32,11 @@ use MDK::Common::Math qw(sum);
use MDK::Common::File qw(renamef);
use MDK::Common::Various qw(chomp_);
-use AdminPanel::rpmdragora;
-use AdminPanel::Rpmdragora::init;
-use AdminPanel::Rpmdragora::pkg;
-use AdminPanel::Rpmdragora::open_db;
-use AdminPanel::Rpmdragora::formatting;
+use ManaTools::rpmdragora;
+use ManaTools::Rpmdragora::init;
+use ManaTools::Rpmdragora::pkg;
+use ManaTools::Rpmdragora::open_db;
+use ManaTools::Rpmdragora::formatting;
use yui;
@@ -44,7 +44,7 @@ use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(rpmnew_dialog do_merge_if_needed);
-my $loc = AdminPanel::rpmdragora::locale();
+my $loc = ManaTools::rpmdragora::locale();
# /var/lib/nfs/etab /var/lib/nfs/rmtab /var/lib/nfs/xtab /var/cache/man/whatis
my %ignores_rpmnew = map { $_ => 1 } qw(
diff --git a/lib/AdminPanel/SettingsReader.pm b/lib/AdminPanel/SettingsReader.pm
index bb6203e..318aefd 100644
--- a/lib/AdminPanel/SettingsReader.pm
+++ b/lib/AdminPanel/SettingsReader.pm
@@ -1,16 +1,16 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::SettingsReader;
+package ManaTools::SettingsReader;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::SettingsReader - This module allows to load an XML configuration file
+ManaTools::SettingsReader - This module allows to load an XML configuration file
=head1 SYNOPSIS
- use AdminPanel::SettingsReader;
+ use ManaTools::SettingsReader;
- my $settings = new AdminPanel::SettingsReader($fileName);
+ my $settings = new ManaTools::SettingsReader($fileName);
=head1 DESCRIPTION
@@ -20,7 +20,7 @@ AdminPanel::SettingsReader - This module allows to load an XML configuration fil
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::SettingsReader
+perldoc ManaTools::SettingsReader
=head1 SEE ALSO
@@ -34,20 +34,20 @@ perldoc AdminPanel::SettingsReader
Copyright (C) 2012-2015, Angelo Naselli.
- This file is part of AdminPanel
+ This file is part of ManaTools
- AdminPanel is free software: you can redistribute it and/or modify
+ ManaTools is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
- AdminPanel is distributed in the hope that it will be useful,
+ ManaTools is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+ along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
=head1 FUNCTIONS
@@ -74,7 +74,7 @@ use Data::Dumper;
=head3 DESCRIPTION
- The constructor just loads the given files and return its representation
+ The constructor just loads the given files and return its representation
into a hash reference.
=cut
@@ -87,7 +87,7 @@ sub new {
my $self = {
settings => 0,
};
- bless $self, 'AdminPanel::SettingsReader';
+ bless $self, 'ManaTools::SettingsReader';
die "File " . $fileName . " not found" if (! -e $fileName);
diff --git a/lib/AdminPanel/Shared.pm b/lib/AdminPanel/Shared.pm
index 6ff12a0..6a40539 100644
--- a/lib/AdminPanel/Shared.pm
+++ b/lib/AdminPanel/Shared.pm
@@ -2,27 +2,27 @@
# Copyright 2012-2015 Angelo Naselli <anaselli@linux.it>
# Copyright 2013-2015 Matteo Pasotti <matteo.pasotti@gmail.com>
#
-# This file is part of AdminPanel
+# This file is part of ManaTools
#
-# AdminPanel is free software: you can redistribute it and/or modify
+# ManaTools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
-# AdminPanel is distributed in the hope that it will be useful,
+# ManaTools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
+# along with ManaTools. If not, see <http://www.gnu.org/licenses/>.
-package AdminPanel::Shared;
+package ManaTools::Shared;
=head1 NAME
-AdminPanel::Shared - AdminPanel::Shared contains all the shared routines
- needed by AdminPanel and modules
+ManaTools::Shared - ManaTools::Shared contains all the shared routines
+ needed by ManaTools and modules
=head1 SYNOPSIS
@@ -30,7 +30,7 @@ AdminPanel::Shared - AdminPanel::Shared contains all the shared routines
=head1 DESCRIPTION
-This module collects all the routines shared between AdminPanel and its modules.
+This module collects all the routines shared between ManaTools and its modules.
=head1 EXPORT
@@ -48,7 +48,7 @@ This module collects all the routines shared between AdminPanel and its modules.
You can find documentation for this module with the perldoc command:
- perldoc AdminPanel::Shared
+ perldoc ManaTools::Shared
=head1 AUTHOR
@@ -156,14 +156,14 @@ $distname: name of the distributed package
This function return the distname, useful to retrieve data
with File::ShareDir::dist_file and must be the same as into
-Makefile.PL (e.g. adminpanel)
+Makefile.PL (e.g. manatools)
=cut
#=============================================================
sub distName {
- return "adminpanel";
+ return "manatools";
}
@@ -372,5 +372,5 @@ sub isProcessRunning {
return;
}
-1; # End of AdminPanel::Shared
+1; # End of ManaTools::Shared
diff --git a/lib/AdminPanel/Shared/Firewall.pm b/lib/AdminPanel/Shared/Firewall.pm
index 50e8a4f..f5a6c45 100644
--- a/lib/AdminPanel/Shared/Firewall.pm
+++ b/lib/AdminPanel/Shared/Firewall.pm
@@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#*****************************************************************************
-package AdminPanel::Shared::Firewall;
+package ManaTools::Shared::Firewall;
use Moose;
use diagnostics;
diff --git a/lib/AdminPanel/Shared/GUI.pm b/lib/AdminPanel/Shared/GUI.pm
index 9a67231..6c6144d 100644
--- a/lib/AdminPanel/Shared/GUI.pm
+++ b/lib/AdminPanel/Shared/GUI.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::GUI;
+package ManaTools::Shared::GUI;
#============================================================= -*-perl-*-
=head1 NAME
@@ -8,7 +8,7 @@ Shared::GUI - Shared graphic routines
=head1 SYNOPSIS
- my $gui = AdminPanel::Shared::GUI->new();
+ my $gui = ManaTools::Shared::GUI->new();
my $yesPressed = $gui->ask_YesOrNo($title, $text);
=head1 DESCRIPTION
@@ -59,9 +59,9 @@ use Moose;
use diagnostics;
use yui;
-use AdminPanel::Shared qw(pathList2hash);
+use ManaTools::Shared qw(pathList2hash);
-use AdminPanel::Shared::Locales;
+use ManaTools::Shared::Locales;
has 'loc' => (
is => 'rw',
@@ -73,7 +73,7 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX-standalone') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -548,8 +548,8 @@ list is an array of hashes like this
text => "descriptive text"
val => reference to the boolean value
}
-
-
+
+
=head3 OUTPUT
undef: if Cancel button has been pressed
@@ -587,11 +587,11 @@ sub ask_multiple_fromList {
my $layout = $factory->createVBox($dlg);
my @ckbox_array = ();
-
+
for my $item(@{$info->{list}})
{
my $ckbox = $factory->createCheckBox(
- $factory->createLeft($factory->createHBox($layout)),
+ $factory->createLeft($factory->createHBox($layout)),
$item->{text},
${$item->{val}}
);
@@ -648,7 +648,7 @@ sub ask_multiple_fromList {
#restore old application title
yui::YUI::app()->setApplicationTitle($appTitle);
-
+
return $selections;
}
@@ -905,7 +905,7 @@ sub ask_fromTreeList {
my $list2Convert;
$list2Convert->{paths} = $info->{list};
$list2Convert->{separator} = $info->{item_separator} if $info->{item_separator};
- $treeInfo->{hash_tree} = AdminPanel::Shared::pathList2hash($list2Convert);
+ $treeInfo->{hash_tree} = ManaTools::Shared::pathList2hash($list2Convert);
$self->hashTreeToYItemCollection($treeInfo);
$treeWidget->addItems($treeInfo->{collection});
diff --git a/lib/AdminPanel/Shared/Hosts.pm b/lib/AdminPanel/Shared/Hosts.pm
index def2b7c..d3b7fc9 100644
--- a/lib/AdminPanel/Shared/Hosts.pm
+++ b/lib/AdminPanel/Shared/Hosts.pm
@@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#*****************************************************************************
-package AdminPanel::Shared::Hosts;
+package ManaTools::Shared::Hosts;
use Moose;
use diagnostics;
diff --git a/lib/AdminPanel/Shared/JournalCtl.pm b/lib/AdminPanel/Shared/JournalCtl.pm
index 5d11bcf..1194538 100644
--- a/lib/AdminPanel/Shared/JournalCtl.pm
+++ b/lib/AdminPanel/Shared/JournalCtl.pm
@@ -1,27 +1,27 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::JournalCtl;
+package ManaTools::Shared::JournalCtl;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Shared::JournalCtl - journalctl perl wrapper
+ManaTools::Shared::JournalCtl - journalctl perl wrapper
=head1 SYNOPSIS
- my $log = AdminPanel::Shared::JournalCtl->new();
+ my $log = ManaTools::Shared::JournalCtl->new();
my @log_content = $log->getLog();
=head1 DESCRIPTION
-This module wraps journalctl allowing some running options and provides the
+This module wraps journalctl allowing some running options and provides the
output log content.
=head1 SUPPORT
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Shared::JournalCtl
+perldoc ManaTools::Shared::JournalCtl
=head1 AUTHOR
diff --git a/lib/AdminPanel/Shared/Locales.pm b/lib/AdminPanel/Shared/Locales.pm
index a1186ad..ec54614 100644
--- a/lib/AdminPanel/Shared/Locales.pm
+++ b/lib/AdminPanel/Shared/Locales.pm
@@ -1,16 +1,16 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::Locales;
+package ManaTools::Shared::Locales;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Shared::Locales - Class to manage locales
+ManaTools::Shared::Locales - Class to manage locales
=head1 SYNOPSIS
-use AdminPanel::Shared::Locales;
+use ManaTools::Shared::Locales;
-my $obj = AdminPanel::Shared::Locales->new(domain_name => 'this_domain');
+my $obj = ManaTools::Shared::Locales->new(domain_name => 'this_domain');
print $obj->N("test string %d", 1) . "\n";
@@ -23,7 +23,7 @@ This class wraps Locale::gettext to manage localization
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Shared::Locales
+perldoc ManaTools::Shared::Locales
=head1 SEE ALSO
@@ -68,7 +68,7 @@ use Text::Iconv;
=head3 INPUT
- hash ref containing
+ hash ref containing
domain_name: gettext domain name (default mpan)
dir_name: gettext optional catalog directory (default undef)
codeset: gettext codeset (default UTF8)
@@ -88,16 +88,16 @@ has 'domain_name' => (
has 'dir_name' => (
is => 'rw',
- default => undef,
+ default => undef,
);
has 'codeset' => (
is => 'rw',
- default => 'UTF8',
+ default => 'UTF8',
);
has 'domain' => (
- is => 'rw',
+ is => 'rw',
init_arg => undef,
);
@@ -153,9 +153,9 @@ sub BUILD {
=cut
#=============================================================
-sub P {
+sub P {
my ($self, $s_singular, $s_plural, $nb, @para) = @_;
-
+
sprintf($self->domain->nget($s_singular, $s_plural, $nb), @para);
}
@@ -167,7 +167,7 @@ sub P {
$self : this object
$s: msg id
-
+
=head3 OUTPUT
locale string
@@ -180,8 +180,8 @@ sub P {
#=============================================================
sub N {
- my ($self, $s, @para) = @_;
-
+ my ($self, $s, @para) = @_;
+
sprintf($self->domain->get($s), @para);
}
@@ -193,7 +193,7 @@ sub N {
$self : this object
$s: msg id
-
+
=head3 OUTPUT
msg id
@@ -207,8 +207,8 @@ sub N {
#=============================================================
sub N_ {
my $self = shift;
-
- $_[0];
+
+ $_[0];
}
@@ -238,7 +238,7 @@ sub from_utf8 {
my $converter = Text::Iconv->new("utf-8", undef);
my $converted = $converter->convert($s);
- return $converted;
+ return $converted;
}
@@ -262,13 +262,13 @@ sub from_utf8 {
=cut
#=============================================================
-sub to_utf8 {
+sub to_utf8 {
my ($self, $s) = @_;
my $converter = Text::Iconv->new(undef, "utf-8");
my $converted = $converter->convert($s);
- return $converted;
+ return $converted;
}
diff --git a/lib/AdminPanel/Shared/Proxy.pm b/lib/AdminPanel/Shared/Proxy.pm
index 18360c8..6accbb7 100644
--- a/lib/AdminPanel/Shared/Proxy.pm
+++ b/lib/AdminPanel/Shared/Proxy.pm
@@ -1,23 +1,23 @@
# vim: set et ts=4 sw=4:
#*****************************************************************************
-#
+#
# Copyright (c) 2013-2015 Matteo Pasotti <matteo.pasotti@gmail.com>
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
+#
#*****************************************************************************
-package AdminPanel::Shared::Proxy;
+package ManaTools::Shared::Proxy;
use Moose;
use diagnostics;
diff --git a/lib/AdminPanel/Shared/RunProgram.pm b/lib/AdminPanel/Shared/RunProgram.pm
index 4355fb9..042f559 100644
--- a/lib/AdminPanel/Shared/RunProgram.pm
+++ b/lib/AdminPanel/Shared/RunProgram.pm
@@ -1,4 +1,4 @@
-package AdminPanel::Shared::RunProgram;
+package ManaTools::Shared::RunProgram;
use strict;
use MDK::Common;
@@ -21,7 +21,7 @@ our @EXPORT_OK = qw(
=head1 SYNOPSYS
-B<rAdminPanel::Shared::RunProgram> enables to:
+B<rManaTools::Shared::RunProgram> enables to:
=over 4
@@ -192,9 +192,9 @@ eg:
=over 4
-=item * C<< AdminPanel::Shared::RunProgram::raw({ root => $::prefix, sensitive_arguments => 1 }, "echo -e $user->{password} | cryptsetup luksFormat $device"); >>
+=item * C<< ManaTools::Shared::RunProgram::raw({ root => $::prefix, sensitive_arguments => 1 }, "echo -e $user->{password} | cryptsetup luksFormat $device"); >>
-=item * C<< AdminPanel::Shared::RunProgram::raw({ detach => 1 }, '/etc/rc.d/init.d/dm', '>', '/dev/null', '2>', '/dev/null', 'restart'); >>
+=item * C<< ManaTools::Shared::RunProgram::raw({ detach => 1 }, '/etc/rc.d/init.d/dm', '>', '/dev/null', '2>', '/dev/null', 'restart'); >>
=back
@@ -308,15 +308,15 @@ sub raw {
if ($stderr && $stderr eq 'STDERR') {
} elsif ($stderr) {
$stderr_mode =~ s/2//;
- open STDERR, "$stderr_mode $stderr" or _die_exit("AdminPanel::Shared::RunProgram cannot output in $stderr (mode `$stderr_mode')");
+ open STDERR, "$stderr_mode $stderr" or _die_exit("ManaTools::Shared::RunProgram cannot output in $stderr (mode `$stderr_mode')");
} elsif ($::isInstall) {
- open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or _die_exit("AdminPanel::Shared::RunProgram cannot log, give me access to /tmp/ddebug.log");
+ open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or _die_exit("ManaTools::Shared::RunProgram cannot log, give me access to /tmp/ddebug.log");
}
if ($stdout && $stdout eq 'STDOUT') {
} elsif ($stdout) {
- open STDOUT, "$stdout_mode $stdout" or _die_exit("AdminPanel::Shared::RunProgram cannot output in $stdout (mode `$stdout_mode')");
+ open STDOUT, "$stdout_mode $stdout" or _die_exit("ManaTools::Shared::RunProgram cannot output in $stdout (mode `$stdout_mode')");
} elsif ($::isInstall) {
- open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or _die_exit("AdminPanel::Shared::RunProgram cannot log, give me access to /tmp/ddebug.log");
+ open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or _die_exit("ManaTools::Shared::RunProgram cannot log, give me access to /tmp/ddebug.log");
}
$root and chroot $root;
diff --git a/lib/AdminPanel/Shared/Services.pm b/lib/AdminPanel/Shared/Services.pm
index b53ad92..abef8c3 100644
--- a/lib/AdminPanel/Shared/Services.pm
+++ b/lib/AdminPanel/Shared/Services.pm
@@ -1,16 +1,16 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::Services;
+package ManaTools::Shared::Services;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Shared::Services - shares the API to manage services
+ManaTools::Shared::Services - shares the API to manage services
=head1 SYNOPSIS
-use AdminPanel::Shared::Services;
+use ManaTools::Shared::Services;
-my $serv = AdminPanel::Shared::Services->new();
+my $serv = ManaTools::Shared::Services->new();
my ($l, $on_services) = $serv->services();
@@ -25,11 +25,11 @@ my ($l, $on_services) = $serv->services();
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Shared::Services
+perldoc ManaTools::Shared::Services
=head1 SEE ALSO
-AdminPanel::Shared
+ManaTools::Shared
=head1 AUTHOR
@@ -64,11 +64,11 @@ use Net::DBus;
use Net::DBus::Annotation qw(:auth);
use File::Basename;
-use AdminPanel::Shared::Locales;
+use ManaTools::Shared::Locales;
use MDK::Common::Func qw(find);
use MDK::Common::File;
use MDK::Common::DataStructure qw(member);
-use AdminPanel::Shared::RunProgram qw(rooted);
+use ManaTools::Shared::RunProgram qw(rooted);
has 'loc' => (
is => 'rw',
@@ -81,7 +81,7 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -374,7 +374,7 @@ sub set_service {
if (MDK::Common::DataStructure::member($service, @xinetd_services)) {
$ENV{PATH} = "/usr/bin:/usr/sbin";
- AdminPanel::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", $enable ? "--add" : "--del", $service);
+ ManaTools::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", $enable ? "--add" : "--del", $service);
} elsif ($self->_running_systemd() || $self->_has_systemd()) {
$service = $service . ".service";
my $dbus_object = $self->dbus_systemd1_object;
@@ -389,11 +389,11 @@ sub set_service {
} else {
my $script = "/etc/rc.d/init.d/$service";
$ENV{PATH} = "/usr/bin:/usr/sbin";
- AdminPanel::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", $enable ? "--add" : "--del", $service);
+ ManaTools::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", $enable ? "--add" : "--del", $service);
#- FIXME: handle services with no chkconfig line and with no Default-Start levels in LSB header
if ($enable && MDK::Common::File::cat_("$script") =~ /^#\s+chkconfig:\s+-/m) {
$ENV{PATH} = "/usr/bin:/usr/sbin";
- AdminPanel::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", "--level", "35", $service, "on");
+ ManaTools::Shared::RunProgram::rooted("", "/usr/sbin/chkconfig", "--level", "35", $service, "on");
}
}
}
@@ -415,7 +415,7 @@ sub _run_action {
$self->_systemd_services(1);
} else {
$ENV{PATH} = "/usr/bin:/usr/sbin:/etc/rc.d/init.d/";
- AdminPanel::Shared::RunProgram::rooted("", "/etc/rc.d/init.d/$service", $action);
+ ManaTools::Shared::RunProgram::rooted("", "/etc/rc.d/init.d/$service", $action);
}
}
@@ -423,14 +423,14 @@ sub _running_systemd {
my $self = shift;
$ENV{PATH} = "/usr/bin:/usr/sbin";
- AdminPanel::Shared::RunProgram::rooted("", '/usr/bin/mountpoint', '-q', '/sys/fs/cgroup/systemd');
+ ManaTools::Shared::RunProgram::rooted("", '/usr/bin/mountpoint', '-q', '/sys/fs/cgroup/systemd');
}
sub _has_systemd {
my $self = shift;
$ENV{PATH} = "/usr/bin:/usr/sbin";
- AdminPanel::Shared::RunProgram::rooted("", '/usr/bin/rpm', '-q', 'systemd');
+ ManaTools::Shared::RunProgram::rooted("", '/usr/bin/rpm', '-q', 'systemd');
}
#=============================================================
@@ -459,7 +459,7 @@ sub xinetd_services {
if ($ser_info && $ser_info->{enabled} eq "1") {
local $ENV{LANGUAGE} = 'C';
$ENV{PATH} = "/usr/bin:/usr/sbin";
- foreach (AdminPanel::Shared::RunProgram::rooted_get_stdout("", '/usr/sbin/chkconfig', '--list', '--type', 'xinetd')) {
+ foreach (ManaTools::Shared::RunProgram::rooted_get_stdout("", '/usr/sbin/chkconfig', '--list', '--type', 'xinetd')) {
if (my ($xinetd_name, $on_off) = m!^\t(\S+):\s*(on|off)!) {
push @xinetd_services, [ $xinetd_name, $on_off eq 'on' ];
}
@@ -530,7 +530,7 @@ sub _legacy_services {
if (!$::isInstall) {
$runlevel = (split " ", `/sbin/runlevel`)[1];
}
- foreach (AdminPanel::Shared::RunProgram::rooted_get_stdout("", '/sbin/chkconfig', '--list', '--type', 'sysv')) {
+ foreach (ManaTools::Shared::RunProgram::rooted_get_stdout("", '/sbin/chkconfig', '--list', '--type', 'sysv')) {
if (my ($name, $l) = m!^(\S+)\s+(0:(on|off).*)!) {
# If we expect to use systemd (i.e. installer) only show those
# sysvinit scripts which are not masked by a native systemd unit.
@@ -767,7 +767,7 @@ sub is_service_running {
$out = $ser_info->{active_state} eq 'active' if $ser_info->{active_state};
} else {
$ENV{PATH} = "/usr/bin:/usr/sbin";
- $out = AdminPanel::Shared::RunProgram::rooted("", '/usr/sbin/service', $service, 'status');
+ $out = ManaTools::Shared::RunProgram::rooted("", '/usr/sbin/service', $service, 'status');
}
return $out;
}
diff --git a/lib/AdminPanel/Shared/Shorewall.pm b/lib/AdminPanel/Shared/Shorewall.pm
index 0cd8ce2..f82c542 100644
--- a/lib/AdminPanel/Shared/Shorewall.pm
+++ b/lib/AdminPanel/Shared/Shorewall.pm
@@ -1,9 +1,9 @@
-package AdminPanel::Shared::Shorewall; # $Id: shorewall.pm 254244 2009-03-18 22:54:32Z eugeni $
+package ManaTools::Shared::Shorewall; # $Id: shorewall.pm 254244 2009-03-18 22:54:32Z eugeni $
use detect_devices;
use network::network;
-use AdminPanel::Shared::RunProgram;
-use AdminPanel::Shared::Services;
+use ManaTools::Shared::RunProgram;
+use ManaTools::Shared::Services;
use MDK::Common::Func qw(if_ partition map_each);
use MDK::Common::File qw(cat_ substInFile output_with_perm);
use MDK::Common::Various qw(to_bool);
@@ -96,7 +96,7 @@ sub read_ {
$ver = $o_ver if $o_ver;
#- read old rules file if config is not moved to rules.drakx yet
my @rules = get_config_file(-f "$::prefix${shorewall_root}${ver}/rules.drakx" ? 'rules.drakx' : 'rules', $ver);
- my $services = AdminPanel::Shared::Services->new();
+ my $services = ManaTools::Shared::Services->new();
my %conf = (disabled => !$services->starts_on_boot("shorewall${ver}"),
version => $ver,
ports => join(' ', map {
@@ -113,18 +113,18 @@ sub read_ {
my @policy = get_config_file('policy', $ver);
$conf{log_net_drop} = @policy ? (any { $_->[0] eq 'net' && $_->[1] eq 'all' && $_->[2] eq 'DROP' && $_->[3] } @policy) : 1;
-
+
return \%conf;
-
- # get_zones has been moved to AdminPanel::Module::Firewall cause it requires
+
+ # get_zones has been moved to ManaTools::Module::Firewall cause it requires
# user interaction thus it should be logically separated by shorewall
# get_zones(\%conf);
# get_config_file('zones', $ver) && \%conf;
# consequently, to read shorewall conf
# you have to do something like this now (within Module::Firewall)
- # my $conf = AdminPanel::Shared::Shorewall::read_();
+ # my $conf = ManaTools::Shared::Shorewall::read_();
# OPTIONAL: my $self->get_zones(\$conf)
- # my $shorewall = AdminPanel::Shared::Shorewall::get_config_file('zones', '') && $conf;
+ # my $shorewall = ManaTools::Shared::Shorewall::get_config_file('zones', '') && $conf;
}
sub ports_by_proto {
@@ -144,7 +144,7 @@ sub ports_by_proto {
=head3 INPUT
$conf: HASH, contains the configuration to write
-
+
$action: Str, possible values are "keep" or "drop"
=head3 OUTPUT
@@ -159,12 +159,12 @@ the proper files.
=head3 NOTES
-if write_ is called without the $action parameter it can return 0
-(i.e. user interaction requested) when the firewall configuration
+if write_ is called without the $action parameter it can return 0
+(i.e. user interaction requested) when the firewall configuration
has been manually changed.
-In that case the developer will have to handle this request by providing
-two choices within the domain (keep | drop) and then recall write_ with
+In that case the developer will have to handle this request by providing
+two choices within the domain (keep | drop) and then recall write_ with
the choosen behaviour.
=cut
@@ -181,7 +181,7 @@ sub write_ {
my ($include_drakx, $other_rules) = partition { $_ eq "INCLUDE\trules.drakx\n" } grep { !/^(#|SECTION)/ } cat_("$::prefix${shorewall_root}${ver}/rules");
#- warn if the config is already in rules.drakx and additionnal rules are configured
if (!is_empty_array_ref($include_drakx) && !is_empty_array_ref($other_rules)) {
- if(!defined($action) || AdminPanel::Shared::trim($action) eq "")
+ if(!defined($action) || ManaTools::Shared::trim($action) eq "")
{
return 0; # user interaction requested
}
@@ -197,7 +197,7 @@ sub write_ {
my ($zone, $interface) = @_;
[ $zone, $interface, 'detect', if_(detect_devices::is_bridge_interface($interface), 'bridge') ];
};
-
+
set_config_file('zones', $ver,
if_($has_loc_zone, [ 'loc', 'ipv' . ($ver || '4') ]),
[ 'net', 'ipv' . ($ver || '4') ],
@@ -235,7 +235,7 @@ sub write_ {
));
set_config_file('masq', $ver, if_(exists $conf->{masq}, [ $conf->{masq}{net_interface}, $conf->{masq}{subnet} ]));
- my $services = AdminPanel::Shared::Services->new();
+ my $services = ManaTools::Shared::Services->new();
if ($conf->{disabled}) {
$services->disable('shorewall', $::isInstall);
run_program::rooted($::prefix, '/sbin/shorewall', 'clear') unless $::isInstall;
@@ -259,12 +259,12 @@ sub set_redirected_ports {
sub update_interfaces_list {
my ($o_intf) = @_;
if (!$o_intf || !member($o_intf, map { $_->[1] } get_config_file('interfaces'))) {
- my $shorewall = AdminPanel::Shared::Shorewall::read_();
- $shorewall && !$shorewall->{disabled} and AdminPanel::Shared::Shorewall::write_($shorewall);
+ my $shorewall = ManaTools::Shared::Shorewall::read_();
+ $shorewall && !$shorewall->{disabled} and ManaTools::Shared::Shorewall::write_($shorewall);
}
if (!$o_intf || !member($o_intf, map { $_->[1] } get_config_file('interfaces', 6))) {
- my $shorewall6 = AdminPanel::Shared::Shorewall::read_(undef, 6);
- $shorewall6 && !$shorewall6->{disabled} and AdminPanel::Shared::Shorewall::write_($shorewall6);
+ my $shorewall6 = ManaTools::Shared::Shorewall::read_(undef, 6);
+ $shorewall6 && !$shorewall6->{disabled} and ManaTools::Shared::Shorewall::write_($shorewall6);
}
}
diff --git a/lib/AdminPanel/Shared/TimeZone.pm b/lib/AdminPanel/Shared/TimeZone.pm
index 47a29af..efb49a2 100644
--- a/lib/AdminPanel/Shared/TimeZone.pm
+++ b/lib/AdminPanel/Shared/TimeZone.pm
@@ -1,15 +1,15 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::TimeZone;
+package ManaTools::Shared::TimeZone;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Shared::TimeZone - module to manage TimeZone settings
+ManaTools::Shared::TimeZone - module to manage TimeZone settings
=head1 SYNOPSIS
- my $tz = AdminPanel::Shared::TimeZone->new();
+ my $tz = ManaTools::Shared::TimeZone->new();
=head1 DESCRIPTION
@@ -20,7 +20,7 @@ This module allows to manage time zone settings.
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Shared::TimeZone
+perldoc ManaTools::Shared::TimeZone
=head1 AUTHOR
@@ -57,8 +57,8 @@ use Moose;
use DateTime::TimeZone;
use Net::DBus;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::Services;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::Services;
use MDK::Common::File qw(cat_ output_p substInFile);
use MDK::Common::Func qw(find if_);
@@ -191,7 +191,7 @@ has 'sh_services' => (
sub _SharedServicesInitialize {
my $self = shift();
- $self->sh_services(AdminPanel::Shared::Services->new() );
+ $self->sh_services(ManaTools::Shared::Services->new() );
}
@@ -250,7 +250,7 @@ sub _localeInitialize {
my $self = shift;
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'libDrakX') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'libDrakX') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -732,7 +732,7 @@ sub setNTPServer {
# TODO is that valid for any ntp program? adding ntp_service_name parameter
my $ntpd = $self->ntp_program . 'd';
- AdminPanel::Shared::disable_x_screensaver();
+ ManaTools::Shared::disable_x_screensaver();
if ($self->isNTPRunning()) {
$self->sh_services->stopService($ntpd);
}
@@ -766,7 +766,7 @@ sub setNTPServer {
$self->sh_services->startService($ntpd);
}
- AdminPanel::Shared::enable_x_screensaver();
+ ManaTools::Shared::enable_x_screensaver();
}
#=============================================================
diff --git a/lib/AdminPanel/Shared/Users.pm b/lib/AdminPanel/Shared/Users.pm
index dd759ee..83c6061 100644
--- a/lib/AdminPanel/Shared/Users.pm
+++ b/lib/AdminPanel/Shared/Users.pm
@@ -1,14 +1,14 @@
# vim: set et ts=4 sw=4:
-package AdminPanel::Shared::Users;
+package ManaTools::Shared::Users;
#============================================================= -*-perl-*-
=head1 NAME
-AdminPanel::Shared::Users - backend to manage users
+ManaTools::Shared::Users - backend to manage users
=head1 SYNOPSIS
- my $userBackEnd = AdminPanel::Shared::Users->new();
+ my $userBackEnd = ManaTools::Shared::Users->new();
my $userInfo = $userManager->getUserInfo('username');
=head1 DESCRIPTION
@@ -20,7 +20,7 @@ This module gives a low level access to the system user management it uses libUS
You can find documentation for this module with the perldoc command:
-perldoc AdminPanel::Shared::Users
+perldoc ManaTools::Shared::Users
=head1 SEE ALSO
@@ -66,8 +66,8 @@ use USER;
use English;
use POSIX qw/ceil/;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared;
#=============================================================
@@ -119,7 +119,7 @@ sub _localeInitialize {
my $self = shift();
# TODO fix domain binding for translation
- $self->loc(AdminPanel::Shared::Locales->new(domain_name => 'userdrake') );
+ $self->loc(ManaTools::Shared::Locales->new(domain_name => 'userdrake') );
# TODO if we want to give the opportunity to test locally add dir_name => 'path'
}
@@ -275,7 +275,7 @@ sub face2png {
=head3 DESCRIPTION
- Retrieves the list of icon name from facesdir()
+ Retrieves the list of icon name from facesdir()
=cut
@@ -304,7 +304,7 @@ sub facenames {
=head3 DESCRIPTION
- Add a $user named icon to $self->user_face_dir. It just copies
+ Add a $user named icon to $self->user_face_dir. It just copies
$icon to $self->user_face_dir, naming it as $user
=cut
@@ -461,7 +461,7 @@ sub updateOrDelUserInGroup {
my $groups = $self->ctx->GroupsEnumerateFull;
foreach my $g (@$groups) {
my $members = $g->MemberName(1, 0);
- if (AdminPanel::Shared::inArray($name, $members)) {
+ if (ManaTools::Shared::inArray($name, $members)) {
eval { $g->MemberName($name, 2) };
eval { $self->ctx->GroupModify($g) };
}
@@ -801,14 +801,14 @@ sub modifyGroup {
my $ugid = $uEnt->Gid($self->USER_GetValue);
my $m = $self->ctx->EnumerateUsersByGroup($orig_groupname);
if (MDK::Common::DataStructure::member($user, @{$members})) {
- if (!AdminPanel::Shared::inArray($user, $m)) {
+ if (!ManaTools::Shared::inArray($user, $m)) {
if ($ugid != $gid) {
eval { $groupEnt->MemberName($user, 1) };
}
}
}
else {
- if (AdminPanel::Shared::inArray($user, $m)) {
+ if (ManaTools::Shared::inArray($user, $m)) {
if ($ugid == $gid) {
return {
status => 0,
@@ -1302,13 +1302,13 @@ sub modifyUser {
my $ugid = $gEnt->Gid($self->USER_GetValue);
my $m = $gEnt->MemberName(1,0);
if (MDK::Common::DataStructure::member($group, @$members)) {
- if (!AdminPanel::Shared::inArray($username, $m) && $userInfo->{gid} != $ugid) {
+ if (!ManaTools::Shared::inArray($username, $m) && $userInfo->{gid} != $ugid) {
eval { $gEnt->MemberName($username, 1) };
$self->ctx->GroupModify($gEnt);
}
}
else {
- if (AdminPanel::Shared::inArray($username, $m)) {
+ if (ManaTools::Shared::inArray($username, $m)) {
eval { $gEnt->MemberName($username, 2) };
$self->ctx->GroupModify($gEnt);
}
@@ -1463,16 +1463,16 @@ sub GetFaceIcon {
my $i;
my $current_icon;
# remove shortcut "&" from label
- $name =~ s/&// if ($name);
+ $name =~ s/&// if ($name);
my $user_icon = $self->user_face_dir . $name . ".png" if ($name);
if ($name) {
$user_icon = $self->face2png($name) unless(-e $user_icon);
}
if ($name && -e $user_icon) {
- my $current_md5 = AdminPanel::Shared::md5sum($user_icon);
+ my $current_md5 = ManaTools::Shared::md5sum($user_icon);
my $found = 0;
for ($i = 0; $i < scalar(@$icons); $i++) {
- if (AdminPanel::Shared::md5sum($self->face2png($icons->[$i])) eq $current_md5) {
+ if (ManaTools::Shared::md5sum($self->face2png($icons->[$i])) eq $current_md5) {
$found = 1;
last;
}
@@ -1518,9 +1518,9 @@ sub GetFaceIcon {
#=============================================================
sub strongPassword {
my ($self, $passwd, $threshold) = @_;
-
+
return 0 if !$passwd;
-
+
my $pwdm = $threshold ? Data::Password::Meter->new($threshold) : Data::Password::Meter->new();
# Check a password
diff --git a/lib/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm
index 98e5d27..ecdf06f 100644
--- a/lib/AdminPanel/rpmdragora.pm
+++ b/lib/AdminPanel/rpmdragora.pm
@@ -24,7 +24,7 @@
#
# $Id: rpmdragora.pm 267936 2010-04-26 16:40:21Z jvictor $
-package AdminPanel::rpmdragora;
+package ManaTools::rpmdragora;
use warnings::register;
use urpm;
@@ -49,9 +49,9 @@ use POSIX qw(_exit);
use feature 'state';
-use AdminPanel::Shared;
-use AdminPanel::Shared::Locales;
-use AdminPanel::Shared::GUI;
+use ManaTools::Shared;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::GUI;
use Carp;
@@ -121,7 +121,7 @@ use Glib;
#ugtk2::add_icon_path('/usr/share/rpmdragora/icons');
# Locale::gettext::bind_textdomain_codeset('rpmdragora', 'UTF8');
-my $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake');;
+my $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake');;
our $mageia_release = MDK::Common::File::cat_(
-e '/etc/mageia-release' ? '/etc/mageia-release' : '/etc/release'
@@ -139,7 +139,7 @@ our $myname_update = $branded ? $loc->N_("Software Update") : $loc->N_("Mageia U
sub locale() {
if (!defined($loc)) {
- $loc = AdminPanel::Shared::Locales->new(domain_name => 'rpmdrake');
+ $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake');
}
return $loc;
@@ -182,7 +182,7 @@ sub myexit {
my ($root) = grep { $_->[2] == 0 } list_passwd();
$ENV{HOME} = $> == 0 ? $root->[7] : $ENV{HOME} || '/root';
-$ENV{HOME} = $::env if $::env = $AdminPanel::Rpmdragora::init::rpmdragora_options{env}[0];
+$ENV{HOME} = $::env if $::env = $ManaTools::Rpmdragora::init::rpmdragora_options{env}[0];
our $configfile = "$ENV{HOME}/.rpmdragora";
@@ -237,7 +237,7 @@ sub readconf() {
}
# special cases:
$::rpmdragora_options{'no-confirmation'} = $no_confirmation->[0] if !defined $::rpmdragora_options{'no-confirmation'};
- $AdminPanel::Rpmdragora::init::default_list_mode = $tree_mode->[0] if ref $tree_mode && !$AdminPanel::Rpmdragora::init::overriding_config;
+ $ManaTools::Rpmdragora::init::default_list_mode = $tree_mode->[0] if ref $tree_mode && !$ManaTools::Rpmdragora::init::overriding_config;
}
sub writeconf() {
@@ -962,7 +962,7 @@ sub update_sources_noninteractive {
sub add_distrib_update_media {
my ($urpm, $mirror, %options) = @_;
#- ensure a unique medium name
- my $medium_name = $AdminPanel::rpmdragora::mageia_release =~ /(\d+\.\d+) \((\w+)\)/ ? $2 . $1 . '-' : 'distrib';
+ my $medium_name = $ManaTools::rpmdragora::mageia_release =~ /(\d+\.\d+) \((\w+)\)/ ? $2 . $1 . '-' : 'distrib';
my $initial_number = 1 + max map { $_->{name} =~ /\(\Q$medium_name\E(\d+)\b/ ? $1 : 0 } @{$urpm->{media}};
add_medium_and_check(
$urpm,
@@ -1021,7 +1021,7 @@ by Mageia Official Updates.")), %options
my @mirrorlist = map {$_->{country} . "|" . $_->{url}} @mirrors;
- my $sh_gui = AdminPanel::Shared::GUI->new();
+ my $sh_gui = ManaTools::Shared::GUI->new();
my $mirror = $sh_gui->ask_fromTreeList({title => $loc->N("Mirror choice"),
header => $loc->N("Please choose the desired mirror."),
default_button => 1,
@@ -1091,18 +1091,18 @@ sub mirrors {
$id and statusbar_msg_remove($id);
};
- require AdminPanel::Rpmdragora::gurpm;
- require AdminPanel::Rpmdragora::pkg;
+ require ManaTools::Rpmdragora::gurpm;
+ require ManaTools::Rpmdragora::pkg;
my $res = urpm::download::sync_url($urpm, $url,
dir => $cachedir,
callback => sub {
$gurpm ||=
- AdminPanel::Rpmdragora::gurpm->new(
+ ManaTools::Rpmdragora::gurpm->new(
text => $loc->N("Please wait"),
);
$canceled ||=
- !AdminPanel::Rpmdragora::pkg::download_callback($gurpm, @_);
+ !ManaTools::Rpmdragora::pkg::download_callback($gurpm, @_);
$gurpm->flush();
},
);
@@ -1111,8 +1111,8 @@ sub mirrors {
});
my @mirrors = @{ mirror::list(urpm::mirrors::parse_LDAP_namespace_structure(MDK::Common::File::cat_('/etc/product.id')), 'distrib') || [] };
- require AdminPanel::Shared::TimeZone;
- my $tzo = AdminPanel::Shared::TimeZone->new();
+ require ManaTools::Shared::TimeZone;
+ my $tzo = ManaTools::Shared::TimeZone->new();
my $tz = $tzo->readConfiguration()->{ZONE};
foreach my $mirror (@mirrors) {
my $goodness = 0;
@@ -1140,16 +1140,16 @@ sub mirrors {
sub open_help {
my ($mode) = @_;
- require AdminPanel::Shared::RunProgram;
- AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'drakhelp', '--id', $mode ? "software-management-$mode" : 'software-management');
+ require ManaTools::Shared::RunProgram;
+ ManaTools::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'drakhelp', '--id', $mode ? "software-management-$mode" : 'software-management');
my $_s = $loc->N("Help launched in background");
statusbar_msg($loc->N("The help window has been started, it should appear shortly on your desktop."), 1);
}
sub run_drakbug {
my ($id) = @_;
- require AdminPanel::Shared::RunProgram;
- AdminPanel::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'drakbug', '--report', $id);
+ require ManaTools::Shared::RunProgram;
+ ManaTools::Shared::RunProgram::raw({ detach => 1, as_user => 1 }, 'drakbug', '--report', $id);
}
#mygtk2::add_icon_path('/usr/share/mcc/themes/default/');