| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package ZConf::Cron::GUI; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
66285
|
use warnings; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
51
|
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
41
|
|
|
5
|
1
|
|
|
1
|
|
784
|
use ZConf::Cron; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
34
|
|
|
6
|
1
|
|
|
1
|
|
1166
|
use ZConf::GUI; |
|
|
1
|
|
|
|
|
5142
|
|
|
|
1
|
|
|
|
|
40
|
|
|
7
|
1
|
|
|
1
|
|
11
|
use base 'Error::Helper'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
815
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
ZConf::Cron::GUI - Implements a GUI for ZConf::Cron. |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.1.0 |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.1.0'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use ZConf::Cron::GUI; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $zcc=$ZConf::Cron->new; |
|
27
|
|
|
|
|
|
|
my $zccg=ZConf::Cron::GUI->new({zccron=>$zcc}); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 METHODS |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 new |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This initializes it. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
One arguement is taken and that is a hash value. |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head3 hash values |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head4 zccron |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This is a ZConf::Cron object to use. If it is not specified, |
|
43
|
|
|
|
|
|
|
a new one will be created. |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head4 zcgui |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This is the ZConf::GUI object. If it is not passed, a new one will be created. |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new{ |
|
52
|
0
|
|
|
0
|
1
|
|
my %args; |
|
53
|
0
|
0
|
|
|
|
|
if(defined($_[1])){ |
|
54
|
0
|
|
|
|
|
|
%args= %{$_[1]}; |
|
|
0
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $self={error=>undef, errorString=>undef}; |
|
58
|
0
|
|
|
|
|
|
bless $self; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#initiates |
|
61
|
0
|
0
|
|
|
|
|
if (!defined($args{zccron})) { |
|
62
|
0
|
|
|
|
|
|
$self->{zcc}=ZConf::Cron->new(); |
|
63
|
|
|
|
|
|
|
}else { |
|
64
|
0
|
|
|
|
|
|
$self->{zcc}=$args{zccron}; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#handles it if initializing ZConf::Runner failed |
|
68
|
0
|
0
|
|
|
|
|
if ($self->{zcc}->error) { |
|
69
|
0
|
|
|
|
|
|
my $errorstring=$self->{zcc}->errorString; |
|
70
|
0
|
|
|
|
|
|
$errorstring=~s/\"/\\\"/g; |
|
71
|
0
|
|
|
|
|
|
my $error='Initializing ZConf::Cron failed. error="'.$self->{zcc}->error |
|
72
|
|
|
|
|
|
|
.'" errorString="'.$self->{zcc}->errorString.'"'; |
|
73
|
0
|
|
|
|
|
|
$self->{error}=3; |
|
74
|
0
|
|
|
|
|
|
$self->{errorString}=$error; |
|
75
|
0
|
|
|
|
|
|
$self->warn; |
|
76
|
0
|
|
|
|
|
|
return $self; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
$self->{zconf}=$self->{zcc}->{zconf}; |
|
80
|
|
|
|
|
|
|
|
|
81
|
0
|
0
|
|
|
|
|
if (!defined($args{zcgui})) { |
|
82
|
|
|
|
|
|
|
#initializes the GUI |
|
83
|
0
|
|
|
|
|
|
$self->{gui}=ZConf::GUI->new({zconf=>$self->zconf}); |
|
84
|
0
|
0
|
|
|
|
|
if ($self->{gui}->error) { |
|
85
|
0
|
|
|
|
|
|
my $errorstring=$self->{gui}->errorString; |
|
86
|
0
|
|
|
|
|
|
$errorstring=~s/\"/\\\"/g; |
|
87
|
0
|
|
|
|
|
|
my $error='Initializing ZConf::GUI failed. error="'.$self->{gui}->error |
|
88
|
|
|
|
|
|
|
.'" errorString="'.$self->{gui}->errorString.'"'; |
|
89
|
0
|
|
|
|
|
|
$self->{error}=2; |
|
90
|
0
|
|
|
|
|
|
$self->{errorString}=$error; |
|
91
|
0
|
|
|
|
|
|
$self->warn; |
|
92
|
0
|
|
|
|
|
|
return $self; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
}else { |
|
95
|
0
|
|
|
|
|
|
$self->{gui}=$args{zcgui}; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
$self->{useX}=$self->{gui}->useX('ZConf::Cron'); |
|
99
|
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
my @preferred=$self->{gui}->which('ZConf::Cron'); |
|
101
|
|
|
|
|
|
|
|
|
102
|
0
|
0
|
|
|
|
|
if (!defined($preferred[0])) { |
|
103
|
0
|
|
|
|
|
|
$self->{perror}=1; |
|
104
|
0
|
|
|
|
|
|
$self->{error}=4; |
|
105
|
0
|
|
|
|
|
|
$self->{errorString}='No backends located'; |
|
106
|
0
|
|
|
|
|
|
$self->warn; |
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
my $toeval='use ZConf::Cron::GUI::'.$preferred[0].';'."\n". |
|
110
|
|
|
|
|
|
|
'$self->{be}=ZConf::Cron::GUI::'.$preferred[0]. |
|
111
|
|
|
|
|
|
|
'->new({zconf=>$self->{zconf}, useX=>$self->{useX},'. |
|
112
|
|
|
|
|
|
|
'zcgui=>$self->{gui}, zccron=>$self->{zcc}}); return 1'; |
|
113
|
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my $er=eval($toeval); |
|
115
|
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
return $self; |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 crontab |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This dialog allows crontabs to be edited. |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
$zccg->crontab; |
|
124
|
|
|
|
|
|
|
if($zccg->error){ |
|
125
|
|
|
|
|
|
|
print "Error!\n"; |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=cut |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub crontab{ |
|
131
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
132
|
|
|
|
|
|
|
|
|
133
|
0
|
0
|
|
|
|
|
if ( ! $self->errorblank ){ |
|
134
|
0
|
|
|
|
|
|
return undef; |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
my $returned=$self->{be}->crontab; |
|
138
|
0
|
0
|
|
|
|
|
if ($self->{be}->error) { |
|
139
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
140
|
0
|
|
|
|
|
|
$self->{errorString}='Backend errored. error="'.$self->{be}->error. |
|
141
|
|
|
|
|
|
|
'" errorString="'.$self->{be}->errorString.'"'; |
|
142
|
0
|
|
|
|
|
|
$self->warn; |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
return $returned; |
|
146
|
|
|
|
|
|
|
} |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head2 dialogs |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
This returns the available dailogs. |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub dialogs{ |
|
155
|
0
|
|
|
0
|
1
|
|
return ('crontab'); |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 windows |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This returns a list of available windows. |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub windows{ |
|
165
|
0
|
|
|
0
|
1
|
|
return (); |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 DIALOGS |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
crontab |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 WINDOWS |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
At this time, no windows are supported. |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head1 ERROR CODES |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head2 1 |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
This means ZConf errored. |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 2 |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Initializing ZConf::GUI failed. |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 3 |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Initializing ZConf::Cron failed. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 4 |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Failed to initailize the primary backend. |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=head2 5 |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Backend errored. |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head1 AUTHOR |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Zane C. Bowers-Hadley, C<< >> |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 BUGS |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
|
205
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
|
206
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head1 SUPPORT |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
perldoc ZConf::Cron::GUI |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
You can also look for information at: |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over 4 |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
L |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
L |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
L |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item * Search CPAN |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
L |
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=back |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
Copyright 2012 Zane C. Bowers-Hadley, all rights reserved. |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
249
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=cut |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
1; # End of ZConf::Cron::GUI |