Mercurial > pidgin
annotate plugins/musicmessaging/musicmessaging.c @ 11365:817e52833803
[gaim-migrate @ 13589]
Fixing to work with dbus.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Muise <christian.muise@gmail.com> |
---|---|
date | Tue, 30 Aug 2005 01:52:21 +0000 |
parents | 6ef19bbfb7cb |
children | a9ec436535bc |
rev | line source |
---|---|
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
1 /* |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
2 * Music messaging plugin for Gaim |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
3 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
4 * Copyright (C) 2005 Christian Muise. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
5 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
6 * This program is free software; you can redistribute it and/or |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
7 * modify it under the terms of the GNU General Public License as |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
8 * published by the Free Software Foundation; either version 2 of the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
9 * License, or (at your option) any later version. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
10 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, but |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
12 * WITHOUT ANY WARRANTY; without even the implied warranty of |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
14 * General Public License for more details. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
15 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
19 * 02111-1307, USA. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
20 */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
21 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
22 #include "internal.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
23 #include "gtkgaim.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
24 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
25 #include "conversation.h" |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
26 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
27 #include "gtkconv.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
28 #include "gtkplugin.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
29 #include "gtkutils.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
30 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
31 #include "notify.h" |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
32 #include "version.h" |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
33 #include "debug.h" |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
34 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
35 #define DBUS_API_SUBJECT_TO_CHANGE |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
36 #include <dbus/dbus.h> |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
37 #include "dbus-maybe.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
38 #include "dbus-bindings.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
39 #include "dbus-server.h" |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
40 #include "dbus-gaim.h" |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
41 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
42 #define MUSICMESSAGING_PLUGIN_ID "gtk-hazure-musicmessaging" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
43 #define MUSICMESSAGING_PREFIX "##MM##" |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
44 #define MUSICMESSAGING_START_MSG "A music messaging session has been requested. Please click the MM icon to accept." |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
45 #define MUSICMESSAGING_CONFIRM_MSG "Music messaging session confirmed." |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
46 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
47 /* Globals */ |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
48 /* List of sessions */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
49 GList *conversations; |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
50 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
51 /* Pointer to this plugin */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
52 GaimPlugin *plugin_pointer; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
53 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
54 /* Define types needed for DBus */ |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
55 DBusGConnection *connection; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
56 DBusGProxy *proxy; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
57 #define DBUS_SERVICE_GSCORE "org.gscore.GScoreService" |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
58 #define DBUS_PATH_GSCORE "/org/gscore/GScoreObject" |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
59 #define DBUS_INTERFACE_GSCORE "org.gscore.GScoreInterface" |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
60 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
61 /* Define the functions to export for use with DBus */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
62 DBUS_EXPORT void music_messaging_change_request (const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
63 DBUS_EXPORT void music_messaging_change_confirmed (const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
64 DBUS_EXPORT void music_messaging_change_failed (const char *id, const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
65 DBUS_EXPORT void music_messaging_done_session (void); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
66 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
67 /* This file has been generated by the #dbus-analize-functions.py |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
68 script. It contains dbus wrappers for the four functions declared |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
69 above. */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
70 #include "music-messaging-bindings.c" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
71 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
72 /* Exported functions */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
73 void music_messaging_change_request(const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
74 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
75 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
76 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
77 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
78 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
79 void music_messaging_change_confirmed(const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
80 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
81 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
82 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
83 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
84 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
85 void music_messaging_change_failed(const char *id, const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
86 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
87 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
88 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
89 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
90 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
91 void music_messaging_done_session(void) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
92 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
93 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, "Session", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
94 "Session Complete", NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
95 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
96 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
97 typedef struct { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
98 GaimConversation *conv; /* pointer to the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
99 GtkWidget *seperator; /* seperator in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
100 GtkWidget *button; /* button in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
101 GPid pid; /* the pid of the score editor */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
102 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
103 gboolean started; /* session has started and editor run */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
104 gboolean originator; /* started the mm session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
105 gboolean requested; /* received a request to start a session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
106 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
107 } MMConversation; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
108 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
109 static gboolean start_session(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
110 static void run_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
111 static void kill_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
112 static void add_button (MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
113 static void remove_widget (GtkWidget *button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
114 static void init_conversation (GaimConversation *conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
115 static void conv_destroyed(GaimConversation *conv); |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
116 static gboolean intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
117 static gboolean intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
118 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
119 |
11355
6903f2f6d61f
[gaim-migrate @ 13574]
Christian Muise <christian.muise@gmail.com>
parents:
11254
diff
changeset
|
120 /* DBus commands that can be sent to the editor */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
121 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
122 void send_change_request (const char *id, const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
123 { |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
124 dbus_g_proxy_call_no_reply(proxy, "GscoreChangeRequest", |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
125 G_TYPE_STRING, &id, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
126 G_TYPE_STRING, &command, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
127 G_TYPE_STRING, ¶meters, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
128 G_TYPE_INVALID); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
129 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
130 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
131 void send_change_confirmed (const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
132 { |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
133 dbus_g_proxy_call_no_reply(proxy, "GscoreChangeConfirmed", |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
134 G_TYPE_STRING, &command, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
135 G_TYPE_STRING, ¶meters, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
136 G_TYPE_INVALID); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
137 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
138 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
139 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
140 static MMConversation* |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
141 mmconv_from_conv(GaimConversation *conv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
142 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
143 MMConversation *mmconv_current = NULL; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
144 guint i; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
145 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
146 for (i = 0; i < g_list_length(conversations); i++) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
147 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
148 mmconv_current = (MMConversation *)g_list_nth_data(conversations, i); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
149 if (conv == mmconv_current->conv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
150 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
151 return mmconv_current; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
152 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
153 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
154 return NULL; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
155 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
156 |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
157 static gboolean |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
158 init_mm_dbus_connection() |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
159 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
160 GError *error = NULL; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
161 g_type_init (); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
162 |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
163 connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
164 if (!connection) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
165 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
166 g_printerr ("Failed to open connection to bus: %s\n", error->message); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
167 g_error_free (error); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
168 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
169 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
170 |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
171 proxy = dbus_g_proxy_new_for_name (connection, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
172 DBUS_SERVICE_GSCORE, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
173 DBUS_PATH_GSCORE, |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
174 DBUS_INTERFACE_GSCORE); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
175 if (!proxy) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
176 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
177 g_printerr("Failed to create the proxy: %s\n", error->message); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
178 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
179 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
180 |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
181 return TRUE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
182 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
183 |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
184 static gboolean |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
185 plugin_load(GaimPlugin *plugin) { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
186 /* First, we have to register our four exported functions with the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
187 main gaim dbus loop. Without this statement, the gaim dbus |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
188 code wouldn't know about our functions. */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
189 GAIM_DBUS_REGISTER_BINDINGS(plugin); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
190 |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
191 /* We need to initialize the dbus stuff */ |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
192 init_mm_dbus_connection(); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
193 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
194 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Welcome", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
195 "Welcome to music messaging.", NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
196 /* Keep the plugin for reference (needed for notify's) */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
197 plugin_pointer = plugin; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
198 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
199 /* Add the button to all the current conversations */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
200 gaim_conversation_foreach (init_conversation); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
201 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
202 /* Listen for any new conversations */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
203 void *conv_list_handle = gaim_conversations_get_handle(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
204 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
205 gaim_signal_connect(conv_list_handle, "conversation-created", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
206 plugin, GAIM_CALLBACK(init_conversation), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
207 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
208 /* Listen for conversations that are ending */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
209 gaim_signal_connect(conv_list_handle, "deleting-conversation", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
210 plugin, GAIM_CALLBACK(conv_destroyed), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
211 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
212 /* Listen for sending/receiving messages to replace tags */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
213 gaim_signal_connect(conv_list_handle, "writing-im-msg", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
214 plugin, GAIM_CALLBACK(intercept_sent), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
215 gaim_signal_connect(conv_list_handle, "receiving-im-msg", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
216 plugin, GAIM_CALLBACK(intercept_received), NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
217 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
218 return TRUE; |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
219 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
220 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
221 static gboolean |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
222 plugin_unload(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
223 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
224 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Unloaded", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
225 DATADIR, NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
226 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
227 MMConversation *mmconv = NULL; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
228 while (g_list_length(conversations) > 0) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
229 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
230 mmconv = g_list_first(conversations)->data; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
231 conv_destroyed(mmconv->conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
232 } |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
233 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
234 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
235 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
236 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
237 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
238 static gboolean |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
239 intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
240 { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
241 GaimConnection *connection = gaim_conversation_get_gc(conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
242 const char *convName = gaim_conversation_get_name(conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
243 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
244 if (0 == strncmp(*message, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX))) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
245 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
246 gaim_debug_misc("gaim-musicmessaging", "Sent MM Message: %s\n", *message); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
247 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
248 message = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
249 } |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
250 else if (0 == strncmp(*message, MUSICMESSAGING_START_MSG, strlen(MUSICMESSAGING_START_MSG))) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
251 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
252 gaim_debug_misc("gaim-musicmessaging", "Sent MM request.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
253 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
254 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
255 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
256 else if (0 == strncmp(*message, MUSICMESSAGING_CONFIRM_MSG, strlen(MUSICMESSAGING_CONFIRM_MSG))) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
257 { |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
258 gaim_debug_misc("gaim-musicmessaging", "Sent MM confirm.\n"); |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
259 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
260 message = 0; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
261 } |
11365
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
262 else if (0 == strncmp(*message, "test1", strlen("test1"))) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
263 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
264 gaim_debug_misc("gaim-musicmessaging", "\n\nTEST 1\n\n"); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
265 send_change_request("test-id", "test-command", "test-parameters"); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
266 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
267 } |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
268 else if (0 == strncmp(*message, "test2", strlen("test2"))) |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
269 { |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
270 gaim_debug_misc("gaim-musicmessaging", "\n\nTEST 2\n\n"); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
271 send_change_confirmed("test-command", "test-parameters"); |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
272 return FALSE; |
817e52833803
[gaim-migrate @ 13589]
Christian Muise <christian.muise@gmail.com>
parents:
11362
diff
changeset
|
273 } |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
274 else |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
275 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
276 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
277 /* Do nothing...procceed as normal */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
278 } |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
279 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
280 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
281 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
282 static gboolean |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
283 intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags) |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
284 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
285 MMConversation *mmconv = mmconv_from_conv(conv); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
286 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
287 gaim_debug_misc("gaim-musicmessaging", "Intercepted: %s\n", *message); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
288 if (strstr(*message, MUSICMESSAGING_PREFIX)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
289 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
290 gaim_debug_misc("gaim-musicmessaging", "Received MM Message: %s\n", |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
291 strtok(strstr(*message, MUSICMESSAGING_PREFIX), "<")); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
292 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
293 /* DEAL WITH A MM MESSAGE */ |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
294 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
295 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
296 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
297 else if (strstr(*message, MUSICMESSAGING_START_MSG)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
298 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
299 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
300 gaim_debug_misc("gaim-musicmessaging", "Received MM request.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
301 if (!(mmconv->originator)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
302 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
303 mmconv->requested = TRUE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
304 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
305 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
306 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
307 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
308 else if (strstr(*message, MUSICMESSAGING_CONFIRM_MSG)) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
309 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
310 message = 0; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
311 gaim_debug_misc("gaim-musicmessagin", "Received MM confirm.\n"); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
312 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
313 if (mmconv->originator) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
314 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
315 start_session(mmconv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
316 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
317 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
318 else |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
319 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
320 return FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
321 /* Do nothing. */ |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
322 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
323 return TRUE; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
324 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
325 |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
326 static void send_request(MMConversation *mmconv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
327 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
328 GaimConnection *connection = gaim_conversation_get_gc(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
329 const char *convName = gaim_conversation_get_name(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
330 serv_send_im(connection, convName, MUSICMESSAGING_START_MSG, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
331 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
332 |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
333 static void send_request_confirmed(MMConversation *mmconv) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
334 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
335 GaimConnection *connection = gaim_conversation_get_gc(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
336 const char *convName = gaim_conversation_get_name(mmconv->conv); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
337 serv_send_im(connection, convName, MUSICMESSAGING_CONFIRM_MSG, GAIM_MESSAGE_SEND); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
338 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
339 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
340 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
341 static gboolean |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
342 start_session(MMConversation *mmconv) |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
343 { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
344 run_editor(mmconv); |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
345 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
346 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
347 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
348 static void music_button_toggled (GtkWidget *widget, gpointer data) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
349 { |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
350 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
351 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
352 if (((MMConversation *) data)->requested) |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
353 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
354 start_session((MMConversation *) data); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
355 send_request_confirmed((MMConversation *) data); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
356 } |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
357 else |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
358 { |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
359 ((MMConversation *) data)->originator = TRUE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
360 send_request((MMConversation *) data); |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
361 } |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
362 } else { |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
363 ((MMConversation *)data)->started = FALSE; |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
364 ((MMConversation *)data)->originator = FALSE; |
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
365 ((MMConversation *)data)->requested = FALSE; |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
366 kill_editor((MMConversation *) data); |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
367 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
368 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
369 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
370 static void set_editor_path (GtkWidget *button, GtkWidget *text_field) |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
371 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
372 const char * path = gtk_entry_get_text((GtkEntry*)text_field); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
373 gaim_prefs_set_string("/plugins/gtk/musicmessaging/editor_path", path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
374 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
375 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
376 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
377 static void run_editor (MMConversation *mmconv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
378 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
379 GError *spawn_error = NULL; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
380 gchar * args[2]; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
381 args[0] = (gchar *)gaim_prefs_get_string("/plugins/gtk/musicmessaging/editor_path"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
382 args[1] = NULL; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
383 if (!(g_spawn_async (".", args, NULL, 12, NULL, NULL, &(mmconv->pid), &spawn_error))) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
384 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
385 gaim_notify_error(plugin_pointer, "Error Running Editor", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
386 "The following error has occured:", spawn_error->message); |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
387 mmconv->started = FALSE; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
388 } |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
389 else |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
390 { |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
391 mmconv->started = TRUE; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
392 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
393 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
394 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
395 static void kill_editor (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
396 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
397 if (mmconv->pid) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
398 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
399 kill(mmconv->pid, SIGINT); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
400 mmconv->pid = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
401 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
402 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
403 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
404 static void init_conversation (GaimConversation *conv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
405 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
406 MMConversation *mmconv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
407 mmconv = g_malloc(sizeof(MMConversation)); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
408 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
409 mmconv->conv = conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
410 mmconv->started = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
411 mmconv->originator = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
412 mmconv->requested = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
413 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
414 add_button(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
415 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
416 conversations = g_list_append(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
417 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
418 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
419 static void conv_destroyed (GaimConversation *conv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
420 { |
11362
6ef19bbfb7cb
[gaim-migrate @ 13586]
Christian Muise <christian.muise@gmail.com>
parents:
11355
diff
changeset
|
421 MMConversation *mmconv = mmconv_from_conv(conv); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
422 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
423 remove_widget(mmconv->button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
424 remove_widget(mmconv->seperator); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
425 if (mmconv->started) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
426 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
427 kill_editor(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
428 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
429 conversations = g_list_remove(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
430 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
431 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
432 static void add_button (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
433 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
434 GaimConversation *conv = mmconv->conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
435 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
436 GtkWidget *button, *image, *sep; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
437 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
438 button = gtk_toggle_button_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
439 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
440 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
441 g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
442 |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
443 /* gchar *file_path = g_build_filename (DATADIR, "pixmaps", "gaim", "buttons", "music.png", NULL); */ |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
444 gchar *file_path = "/usr/local/share/pixmaps/gaim/buttons/music.png"; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
445 image = gtk_image_new_from_file(file_path); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
446 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
447 gtk_container_add((GtkContainer *)button, image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
448 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
449 sep = gtk_vseparator_new(); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
450 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
451 mmconv->seperator = sep; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
452 mmconv->button = button; |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
453 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
454 gtk_widget_show(sep); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
455 gtk_widget_show(image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
456 gtk_widget_show(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
457 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
458 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), sep, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
459 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), button, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
460 } |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
461 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
462 static void remove_widget (GtkWidget *button) |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
463 { |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
464 gtk_widget_hide(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
465 gtk_widget_destroy(button); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
466 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
467 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
468 static GtkWidget * |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
469 get_config_frame(GaimPlugin *plugin) |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
470 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
471 GtkWidget *ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
472 GtkWidget *vbox; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
473 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
474 GtkWidget *editor_path; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
475 GtkWidget *editor_path_label; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
476 GtkWidget *editor_path_button; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
477 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
478 /* Outside container */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
479 ret = gtk_vbox_new(FALSE, 18); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
480 gtk_container_set_border_width(GTK_CONTAINER(ret), 10); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
481 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
482 /* Configuration frame */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
483 vbox = gaim_gtk_make_frame(ret, _("Music Messaging Configuration")); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
484 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
485 /* Path to the score editor */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
486 editor_path = gtk_entry_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
487 editor_path_label = gtk_label_new("Score Editor Path"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
488 editor_path_button = gtk_button_new_with_mnemonic(_("_Apply")); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
489 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
490 gtk_entry_set_text((GtkEntry*)editor_path, "/usr/local/bin/gscore"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
491 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
492 g_signal_connect(G_OBJECT(editor_path_button), "clicked", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
493 G_CALLBACK(set_editor_path), editor_path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
494 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
495 gtk_box_pack_start(GTK_BOX(vbox), editor_path_label, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
496 gtk_box_pack_start(GTK_BOX(vbox), editor_path, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
497 gtk_box_pack_start(GTK_BOX(vbox), editor_path_button, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
498 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
499 gtk_widget_show_all(ret); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
500 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
501 return ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
502 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
503 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
504 static GaimGtkPluginUiInfo ui_info = |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
505 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
506 get_config_frame |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
507 }; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
508 |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
509 static GaimPluginInfo info = { |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
510 GAIM_PLUGIN_MAGIC, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
511 GAIM_MAJOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
512 GAIM_MINOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
513 GAIM_PLUGIN_STANDARD, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
514 GAIM_GTK_PLUGIN_TYPE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
515 0, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
516 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
517 GAIM_PRIORITY_DEFAULT, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
518 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
519 MUSICMESSAGING_PLUGIN_ID, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
520 "Music Messaging", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
521 VERSION, |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
522 "Music Messaging Plugin for collabrative composition.", |
11216
1b32ad61e114
[gaim-migrate @ 13348]
Richard Laager <rlaager@wiktel.com>
parents:
11200
diff
changeset
|
523 "The Music Messaging Plugin allows a number of users to simultaneously work on a piece of music by editting a common score in real-time.", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
524 "Christian Muise <christian.muise@gmail.com>", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
525 GAIM_WEBSITE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
526 plugin_load, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
527 plugin_unload, |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
528 NULL, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
529 &ui_info, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
530 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
531 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
532 NULL |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
533 }; |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
534 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
535 static void |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
536 init_plugin(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
537 gaim_prefs_add_none("/plugins/gtk/musicmessaging"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
538 gaim_prefs_add_string("/plugins/gtk/musicmessaging/editor_path", "/usr/local/bin/gscore"); |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
539 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
540 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
541 GAIM_INIT_PLUGIN(musicmessaging, init_plugin, info); |