| 1 | package UI::Dialog::Backend::KDialog; | ||||||||||||||||||||||||||||||
| 2 | ############################################################################### | ||||||||||||||||||||||||||||||
| 3 | # Copyright (C) 2004-2016 Kevin C. Krinke <kevin@krinke.ca> | ||||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||||
| 5 | # This library is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||||
| 6 | # modify it under the terms of the GNU Lesser General Public | ||||||||||||||||||||||||||||||
| 7 | # License as published by the Free Software Foundation; either | ||||||||||||||||||||||||||||||
| 8 | # version 2.1 of the License, or (at your option) any later version. | ||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||
| 10 | # This library is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||||
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||||
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||||||||||||||||||||||||||||
| 13 | # Lesser General Public License for more details. | ||||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||||
| 15 | # You should have received a copy of the GNU Lesser General Public | ||||||||||||||||||||||||||||||
| 16 | # License along with this library; if not, write to the Free Software | ||||||||||||||||||||||||||||||
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||||||||||||||||||||||||||||
| 18 | ############################################################################### | ||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use 5.006; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Cwd qw( abs_path ); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 24 | 2 | ▶ | use UI::Dialog::Backend; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||
| 26 | BEGIN { | ||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | use vars qw( $VERSION @ISA ); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 28 | 2 | ▶ | @ISA = qw( UI::Dialog::Backend ); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 29 | 2 | $VERSION = '1.20'; | |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||
| 32 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||
| 33 | #: Constructor Method | ||||||||||||||||||||||||||||||
| 34 | #: | ||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||
| 36 | sub new { | ||||||||||||||||||||||||||||||
| 37 | 1 | ▶ | my $proto = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
new: called CC=31 SCAR=48.3
Pod
documented
| |||||||||||||||||||||||||||||||
| 38 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | my $cfg = ((ref($_[0]) eq "HASH") ? $_[0] : (@_) ? { @_ } : {}); | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 40 | 1 | my $self = {}; | |||||||||||||||||||||||||||||
| 41 | 1 | bless($self, $class); | |||||||||||||||||||||||||||||
| 42 | 1 | $self->{'_state'} = {}; | |||||||||||||||||||||||||||||
| 43 | 1 | $self->{'_opts'} = {}; | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||
| 45 | #: Dynamic path discovery... | ||||||||||||||||||||||||||||||
| 46 | 1 | my $CFG_PATH = $cfg->{'PATH'}; | |||||||||||||||||||||||||||||
| 47 | 1 | ▶ | if ($CFG_PATH) { | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | if (ref($CFG_PATH) eq "ARRAY") { | ||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||
| 49 | 0 | $self->{'PATHS'} = $CFG_PATH; | |||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||
| 51 | elsif ($CFG_PATH =~ m!:!) { | ||||||||||||||||||||||||||||||
| 52 | 0 | $self->{'PATHS'} = [ split(/:/,$CFG_PATH) ]; | |||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||
| 54 | elsif (-d $CFG_PATH) { | ||||||||||||||||||||||||||||||
| 55 | 0 | $self->{'PATHS'} = [ $CFG_PATH ]; | |||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||
| 58 | elsif ($ENV{'PATH'}) { | ||||||||||||||||||||||||||||||
| 59 | 1 | $self->{'PATHS'} = [ split(/:/,$ENV{'PATH'}) ]; | |||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||
| 61 | else { | ||||||||||||||||||||||||||||||
| 62 | 0 | $self->{'PATHS'} = ''; | |||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||
| 65 | 1 | ▶ | $self->{'_opts'}->{'literal'} = $cfg->{'literal'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'literal'} || 0
MC/DC0%0/1
$cfg->{'literal'} || 0
$cfg->{'literal'}
Truth table50%1/2
A
A= $cfg->{'literal'}
| |||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | $self->{'_opts'}->{'callbacks'} = $cfg->{'callbacks'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'callbacks'} || undef()
MC/DC0%0/1
$cfg->{'callbacks'} || undef()
$cfg->{'callbacks'}
Truth table50%1/2
A
A= $cfg->{'callbacks'}
| |||||||||||||||||||||||||||||||
| 67 | 1 | ▶ | $self->{'_opts'}->{'debug'} = $cfg->{'debug'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'debug'} || undef()
MC/DC0%0/1
$cfg->{'debug'} || undef()
$cfg->{'debug'}
Truth table50%1/2
A
A= $cfg->{'debug'}
| |||||||||||||||||||||||||||||||
| 68 | 1 | ▶ | $self->{'_opts'}->{'caption'} = $cfg->{'caption'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'caption'} || undef()
MC/DC0%0/1
$cfg->{'caption'} || undef()
$cfg->{'caption'}
Truth table50%1/2
A
A= $cfg->{'caption'}
| |||||||||||||||||||||||||||||||
| 69 | 1 | ▶ | $self->{'_opts'}->{'icon'} = $cfg->{'icon'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'icon'} || undef()
MC/DC0%0/1
$cfg->{'icon'} || undef()
$cfg->{'icon'}
Truth table50%1/2
A
A= $cfg->{'icon'}
| |||||||||||||||||||||||||||||||
| 70 | 1 | ▶ | $self->{'_opts'}->{'miniicon'} = $cfg->{'miniicon'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'miniicon'} || undef()
MC/DC0%0/1
$cfg->{'miniicon'} || undef()
$cfg->{'miniicon'}
Truth table50%1/2
A
A= $cfg->{'miniicon'}
| |||||||||||||||||||||||||||||||
| 71 | 1 | ▶ | $self->{'_opts'}->{'title'} = $cfg->{'title'} || undef(); | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'title'} || undef()
MC/DC0%0/1
$cfg->{'title'} || undef()
$cfg->{'title'}
Truth table50%1/2
A
A= $cfg->{'title'}
| |||||||||||||||||||||||||||||||
| 72 | 1 | ▶ | $self->{'_opts'}->{'width'} = $cfg->{'width'} || 65; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'width'} || 65
MC/DC0%0/1
$cfg->{'width'} || 65
$cfg->{'width'}
Truth table50%1/2
A
A= $cfg->{'width'}
| |||||||||||||||||||||||||||||||
| 73 | 1 | ▶ | $self->{'_opts'}->{'height'} = $cfg->{'height'} || 10; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'height'} || 10
MC/DC0%0/1
$cfg->{'height'} || 10
$cfg->{'height'}
Truth table50%1/2
A
A= $cfg->{'height'}
| |||||||||||||||||||||||||||||||
| 74 | 1 | ▶ | $self->{'_opts'}->{'bin'} ||= $self->_find_bin('kdialog'); | ||||||||||||||||||||||||||||
|
Condition33%1/3
$self->{"_opts"}{"bin"} ||= $self->_find_bin("kdialog")
MC/DC0%0/2
$self->{"_opts"}{"bin"} ||= $self->_find_bin("kdialog")
$self->{"_opts"}{"bin"}
$self->_find_bin("kdialog")
Truth table33%1/3
A ||= B
A= $self->{"_opts"}{"bin"}B= $self->_find_bin("kdialog")
| |||||||||||||||||||||||||||||||
| 75 | 1 | ▶ | $self->{'_opts'}->{'autoclear'} = $cfg->{'autoclear'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'autoclear'} || 0
MC/DC0%0/1
$cfg->{'autoclear'} || 0
$cfg->{'autoclear'}
Truth table50%1/2
A
A= $cfg->{'autoclear'}
| |||||||||||||||||||||||||||||||
| 76 | 1 | ▶ | $self->{'_opts'}->{'clearbefore'} = $cfg->{'clearbefore'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'clearbefore'} || 0
MC/DC0%0/1
$cfg->{'clearbefore'} || 0
$cfg->{'clearbefore'}
Truth table50%1/2
A
A= $cfg->{'clearbefore'}
| |||||||||||||||||||||||||||||||
| 77 | 1 | ▶ | $self->{'_opts'}->{'clearafter'} = $cfg->{'clearafter'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'clearafter'} || 0
MC/DC0%0/1
$cfg->{'clearafter'} || 0
$cfg->{'clearafter'}
Truth table50%1/2
A
A= $cfg->{'clearafter'}
| |||||||||||||||||||||||||||||||
| 78 | 1 | ▶ | $self->{'_opts'}->{'beepbin'} = $cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'; | ||||||||||||||||||||||||||||
|
Condition40%2/5
$cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'
$cfg->{"beepbin"} or $self->_find_bin("beep")
MC/DC0%0/2
$cfg->{'beepbin'} || $self->_find_bin('beep') || '/usr/bin/beep'
$cfg->{"beepbin"}
$self->_find_bin("beep")
Truth table33%1/3
A or B
A= $cfg->{"beepbin"}B= $self->_find_bin("beep")
| |||||||||||||||||||||||||||||||
| 79 | 1 | ▶ | $self->{'_opts'}->{'beepbefore'} = $cfg->{'beepbefore'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'beepbefore'} || 0
MC/DC0%0/1
$cfg->{'beepbefore'} || 0
$cfg->{'beepbefore'}
Truth table50%1/2
A
A= $cfg->{'beepbefore'}
| |||||||||||||||||||||||||||||||
| 80 | 1 | ▶ | $self->{'_opts'}->{'beepafter'} = $cfg->{'beepafter'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'beepafter'} || 0
MC/DC0%0/1
$cfg->{'beepafter'} || 0
$cfg->{'beepafter'}
Truth table50%1/2
A
A= $cfg->{'beepafter'}
| |||||||||||||||||||||||||||||||
| 81 | 1 | ▶ | $self->{'_opts'}->{'timeout'} = $cfg->{'timeout'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'timeout'} || 0
MC/DC0%0/1
$cfg->{'timeout'} || 0
$cfg->{'timeout'}
Truth table50%1/2
A
A= $cfg->{'timeout'}
| |||||||||||||||||||||||||||||||
| 82 | 1 | ▶ | $self->{'_opts'}->{'wait'} = $cfg->{'wait'} || 0; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{'wait'} || 0
MC/DC0%0/1
$cfg->{'wait'} || 0
$cfg->{'wait'}
Truth table50%1/2
A
A= $cfg->{'wait'}
| |||||||||||||||||||||||||||||||
| 83 | 1 | ▶ | unless (-x $self->{'_opts'}->{'bin'}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 84 | 1 | croak("the kdialog binary could not be found at: ".$self->{'_opts'}->{'bin'}); | |||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $self->{'_opts'}->{'trust-input'} = $cfg->{'trust-input'} || 0; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$cfg->{'trust-input'} || 0
MC/DC0%0/1
$cfg->{'trust-input'} || 0
$cfg->{'trust-input'}
Truth table0%0/2
A
A= $cfg->{'trust-input'}
| |||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | $self->{'test_mode'} = $cfg->{'test_mode'} if exists $cfg->{'test_mode'}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 90 | 0 | $self->{'test_mode_result'} = ''; | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||
| 92 | 0 | return($self); | |||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||
| 95 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||
| 96 | #: Private Methods | ||||||||||||||||||||||||||||||
| 97 | #: | ||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||
| 99 | sub append_format_base { | ||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | my ($self,$args,$fmt) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
append_format_base: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 101 | 0 | $fmt = $self->append_format_check($args,$fmt,'caption','--caption {{caption}}'); | |||||||||||||||||||||||||||||
| 102 | 0 | $fmt = $self->append_format_check($args,$fmt,'icon','--icon {{icon}}'); | |||||||||||||||||||||||||||||
| 103 | 0 | $fmt = $self->append_format_check($args,$fmt,'miniicon','--miniicon {{miniicon}}'); | |||||||||||||||||||||||||||||
| 104 | 0 | ▶ | if ($self->{'_opts'}->{'force-no-separate-output'}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 105 | 0 | delete $args->{'separate-output'}; | |||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||
| 107 | else { | ||||||||||||||||||||||||||||||
| 108 | 0 | $fmt = $self->append_format_check($args,$fmt,"separate-output","--separate-output"); | |||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||
| 110 | 0 | return $fmt; | |||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||
| 113 | #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||||||||||||||||||||||||||||||
| 114 | #: Public Methods | ||||||||||||||||||||||||||||||
| 115 | #: | ||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||
| 118 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 119 | #: Ask a binary question (Yes/No) | ||||||||||||||||||||||||||||||
| 120 | sub yesno { | ||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
yesno: not called CC=10 SCAR=47.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 125 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||
| 127 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | $args->{'yesno'} ||= "yesno"; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"yesno"} ||= "yesno"
MC/DC0%0/1
$args->{"yesno"} ||= "yesno"
$args->{"yesno"}
Truth table0%0/2
A
A= $args->{"yesno"}
| |||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||
| 131 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 132 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 133 | 0 | $fmt = $self->append_format($fmt,'--'.$args->{'yesno'}.' {{text}} {{height}} {{width}}'); | |||||||||||||||||||||||||||||
| 134 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 135 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 136 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||
| 137 | ); | ||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||
| 139 | 0 | my $rv = $self->command_state($command); | |||||||||||||||||||||||||||||
| 140 | 0 | ▶ | if ($rv && $rv >= 1) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rv and $rv >= 1
MC/DC0%0/2
$rv and $rv >= 1
$rv
$rv >= 1
Truth table0%0/3
A and B
A= $rvB= $rv >= 1
| |||||||||||||||||||||||||||||||
| 141 | 0 | $self->ra("NO"); | |||||||||||||||||||||||||||||
| 142 | 0 | $self->rs("NO"); | |||||||||||||||||||||||||||||
| 143 | 0 | $self->rv($rv); | |||||||||||||||||||||||||||||
| 144 | } else { | ||||||||||||||||||||||||||||||
| 145 | 0 | $self->ra("YES"); | |||||||||||||||||||||||||||||
| 146 | 0 | $self->rs("YES"); | |||||||||||||||||||||||||||||
| 147 | 0 | $self->rv('null'); | |||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||
| 149 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 150 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||
| 152 | sub yesnocancel { | ||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
yesnocancel: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | return($self->yesno('caller',((caller(1))[3]||'main'),@_,'yesno','yesnocancel')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||
| 156 | sub warningyesno { | ||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
warningyesno: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | return($self->yesno('caller',((caller(1))[3]||'main'),@_,'yesno','warningyesno')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||
| 160 | sub warningyesnocancel { | ||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
warningyesnocancel: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | return($self->yesno('caller',((caller(1))[3]||'main'),@_,'yesno','warningyesnocancel')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||
| 164 | #: Broken documented "feature" | ||||||||||||||||||||||||||||||
| 165 | # sub warningcontinuecancel { | ||||||||||||||||||||||||||||||
| 166 | # my $self = shift(); | ||||||||||||||||||||||||||||||
| 167 | # return($self->yesno(@_,'yesno','warningcontinuecancel')); | ||||||||||||||||||||||||||||||
| 168 | # } | ||||||||||||||||||||||||||||||
| 169 | sub noyes { | ||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
noyes: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | return($self->yesno('caller',((caller(1))[3]||'main'),@_)); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||
| 174 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 175 | #: Text entry | ||||||||||||||||||||||||||||||
| 176 | sub inputbox { | ||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
inputbox: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 181 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||
| 183 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | $args->{'inputbox'} ||= 'inputbox'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"inputbox"} ||= "inputbox"
MC/DC0%0/1
$args->{"inputbox"} ||= "inputbox"
$args->{"inputbox"}
Truth table0%0/2
A
A= $args->{"inputbox"}
| |||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||
| 187 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 188 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 189 | 0 | $fmt = $self->append_format($fmt,'--'.$args->{'inputbox'}.' {{text}} {{entry}}'); | |||||||||||||||||||||||||||||
| 190 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 191 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 192 | text => $self->make_kvt($args,$args->{'text'}), | ||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | entry => $self->make_kvl($args,($args->{'init'}||$args->{'entry'})), | ||||||||||||||||||||||||||||
|
Condition0%0/3
$args->{'init'} || $args->{'entry'}
MC/DC0%0/2
$args->{'init'} || $args->{'entry'}
$args->{'init'}
$args->{'entry'}
Truth table0%0/3
A || B
A= $args->{'init'}B= $args->{'entry'}
| |||||||||||||||||||||||||||||||
| 194 | ); | ||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||
| 196 | 0 | my ($rv,$text) = $self->command_string($command); | |||||||||||||||||||||||||||||
| 197 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 198 | 0 | ▶ | return($rv == 0 ? $text : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||
| 200 | sub password { | ||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
password: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | return($self->inputbox('caller',((caller(1))[3]||'main'),@_,'inputbox','password')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||
| 205 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 206 | #: Text box | ||||||||||||||||||||||||||||||
| 207 | sub msgbox { | ||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
msgbox: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 212 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||
| 214 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $args->{'msgbox'} ||= 'msgbox'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"msgbox"} ||= "msgbox"
MC/DC0%0/1
$args->{"msgbox"} ||= "msgbox"
$args->{"msgbox"}
Truth table0%0/2
A
A= $args->{"msgbox"}
| |||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||
| 218 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 219 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 220 | 0 | $fmt = $self->append_format($fmt,'--'.$args->{'msgbox'}.' {{text}}'); | |||||||||||||||||||||||||||||
| 221 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 222 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 223 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||
| 224 | ); | ||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||
| 226 | 0 | my $rv = $self->command_state($command); | |||||||||||||||||||||||||||||
| 227 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 228 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||
| 230 | sub error { | ||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
error: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | return($self->msgbox('caller',((caller(1))[3]||'main'),@_,'msgbox','error')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||
| 234 | sub sorry { | ||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
sorry: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | return($self->msgbox('caller',((caller(1))[3]||'main'),@_,'msgbox','sorry')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||
| 238 | sub infobox { | ||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
infobox: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | return($self->msgbox('caller',((caller(1))[3]||'main'),@_,'msgbox','msgbox')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||
| 243 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 244 | #: File box | ||||||||||||||||||||||||||||||
| 245 | sub textbox { | ||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
textbox: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 250 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||
| 252 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||
| 254 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 255 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 256 | 0 | $fmt = $self->append_format($fmt,'--textbox'); | |||||||||||||||||||||||||||||
| 257 | 0 | $fmt = $self->append_format($fmt,'{{path}} {{height}} {{width}}'); | |||||||||||||||||||||||||||||
| 258 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 259 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | path => $self->make_kvl($args,($args->{'filename'}||$args->{'path'}||'.')), | ||||||||||||||||||||||||||||
|
Condition0%0/5
$args->{'filename'} || $args->{'path'} || '.'
$args->{"filename"} or $args->{"path"}
MC/DC0%0/2
$args->{'filename'} || $args->{'path'} || '.'
$args->{"filename"}
$args->{"path"}
Truth table0%0/3
A or B
A= $args->{"filename"}B= $args->{"path"}
| |||||||||||||||||||||||||||||||
| 261 | ); | ||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||
| 263 | 0 | my ($rv,$text) = $self->command_string($command); | |||||||||||||||||||||||||||||
| 264 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 265 | 0 | ▶ | return($rv == 0 ? 1 : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||
| 268 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 269 | #: a simple menu | ||||||||||||||||||||||||||||||
| 270 | sub menu { | ||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
menu: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 275 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||
| 277 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||
| 279 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 280 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 281 | 0 | $fmt = $self->append_format($fmt,'--separate-output'); | |||||||||||||||||||||||||||||
| 282 | 0 | $fmt = $self->append_format($fmt,'--menu'); | |||||||||||||||||||||||||||||
| 283 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{list}}'); | |||||||||||||||||||||||||||||
| 284 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 285 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 286 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||
| 287 | ); | ||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||
| 289 | 0 | my ($rv,$selected) = $self->command_string($command); | |||||||||||||||||||||||||||||
| 290 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 291 | 0 | ▶ | return($rv == 0 ? $selected : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||
| 294 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 295 | #: a check list | ||||||||||||||||||||||||||||||
| 296 | sub checklist { | ||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
checklist: not called CC=12 SCAR=50.5
Pod
documented
| |||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 301 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||
| 303 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||
| 305 | $args->{'listheight'} = $args->{'menuheight'} | ||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | if exists $args->{'menuheight'}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||
| 308 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 309 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 310 | 0 | ▶ | $args->{radiolist} ||= 0; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"radiolist"} ||= 0
MC/DC0%0/1
$args->{"radiolist"} ||= 0
$args->{"radiolist"}
Truth table0%0/2
A
A= $args->{"radiolist"}
| |||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | if ($args->{radiolist}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 312 | 0 | $fmt = $self->append_format($fmt,'--radiolist'); | |||||||||||||||||||||||||||||
| 313 | } | ||||||||||||||||||||||||||||||
| 314 | else { | ||||||||||||||||||||||||||||||
| 315 | 0 | $fmt = $self->append_format($fmt,'--separate-output'); | |||||||||||||||||||||||||||||
| 316 | 0 | $fmt = $self->append_format($fmt,'--checklist'); | |||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||
| 318 | 0 | $fmt = $self->append_format($fmt,'{{text}} {{list}}'); | |||||||||||||||||||||||||||||
| 319 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 320 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 321 | 0 | text => $self->make_kvt($args,$args->{'text'}), | |||||||||||||||||||||||||||||
| 322 | ); | ||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if ($args->{radiolist}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 325 | 0 | my ($rv,$selected) = $self->command_string($command); | |||||||||||||||||||||||||||||
| 326 | 0 | ▶ | return($rv == 0 ? $selected : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||
| 328 | 0 | my ($rv,$selected) = $self->command_array($command); | |||||||||||||||||||||||||||||
| 329 | 0 | ▶ | return($rv == 0 ? @{$selected} : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||
| 331 | #: a radio button list | ||||||||||||||||||||||||||||||
| 332 | sub radiolist { | ||||||||||||||||||||||||||||||
| 333 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
radiolist: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | return($self->checklist('caller',((caller(1))[3]||'main'),@_,'radiolist',1)); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||
| 338 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 339 | #: file select | ||||||||||||||||||||||||||||||
| 340 | sub fselect { | ||||||||||||||||||||||||||||||
| 341 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
fselect: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | my $caller = (caller(1))[3] || 'main'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller 2)[3] or "main"
MC/DC0%0/1
(caller 2)[3] or "main"
(caller 2)[3]
Truth table0%0/2
A
A= (caller 2)[3]
| |||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | if ($_[0] && $_[0] eq 'caller') { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_[0] and $_[0] eq "caller"
MC/DC0%0/2
$_[0] and $_[0] eq "caller"
$_[0]
$_[0] eq "caller"
Truth table0%0/3
A and B
A= $_[0]B= $_[0] eq "caller"
| |||||||||||||||||||||||||||||||
| 345 | 0 | shift(); $caller = shift(); | |||||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||||
| 347 | 0 | my $args = $self->_pre($caller,@_); | |||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | $args->{'fselect'} ||= 'getopenfilename'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"fselect"} ||= "getopenfilename"
MC/DC0%0/1
$args->{"fselect"} ||= "getopenfilename"
$args->{"fselect"}
Truth table0%0/2
A
A= $args->{"fselect"}
| |||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||
| 351 | 0 | my $fmt = $self->prepare_format($args); | |||||||||||||||||||||||||||||
| 352 | 0 | $fmt = $self->append_format_base($args,$fmt); | |||||||||||||||||||||||||||||
| 353 | 0 | $fmt = $self->append_format($fmt,'--separate-output'); | |||||||||||||||||||||||||||||
| 354 | 0 | $fmt = $self->append_format($fmt,'--'.$args->{'fselect'}); | |||||||||||||||||||||||||||||
| 355 | 0 | ▶ | if ($args->{'getexistingdirectory'}) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 356 | 0 | $fmt = $self->append_format($fmt,'{{path}}'); | |||||||||||||||||||||||||||||
| 357 | } else { | ||||||||||||||||||||||||||||||
| 358 | 0 | $fmt = $self->append_format($fmt,'{{path}} {{filter}}'); | |||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||
| 360 | my $command = $self->prepare_command | ||||||||||||||||||||||||||||||
| 361 | ( $args, $fmt, | ||||||||||||||||||||||||||||||
| 362 | path => $self->make_kvl($args,($args->{'path'}||abs_path())), | ||||||||||||||||||||||||||||||
| 363 | 0 | ▶ | filter => $self->make_kvl($args,($args->{'filter'}||'*')) | ||||||||||||||||||||||||||||
|
Condition0%0/5
$args->{'path'} || abs_path()
$args->{'filter'} || '*'
MC/DC0%0/2
$args->{'path'} || abs_path()
$args->{'path'}
abs_path()
MC/DC0%0/1
$args->{'filter'} || '*'
$args->{'filter'}
Truth table0%0/3
A || B
A= $args->{'path'}B= abs_path()
Truth table0%0/2
A
A= $args->{'filter'}
| |||||||||||||||||||||||||||||||
| 364 | ); | ||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||
| 366 | 0 | my ($rv,$selected) = $self->command_string($command); | |||||||||||||||||||||||||||||
| 367 | 0 | $self->_post($args); | |||||||||||||||||||||||||||||
| 368 | 0 | ▶ | return($rv == 0 ? $selected : 0); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||
| 370 | sub getopenfilename { | ||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
getopenfilename: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 372 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getopenfilename')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||
| 374 | sub getsavefilename { | ||||||||||||||||||||||||||||||
| 375 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
getsavefilename: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 376 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getsavefilename')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 377 | } | ||||||||||||||||||||||||||||||
| 378 | sub getopenurl { | ||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
getopenurl: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 380 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getopenurl')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||
| 382 | sub getsaveurl { | ||||||||||||||||||||||||||||||
| 383 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
getsaveurl: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 384 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getsaveurl')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||
| 387 | #:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||||||||||||||||||||||||||||||
| 388 | #: directory select | ||||||||||||||||||||||||||||||
| 389 | sub dselect { | ||||||||||||||||||||||||||||||
| 390 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
dselect: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getexistingdirectory')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||
| 393 | sub getexistingdirectory { | ||||||||||||||||||||||||||||||
| 394 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||||
|
Subroutine
getexistingdirectory: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 395 | 0 | ▶ | return($self->fselect('caller',((caller(1))[3]||'main'),@_,'fselect','getexistingdirectory')); | ||||||||||||||||||||||||||||
|
Condition0%0/2
(caller 1)[3] || 'main'
MC/DC0%0/1
(caller 1)[3] || 'main'
(caller 1)[3]
Truth table0%0/2
A
A= (caller 1)[3]
| |||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||
| 399 | 2 | 1; | |||||||||||||||||||||||||||||