From c60e1443cfda6a19427d75490de054158a33b328 Mon Sep 17 00:00:00 2001 From: etienne Date: Wed, 31 Jan 2018 15:52:42 +0000 Subject: Possibilite' d'elargir la frame Applications. Corrections concernant : . la navigation dans l'historique des saisies (abonnements, recherche, envoi de msg);. la gestion des agents connectes : quand un agent UNTEL se connectait, le premier agent de la liste dont le nom commencait par UNTEL disparaissait. --- src/ivymon | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/ivymon b/src/ivymon index debb7dc..8f1e02c 100755 --- a/src/ivymon +++ b/src/ivymon @@ -94,7 +94,7 @@ use Tk::CmdLine; use vars qw/$VERSION $opt_help $opt_b $opt_bus $opt_history @opt_bind $opt_verbose @opt_send $opt_size $opt_undersize $opt_out $opt_debug $opt_buf/; # **** VERSION **** -$VERSION = '1.27'; # TODO a modifier +$VERSION = '1.29'; # TODO a modifier # options initialisation # geometry @@ -427,13 +427,28 @@ $bindingsEnlargeBtn->configure(-relief => 'flat', } }); my $clients_fm = - $bottom_fm->LabFrame(-label => 'Applications : ', + $bottom_fm->eLabFrame(-label => 'Applications : ', + -buttonbmp => $enlargebmp, -labelside => 'acrosstop', -borderwidth => 3)->pack(-fill => 'both', -side => 'left', -expand => 0, -padx => 5*$coef, ); +my $clientsEnlargeBtn = $clients_fm->Subwidget('button'); +$clientsEnlargeBtn->{enlarge} = 0; +$clientsEnlargeBtn->configure(-relief => 'flat', + -command => sub { + if ($clientsEnlargeBtn->{enlarge}) { + &shrink_clientsfm; + $clientsEnlargeBtn->{enlarge} = 0; + $clientsEnlargeBtn->configure(-image => $enlargebmp); + } else { + &enlarge_clientsfm; + $clientsEnlargeBtn->{enlarge} = 1; + $clientsEnlargeBtn->configure(-image => $shrinkbmp); + } + }); my $send_fm = $bottom_fm->eLabFrame(-label => ' Messages to send : ', -buttonbmp => $enlargebmp, @@ -1287,7 +1302,7 @@ sub removeClient { $host = $hostname if $host eq 'localhost' or $host =~ /^$hostname\./; $connectedClients{$client}->{$host}-- if $connectedClients{$client}->{$host} > 0; - my $num = 0; + my $num = 0; # nombre d'agents $client connectes for my $host ((keys(%{$connectedClients{$client}}))) { $num += $connectedClients{$client}->{$host}; } @@ -1303,13 +1318,13 @@ sub manageClient { my $i = 0; for ($clientsListbox->get(0, 'end')) { - if ($_ =~ /^$client/ or $_ =~ /-- $client/) { + if ($_ =~ /^$client on/ or $_ =~ /-- $client died/) { $clientsListbox->delete($i); last; } $i++; } - my $num = 0; + my $num = 0; # nombre d'agents $client connectes for (values(%{$connectedClients{$client}})) { $num += $_; } @@ -1942,6 +1957,7 @@ sub bindHistoryGenList { return if $bindHistory{$string}; $bindHistory{$string} = 1; push(@bindHistory, $string); + $bindHistoryIndex = $#bindHistory; } # end bindHistoryGenList @@ -2060,6 +2076,7 @@ sub sendHistoryGenList { return if $sendHistory{$string}; $sendHistory{$string} = 1; push(@sendHistory, $string); + $sendHistoryIndex = $#sendHistory; } # end sendHistoryGenList @@ -2145,6 +2162,7 @@ sub searchHistoryGenList { return if $searchHistory{$string}; $searchHistory{$string} = 1; push(@searchHistory, $string); + $searchHistoryIndex = $#searchHistory; } # end searchHistoryGenList @@ -2882,6 +2900,28 @@ sub shrink_sendfm { } # end shrink_sendfm +sub enlarge_clientsfm { + + @packinfo = (); + push(@packinfo, [$bindings_fm->packInfo]); + push(@packinfo, [$clients_fm->packInfo]); + push(@packinfo, [$send_fm->packInfo]); + push(@packinfo, [$searchandcontrol_fm->packInfo]); + $clients_fm->pack(-expand => 1); + $send_fm->packForget; + +} # end enlarge_clientsfm + + +sub shrink_clientsfm { + + $clients_fm->packForget; + $clients_fm->pack(@{$packinfo[1]}); + $send_fm->pack(@{$packinfo[2]}); + +} # end shrink_clientsfm + + sub wheelmousebindings { my $w = shift; my $count = shift; -- cgit v1.1