~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/Dialog/About.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Padre::Wx::Dialog::About;
 
2
 
 
3
use 5.008;
 
4
use strict;
 
5
use warnings;
 
6
use utf8;
 
7
use Config;
 
8
use Padre::Wx               ();
 
9
use Wx::Perl::ProcessStream ();
 
10
use Padre::Util             ();
 
11
use PPI                     ();
 
12
use Padre::Wx::FBP::About   ();
 
13
 
 
14
our $VERSION = '0.92';
 
15
our @ISA     = qw{
 
16
        Padre::Wx::FBP::About
 
17
};
 
18
 
 
19
use constant {
 
20
        OFFSET => 24,
 
21
};
 
22
 
 
23
#######
 
24
# new
 
25
#######
 
26
sub new {
 
27
        my $class = shift;
 
28
        my $self  = $class->SUPER::new(@_);
 
29
 
 
30
        # Always show the first tab regardless of which one
 
31
        # was selected in wxFormBuilder.
 
32
        $self->notebook->ChangeSelection(0);
 
33
 
 
34
        $self->CenterOnParent;
 
35
 
 
36
        return $self;
 
37
}
 
38
 
 
39
#######
 
40
# Method run
 
41
#######
 
42
sub run {
 
43
        my $self    = shift;
 
44
        my $current = $self->current;
 
45
 
 
46
        # auto-fill dialogue
 
47
        $self->_set_up();
 
48
 
 
49
        # Show the dialog
 
50
        my $result = $self->ShowModal;
 
51
 
 
52
        if ( $result == Wx::ID_CANCEL ) {
 
53
 
 
54
                # As we leave the About dialog, return the user to the current editor
 
55
                # window so they don't need to click it.
 
56
                my $editor = $current->editor;
 
57
                $editor->SetFocus if $editor;
 
58
 
 
59
                # Clean up
 
60
                $self->Destroy;
 
61
 
 
62
                return;
 
63
        }
 
64
 
 
65
        return;
 
66
}
 
67
 
 
68
#######
 
69
# Method _set_up
 
70
#######
 
71
sub _set_up {
 
72
        my $self = shift;
 
73
        
 
74
        $self->app_name->SetLabel("Padre $VERSION:-");
 
75
 
 
76
        # load the image
 
77
        $self->{splash}->SetBitmap( Wx::Bitmap->new( Padre::Util::splash, Wx::BITMAP_TYPE_PNG ) );
 
78
 
 
79
        $self->creator->SetLabel('Gábor Szabó');
 
80
 
 
81
        $self->_translation();
 
82
 
 
83
        $self->_information();
 
84
 
 
85
        return;
 
86
}
 
87
 
 
88
#######
 
89
# Composed Method _translation
 
90
#######
 
91
sub _translation {
 
92
        my $self = shift;
 
93
        
 
94
        #TODO will all translators please add there name
 
95
        # in native language please and uncommet please
 
96
 
 
97
        $self->ahmad_zawawi->SetLabel('أحمد محمد زواوي');
 
98
 
 
99
        # $self->fayland_lam->SetLabel('');
 
100
        # $self->chuanren_wu->SetLabel('');
 
101
        $self->matthew_lien->SetLabel('練喆明');
 
102
 
 
103
 
 
104
        $self->marcela_maslanova->SetLabel('Marcela Mašláňová');
 
105
 
 
106
        # $self->dirk_de_nijs->SetLabel('');
 
107
        $self->jerome_quelin->SetLabel('Jérôme Quelin');
 
108
        $self->olivier_mengue->SetLabel('Olivier Mengué');
 
109
 
 
110
 
 
111
        # $self->heiko_jansen->SetLabel('');
 
112
        # $self->sebastian_willing->SetLabel('');
 
113
        # $self->zeno_gantner->SetLabel('');
 
114
        $self->omer_zak->SetLabel('עומר זק');
 
115
        $self->shlomi_fish->SetLabel('שלומי פיש');
 
116
        $self->amir_e_aharoni->SetLabel('אמיר א. אהרוני');
 
117
        $self->gyorgy_pasztor->SetLabel('György Pásztor');
 
118
 
 
119
        # $self->simone_blandino->SetLabel('');
 
120
        $self->kenichi_ishigaki->SetLabel('石垣憲');
 
121
        $self->keedi_kim->SetLabel('김도형');
 
122
 
 
123
        # $self->kjetil_skotheim->SetLabel('');
 
124
        # $self->cezary_morga->SetLabel('');
 
125
        # $self->breno_g_de_oliveira->SetLabel('');
 
126
        # $self->gabriel_vieira->SetLabel('');
 
127
 
 
128
 
 
129
        # $self->paco_alguacil->SetLabel('');
 
130
        # $self->enrique_nell->SetLabel('');
 
131
        # $self->andrew_shitov->SetLabel('');
 
132
        $self->burak_gursoy->SetLabel('Burak Gürsoy');
 
133
 
 
134
        return;
 
135
}
 
