diff options
author | matteo <matteo.pasotti@gmaail.com> | 2021-02-07 02:21:32 +0100 |
---|---|---|
committer | matteo <matteo.pasotti@gmaail.com> | 2021-02-07 02:21:32 +0100 |
commit | 63c12de3bbda3244da831bcb9ff96176d3b860cf (patch) | |
tree | 6c6c95828254a6f26b51a6e5e24e95f197793823 /lib/ManaTools/Module | |
parent | 4c828088319db0a951b3120cfe6ce244740becd3 (diff) | |
download | manatools-63c12de3bbda3244da831bcb9ff96176d3b860cf.tar manatools-63c12de3bbda3244da831bcb9ff96176d3b860cf.tar.gz manatools-63c12de3bbda3244da831bcb9ff96176d3b860cf.tar.bz2 manatools-63c12de3bbda3244da831bcb9ff96176d3b860cf.tar.xz manatools-63c12de3bbda3244da831bcb9ff96176d3b860cf.zip |
revert previous commit because it invalidates polkit action
Diffstat (limited to 'lib/ManaTools/Module')
-rw-r--r-- | lib/ManaTools/Module/Hosts.pm | 59 |
1 files changed, 1 insertions, 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; |