diff options
author | Matteo Pasotti <matteo.pasotti@gmail.com> | 2014-01-25 00:27:31 +0100 |
---|---|---|
committer | Matteo Pasotti <matteo.pasotti@gmail.com> | 2014-01-25 00:27:31 +0100 |
commit | db7cd49a868a49e46e35190f4ed73a197c8b892a (patch) | |
tree | e398457d831b5193e563580fdab7d93a94dcc56d | |
parent | 97d9107d09e7112c012bd3637e30e0821b5f6885 (diff) | |
download | manatools-db7cd49a868a49e46e35190f4ed73a197c8b892a.tar manatools-db7cd49a868a49e46e35190f4ed73a197c8b892a.tar.gz manatools-db7cd49a868a49e46e35190f4ed73a197c8b892a.tar.bz2 manatools-db7cd49a868a49e46e35190f4ed73a197c8b892a.tar.xz manatools-db7cd49a868a49e46e35190f4ed73a197c8b892a.zip |
asking confirmation before dropping the selected host; writing changes when pressing the ok button
-rw-r--r-- | AdminPanel/Hosts/GHosts.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/AdminPanel/Hosts/GHosts.pm b/AdminPanel/Hosts/GHosts.pm index 91959297..d55daaf1 100644 --- a/AdminPanel/Hosts/GHosts.pm +++ b/AdminPanel/Hosts/GHosts.pm @@ -28,7 +28,7 @@ use utf8; use Glib; use yui; -#use AdminPanel::Shared; +use AdminPanel::Shared; use AdminPanel::Hosts::hosts; =head1 VERSION @@ -174,7 +174,6 @@ sub setupTable { $tblItem = new yui::YTableItem($host->{'ip'},$host->{'hosts'}[0],$aliases); $self->table->addItem($tblItem); } - } sub manageHostsDialog { @@ -256,6 +255,15 @@ sub manageHostsDialog { } elsif ($widget == $remButton) { # implement deletion dialog + if(AdminPanel::Shared::ask_YesOrNo("Confirmation","Are you sure to drop this host?") == 1){ + my $tblItem = yui::toYTableItem($self->table->selectedItem()); + # drop the host using the ip + $self->cfgHosts->_dropHost($tblItem->cell(0)->label()); + } + }elsif ($widget == $okButton) { + # write changes + $self->cfgHosts->_writeHosts(); + last; } } } |