136
 
 
137
#######
 
138
# Composed Method _core_info
 
139
#######
 
140
sub _information {
 
141
        my $self = shift;
 
142
 
 
143
        my $output = "\n";
 
144
        $output .= sprintf "%*s %s\n", OFFSET, 'Padre', $VERSION;
 
145
 
 
146
        $output .= $self->_core_info();
 
147
        $output .= $self->_wx_info();
 
148
 
 
149
        $output .= "Other...\n";
 
150
        $output .= sprintf "%*s %s\n", OFFSET, 'PPI', $PPI::VERSION;
 
151
        $output .= sprintf "%*s %s\n", OFFSET, Wx::gettext('Config'), Padre::Constant::CONFIG_DIR;
 
152
 
 
153
        $self->{output}->ChangeValue($output);
 
154
        return;
 
155
}
 
156
 
 
157
#######
 
158
# Composed Method _core_info
 
159
#######
 
160
sub _core_info {
 
161
        my $self = shift;
 
162
 
 
163
        my $output = "Core...\n";
 
164
 
 
165
        # Do not translate those labels
 
166
        $output .= sprintf "%*s %s\n", OFFSET, "osname",   $Config{osname};
 
167
        $output .= sprintf "%*s %s\n", OFFSET, "archname", $Config{archname};
 
168
 
 
169
        if ( $Config{osname} eq 'linux' ) {
 
170
 
 
171
                my $distro = qx{cat /etc/issue};
 
172
                chomp($distro);
 
173
                $distro =~ s/\\n \\l//g;
 
174
                $distro =~ s/\x0A//g;
 
175
                $output .= sprintf "%*s %s\n", OFFSET, Wx::gettext('Distribution'), $distro;
 
176
 
 
177
                # Do we really care for Padre?
 
178
                my $kernel = qx{uname -r};
 
179
                chomp($kernel);
 
180
                $output .= sprintf "%*s %s\n", OFFSET, Wx::gettext('Kernel'), $kernel;
 
181
        }
 
182
 
 
183
        # Yes, THIS variable should have this upper case char :-)
 
184
        my $perl_version = $^V || $];
 
185
 
 
186
        # $perl_version = "$perl_version";
 
187
        $perl_version =~ s/^v//;
 
188
        $output .= sprintf "%*s %s\n", OFFSET, 'Perl', $perl_version;
 
189
 
 
190
        # How many threads are running
 
191
        my $threads = $INC{'threads.pm'} ? scalar( threads->list ) : Wx::gettext('(disabled)');
 
192
        $output .= sprintf "%*s %s\n", OFFSET, Wx::gettext('Threads'), $threads;
 
193
 
 
194
        # Calculate the current memory in use across all threads
 
195
        my $ram = Padre::Util::process_memory();
 
196
        $ram = $ram ? Padre::Util::humanbytes($ram) : Wx::gettext('(unsupported)');
 
197
        $output .= sprintf "%*s %s\n", OFFSET, Wx::gettext("RAM"), $ram;
 
198
 
 
199
        return $output;
 
200
}
 
201
 
 
202
#######
 
203
# Composed Method _wx_info
 
204
#######
 
205
sub _wx_info {
 
206
        my $self = shift;
 
207
 
 
208
        my $output .= "Wx...\n";
 
209
        $output .= sprintf "%*s %s\n", OFFSET, 'Wx', $Wx::VERSION;
 
210
 
 
211
        # Reformat the native wxWidgets version string slightly
 
212
        my $wx_widgets = Wx::wxVERSION_STRING();
 
213
        $wx_widgets =~ s/^wx\w+\s+//;
 
214
        $output .= sprintf "%*s %s\n", OFFSET, 'WxWidgets', $wx_widgets;
 
215
        $output .= sprintf "%*s %s\n", OFFSET, 'unicode', Wx::wxUNICODE();
 
216
 
 
217
        require Alien::wxWidgets;
 
218
        my $alien = $Alien::wxWidgets::VERSION;
 
219
        $output .= sprintf "%*s %s\n", OFFSET, 'Alien::wxWidgets', $alien;
 
220
 
 
221
        $output .= sprintf "%*s %s\n", OFFSET, 'Wx::Perl::ProcessStream', $Wx::Perl::ProcessStream::VERSION;
 
222
 
 
223
        require Wx::Scintilla;
 
224
        $output .= sprintf "%*s %s\n", OFFSET, 'Wx::Scintilla', $Wx::Scintilla::VERSION;
 
225
 
 
226
        return $output;
 
227
}
 
228
 
 
229
 
 
230
 
 
231
 
 
232
1;
 
233
 
 
234
__END__
 
235
 
 
236
# Copyright 2008-2011 The Padre development team as listed in Padre.pm.
 
237
# LICENSE
 
238
# This program is free software; you can redistribute it and/or
 
239
# modify it under the same terms as Perl 5 itself.