Mercurial > pidgin.yaz
comparison libpurple/plugins/perl/scripts/plugin_pref.pl @ 15834:2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 17:02:24 +0000 |
parents | 5fe8042783c1 |
children | fb86dbeb2b15 |
comparison
equal
deleted
inserted
replaced
15833:df859a1b40b1 | 15834:2f8274ce570a |
---|---|
1 $MODULE_NAME = "Prefs Functions Test"; | 1 $MODULE_NAME = "Prefs Functions Test"; |
2 use Gaim; | 2 use Purple; |
3 # All the information Gaim gets about our nifty plugin | 3 # All the information Purple gets about our nifty plugin |
4 %PLUGIN_INFO = ( | 4 %PLUGIN_INFO = ( |
5 perl_api_version => 2, | 5 perl_api_version => 2, |
6 name => "Perl: $MODULE_NAME", | 6 name => "Perl: $MODULE_NAME", |
7 version => "0.1", | 7 version => "0.1", |
8 summary => "Test plugin for the Perl interpreter.", | 8 summary => "Test plugin for the Perl interpreter.", |
29 my $TEST_NAME = "perlTestName"; | 29 my $TEST_NAME = "perlTestName"; |
30 my $TEST_ALIAS = "perlTestAlias"; | 30 my $TEST_ALIAS = "perlTestAlias"; |
31 my $PROTOCOL_ID = "prpl-oscar"; | 31 my $PROTOCOL_ID = "prpl-oscar"; |
32 | 32 |
33 sub foo { | 33 sub foo { |
34 $frame = Gaim::PluginPref::Frame->new(); | 34 $frame = Purple::PluginPref::Frame->new(); |
35 | 35 |
36 $ppref = Gaim::PluginPref->new_with_label("boolean"); | 36 $ppref = Purple::PluginPref->new_with_label("boolean"); |
37 $frame->add($ppref); | 37 $frame->add($ppref); |
38 | 38 |
39 $ppref = Gaim::PluginPref->new_with_name_and_label( | 39 $ppref = Purple::PluginPref->new_with_name_and_label( |
40 "/plugins/core/perl_test/bool", "Boolean Preference"); | 40 "/plugins/core/perl_test/bool", "Boolean Preference"); |
41 $frame->add($ppref); | 41 $frame->add($ppref); |
42 | 42 |
43 | 43 |
44 $ppref = Gaim::PluginPref->new_with_name_and_label( | 44 $ppref = Purple::PluginPref->new_with_name_and_label( |
45 "/plugins/core/perl_test/choice", "Choice Preference"); | 45 "/plugins/core/perl_test/choice", "Choice Preference"); |
46 $ppref->set_type(1); | 46 $ppref->set_type(1); |
47 $ppref->add_choice("ch0", $frame); | 47 $ppref->add_choice("ch0", $frame); |
48 $ppref->add_choice("ch1", $frame); | 48 $ppref->add_choice("ch1", $frame); |
49 $frame->add($ppref); | 49 $frame->add($ppref); |
50 | 50 |
51 $ppref = Gaim::PluginPref->new_with_name_and_label( | 51 $ppref = Purple::PluginPref->new_with_name_and_label( |
52 "/plugins/core/perl_test/text", "Text Box Preference"); | 52 "/plugins/core/perl_test/text", "Text Box Preference"); |
53 $ppref->set_max_length(16); | 53 $ppref->set_max_length(16); |
54 $frame->add($ppref); | 54 $frame->add($ppref); |
55 | 55 |
56 return $frame; | 56 return $frame; |
69 print "#" x 80 . "\n\n"; | 69 print "#" x 80 . "\n\n"; |
70 | 70 |
71 | 71 |
72 ######### TEST CODE HERE ########## | 72 ######### TEST CODE HERE ########## |
73 | 73 |
74 Gaim::Prefs::add_none("/plugins/core/perl_test"); | 74 Purple::Prefs::add_none("/plugins/core/perl_test"); |
75 Gaim::Prefs::add_bool("/plugins/core/perl_test/bool", 1); | 75 Purple::Prefs::add_bool("/plugins/core/perl_test/bool", 1); |
76 Gaim::Prefs::add_string("/plugins/core/perl_test/choice", "ch1"); | 76 Purple::Prefs::add_string("/plugins/core/perl_test/choice", "ch1"); |
77 Gaim::Prefs::add_string("/plugins/core/perl_test/text", "Foobar"); | 77 Purple::Prefs::add_string("/plugins/core/perl_test/text", "Foobar"); |
78 | 78 |
79 | 79 |
80 print "\n\n" . "#" x 80 . "\n\n"; | 80 print "\n\n" . "#" x 80 . "\n\n"; |
81 } | 81 } |
82 | 82 |