| 14 * |
14 * |
| 15 * You should have received a copy of the GNU General Public License |
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 |
16 * along with this program; if not, write to the Free Software |
| 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 18 */ |
18 */ |
| |
19 #include <glib.h> |
| |
20 #include <glib/gi18n-lib.h> |
| |
21 |
| 19 #include <purple.h> |
22 #include <purple.h> |
| 20 |
23 |
| 21 #include <pidgin.h> |
24 #include <pidgin.h> |
| |
25 |
| |
26 #include <talkatu.h> |
| 22 |
27 |
| 23 #include <unity.h> |
28 #include <unity.h> |
| 24 #include <messaging-menu.h> |
29 #include <messaging-menu.h> |
| 25 |
30 |
| 26 #define UNITY_PLUGIN_ID "gtk-unity-integration" |
31 #define UNITY_PLUGIN_ID "gtk-unity-integration" |
| 394 |
399 |
| 395 id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", |
400 id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", |
| 396 G_CALLBACK(unalert_cb), conv); |
401 G_CALLBACK(unalert_cb), conv); |
| 397 g_object_set_data(G_OBJECT(conv), "unity-entry-signal", GUINT_TO_POINTER(id)); |
402 g_object_set_data(G_OBJECT(conv), "unity-entry-signal", GUINT_TO_POINTER(id)); |
| 398 |
403 |
| 399 id = g_signal_connect(G_OBJECT(gtkconv->webview), "focus-in-event", |
404 id = g_signal_connect(G_OBJECT(gtkconv->history), "focus-in-event", |
| 400 G_CALLBACK(unalert_cb), conv); |
405 G_CALLBACK(unalert_cb), conv); |
| 401 g_object_set_data(G_OBJECT(conv), "unity-webview-signal", GUINT_TO_POINTER(id)); |
406 g_object_set_data(G_OBJECT(conv), "unity-history-signal", GUINT_TO_POINTER(id)); |
| 402 |
407 |
| 403 return 0; |
408 return 0; |
| 404 } |
409 } |
| 405 |
410 |
| 406 static void |
411 static void |
| 410 guint id; |
415 guint id; |
| 411 gtkconv = PIDGIN_CONVERSATION(conv); |
416 gtkconv = PIDGIN_CONVERSATION(conv); |
| 412 if (!gtkconv) |
417 if (!gtkconv) |
| 413 return; |
418 return; |
| 414 |
419 |
| 415 id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-webview-signal")); |
420 id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-history-signal")); |
| 416 g_signal_handler_disconnect(gtkconv->webview, id); |
421 g_signal_handler_disconnect(gtkconv->history, id); |
| 417 |
422 |
| 418 id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-entry-signal")); |
423 id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "unity-entry-signal")); |
| 419 g_signal_handler_disconnect(gtkconv->entry, id); |
424 g_signal_handler_disconnect(gtkconv->entry, id); |
| 420 |
425 |
| 421 g_object_set_data(G_OBJECT(conv), "unity-message-count", |
426 g_object_set_data(G_OBJECT(conv), "unity-message-count", |