App/Chart/Manual.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« App/Chart/Gtk2/WatchlistModel.pm ↑ Summary App/Chart/SymbolMatch.pm »
1 # Copyright 2007, 2008, 2009, 2010, 2011, 2016 Kevin Ryde
2  
3 # This file is part of Chart.
4 #
5 # Chart is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3, or (at your option) any later version.
8 #
9 # Chart is distributed in the hope that it will be useful, but WITHOUT ANY
10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 # details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with Chart. If not, see <http://www.gnu.org/licenses/>.
16  
17 package App::Chart::Manual;
18 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 # use Locale::TextDomain ('App-Chart');
22  
23 0 ▶use App::Chart;
Subroutine BEGIN: called CC=1 SCAR=2.6
24  
25 sub open {
26 my ($class, $node, $parent_widget) = @_;
27 my $uri;
28 if (defined $node && $node =~ /^http:/) {
29 $uri = $node;
30 } else {
31 require URI::file;
32 $uri = URI::file->new (App::Chart::datafilename('doc', 'chart.html'));
33 if (defined $node) {
34 require App::Chart::Texinfo::Util;
35 $uri->fragment (App::Chart::Texinfo::Util::node_to_html_anchor($node));
36 }
37 }
38 require App::Chart::Gtk2::GUI;
39 App::Chart::Gtk2::GUI::browser_open ($uri, $parent_widget);
40 }
41  
42 sub open_for_symbol {
43 my ($class, $symbol, $parent_widget) = @_;
44 my $node = App::Chart::symbol_source_help ($symbol);
45 if (defined $node) {
46 $class->open ($node, $parent_widget);
47 } else {
48 if ($parent_widget) {
49 $parent_widget->error_bell;
50 } elsif (Gtk2::Gdk::Display->can('get_default')) {
51 Gtk2::Gdk::Display->get_default->beep;
52 }
53 }
54 }
55  
56 1;
57 __END__
« App/Chart/Gtk2/WatchlistModel.pm ↑ Summary App/Chart/SymbolMatch.pm »