void ascii_open (void) { int do_unref = TRUE; int i, j, val; unsigned char name[2], num[4]; GtkWidget *wid, *but, *hbox, *vbox, *win; GtkStyle *style; style = gtk_style_new (); gdk_font_unref (style->font); if (menu_sess && menu_sess->type == SESS_DIALOG) { style->font = dialog_font_normal; gdk_font_ref (dialog_font_normal); } else { style->font = font_normal; gdk_font_ref (font_normal); } win = maingui_window ("asciichart", _("Ascii Chart"), TRUE, TRUE, NULL, NULL, 0, 0, NULL); vbox = wins_get_vbox (win); name[1] = 0; for (i = 0; i < 16; i++) { hbox = gtk_hbox_new (0, 0); sprintf (num, "%03d", i * 16); wid = gtk_label_new (num); gtk_widget_set_usize (wid, 36, 20); gtk_container_add (GTK_CONTAINER (hbox), wid); gtk_widget_show (wid); for (j = 0; j < 16; j++) { val = j + (i * 16); name[0] = val; but = gtk_button_new_with_label (name); gtk_widget_set_style (GTK_BIN (but)->child, style); if (do_unref) { do_unref = FALSE; gtk_style_unref (style); } gtk_signal_connect (GTK_OBJECT (but), "clicked", GTK_SIGNAL_FUNC (ascii_click), GINT_TO_POINTER (val)); gtk_widget_set_usize (but, 24, 20); gtk_container_add (GTK_CONTAINER (hbox), but); gtk_widget_show (but); } gtk_container_add (GTK_CONTAINER (vbox), hbox); gtk_widget_show (hbox); } gtk_widget_show (win); }
void fe_dcc_open_send_win (int passive) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), _("Ack"), "%", _("CPS"), _("ETA"), _("To") }; if (dccswin.window) { fe_dcc_update_send_win (); if (!passive) wins_bring_tofront (dccswin.window); return; } dccswin.window = maingui_window ("dccsend", _("X-Chat: File Send List"), FALSE, TRUE, close_dcc_send_window, NULL, 595, 0, &dccswin.window); vbox = wins_get_vbox (dccswin.window); dccswin.list = gtkutil_clist_new (9, titles, vbox, GTK_POLICY_ALWAYS, send_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 2, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 3, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 4, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 5, 30); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 6, 50); gtk_clist_set_column_width (GTK_CLIST (dccswin.list), 7, 50); gtk_clist_set_column_justification (GTK_CLIST (dccswin.list), 5, GTK_JUSTIFY_CENTER); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dccswin.window, 0, _("Abort"), abort_send_clicked, 0, bbox); gtkutil_button (dccswin.window, 0, _("Info"), info_send_clicked, 0, bbox); gtk_widget_show (dccswin.window); fe_dcc_update_send_win (); }
void url_opengui () { GtkWidget *vbox, *hbox; GSList *list; if (urlgrabberwindow) { wins_bring_tofront (urlgrabberwindow); return; } urlgrabberwindow = maingui_window ("urlgrabber", _("X-Chat: URL Grabber"), FALSE, TRUE, url_closegui, NULL, 350, 100, &urlgrabberwindow); vbox = wins_get_vbox (urlgrabberwindow); urlgrabberlist = gtkutil_clist_new (1, 0, vbox, GTK_POLICY_AUTOMATIC, 0, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_signal_connect (GTK_OBJECT (urlgrabberlist), "button_press_event", GTK_SIGNAL_FUNC (url_clicklist), 0); gtk_widget_set_usize (urlgrabberlist, 350, 0); gtk_clist_set_column_width (GTK_CLIST (urlgrabberlist), 0, 100); hbox = gtk_hbox_new (FALSE, 1); gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); gtk_widget_show (hbox); gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_CLEAR, _("Clear"), url_button_clear, 0, hbox); gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_SAVE, _("Save"), url_button_save, 0, hbox); gtk_widget_show (urlgrabberwindow); list = url_list; while (list) { url_addurlgui ((char *) list->data); list = list->next; } }
void notify_opengui (void) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("User"), _("Status"), _("Server"), _("Last Seen") }; if (notify_window) { wins_bring_tofront (notify_window); return; } notify_window = maingui_window ("notify", _("X-Chat: Notify List"), FALSE, TRUE, notify_closegui, NULL, 400, 120, ¬ify_window); vbox = wins_get_vbox (notify_window); notify_guilist = gtkutil_clist_new (4, titles, vbox, GTK_POLICY_ALWAYS, 0, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 0, 100); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 1, 60); gtk_clist_set_column_width (GTK_CLIST (notify_guilist), 2, 100); gtk_clist_set_auto_sort (GTK_CLIST (notify_guilist), FALSE); bbox = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); gtkutil_button (notify_window, GNOME_STOCK_PIXMAP_NEW, _("Add"), notify_add_clicked, 0, bbox); gtkutil_button (notify_window, GNOME_STOCK_PIXMAP_CLOSE, _("Remove"), notify_remove_clicked, 0, bbox); notify_gui_update (); gtk_widget_show (notify_window); }
void fe_dcc_open_chat_win (int passive) { GtkWidget *vbox, *bbox; gchar *titles[] = { _("Status"), _("To/From"), _("Recv"), _("Sent"), _("StartTime") }; if (dcccwin.window) { fe_dcc_update_chat_win (); if (!passive) wins_bring_tofront (dcccwin.window); return; } dcccwin.window = maingui_window ("dccchat", _("X-Chat: DCC Chat List"), FALSE, TRUE, close_dcc_chat_window, NULL, 550, 0, &dcccwin.window); vbox = wins_get_vbox (dcccwin.window); dcccwin.list = gtkutil_clist_new (5, titles, vbox, GTK_POLICY_ALWAYS, chat_row_selected, 0, 0, 0, GTK_SELECTION_BROWSE); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 2, 65); gtk_clist_set_column_width (GTK_CLIST (dcccwin.list), 3, 65); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dcccwin.window, 0, _("Accept"), accept_chat_clicked, 0, bbox); gtkutil_button (dcccwin.window, 0, _("Abort"), abort_chat_clicked, 0, bbox); gtk_widget_show (dcccwin.window); fe_dcc_update_chat_win (); }
void fe_dcc_open_recv_win (int passive) { GtkWidget *vbox, *bbox; #ifdef USE_GNOME gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), "%", _("CPS"), _("ETA"), _("From"), _("MIME Type") }; #else gchar *titles[] = { _("Status"), _("File"), _("Size"), _("Position"), "%", _("CPS"), _("ETA"), _("From") }; #endif if (dccrwin.window) { fe_dcc_update_recv_win (); if (!passive) wins_bring_tofront (dccrwin.window); return; } dccrwin.window = maingui_window ("dccrecv", _("X-Chat: File Receive List"), FALSE, TRUE, close_dcc_recv_window, NULL, 601, 0, &dccrwin.window); vbox = wins_get_vbox (dccrwin.window); #ifdef USE_GNOME dccrwin.list = gtkutil_clist_new (9, titles, vbox, GTK_POLICY_ALWAYS, recv_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); #else dccrwin.list = gtkutil_clist_new (8, titles, vbox, GTK_POLICY_ALWAYS, recv_row_selected, 0, 0, 0, GTK_SELECTION_SINGLE); #endif gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 0, 65); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 1, 100); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 2, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 3, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 4, 30); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 5, 50); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 6, 60); gtk_clist_set_column_width (GTK_CLIST (dccrwin.list), 7, 60); gtk_clist_set_column_justification (GTK_CLIST (dccrwin.list), 4, GTK_JUSTIFY_CENTER); bbox = gtk_hbox_new (FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 2); gtk_widget_show (bbox); gtkutil_button (dccrwin.window, 0, _("Accept"), accept_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Resume"), resume_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Abort"), abort_clicked, 0, bbox); gtkutil_button (dccrwin.window, 0, _("Info"), info_clicked, 0, bbox); #ifdef USE_GNOME gtkutil_button (dccrwin.window, 0, _("Open"), open_clicked, 0, bbox); #endif gtk_widget_show (dccrwin.window); fe_dcc_update_recv_win (); }