/[smeserver]/rpms/e-smith-lib/sme9/e-smith-lib-2.4.0-textboxLicenseFile.patch
ViewVC logotype

Contents of /rpms/e-smith-lib/sme9/e-smith-lib-2.4.0-textboxLicenseFile.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Mar 17 00:15:20 2014 UTC (10 years, 2 months ago) by wellsi
Branch: MAIN
CVS Tags: e-smith-lib-2_4_0-18_el6_sme, e-smith-lib-2_4_0-17_el6_sme, e-smith-lib-2_4_0-15_el6_sme, e-smith-lib-2_4_0-16_el6_sme, e-smith-lib-2_4_0-13_el6_sme, e-smith-lib-2_4_0-14_el6_sme, HEAD
* Sun Mar 16 2014 Ian Wells <esmith@wellsi.com> 2.4.0-13.sme
- Add textbox() to console.pm, getLicenseFile to util.pm [SME: 8264]

1 diff -ruN e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console.pm e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/console.pm
2 --- e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console.pm 2008-08-20 14:23:20.000000000 -0700
3 +++ e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/console.pm 2014-03-16 17:01:16.000000000 -0700
4 @@ -385,6 +385,29 @@
5 );
6 }
7
8 +
9 +=head2 textbox
10 +
11 +A text box lets you display the contents of a text file in a dialog box.
12 +It is like a simple text file viewer.
13 +
14 +=cut
15 +
16 +sub textbox
17 +{
18 + my $self = shift;
19 + my %params = @_;
20 + my $title = $params{title};
21 + my $file = $params{file};
22 + my $height = $params{height} || '20';
23 + my $width = $params{width} || SCREEN_COLUMNS;
24 + $self->screen("--title", $title,
25 + "--textbox", $file,
26 + $height,
27 + $width,
28 + );
29 +}
30 +
31 =head2 menu_page
32
33 This method displays a screen with a menu.
34 diff -ruN e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/util.pm e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/util.pm
35 --- e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/util.pm 2013-01-25 08:09:11.000000000 -0800
36 +++ e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/util.pm 2014-03-16 16:57:08.000000000 -0700
37 @@ -1170,6 +1170,58 @@
38 return wantarray ? @licenses : "@licenses";
39 }
40
41 +=head2 getLicenseFile()
42 +
43 +Return the license filename.
44 +
45 +Optionally takes a language tag to be used for retrieving the license,
46 +defaulting to the locale of the server.
47 +
48 +If more than one license file than return the first alphabetically.
49 +
50 +=cut
51 +
52 +sub getLicenseFile
53 +{
54 + my ($locale) = @_;
55 +
56 + if ($locale)
57 + {
58 + $locale =~ s/-(\S\S)/_\U$1/;
59 + }
60 + else
61 + {
62 + my $db = esmith::ConfigDB->open();
63 +
64 + my ( $lang, @rest ) = $db->getLocale();
65 +
66 + $lang = $lang || "en_US";
67 +
68 + $locale = $lang;
69 + }
70 +
71 + my $base_dir = $ENV{ESMITH_LICENSE_DIR} || "/etc/e-smith/licenses";
72 +
73 + $locale = "en_US" unless ( -d "${base_dir}/${locale}" );
74 +
75 + my $dir = "${base_dir}/${locale}";
76 +
77 + opendir( DIR, $dir ) || die "Couldn't open licenses directory\n";
78 +
79 + my @licenses;
80 + foreach my $license ( readdir(DIR) )
81 + {
82 + my $file = "${dir}/${license}";
83 + next unless ( -f $file );
84 + push @licenses, $file;
85 + }
86 +
87 + @licenses = sort @licenses;
88 +
89 + return shift @licenses;
90 +}
91 +
92 +
93 =item B<initialize_default_databases>
94
95 Initialize all databases located at /etc/e-smith/db.

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed