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
|
|
38
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
95
|
|
8
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
106
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
16
|
use base qw( Tangence::Object Circle::WindowItem ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1462
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.173320'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub set_network_status |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
17
|
0
|
|
|
|
|
|
my ( $status ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$self->{status} = $status; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $text = $self->get_prop_tag; |
22
|
0
|
0
|
|
|
|
|
$text .= "[$self->{status}]" if length $self->{status}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
$self->{widget_netname}->set_prop_text( $text ) if $self->{widget_netname}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_widget_netname |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
0
|
|
|
|
return $self->{widget_netname} ||= do { |
32
|
0
|
|
|
|
|
|
my $registry = $self->{registry}; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $widget = $registry->construct( |
35
|
|
|
|
|
|
|
"Circle::Widget::Label", |
36
|
|
|
|
|
|
|
classes => [qw( netname )], |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
$self->watch_property( "tag", |
39
|
|
|
|
|
|
|
on_updated => sub { |
40
|
0
|
|
|
0
|
|
|
my $text = $_[1]; |
41
|
0
|
0
|
|
|
|
|
$text .= "[$self->{status}]" if length $self->{status}; |
42
|
0
|
|
|
|
|
|
$widget->set_prop_text( $text ); |
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
); |
45
|
0
|
|
|
|
|
|
$widget; |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
0x55AA; |