Пример #1
0
void
fe_dcc_add (struct DCC *dcc)
{
    if (dcc->type == TYPE_CHATRECV || dcc->type == TYPE_CHATSEND) {
        /* chats */
        if (prefs.autodccchat == FALSE) {
            GtkWidget *dialog;
            gint response;

            dialog = gtk_message_dialog_new (GTK_WINDOW (gui.main_window),
                                             GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                                             GTK_MESSAGE_QUESTION,
                                             GTK_BUTTONS_CANCEL,
                                             _("Incoming DCC Chat"));
            gtk_dialog_add_button (GTK_DIALOG (dialog),
                                   _("_Accept"),
                                   GTK_RESPONSE_ACCEPT);
            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                    _("%s is attempting to create a direct chat. Do you wish to accept the connection?"),
                    dcc->nick);

            response = gtk_dialog_run (GTK_DIALOG (dialog));
            if (response == GTK_RESPONSE_ACCEPT) {
                dcc_get (dcc);
            } else {
                dcc_abort (dcc->serv->server_session, dcc);
            }
            gtk_widget_destroy (dialog);
        }
    } else {
        /* file transfers */
        dcc_window_add (gui.dcc, dcc);
    }
}
Пример #2
0
static void
accept_chat_clicked (GtkWidget * wid, gpointer none)
{
	int row;
	struct DCC *dcc;

	row = gtkutil_clist_selection (dcccwin.list);
	if (row != -1)
	{
		dcc = gtk_clist_get_row_data (GTK_CLIST (dcccwin.list), row);
		gtk_clist_unselect_row (GTK_CLIST (dcccwin.list), row, 0);
		dcc_get (dcc);
	}
}
Пример #3
0
static void
accept_chat_clicked (GtkWidget * wid, gpointer none)
{
	struct DCC *dcc;
	GSList *start, *list;

	start = list = dcc_chat_get_selected ();
	for (; list; list = list->next)
	{
		dcc = list->data;
		dcc_get (dcc);
	}
	g_slist_free (start);
}