summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakTermServ
diff options
context:
space:
mode:
authorStew Benedict <stewb@mandriva.org>2003-02-20 20:49:39 +0000
committerStew Benedict <stewb@mandriva.org>2003-02-20 20:49:39 +0000
commit46f4f36589a297c6c0db311e003bb49743ee36eb (patch)
tree22bf5e9db212774daa87d24243363d4324a1e132 /perl-install/standalone/drakTermServ
parentb2e3d4b89bdc2c8de7f400ef8cd036f44fa63be3 (diff)
downloaddrakx-46f4f36589a297c6c0db311e003bb49743ee36eb.tar
drakx-46f4f36589a297c6c0db311e003bb49743ee36eb.tar.gz
drakx-46f4f36589a297c6c0db311e003bb49743ee36eb.tar.bz2
drakx-46f4f36589a297c6c0db311e003bb49743ee36eb.tar.xz
drakx-46f4f36589a297c6c0db311e003bb49743ee36eb.zip
Finish gtk2 port.
Diffstat (limited to 'perl-install/standalone/drakTermServ')
-rwxr-xr-xperl-install/standalone/drakTermServ40
1 files changed, 23 insertions, 17 deletions
diff --git a/perl-install/standalone/drakTermServ b/perl-install/standalone/drakTermServ
index b723b8588..eaf9569a5 100755
--- a/perl-install/standalone/drakTermServ
+++ b/perl-install/standalone/drakTermServ
@@ -525,27 +525,28 @@ sub make_nbi {
my $t_kernel = Gtk2::TreeIter->new;
$model->append($t_kernel, undef);
$model->set($t_kernel, [ 0 => $_ ]);
-
-# FIXME - SIGNAL
- #gtksignal_connect($t_kernel, select => sub { $kernel = $t;
- # $nic = '' });
-
my $k_detail = Gtk2::TreeIter->new;
foreach (@nics) {
$model->append($k_detail, $t_kernel);
$model->set($k_detail, [ 0 => $_ ]);
-# FIXME - SIGNAL
- # gtksignal_connect($k_det_nic, select => sub { $nic = $m;
- # $kernel = $t });
}
$k_detail->free;
}
$tree_kernels->get_selection->signal_connect(changed => sub {
+ $kernel = '';
+ $nic = '';
my ($model, $iter) = $_[0]->get_selected;
$model && $iter or return;
- my $kernel = $model->get($iter, 0);
-print "$model, $kernel\n";
+ my $value = $model->get($iter, 0);
+ my $path = $model->get_path_str($iter);
+ if ( $path !~ /:/ ) {
+ $kernel = $value;
+ } else {
+ my @elements = split(/:/, $path);
+ $nic = $value;
+ $kernel = $kernels[$elements[0]];
+ }
});
# existing nbi images in list
@@ -730,13 +731,14 @@ sub maintain_clients {
my $client_box;
my %clients = read_dhcpd_conf();
my $client;
+ my $citer;
#- client info in tree view
my $model = Gtk2::TreeStore->new(Gtk2::GType->STRING);
my $tree_clients = Gtk2::TreeView->new_with_model($model);
$tree_clients->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
$tree_clients->set_headers_visible(0);
- $tree_clients->get_selection->set_mode('single');
+ $tree_clients->get_selection->set_mode('browse');
foreach my $key (keys(%clients)) {
my $t_client = Gtk2::TreeIter->new;
@@ -763,7 +765,14 @@ sub maintain_clients {
$tree_clients->get_selection->signal_connect(changed => sub {
my ($model, $iter) = $_[0]->get_selected;
$model && $iter or return;
- $client = $model->get($iter, 0);
+ my $value = $model->get($iter, 0);
+ my $path = $model->get_path_str($iter);
+ if ( $path !~ /:/ ) {
+ $client = $value;
+ $citer = $iter;
+ } else {
+ $client = '';
+ }
});
#- entry boxes for client data entry
@@ -863,16 +872,13 @@ sub maintain_clients {
$entry_nbi->entry->set_text($clients{$client}{filename});
my $result = delclient(0, $client);
if ($result eq 0) {
-
-# FIXME
-# $model->remove($iter);
+ $model->remove($citer);
}
}),
gtksignal_connect(new Gtk2::Button(N("Delete Client")), clicked =>
sub { my $result = delclient(0, $client);
if ($result eq 0) {
-# FIXME
-# $tree_clients->remove_items($tree_clients->selection);
+ $model->remove($citer);
}
}),
gtksignal_connect(new Gtk2::Button(N("dhcpd Config...")), clicked =>