Mercurial > pidgin.yaz
comparison libpurple/plugins/pluginpref_example.c @ 16427:4999bbc52881
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Wed, 25 Apr 2007 23:55:56 +0000 |
| parents | 32c366eeeb99 |
| children | f8eb3e7c4fbd |
comparison
equal
deleted
inserted
replaced
| 16426:0fb719b5dc0e | 16427:4999bbc52881 |
|---|---|
| 43 | 43 |
| 44 ppref = purple_plugin_pref_new_with_label("boolean"); | 44 ppref = purple_plugin_pref_new_with_label("boolean"); |
| 45 purple_plugin_pref_frame_add(frame, ppref); | 45 purple_plugin_pref_frame_add(frame, ppref); |
| 46 | 46 |
| 47 ppref = purple_plugin_pref_new_with_name_and_label( | 47 ppref = purple_plugin_pref_new_with_name_and_label( |
| 48 "/plugins/core/pluginpref_example/bool", | 48 "/plugins/purple/pluginpref_example/bool", |
| 49 "boolean pref"); | 49 "boolean pref"); |
| 50 purple_plugin_pref_frame_add(frame, ppref); | 50 purple_plugin_pref_frame_add(frame, ppref); |
| 51 | 51 |
| 52 ppref = purple_plugin_pref_new_with_label("integer"); | 52 ppref = purple_plugin_pref_new_with_label("integer"); |
| 53 purple_plugin_pref_frame_add(frame, ppref); | 53 purple_plugin_pref_frame_add(frame, ppref); |
| 54 | 54 |
| 55 ppref = purple_plugin_pref_new_with_name_and_label( | 55 ppref = purple_plugin_pref_new_with_name_and_label( |
| 56 "/plugins/core/pluginpref_example/int", | 56 "/plugins/purple/pluginpref_example/int", |
| 57 "integer pref"); | 57 "integer pref"); |
| 58 purple_plugin_pref_set_bounds(ppref, 0, 255); | 58 purple_plugin_pref_set_bounds(ppref, 0, 255); |
| 59 purple_plugin_pref_frame_add(frame, ppref); | 59 purple_plugin_pref_frame_add(frame, ppref); |
| 60 | 60 |
| 61 ppref = purple_plugin_pref_new_with_name_and_label( | 61 ppref = purple_plugin_pref_new_with_name_and_label( |
| 62 "/plugins/core/pluginpref_example/int_choice", | 62 "/plugins/purple/pluginpref_example/int_choice", |
| 63 "integer choice"); | 63 "integer choice"); |
| 64 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE); | 64 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE); |
| 65 purple_plugin_pref_add_choice(ppref, "One", GINT_TO_POINTER(1)); | 65 purple_plugin_pref_add_choice(ppref, "One", GINT_TO_POINTER(1)); |
| 66 purple_plugin_pref_add_choice(ppref, "Two", GINT_TO_POINTER(2)); | 66 purple_plugin_pref_add_choice(ppref, "Two", GINT_TO_POINTER(2)); |
| 67 purple_plugin_pref_add_choice(ppref, "Four", GINT_TO_POINTER(4)); | 67 purple_plugin_pref_add_choice(ppref, "Four", GINT_TO_POINTER(4)); |
| 74 | 74 |
| 75 ppref = purple_plugin_pref_new_with_label("string"); | 75 ppref = purple_plugin_pref_new_with_label("string"); |
| 76 purple_plugin_pref_frame_add(frame, ppref); | 76 purple_plugin_pref_frame_add(frame, ppref); |
| 77 | 77 |
| 78 ppref = purple_plugin_pref_new_with_name_and_label( | 78 ppref = purple_plugin_pref_new_with_name_and_label( |
| 79 "/plugins/core/pluginpref_example/string", | 79 "/plugins/purple/pluginpref_example/string", |
| 80 "string pref"); | 80 "string pref"); |
| 81 purple_plugin_pref_frame_add(frame, ppref); | 81 purple_plugin_pref_frame_add(frame, ppref); |
| 82 | 82 |
| 83 ppref = purple_plugin_pref_new_with_name_and_label( | 83 ppref = purple_plugin_pref_new_with_name_and_label( |
| 84 "/plugins/core/pluginpref_example/masked_string", | 84 "/plugins/purple/pluginpref_example/masked_string", |
| 85 "masked string"); | 85 "masked string"); |
| 86 purple_plugin_pref_set_masked(ppref, TRUE); | 86 purple_plugin_pref_set_masked(ppref, TRUE); |
| 87 purple_plugin_pref_frame_add(frame, ppref); | 87 purple_plugin_pref_frame_add(frame, ppref); |
| 88 | 88 |
| 89 ppref = purple_plugin_pref_new_with_name_and_label( | 89 ppref = purple_plugin_pref_new_with_name_and_label( |
| 90 "/plugins/core/pluginpref_example/max_string", | 90 "/plugins/purple/pluginpref_example/max_string", |
| 91 "string pref\n(max length of 16)"); | 91 "string pref\n(max length of 16)"); |
| 92 purple_plugin_pref_set_max_length(ppref, 16); | 92 purple_plugin_pref_set_max_length(ppref, 16); |
| 93 purple_plugin_pref_frame_add(frame, ppref); | 93 purple_plugin_pref_frame_add(frame, ppref); |
| 94 | 94 |
| 95 ppref = purple_plugin_pref_new_with_name_and_label( | 95 ppref = purple_plugin_pref_new_with_name_and_label( |
| 96 "/plugins/core/pluginpref_example/string_choice", | 96 "/plugins/purple/pluginpref_example/string_choice", |
| 97 "string choice"); | 97 "string choice"); |
| 98 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE); | 98 purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE); |
| 99 purple_plugin_pref_add_choice(ppref, "red", "red"); | 99 purple_plugin_pref_add_choice(ppref, "red", "red"); |
| 100 purple_plugin_pref_add_choice(ppref, "orange", "orange"); | 100 purple_plugin_pref_add_choice(ppref, "orange", "orange"); |
| 101 purple_plugin_pref_add_choice(ppref, "yellow", "yellow"); | 101 purple_plugin_pref_add_choice(ppref, "yellow", "yellow"); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 static void | 147 static void |
| 148 init_plugin(PurplePlugin *plugin) | 148 init_plugin(PurplePlugin *plugin) |
| 149 { | 149 { |
| 150 purple_prefs_add_none("/plugins/core/pluginpref_example"); | 150 purple_prefs_add_none("/plugins/purple/pluginpref_example"); |
| 151 purple_prefs_add_bool("/plugins/core/pluginpref_example/bool", TRUE); | 151 purple_prefs_add_bool("/plugins/purple/pluginpref_example/bool", TRUE); |
| 152 purple_prefs_add_int("/plugins/core/pluginpref_example/int", 0); | 152 purple_prefs_add_int("/plugins/purple/pluginpref_example/int", 0); |
| 153 purple_prefs_add_int("/plugins/core/pluginpref_example/int_choice", 1); | 153 purple_prefs_add_int("/plugins/purple/pluginpref_example/int_choice", 1); |
| 154 purple_prefs_add_string("/plugins/core/pluginpref_example/string", | 154 purple_prefs_add_string("/plugins/purple/pluginpref_example/string", |
| 155 "string"); | 155 "string"); |
| 156 purple_prefs_add_string("/plugins/core/pluginpref_example/max_string", | 156 purple_prefs_add_string("/plugins/purple/pluginpref_example/max_string", |
| 157 "max length string"); | 157 "max length string"); |
| 158 purple_prefs_add_string("/plugins/core/pluginpref_example/masked_string", "masked"); | 158 purple_prefs_add_string("/plugins/purple/pluginpref_example/masked_string", "masked"); |
| 159 purple_prefs_add_string("/plugins/core/pluginpref_example/string_choice", "red"); | 159 purple_prefs_add_string("/plugins/purple/pluginpref_example/string_choice", "red"); |
| 160 } | 160 } |
| 161 | 161 |
| 162 PURPLE_INIT_PLUGIN(ppexample, init_plugin, info) | 162 PURPLE_INIT_PLUGIN(ppexample, init_plugin, info) |
