Mon, 29 Jul 2013 11:52:27 +0530
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
| 15230 | 1 | /* |
| 2 | * BuddyNote - Store notes on particular buddies | |
| 3 | * Copyright (C) 2004 Stu Tomlinson <stu@nosnilmot.com> | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or | |
| 6 | * modify it under the terms of the GNU General Public License | |
| 7 | * as published by the Free Software Foundation; either version 2 | |
| 8 | * of the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17708
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
| 15230 | 18 | */ |
| 19 | #include "internal.h" | |
| 20 | ||
| 21 | #include <debug.h> | |
| 22 | #include <notify.h> | |
| 23 | #include <request.h> | |
| 24 | #include <signals.h> | |
| 25 | #include <util.h> | |
| 26 | #include <version.h> | |
| 27 | ||
| 28 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
29 | dont_do_it_cb(PurpleBlistNode *node, const char *note) |
| 15230 | 30 | { |
| 31 | } | |
| 32 | ||
| 33 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
34 | do_it_cb(PurpleBlistNode *node, const char *note) |
| 15230 | 35 | { |
| 15884 | 36 | purple_blist_node_set_string(node, "notes", note); |
| 15230 | 37 | } |
| 38 | ||
| 39 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
40 | buddynote_edit_cb(PurpleBlistNode *node, gpointer data) |
| 15230 | 41 | { |
| 42 | const char *note; | |
| 43 | ||
| 15884 | 44 | note = purple_blist_node_get_string(node, "notes"); |
| 15230 | 45 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
46 | purple_request_input(node, _("Notes"), |
| 15230 | 47 | _("Enter your notes below..."), |
| 48 | NULL, | |
| 49 | note, TRUE, FALSE, "html", | |
| 50 | _("Save"), G_CALLBACK(do_it_cb), | |
| 51 | _("Cancel"), G_CALLBACK(dont_do_it_cb), | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16131
diff
changeset
|
52 | NULL, NULL, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
53 | node); |
| 15230 | 54 | } |
| 55 | ||
| 56 | static void | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
57 | buddynote_extended_menu_cb(PurpleBlistNode *node, GList **m) |
| 15230 | 58 | { |
| 15884 | 59 | PurpleMenuAction *bna = NULL; |
| 15230 | 60 | |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
61 | if (purple_blist_node_is_transient(node)) |
|
17708
0f23250ae460
Prevent the Buddy Notes plugin from offering to edit notes on a buddy list
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16745
diff
changeset
|
62 | return; |
|
0f23250ae460
Prevent the Buddy Notes plugin from offering to edit notes on a buddy list
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16745
diff
changeset
|
63 | |
| 15230 | 64 | *m = g_list_append(*m, bna); |
| 15884 | 65 | bna = purple_menu_action_new(_("Edit Notes..."), PURPLE_CALLBACK(buddynote_edit_cb), NULL, NULL); |
| 15230 | 66 | *m = g_list_append(*m, bna); |
| 67 | } | |
| 68 | ||
| 69 | static gboolean | |
| 15884 | 70 | plugin_load(PurplePlugin *plugin) |
| 15230 | 71 | { |
| 72 | ||
| 15884 | 73 | purple_signal_connect(purple_blist_get_handle(), "blist-node-extended-menu", |
| 74 | plugin, PURPLE_CALLBACK(buddynote_extended_menu_cb), NULL); | |
| 15230 | 75 | |
| 76 | return TRUE; | |
| 77 | } | |
| 78 | ||
| 15884 | 79 | static PurplePluginInfo info = |
| 15230 | 80 | { |
| 15884 | 81 | PURPLE_PLUGIN_MAGIC, |
| 16131 | 82 | PURPLE_MAJOR_VERSION, /**< major version */ |
| 83 | PURPLE_MINOR_VERSION, /**< minor version */ | |
| 15884 | 84 | PURPLE_PLUGIN_STANDARD, /**< type */ |
| 15230 | 85 | NULL, /**< ui_requirement */ |
| 86 | 0, /**< flags */ | |
| 87 | NULL, /**< dependencies */ | |
| 16131 | 88 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 15230 | 89 | "core-plugin_pack-buddynote", /**< id */ |
| 90 | N_("Buddy Notes"), /**< name */ | |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
91 | DISPLAY_VERSION, /**< version */ |
| 16131 | 92 | N_("Store notes on particular buddies."), /**< summary */ |
| 15230 | 93 | N_("Adds the option to store notes for buddies " |
| 16131 | 94 | "on your buddy list."), /**< description */ |
| 15230 | 95 | "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ |
| 15884 | 96 | PURPLE_WEBSITE, /**< homepage */ |
| 15230 | 97 | plugin_load, /**< load */ |
| 98 | NULL, /**< unload */ | |
| 99 | NULL, /**< destroy */ | |
| 100 | NULL, /**< ui_info */ | |
| 101 | NULL, /**< extra_info */ | |
| 102 | NULL, /**< prefs_info */ | |
|
16745
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
103 | NULL, /**< actions */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
104 | |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
105 | /* padding */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
106 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
107 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
108 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
109 | NULL |
| 15230 | 110 | }; |
| 111 | ||
| 112 | ||
| 113 | static void | |
| 15884 | 114 | init_plugin(PurplePlugin *plugin) { |
| 15230 | 115 | } |
| 116 | ||
| 15884 | 117 | PURPLE_INIT_PLUGIN(buddynote, init_plugin, info) |