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 (); }
void key_dialog_show () { GtkWidget *vbox, *hbox, *list, *vbox2, *wid, *wid2, *wid3, *hbox2; struct key_binding *kb; gchar *titles[] = { NULL, NULL, NULL, "1", "2" }; char temp[32]; int i; titles[0] = _("Mod"); titles[1] = _("Key"); titles[2] = _("Action"); if (key_dialog) { mg_bring_tofront (key_dialog); return; } key_dialog = mg_create_generic_tab ("editkeys", _("ZChat: Keyboard Shortcuts"), TRUE, FALSE, key_dialog_close, NULL, 560, 330, &vbox, 0); hbox = gtk_hbox_new (0, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, 1, 1, 0); list = gtkutil_clist_new (5, titles, hbox, 0, key_dialog_sel_row, 0, NULL, 0, GTK_SELECTION_SINGLE); gtk_widget_set_usize (list, 400, 0); key_dialog_kb_clist = list; gtk_widget_show (hbox); kb = keys_root; gtk_clist_set_column_width (GTK_CLIST (list), 1, 50); gtk_clist_set_column_width (GTK_CLIST (list), 2, 120); gtk_clist_set_column_width (GTK_CLIST (list), 3, 50); gtk_clist_set_column_width (GTK_CLIST (list), 4, 50); while (kb) { titles[0] = key_make_mod_str (kb->mod, temp); titles[1] = kb->keyname; if (kb->action < 0 || kb->action > KEY_MAX_ACTIONS) titles[2] = _("<none>"); else titles[2] = key_actions[kb->action].name; if (kb->data1) titles[3] = kb->data1; else titles[3] = _("<none>"); if (kb->data2) titles[4] = kb->data2; else titles[4] = _("<none>"); gtk_clist_set_row_data (GTK_CLIST (list), gtk_clist_append (GTK_CLIST (list), titles), kb); kb = kb->next; } vbox2 = gtk_vbox_new (0, 2); gtk_box_pack_end (GTK_BOX (hbox), vbox2, 1, 1, 0); wid = gtk_button_new_with_label (_("Add New")); gtk_box_pack_start (GTK_BOX (vbox2), wid, 0, 0, 0); gtk_signal_connect (GTK_OBJECT (wid), "clicked", GTK_SIGNAL_FUNC (key_dialog_add_new), list); gtk_widget_show (wid); wid = gtk_button_new_with_label (_("Delete")); gtk_box_pack_start (GTK_BOX (vbox2), wid, 0, 0, 0); gtk_signal_connect (GTK_OBJECT (wid), "clicked", GTK_SIGNAL_FUNC (key_dialog_delete), list); gtk_widget_show (wid); gtk_widget_show (vbox2); wid = gtk_option_menu_new (); wid2 = gtk_menu_new (); for (i = 0; i <= KEY_MAX_ACTIONS; i++) { wid3 = gtk_menu_item_new_with_label (_(key_actions[i].name)); gtk_widget_show (wid3); gtk_menu_shell_append (GTK_MENU_SHELL (wid2), wid3); gtk_signal_connect (GTK_OBJECT (wid3), "activate", GTK_SIGNAL_FUNC (key_dialog_sel_act), GINT_TO_POINTER (i)); } gtk_option_menu_set_menu (GTK_OPTION_MENU (wid), wid2); gtk_option_menu_set_history (GTK_OPTION_MENU (wid), 0); gtk_box_pack_end (GTK_BOX (vbox2), wid, 0, 0, 0); gtk_widget_show (wid); key_dialog_act_menu = wid; key_dialog_tog_s = key_dialog_make_toggle (_("Shift"), key_dialog_tog_key, (void *) STATE_SHIFT, vbox2); key_dialog_tog_a = key_dialog_make_toggle (_("Alt"), key_dialog_tog_key, (void *) STATE_ALT, vbox2); key_dialog_tog_c = key_dialog_make_toggle (_("Ctrl"), key_dialog_tog_key, (void *) STATE_CTRL, vbox2); key_dialog_ent_key = key_dialog_make_entry (_("Key"), "key_press_event", key_dialog_set_key, NULL, vbox2); key_dialog_ent_d1 = key_dialog_make_entry (_("Data 1"), "activate", key_dialog_set_data, NULL, vbox2); key_dialog_ent_d2 = key_dialog_make_entry (_("Data 2"), "activate", key_dialog_set_data, (void *) 1, vbox2); hbox2 = gtk_hbox_new (0, 2); gtk_box_pack_end (GTK_BOX (vbox), hbox2, 0, 0, 1); wid = gtk_xtext_new (colors, 0); gtk_xtext_set_tint (GTK_XTEXT (wid), prefs.tint_red, prefs.tint_green, prefs.tint_blue); gtk_xtext_set_background (GTK_XTEXT (wid), channelwin_pix, prefs.transparent); gtk_widget_set_usize (wid, 0, 75); gtk_box_pack_start (GTK_BOX (hbox2), wid, 1, 1, 1); gtk_xtext_set_font (GTK_XTEXT (wid), prefs.font_normal); gtk_widget_show (wid); wid2 = gtk_vscrollbar_new (GTK_XTEXT (wid)->adj); gtk_box_pack_start (GTK_BOX (hbox2), wid2, 0, 0, 0); gtk_widget_show (wid2); gtk_widget_show (hbox2); key_dialog_text = wid; gtk_widget_show_all (key_dialog); }
void editlist_gui_open (char *title1, char *title2, GSList * list, char *title, char *wmclass, char *file, char *help) { gchar *titles[2]; GtkWidget *vbox, *hbox, *button; if (title1) { titles[0] = title1; titles[1] = title2; } else { titles[0] = _("Name"); titles[1] = _("Command"); } if (editlist_gui_window) { mg_bring_tofront (editlist_gui_window); return; } editlist_list = list; editlist_file = file; editlist_help = help; editlist_gui_window = mg_create_generic_tab (wmclass, title, TRUE, FALSE, editlist_gui_close, NULL, 450, 250, &vbox, 0); editlist_gui_list = gtkutil_clist_new (2, titles, vbox, GTK_POLICY_ALWAYS, editlist_gui_row_selected, 0, editlist_gui_row_unselected, 0, GTK_SELECTION_BROWSE); gtk_clist_set_column_width (GTK_CLIST (editlist_gui_list), 0, 90); hbox = gtk_hbox_new (0, 2); gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); gtk_widget_show (hbox); button = gtkutil_button (hbox, GTK_STOCK_GO_UP, 0, editlist_gui_moveup, 0, _("Move Up")); gtk_widget_set_usize (button, 100, 0); button = gtkutil_button (hbox, GTK_STOCK_GO_DOWN, 0, editlist_gui_movedown, 0, _("Move Dn")); gtk_widget_set_usize (button, 100, 0); button = gtk_vseparator_new (); gtk_container_add (GTK_CONTAINER (hbox), button); gtk_widget_show (button); button = gtkutil_button (hbox, GTK_STOCK_CANCEL, 0, gtkutil_destroy, editlist_gui_window, _("Cancel")); gtk_widget_set_usize (button, 100, 0); button = gtkutil_button (hbox, GTK_STOCK_SAVE, 0, editlist_gui_save, 0, _("Save")); gtk_widget_set_usize (button, 100, 0); hbox = gtk_hbox_new (0, 2); gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); gtk_widget_show (hbox); button = gtkutil_button (hbox, GTK_STOCK_ADD, 0, editlist_gui_addnew, 0, _("Add New")); gtk_widget_set_usize (button, 100, 0); button = gtkutil_button (hbox, GTK_STOCK_REMOVE, 0, editlist_gui_delete, 0, _("Delete")); gtk_widget_set_usize (button, 100, 0); button = gtk_vseparator_new (); gtk_container_add (GTK_CONTAINER (hbox), button); gtk_widget_show (button); button = gtkutil_button (hbox, GTK_STOCK_SORT_ASCENDING, 0, editlist_gui_sort, 0, _("Sort")); gtk_widget_set_usize (button, 100, 0); button = gtkutil_button (hbox, GTK_STOCK_HELP, 0, editlist_gui_help, 0, _("Help")); gtk_widget_set_usize (button, 100, 0); if (!help) gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); hbox = gtk_hbox_new (0, 2); gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); gtk_widget_show (hbox); editlist_gui_entry_name = gtk_entry_new_with_max_length (82); gtk_widget_set_usize (editlist_gui_entry_name, 96, 0); gtk_signal_connect (GTK_OBJECT (editlist_gui_entry_name), "changed", GTK_SIGNAL_FUNC (editlist_gui_handle_name), 0); gtk_box_pack_start (GTK_BOX (hbox), editlist_gui_entry_name, 0, 0, 0); gtk_widget_show (editlist_gui_entry_name); editlist_gui_entry_cmd = gtk_entry_new_with_max_length (255); gtk_signal_connect (GTK_OBJECT (editlist_gui_entry_cmd), "changed", GTK_SIGNAL_FUNC (editlist_gui_handle_cmd), 0); gtk_container_add (GTK_CONTAINER (hbox), editlist_gui_entry_cmd); gtk_widget_show (editlist_gui_entry_cmd); hbox = gtk_hbox_new (0, 2); gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); gtk_widget_show (hbox); editlist_gui_load (editlist_gui_list); gtk_widget_show (editlist_gui_window); }