static void action_change_icon(PurplePluginAction *action) { PurpleConnection *gc = (PurpleConnection *) action->context; qq_data *qd; gchar *icon_name; gchar *icon_path; g_return_if_fail(NULL != gc && NULL != gc->proto_data); qd = (qq_data *) gc->proto_data; if ( !qd->is_login ) { return; } icon_name = qq_get_icon_name(qd->my_icon); icon_path = qq_get_icon_path(icon_name); g_free(icon_name); purple_debug_info("QQ", "Change prev icon %s to...\n", icon_path); purple_request_file(action, _("Select icon..."), icon_path, FALSE, G_CALLBACK(qq_change_icon_cb), NULL, purple_connection_get_account(gc), NULL, NULL, gc); g_free(icon_path); }
static void install_plugin_cb(GntWidget *w, gpointer null) { static int handle; purple_request_close_with_handle(&handle); purple_request_file(&handle, _("Select plugin to install"), NULL, FALSE, G_CALLBACK(install_selected_file_cb), NULL, NULL, &handle); g_signal_connect_swapped(G_OBJECT(w), "destroy", G_CALLBACK(purple_request_close_with_handle), &handle); }
static int purple_xfer_choose_file(PurpleXfer *xfer) { purple_request_file(xfer, NULL, purple_xfer_get_filename(xfer), (purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE), G_CALLBACK(purple_xfer_choose_file_ok_cb), G_CALLBACK(purple_xfer_choose_file_cancel_cb), purple_xfer_get_account(xfer), xfer->who, NULL, xfer); return 0; }
static void silcpurple_add_buddy_ask_pk_cb(SilcPurpleBuddyRes r, gint id) { if (id != 0) { /* The user did not import public key. The buddy is unusable. */ silcpurple_add_buddy_pk_no(r); silc_free(r); return; } /* Open file selector to select the public key. */ purple_request_file(r->client->application, _("Open..."), NULL, FALSE, G_CALLBACK(silcpurple_add_buddy_ask_import), G_CALLBACK(silcpurple_add_buddy_ask_pk_cancel), purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r); }