| 366 gtk_drag_finish(dc, TRUE, FALSE, t); |
366 gtk_drag_finish(dc, TRUE, FALSE, t); |
| 367 } |
367 } |
| 368 gtk_drag_finish(dc, FALSE, FALSE, t); |
368 gtk_drag_finish(dc, FALSE, FALSE, t); |
| 369 } |
369 } |
| 370 |
370 |
| 371 static void |
|
| 372 statusbox_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
|
| 373 const gchar *themedata, size_t len, const gchar *error_message) |
|
| 374 { |
|
| 375 FILE *f; |
|
| 376 gchar *path; |
|
| 377 size_t wc; |
|
| 378 |
|
| 379 if ((error_message != NULL) || (len == 0)) |
|
| 380 return; |
|
| 381 |
|
| 382 f = purple_mkstemp(&path, TRUE); |
|
| 383 wc = fwrite(themedata, len, 1, f); |
|
| 384 if (wc != 1) { |
|
| 385 purple_debug_warning("theme_got_url", "Unable to write theme data.\n"); |
|
| 386 fclose(f); |
|
| 387 g_unlink(path); |
|
| 388 g_free(path); |
|
| 389 return; |
|
| 390 } |
|
| 391 fclose(f); |
|
| 392 |
|
| 393 icon_choose_cb(path, user_data); |
|
| 394 |
|
| 395 g_unlink(path); |
|
| 396 g_free(path); |
|
| 397 } |
|
| 398 |
|
| 399 |
|
| 400 static gboolean |
|
| 401 statusbox_uri_handler(const char *proto, const char *cmd, GHashTable *params, void *data) |
|
| 402 { |
|
| 403 const char *src; |
|
| 404 |
|
| 405 if (g_ascii_strcasecmp(proto, "aim")) |
|
| 406 return FALSE; |
|
| 407 |
|
| 408 if (g_ascii_strcasecmp(cmd, "buddyicon")) |
|
| 409 return FALSE; |
|
| 410 |
|
| 411 src = g_hash_table_lookup(params, "account"); |
|
| 412 if (src == NULL) |
|
| 413 return FALSE; |
|
| 414 |
|
| 415 purple_util_fetch_url(src, TRUE, NULL, FALSE, statusbox_got_url, data); |
|
| 416 return TRUE; |
|
| 417 } |
|
| 418 |
371 |
| 419 static gboolean |
372 static gboolean |
| 420 icon_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginStatusBox *box) |
373 icon_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginStatusBox *box) |
| 421 { |
374 { |
| 422 gdk_window_set_cursor(widget->window, box->hand_cursor); |
375 gdk_window_set_cursor(widget->window, box->hand_cursor); |
| 1917 |
1870 |
| 1918 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |
1871 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |
| 1919 spellcheck_prefs_cb, status_box); |
1872 spellcheck_prefs_cb, status_box); |
| 1920 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
1873 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
| 1921 update_buddyicon_cb, status_box); |
1874 update_buddyicon_cb, status_box); |
| 1922 purple_signal_connect(purple_get_core(), "uri-handler", status_box, |
|
| 1923 PURPLE_CALLBACK(statusbox_uri_handler), status_box); |
|
| 1924 |
|
| 1925 } |
1875 } |
| 1926 |
1876 |
| 1927 static void |
1877 static void |
| 1928 pidgin_status_box_size_request(GtkWidget *widget, |
1878 pidgin_status_box_size_request(GtkWidget *widget, |
| 1929 GtkRequisition *requisition) |
1879 GtkRequisition *requisition) |