diff plugins/perl/scripts/plugin_pref.pl @ 12364:6fd82071a7b8

[gaim-migrate @ 14668] sf patch #1373688, from Will Thompson "Make the Perl bindings more Perl-ish" committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 23:54:34 +0000
parents 0e9e2b923d09
children
line wrap: on
line diff
--- a/plugins/perl/scripts/plugin_pref.pl	Mon Dec 05 23:41:29 2005 +0000
+++ b/plugins/perl/scripts/plugin_pref.pl	Mon Dec 05 23:54:34 2005 +0000
@@ -3,10 +3,15 @@
 # All the information Gaim gets about our nifty plugin
 %PLUGIN_INFO = ( 
 	perl_api_version => 2, 
-	name => " Perl: $MODULE_NAME", 
+	name => "Perl: $MODULE_NAME",
 	version => "0.1", 
 	summary => "Test plugin for the Perl interpreter.", 
-	description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface.  As XSUBs are added, this *should* be updated to test the changes.  Furthermore, this will function as the tutorial perl plugin.", 
+	description => "Implements a set of test proccedures to ensure all " .
+	               "functions that work in the C API still work in the " .
+		       "Perl plugin interface.  As XSUBs are added, this " .
+		       "*should* be updated to test the changes.  " .
+		       "Furthermore, this will function as the tutorial perl " .
+		       "plugin.",
 	author => "John H. Kelm <johnhkelm\@gmail.com>", 
 	url => "http://sourceforge.net/users/johnhkelm/", 
 	
@@ -26,24 +31,27 @@
 	my $PROTOCOL_ID 	= "prpl-oscar";
 
 sub foo {
-	$frame = Gaim::Pref::frame_new();
+	$frame = Gaim::PluginPref::Frame->new();
 
-	$ppref = Gaim::Pref::new_with_label("boolean");
-	Gaim::Pref::frame_add($frame, $ppref);
+	$ppref = Gaim::PluginPref->new_with_label("boolean");
+	$frame->add($ppref);
 	
-	$ppref = Gaim::Pref::new_with_name_and_label("/plugins/core/perl_test/bool", "Boolean Preference");
-	Gaim::Pref::frame_add($frame, $ppref);	
+	$ppref = Gaim::PluginPref->new_with_name_and_label(
+	    "/plugins/core/perl_test/bool", "Boolean Preference");
+	$frame->add($ppref);
 
 		
-	$ppref = Gaim::Pref::new_with_name_and_label("/plugins/core/perl_test/choice", "Choice Preference");
-	Gaim::Pref::set_type($ppref, 1);
-	Gaim::Pref::add_choice($ppref, "foo", $frame);
-	Gaim::Pref::add_choice($ppref, "bar", $frame);
-	Gaim::Pref::frame_add($frame, $ppref);
+	$ppref = Gaim::PluginPref->new_with_name_and_label(
+	    "/plugins/core/perl_test/choice", "Choice Preference");
+	$ppref->set_type(1);
+	$ppref->add_choice("ch0", $frame);
+	$ppref->add_choice("ch1", $frame);
+	$frame->add($ppref);
 	
-	$ppref = Gaim::Pref::new_with_name_and_label("/plugins/core/perl_test/text", "Text Box Preference");
-	Gaim::Pref::set_max_length($ppref, 16);
-	Gaim::Pref::frame_add($frame, $ppref);
+	$ppref = Gaim::PluginPref->new_with_name_and_label(
+	    "/plugins/core/perl_test/text", "Text Box Preference");
+	$ppref->set_max_length(16);
+	$frame->add($ppref);
 	
 	return $frame;
 }
@@ -65,8 +73,8 @@
 
 	Gaim::Prefs::add_none("/plugins/core/perl_test");
 	Gaim::Prefs::add_bool("/plugins/core/perl_test/bool", 1);	
-	Gaim::Prefs::add_string("/plugins/core/perl_test/choice", "bar");	
-	Gaim::Prefs::add_string("/plugins/core/perl_test/text", "Foo");	
+	Gaim::Prefs::add_string("/plugins/core/perl_test/choice", "ch1");	
+	Gaim::Prefs::add_string("/plugins/core/perl_test/text", "Foobar");	
 	
 
 	print "\n\n" . "#" x 80 . "\n\n";