line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of the GNU General Public License |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# (C) Paul Evans, 2017 -- leonerd@leonerd.org.uk |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Circle::Net; |
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
94
|
|
8
|
4
|
|
|
4
|
|
13
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
85
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
13
|
use base qw( Tangence::Object Circle::WindowItem ); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
1050
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub set_network_status |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my ( $status ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
$self->{status} = $status; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $text = $self->get_prop_tag; |
20
|
0
|
0
|
|
|
|
|
$text .= "[$self->{status}]" if length $self->{status}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
$self->{widget_netname}->set_prop_text( $text ) if $self->{widget_netname}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get_widget_netname |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
0
|
|
|
|
return $self->{widget_netname} ||= do { |
30
|
0
|
|
|
|
|
|
my $registry = $self->{registry}; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $widget = $registry->construct( |
33
|
|
|
|
|
|
|
"Circle::Widget::Label", |
34
|
|
|
|
|
|
|
classes => [qw( netname )], |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
$self->watch_property( "tag", |
37
|
|
|
|
|
|
|
on_updated => sub { |
38
|
0
|
|
|
0
|
|
|
my $text = $_[1]; |
39
|
0
|
0
|
|
|
|
|
$text .= "[$self->{status}]" if length $self->{status}; |
40
|
0
|
|
|
|
|
|
$widget->set_prop_text( $text ); |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
); |
43
|
0
|
|
|
|
|
|
$widget; |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
0x55AA; |