| ZConf-Cron documentation | Contained in the ZConf-Cron distribution. |
ZConf::Cron::GUI - Implements a GUI for ZConf::Cron.
Version 0.0.0
use ZConf::Cron::GUI;
my $zcc=$ZConf::Cron->new;
my $zccg=ZConf::Cron::GUI->new({zccron=>$zcc});
This initializes it.
One arguement is taken and that is a hash value.
This is a ZConf::Cron object to use. If it is not specified, a new one will be created.
This is the ZConf::GUI object. If it is not passed, a new one will be created.
Allows the crontabs to be edited.
$zccg->crontab;
if($zccg->{error}){
print "Error!\n";
}
This returns the available dailogs.
This returns a list of available windows.
This blanks the error storage and is only meant for internal usage.
It does the following.
$self->{error}=undef;
$self->{errorString}="";
ask
At this time, no windows are supported.
This means ZConf errored.
Initializing ZConf::GUI failed.
Initializing ZConf::Cron failed.
Failed to initailize the primary backend.
Backend errored.
Zane C. Bowers, <vvelox at vvelox.net>
Please report any bugs or feature requests to bug-zconf-runner at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ZConf-Runner. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc ZConf::Cron::GUI
You can also look for information at:
Copyright 2009 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| ZConf-Cron documentation | Contained in the ZConf-Cron distribution. |
package ZConf::Cron::GUI; use warnings; use strict; use ZConf::Cron; use ZConf::GUI;
our $VERSION = '0.0.0';
sub new{ my %args; if(defined($_[1])){ %args= %{$_[1]}; } my $self={error=>undef, errorString=>undef}; bless $self; #initiates if (!defined($args{zccron})) { $self->{zcc}=ZConf::Cron->new(); }else { $self->{zcc}=$args{zccron}; } #handles it if initializing ZConf::Runner failed if ($self->{zcc}->{error}) { my $errorstring=$self->{zcc}->{errorString}; $errorstring=~s/\"/\\\"/g; my $error='Initializing ZConf::Cron failed. error="'.$self->{zcc}->{error} .'" errorString="'.$self->{zcc}->{errorString}.'"'; $self->{error}=3; $self->{errorString}=$error; warn('ZConf-Cron-GUI new:3: '.$error); return $self; } $self->{zconf}=$self->{zcc}->{zconf}; if (!defined($args{zcgui})) { #initializes the GUI $self->{gui}=ZConf::GUI->new({zconf=>$self->{zconf}}); if ($self->{gui}->{error}) { my $errorstring=$self->{gui}->{errorString}; $errorstring=~s/\"/\\\"/g; my $error='Initializing ZConf::GUI failed. error="'.$self->{gui}->{error} .'" errorString="'.$self->{gui}->{errorString}.'"'; $self->{error}=2; $self->{errorString}=$error; warn('ZConf-Cron-GUI new:2: '.$error); return $self; } }else { $self->{gui}=$args{zcgui}; } $self->{useX}=$self->{gui}->useX('ZConf::Cron'); my @preferred=$self->{gui}->which('ZConf::Cron'); if (!defined($preferred[0])) { $self->{perror}=1; $self->{error}=4; $self->{errorString}='No backends located.'; warn('ZConf-Cron-GUI new:4: '.$self->{errorString}); } my $toeval='use ZConf::Cron::GUI::'.$preferred[0].';'."\n". '$self->{be}=ZConf::Cron::GUI::'.$preferred[0]. '->new({zconf=>$self->{zconf}, useX=>$self->{useX},'. 'zcgui=>$self->{gui}, zccron=>$self->{zcc}}); return 1'; my $er=eval($toeval); return $self; }
sub crontab{ my $self=$_[0]; $self->errorblank; if ($self->{error}) { warn('ZConf-Cron-GUI crontab: A permanent error was set'); return undef; } my $returned=$self->{be}->crontab; if ($self->{be}->{error}) { $self->{error}=5; $self->{errorString}='Backend errored. error="'.$self->{be}->{error}. '" errorString="'.$self->{be}->{errorString}.'"'; warn('ZConf-Cron-GUI crontab:'.$self->{errorString}); } return $returned; }
sub dialogs{ return ('crontab'); }
sub windows{ return (); }
#blanks the error flags sub errorblank{ my $self=$_[0]; if ($self->{perror}) { warn('ZConf-Cron-GUI errorblank: A permanent error is set.'); return undef; } $self->{error}=undef; $self->{errorString}=""; return 1; }
1; # End of ZConf::Cron::GUI