-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathgui_errormsg.pm
56 lines (47 loc) · 976 Bytes
/
gui_errormsg.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package gui_errormsg;
use strict;
use kh_mailif;
use gui_errormsg::msg;
use gui_errormsg::file;
use gui_errormsg::mysql;
use gui_errormsg::print;
my $exiting = 0;
# usege: gui_errormsg->open
# options:
# msg
# *window
# type [msg,file,mysql]
# *thefile
# *sql
# *icon [info,,, ]
sub open{
my $class = shift;
my %args = @_;
my $self = \%args;
bless $self, "$class"."::"."$args{type}";
kh_mailif->failure;
$self->{msg} = $self->get_msg;
unless ($self->{type} eq 'msg') {
#print "hoge!!!!\n";
($self->{caller_pac}, $self->{caller_file}, $self->{caller_line}) = caller;
$self->{msg} .= "\n\n";
$self->{msg} .= "$self->{caller_file} line $self->{caller_line}";
}
$self->print;
unless ($self->{type} eq 'msg'){
if ($::main_gui){
print "Exit (gui_errormsg.pm)\n";
exit if $exiting;
$exiting = 1;
$::main_gui->close;
} else {
exit;
}
}
}
sub print{
my $self = shift;
my %args = %{$self};
gui_errormsg::print->new(%args);
}
1;