From 63c12de3bbda3244da831bcb9ff96176d3b860cf Mon Sep 17 00:00:00 2001 From: matteo Date: Sun, 7 Feb 2021 02:21:32 +0100 Subject: revert previous commit because it invalidates polkit action --- lib/ManaTools/Module/Hosts.pm | 59 +------------------------------------------ 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/lib/ManaTools/Module/Hosts.pm b/lib/ManaTools/Module/Hosts.pm index 4c353c13..25b779e2 100644 --- a/lib/ManaTools/Module/Hosts.pm +++ b/lib/ManaTools/Module/Hosts.pm @@ -21,7 +21,6 @@ package ManaTools::Module::Hosts; use Modern::Perl '2011'; -use English; use autodie; use Moose; use POSIX qw(ceil); @@ -95,15 +94,7 @@ sub _SharedUGUIInitialize { sub start { my $self = shift; - my $login = (getpwuid $>); - if ($login ne 'root') - { - $self->_warningMissingPrivileges(); - } - else - { - $self->_manageHostsDialog(); - } + $self->_manageHostsDialog(); }; #============================================================= @@ -394,54 +385,6 @@ sub setupTable { } } -sub _warningMissingPrivileges{ - my $self = shift; - - my $appTitle = yui::YUI::app()->applicationTitle(); - my $appIcon = yui::YUI::app()->applicationIcon(); - ## set new title to get it in dialog - my $newTitle = $self->loc->N("Need administrator privileges"); - - my $factory = yui::YUI::widgetFactory; - my $optional = yui::YUI::optionalWidgetFactory; - -## TODO remove title and icon when using Shared::Module::GUI::Dialog - ## 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()); - - $self->dialog($factory->createMainDialog()); - my $layout = $factory->createVBox($self->dialog); - - my $hbox_header = $factory->createHBox($layout); - my $labelAppDescription = $factory->createLabel($hbox_header,$newTitle); - $labelAppDescription->setWeight($yui::YD_HORIZ,0); - my $hbox_foot = $factory->createHBox($layout); - my $okButton = $factory->createPushButton($hbox_foot,$self->loc->N("&OK")); - - # main loop - while(1) { - my $event = $self->dialog->waitForEvent(); - my $eventType = $event->eventType(); - - #event type checking - if ($eventType == $yui::YEvent::CancelEvent) { - last; - } - elsif ($eventType == $yui::YEvent::WidgetEvent) { - my $widget = $event->widget(); - if ($widget == $okButton) { - last; - } - } - } - $self->dialog->destroy() ; - - #restore old application title - yui::YUI::app()->setApplicationTitle($appTitle); -} - sub _manageHostsDialog { my $self = shift; -- cgit v1.2.1