diff options
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/ascii.c | 2 | ||||
-rw-r--r-- | src/fe-gtk/banlist.c | 591 | ||||
-rw-r--r-- | src/fe-gtk/banlist.h | 59 | ||||
-rw-r--r-- | src/fe-gtk/chanview-tree.c | 23 | ||||
-rw-r--r-- | src/fe-gtk/dccgui.c | 2 | ||||
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 8 | ||||
-rw-r--r-- | src/fe-gtk/fe-gtk.h | 6 | ||||
-rw-r--r-- | src/fe-gtk/gtkutil.c | 15 | ||||
-rw-r--r-- | src/fe-gtk/gtkutil.h | 1 | ||||
-rw-r--r-- | src/fe-gtk/ignoregui.c | 21 | ||||
-rw-r--r-- | src/fe-gtk/maingui.c | 4 | ||||
-rw-r--r-- | src/fe-gtk/notifygui.c | 1 | ||||
-rw-r--r-- | src/fe-gtk/plugingui.c | 1 | ||||
-rw-r--r-- | src/fe-gtk/rawlog.c | 11 | ||||
-rw-r--r-- | src/fe-gtk/search.c | 11 | ||||
-rw-r--r-- | src/fe-gtk/servlistgui.c | 1 | ||||
-rw-r--r-- | src/fe-gtk/setup.c | 13 | ||||
-rw-r--r-- | src/fe-gtk/urlgrab.c | 1 | ||||
-rw-r--r-- | src/fe-gtk/xtext.c | 9 |
19 files changed, 616 insertions, 164 deletions
diff --git a/src/fe-gtk/ascii.c b/src/fe-gtk/ascii.c index 06621cd7..ab6ac0ee 100644 --- a/src/fe-gtk/ascii.c +++ b/src/fe-gtk/ascii.c @@ -90,7 +90,6 @@ static const unsigned char table[]= 0xd1,0x89,0xd1,0x8a,0xd1,0x8b,0xd1,0x8c,0xd1,0x8d,0xd1,0x8e,0xd1,0x8f,0 }; - static gboolean ascii_enter (GtkWidget * wid, GdkEventCrossing *event, GtkWidget *label) { @@ -133,6 +132,7 @@ ascii_open (void) win = mg_create_generic_tab ("charmap", _("Character Chart"), TRUE, TRUE, NULL, NULL, 0, 0, &vbox, NULL); gtk_container_set_border_width (GTK_CONTAINER (win), 5); + gtkutil_destroy_on_esc (win); label = gtk_label_new (NULL); diff --git a/src/fe-gtk/banlist.c b/src/fe-gtk/banlist.c index a783ea07..995af8a2 100644 --- a/src/fe-gtk/banlist.c +++ b/src/fe-gtk/banlist.c @@ -36,6 +36,7 @@ #include <gtk/gtkmessagedialog.h> #include <gtk/gtktreeview.h> #include <gtk/gtktreeselection.h> +#include <glib.h> #include "../common/hexchat.h" #include "../common/fe.h" @@ -46,9 +47,56 @@ #include "maingui.h" #include "banlist.h" +/* + * These supports_* routines set capable, readable, writable bits */ +static void supports_bans (banlist_info *, int); +static void supports_exempt (banlist_info *, int); +static void supports_invite (banlist_info *, int); +static void supports_quiet (banlist_info *, int); + +static mode_info modes[MODE_CT] = { + { + N_("Bans"), + N_("Ban"), + 'b', + RPL_BANLIST, + RPL_ENDOFBANLIST, + 1<<MODE_BAN, + supports_bans + } + ,{ + N_("Exempts"), + N_("Exempt"), + 'e', + RPL_EXCEPTLIST, + RPL_ENDOFEXCEPTLIST, + 1<<MODE_EXEMPT, + supports_exempt + } + ,{ + N_("Invites"), + N_("Invite"), + 'I', + RPL_INVITELIST, + RPL_ENDOFINVITELIST, + 1<<MODE_INVITE, + supports_invite + } + ,{ + N_("Quiets"), + N_("Quiet"), + 'q', + RPL_QUIETLIST, + RPL_ENDOFQUIETLIST, + 1<<MODE_QUIET, + supports_quiet + } +}; + /* model for the banlist tree */ enum { + TYPE_COLUMN, MASK_COLUMN, FROM_COLUMN, DATE_COLUMN, @@ -58,7 +106,7 @@ enum static GtkTreeView * get_view (struct session *sess) { - return GTK_TREE_VIEW (sess->res->banlist_treeview); + return GTK_TREE_VIEW (sess->res->banlist->treeview); } static GtkListStore * @@ -67,91 +115,280 @@ get_store (struct session *sess) return GTK_LIST_STORE (gtk_tree_view_get_model (get_view (sess))); } -static gboolean -supports_exempt (server *serv) +static void +supports_bans (banlist_info *banl, int i) +{ + int bit = 1<<i; + + banl->capable |= bit; + banl->readable |= bit; + banl->writeable |= bit; + return; +} + +static void +supports_exempt (banlist_info *banl, int i) { + server *serv = banl->sess->server; char *cm = serv->chanmodes; + int bit = 1<<i; if (serv->have_except) - return TRUE; + goto yes; if (!cm) - return FALSE; + return; while (*cm) { if (*cm == ',') break; if (*cm == 'e') - return TRUE; + goto yes; cm++; } + return; - return FALSE; +yes: + banl->capable |= bit; + banl->writeable |= bit; } -void -fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int is_exempt) +static void +supports_invite (banlist_info *banl, int i) +{ + server *serv = banl->sess->server; + char *cm = serv->chanmodes; + int bit = 1<<i; + + if (serv->have_invite) + goto yes; + + if (!cm) + return; + + while (*cm) + { + if (*cm == ',') + break; + if (*cm == 'I') + goto yes; + cm++; + } + return; + +yes: + banl->capable |= bit; + banl->writeable |= bit; +} + +static void +supports_quiet (banlist_info *banl, int i) { + server *serv = banl->sess->server; + char *cm = serv->chanmodes; + int bit = 1<<i; + + if (!cm) + return; + + while (*cm) + { + if (*cm == ',') + break; + if (*cm == modes[i].letter) + goto yes; + cm++; + } + return; + +yes: + banl->capable |= bit; + banl->readable |= bit; + banl->writeable |= bit; +} + +/* fe_add_ban_list() and fe_ban_list_end() return TRUE if consumed, FALSE otherwise */ +gboolean +fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int rplcode) +{ + banlist_info *banl = sess->res->banlist; + int i; GtkListStore *store; GtkTreeIter iter; - char buf[512]; - store = get_store (sess); - gtk_list_store_append (store, &iter); + if (!banl) + return FALSE; - if (is_exempt) + for (i = 0; i < MODE_CT; i++) + if (modes[i].code == rplcode) + break; + if (i == MODE_CT) { - snprintf (buf, sizeof (buf), "(EX) %s", mask); - gtk_list_store_set (store, &iter, 0, buf, 1, who, 2, when, -1); - } else + /* printf ("Unexpected value in fe_add_ban_list: %d\n", rplcode); */ + return FALSE; + } + if (banl->pending & 1<<i) { - gtk_list_store_set (store, &iter, 0, mask, 1, who, 2, when, -1); + store = get_store (sess); + gtk_list_store_append (store, &iter); + + gtk_list_store_set (store, &iter, TYPE_COLUMN, _(modes[i].type), MASK_COLUMN, mask, + FROM_COLUMN, who, DATE_COLUMN, when, -1); + + banl->line_ct++; + return TRUE; } + else return FALSE; } -void -fe_ban_list_end (struct session *sess, int is_exemption) +/* Sensitize checkboxes and buttons as appropriate for the moment */ +static void +banlist_sensitize (banlist_info *banl) +{ + int checkable, i; + + /* CHECKBOXES -- */ + checkable = banl->sess->me->op? banl->writeable: banl->readable; + for (i = 0; i < MODE_CT; i++) + { + if (banl->checkboxes[i] == NULL) + continue; + if ((checkable & 1<<i) == 0) + /* Checkbox is not checkable. Grey it and uncheck it. */ + { + gtk_widget_set_sensitive (banl->checkboxes[i], FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (banl->checkboxes[i]), FALSE); + } + else + /* Checkbox is checkable. Be sure it's sensitive. */ + { + gtk_widget_set_sensitive (banl->checkboxes[i], TRUE); + } + } + + /* BUTTONS --- */ + if (banl->sess->me->op == 0 || banl->line_ct == 0) + { + /* If user is not op or list is empty, buttons should be all greyed */ + gtk_widget_set_sensitive (banl->but_clear, FALSE); + gtk_widget_set_sensitive (banl->but_crop, FALSE); + gtk_widget_set_sensitive (banl->but_remove, FALSE); + } + else + { + /* If no lines are selected, only the CLEAR button should be sensitive */ + if (banl->select_ct == 0) + { + gtk_widget_set_sensitive (banl->but_clear, TRUE); + gtk_widget_set_sensitive (banl->but_crop, FALSE); + gtk_widget_set_sensitive (banl->but_remove, FALSE); + } + /* If any lines are selected, only the REMOVE and CROP buttons should be sensitive */ + else + { + gtk_widget_set_sensitive (banl->but_clear, FALSE); + gtk_widget_set_sensitive (banl->but_crop, TRUE); + gtk_widget_set_sensitive (banl->but_remove, TRUE); + } + } + + /* Set "Refresh" sensitvity */ + gtk_widget_set_sensitive (banl->but_refresh, banl->pending? FALSE: banl->checked? TRUE: FALSE); +} +/* fe_ban_list_end() returns TRUE if consumed, FALSE otherwise */ +gboolean +fe_ban_list_end (struct session *sess, int rplcode) +{ + banlist_info *banl = sess->res->banlist; + int i; + + if (!banl) + return FALSE; + + for (i = 0; i < MODE_CT; i++) + if (modes[i].endcode == rplcode) + break; + if (i == MODE_CT) + { + /* printf ("Unexpected rplcode value in fe_ban_list_end: %d\n", rplcode); */ + return FALSE; + } + if (banl->pending & modes[i].bit) + { + banl->pending &= ~modes[i].bit; + if (!banl->pending) + { + gtk_widget_set_sensitive (banl->but_refresh, TRUE); + banlist_sensitize (banl); + } + return TRUE; + } + else return FALSE; +} + +static void +banlist_select_changed (GtkWidget *item, banlist_info *banl) { - gtk_widget_set_sensitive (sess->res->banlist_butRefresh, TRUE); + GList *list; + + if (banl->line_ct == 0) + banl->select_ct = 0; + else + { + list = gtk_tree_selection_get_selected_rows (GTK_TREE_SELECTION (item), NULL); + banl->select_ct = list? 1: 0; + g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); + g_list_free (list); + } + banlist_sensitize (banl); } /** * * Performs the actual refresh operations. * */ static void -banlist_do_refresh (struct session *sess) +banlist_do_refresh (banlist_info *banl) { + session *sess = banl->sess; char tbuf[256]; + int i; + char *tbufp; + + banlist_sensitize (banl); + if (sess->server->connected) { GtkListStore *store; - gtk_widget_set_sensitive (sess->res->banlist_butRefresh, FALSE); - - snprintf (tbuf, sizeof tbuf, DISPLAY_NAME": Ban List (%s, %s)", + g_snprintf (tbuf, sizeof tbuf, DISPLAY_NAME": Ban List (%s, %s)", sess->channel, sess->server->servername); - mg_set_title (sess->res->banlist_window, tbuf); + mg_set_title (banl->window, tbuf); store = get_store (sess); gtk_list_store_clear (store); - - handle_command (sess, "ban", FALSE); - - if (supports_exempt (sess->server)) + banl->line_ct = 0; + banl->pending = banl->checked; + if (banl->pending) { - snprintf (tbuf, sizeof (tbuf), "quote mode %s +e", sess->channel); + tbufp = tbuf + g_snprintf (tbuf, sizeof tbuf, "quote mode %s +", sess->channel); + for (i = 0; i < MODE_CT; i++) + if (banl->pending & 1<<i) + { + *tbufp++ = modes[i].letter; + } + *tbufp = 0; handle_command (sess, tbuf, FALSE); } - - } else + } + else { fe_message (_("Not connected."), FE_MSG_ERROR); } } static void -banlist_refresh (GtkWidget * wid, struct session *sess) +banlist_refresh (GtkWidget * wid, banlist_info *banl) { /* JG NOTE: Didn't see actual use of wid here, so just forwarding * * this to chanlist_do_refresh because I use it without any widget @@ -159,123 +396,106 @@ banlist_refresh (GtkWidget * wid, struct session *sess) * * or apply for the first time if the list has not yet been * * received. * */ - banlist_do_refresh (sess); + banlist_do_refresh (banl); } static int -banlist_unban_inner (gpointer none, struct session *sess, int do_exempts) +banlist_unban_inner (gpointer none, banlist_info *banl, int mode_num) { + session *sess = banl->sess; GtkTreeModel *model; GtkTreeSelection *sel; GtkTreeIter iter; char tbuf[2048]; - char **masks, *tmp, *space; + char **masks, *mask, *type; int num_sel, i; + /* grab the list of selected items */ model = GTK_TREE_MODEL (get_store (sess)); sel = gtk_tree_view_get_selection (get_view (sess)); - num_sel = 0; - if (gtk_tree_model_get_iter_first (model, &iter)) - { - do - { - if (gtk_tree_selection_iter_is_selected (sel, &iter)) - num_sel++; - } - while (gtk_tree_model_iter_next (model, &iter)); - } - if (num_sel < 1) + if (!gtk_tree_model_get_iter_first (model, &iter)) return 0; - /* create an array of all the masks */ - masks = calloc (1, num_sel * sizeof (char *)); - - i = 0; - gtk_tree_model_get_iter_first (model, &iter); + masks = g_malloc (sizeof (char *) * banl->line_ct); + num_sel = 0; do { if (gtk_tree_selection_iter_is_selected (sel, &iter)) { - gtk_tree_model_get (model, &iter, MASK_COLUMN, &masks[i], -1); - space = strchr (masks[i], ' '); + /* Get the mask part of this selected line */ + gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, MASK_COLUMN, &mask, -1); - if (do_exempts) - { - if (space) - { - /* remove the "(EX) " */ - tmp = masks[i]; - masks[i] = g_strdup (space + 1); - g_free (tmp); - i++; - } - } else - { - if (!space) - i++; - } + /* If it's the wrong type of mask, just continue */ + if (strcmp (_(modes[mode_num].type), type) != 0) + continue; + + /* Otherwise add it to our array of mask pointers */ + masks[num_sel++] = g_strdup (mask); + g_free (mask); + g_free (type); } } while (gtk_tree_model_iter_next (model, &iter)); /* and send to server */ - if (do_exempts) - send_channel_modes (sess, tbuf, masks, 0, i, '-', 'e', 0); - else - send_channel_modes (sess, tbuf, masks, 0, i, '-', 'b', 0); + if (num_sel) + send_channel_modes (sess, tbuf, masks, 0, num_sel, '-', modes[mode_num].letter, 0); - /* now free everything, and refresh banlist */ + /* now free everything */ for (i=0; i < num_sel; i++) g_free (masks[i]); - free (masks); + g_free (masks); return num_sel; } static void -banlist_unban (GtkWidget * wid, struct session *sess) +banlist_unban (GtkWidget * wid, banlist_info *banl) { - int num = 0; + int i, num = 0; - num += banlist_unban_inner (wid, sess, FALSE); - num += banlist_unban_inner (wid, sess, TRUE); + for (i = 0; i < MODE_CT; i++) + num += banlist_unban_inner (wid, banl, i); + /* This really should not occur with the redesign */ if (num < 1) { fe_message (_("You must select some bans."), FE_MSG_ERROR); return; } - banlist_do_refresh (sess); + banlist_do_refresh (banl); } static void -banlist_clear_cb (GtkDialog *dialog, gint response, gpointer sess) +banlist_clear_cb (GtkDialog *dialog, gint response, gpointer data) { + banlist_info *banl = data; GtkTreeSelection *sel; gtk_widget_destroy (GTK_WIDGET (dialog)); if (response == GTK_RESPONSE_OK) { - sel = gtk_tree_view_get_selection (get_view (sess)); + sel = gtk_tree_view_get_selection (get_view (banl->sess)); gtk_tree_selection_select_all (sel); - banlist_unban (NULL, sess); + banlist_unban (NULL, banl); } } static void -banlist_clear (GtkWidget * wid, struct session *sess) +banlist_clear (GtkWidget * wid, banlist_info *banl) { GtkWidget *dialog; dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, - _("Are you sure you want to remove all bans in %s?"), sess->channel); + _("Are you sure you want to remove all listed items in %s?"), banl->sess->channel); + g_signal_connect (G_OBJECT (dialog), "response", - G_CALLBACK (banlist_clear_cb), sess); + G_CALLBACK (banlist_clear_cb), banl); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); gtk_widget_show (dialog); } @@ -298,8 +518,9 @@ banlist_add_selected_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *it } static void -banlist_crop (GtkWidget * wid, struct session *sess) +banlist_crop (GtkWidget * wid, banlist_info *banl) { + session *sess = banl->sess; GtkTreeSelection *select; GSList *list = NULL, *node; int num_sel; @@ -318,44 +539,147 @@ banlist_crop (GtkWidget * wid, struct session *sess) for (node = list; node; node = node->next) gtk_tree_selection_unselect_iter (select, node->data); - + g_slist_foreach (list, (GFunc)g_free, NULL); g_slist_free (list); - banlist_unban (NULL, sess); + banlist_unban (NULL, banl); } else fe_message (_("You must select some bans."), FE_MSG_ERROR); } +static void +banlist_toggle (GtkWidget *item, gpointer data) +{ + banlist_info *banl = data; + int i, bit = 0; + + for (i = 0; i < MODE_CT; i++) + if (banl->checkboxes[i] == item) + { + bit = 1<<i; + break; + } + + if (bit) /* Should be gassert() */ + { + banl->checked &= ~bit; + banl->checked |= (GTK_TOGGLE_BUTTON (item)->active)? bit: 0; + banlist_do_refresh (banl); + } +} + +/* NOTICE: The official strptime() is not available on all platforms so + * I've implemented a special version here. The official version is + * vastly more general than this: it uses locales for weekday and month + * names and its second arg is a format character-string. This special + * version depends on the format returned by ctime(3) whose manpage + * says it returns: + * "a null-terminated string of the form "Wed Jun 30 21:49:08 1993\n" + * + * If the real strpftime() comes available, use this format string: + * #define DATE_FORMAT "%a %b %d %T %Y" + */ +static void +strptime (char *ti, struct tm *tm) +{ + /* Expect something like "Sat Mar 16 21:24:27 2013" */ + static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL }; + int M = -1, d = -1, h = -1, m = -1, s = -1, y = -1; + + if (*ti == 0) + { + memset (tm, 0, sizeof *tm); + return; + } + /* No need to supply tm->tm_wday; mktime() doesn't read it */ + ti += 4; + while ((mon[++M])) + if (strncmp (ti, mon[M], 3) == 0) + break; + ti += 4; + + d = strtol (ti, &ti, 10); + h = strtol (++ti, &ti, 10); + m = strtol (++ti, &ti, 10); + s = strtol (++ti, &ti, 10); + y = strtol (++ti, NULL, 10) - 1900; + + tm->tm_sec = s; + tm->tm_min = m; + tm->tm_hour = h; + tm->tm_mday = d; + tm->tm_mon = M; + tm->tm_year = y; +} + +gint +banlist_date_sort (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) +{ + struct tm tm1, tm2; + time_t t1, t2; + char *time1, *time2; + + gtk_tree_model_get(model, a, 2, &time1, -1); + gtk_tree_model_get(model, b, 2, &time2, -1); + strptime (time1, &tm1); + strptime (time2, &tm2); + t1 = mktime (&tm1); + t2 = mktime (&tm2); + + if (t1 < t2) return 1; + if (t1 == t2) return 0; + return -1; +} + static GtkWidget * -banlist_treeview_new (GtkWidget *box) +banlist_treeview_new (GtkWidget *box, banlist_info *banl) { GtkListStore *store; GtkWidget *view; GtkTreeSelection *select; GtkTreeViewColumn *col; + GtkTreeSortable *sortable; store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_STRING); + G_TYPE_STRING, G_TYPE_STRING); g_return_val_if_fail (store != NULL, NULL); + + sortable = GTK_TREE_SORTABLE (store); + gtk_tree_sortable_set_sort_func (sortable, 2, banlist_date_sort, GINT_TO_POINTER (2), NULL); + view = gtkutil_treeview_new (box, GTK_TREE_MODEL (store), NULL, + TYPE_COLUMN, _("Type"), MASK_COLUMN, _("Mask"), FROM_COLUMN, _("From"), DATE_COLUMN, _("Date"), -1); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), MASK_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); - gtk_tree_view_column_set_min_width (col, 300); + gtk_tree_view_column_set_min_width (col, 100); gtk_tree_view_column_set_sort_column_id (col, MASK_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); + + col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), TYPE_COLUMN); + gtk_tree_view_column_set_alignment (col, 0.5); + gtk_tree_view_column_set_sort_column_id (col, TYPE_COLUMN); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), FROM_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); gtk_tree_view_column_set_sort_column_id (col, FROM_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), DATE_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); + gtk_tree_view_column_set_sort_column_id (col, DATE_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); select = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); + g_signal_connect (G_OBJECT (select), "changed", G_CALLBACK (banlist_select_changed), banl); gtk_tree_selection_set_mode (select, GTK_SELECTION_MULTIPLE); gtk_widget_show (view); @@ -363,56 +687,99 @@ banlist_treeview_new (GtkWidget *box) } static void -banlist_closegui (GtkWidget *wid, session *sess) +banlist_closegui (GtkWidget *wid, banlist_info *banl) { - if (is_session (sess)) - sess->res->banlist_window = 0; + session *sess = banl->sess; + + if (sess->res->banlist == banl) + { + g_free (banl); + sess->res->banlist = NULL; + } } void banlist_opengui (struct session *sess) { - GtkWidget *vbox1; - GtkWidget *bbox; + banlist_info *banl; + int i; + GtkWidget *table, *vbox, *bbox; char tbuf[256]; - if (sess->res->banlist_window) + if (sess->type != SESS_CHANNEL) { - mg_bring_tofront (sess->res->banlist_window); + fe_message (_("You can only open the Ban List window while in a channel tab."), FE_MSG_ERROR); return; } - if (sess->type != SESS_CHANNEL) + if (!sess->res->banlist) { - fe_message (_("You can only open the Ban List window while in a channel tab."), FE_MSG_ERROR); + sess->res->banlist = g_malloc0 (sizeof (banlist_info)); + if (!sess->res->banlist) + { + fe_message (_("Banlist initialization failed."), FE_MSG_ERROR); + return; + } + } + banl = sess->res->banlist; + if (banl->window) + { + mg_bring_tofront (banl->window); return; } - snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Ban List (%s)"), + /* New banlist for this session -- Initialize it */ + banl->sess = sess; + /* For each mode set its bit in capable/readable/writeable */ + for (i = 0; i < MODE_CT; i++) + modes[i].tester (banl, i); + /* Force on the checkmark in the "Bans" box */ + banl->checked = 1<<MODE_BAN; + + g_snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Ban List (%s)"), sess->server->servername); - sess->res->banlist_window = mg_create_generic_tab ("BanList", tbuf, FALSE, - TRUE, banlist_closegui, sess, 550, 200, &vbox1, sess->server); + banl->window = mg_create_generic_tab ("BanList", tbuf, FALSE, + TRUE, banlist_closegui, banl, 550, 200, &vbox, sess->server); + gtkutil_destroy_on_esc (banl->window); + + gtk_container_set_border_width (GTK_CONTAINER (banl->window), 3); + gtk_box_set_spacing (GTK_BOX (vbox), 3); /* create banlist view */ - sess->res->banlist_treeview = banlist_treeview_new (vbox1); + banl->treeview = banlist_treeview_new (vbox, banl); + + table = gtk_table_new (1, 3, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 16); + gtk_box_pack_start (GTK_BOX (vbox), table, 0, 0, 0); + + for (i = 0; i < MODE_CT; i++) + { + if (!(banl->capable & 1<<i)) + continue; + banl->checkboxes[i] = gtk_check_button_new_with_label (_(modes[i].name)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (banl->checkboxes[i]), (banl->checked & 1<<i? TRUE: FALSE)); + g_signal_connect (G_OBJECT (banl->checkboxes[i]), "toggled", + G_CALLBACK (banlist_toggle), banl); + gtk_table_attach (GTK_TABLE (table), banl->checkboxes[i], i+1, i+2, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + } bbox = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD); gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); - gtk_box_pack_end (GTK_BOX (vbox1), bbox, 0, 0, 0); + gtk_box_pack_end (GTK_BOX (vbox), bbox, 0, 0, 0); gtk_widget_show (bbox); - gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_unban, sess, + banl->but_remove = gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_unban, banl, _("Remove")); - gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_crop, sess, + banl->but_crop = gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_crop, banl, _("Crop")); - gtkutil_button (bbox, GTK_STOCK_CLEAR, 0, banlist_clear, sess, + banl->but_clear = gtkutil_button (bbox, GTK_STOCK_CLEAR, 0, banlist_clear, banl, _("Clear")); - sess->res->banlist_butRefresh = gtkutil_button (bbox, GTK_STOCK_REFRESH, 0, banlist_refresh, sess, _("Refresh")); + banl->but_refresh = gtkutil_button (bbox, GTK_STOCK_REFRESH, 0, banlist_refresh, banl, _("Refresh")); - banlist_do_refresh (sess); + banlist_do_refresh (banl); - gtk_widget_show (sess->res->banlist_window); + gtk_widget_show_all (banl->window); } diff --git a/src/fe-gtk/banlist.h b/src/fe-gtk/banlist.h index 7ceccd00..0fabc605 100644 --- a/src/fe-gtk/banlist.h +++ b/src/fe-gtk/banlist.h @@ -1 +1,60 @@ +#ifndef BANLIST_H +#define BANLIST_H + +#include "../common/hexchat.h" void banlist_opengui (session *sess); + +#ifndef RPL_BANLIST +/* Where's that darn header file, that would have all these defines ? */ +#define RPL_BANLIST 367 +#define RPL_ENDOFBANLIST 368 +#define RPL_INVITELIST 346 +#define RPL_ENDOFINVITELIST 347 +#define RPL_EXCEPTLIST 348 +#define RPL_ENDOFEXCEPTLIST 349 +#define RPL_QUIETLIST 728 +#define RPL_ENDOFQUIETLIST 729 +#endif + +typedef enum banlist_modes_e { + MODE_BAN, + MODE_EXEMPT, + MODE_INVITE, + MODE_QUIET, + MODE_CT +} banlist_modes; + +typedef struct banlist_info_s banlist_info; + +typedef struct mode_info_s { + char *name; /* Checkbox name, e.g. "Bans" */ + char *type; /* Type for type column, e.g. "Ban" */ + char letter; /* /mode-command letter, e.g. 'b' for MODE_BAN */ + int code; /* rfc RPL_foo code, e.g. 367 for RPL_BANLIST */ + int endcode; /* rfc RPL_ENDOFfoo code, e.g. 368 for RPL_ENDOFBANLIST */ + int bit; /* Mask bit, e.g., 1<<MODE_BAN */ + void (*tester)(banlist_info *, int); /* Function returns true to set bit into checkable */ +} mode_info; + +typedef struct banlist_info_s { + session *sess; + int capable; /* MODE bitmask */ + int readable; /* subset of capable if not op */ + int writeable; /* subset of capable if op */ + int checked; /* subset of (op? writeable: readable) */ + int pending; /* subset of checked */ + int current; /* index of currently processing mode */ + int line_ct; /* count of presented lines */ + int select_ct; /* count of selected lines */ + /* Not really; 1 if any are selected otherwise 0 */ + GtkWidget *window; + GtkWidget *treeview; + GtkWidget *radios[MODE_CT]; + GtkWidget *checkboxes[MODE_CT]; + GtkWidget *but_remove; + GtkWidget *but_crop; + GtkWidget *but_clear; + GtkWidget *but_refresh; + GtkWidget *checkbox[MODE_CT]; /* Checkbox widget for mode */ +} banlist_info; +#endif /* BANLIST_H */ diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 4a4f1db2..2a0bff65 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -75,6 +75,8 @@ cv_tree_init (chanview *cv) { GtkWidget *view, *win; GtkCellRenderer *renderer; + GtkTreeViewColumn *col; + int wid1, wid2; static const GtkTargetEntry dnd_src_target[] = { {"HEXCHAT_CHANVIEW", GTK_TARGET_SAME_APP, 75 } @@ -105,8 +107,17 @@ cv_tree_init (chanview *cv) { gtk_tree_view_set_enable_tree_lines (GTK_TREE_VIEW (view), TRUE); } + + /* Indented channels with no server looks silly, but we still want expanders */ + if (!prefs.hex_gui_tab_server) + { + gtk_widget_style_get (view, "expander-size", &wid1, "horizontal-separator", &wid2, NULL); + gtk_tree_view_set_level_indentation (GTK_TREE_VIEW (view), -wid1 - wid2); + } + gtk_container_add (GTK_CONTAINER (win), view); + col = gtk_tree_view_column_new(); /* icon column */ if (cv->use_icons) @@ -114,9 +125,9 @@ cv_tree_init (chanview *cv) renderer = gtk_cell_renderer_pixbuf_new (); if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "pixbuf", COL_PIXBUF, NULL); + + gtk_tree_view_column_pack_start(col, renderer, FALSE); + gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", COL_PIXBUF, NULL); } /* main column */ @@ -124,9 +135,9 @@ cv_tree_init (chanview *cv) if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_set_attributes (col, renderer, "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), col); g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (view))), "changed", G_CALLBACK (cv_tree_sel_cb), cv); diff --git a/src/fe-gtk/dccgui.c b/src/fe-gtk/dccgui.c index 6cfcd8b7..ffb95218 100644 --- a/src/fe-gtk/dccgui.c +++ b/src/fe-gtk/dccgui.c @@ -745,6 +745,7 @@ fe_dcc_open_recv_win (int passive) dccfwin.window = mg_create_generic_tab ("Transfers", _(DISPLAY_NAME": Uploads and Downloads"), FALSE, TRUE, close_dcc_file_window, NULL, win_width, win_height, &vbox, 0); + gtkutil_destroy_on_esc (dccfwin.window); gtk_container_set_border_width (GTK_CONTAINER (dccfwin.window), 3); gtk_box_set_spacing (GTK_BOX (vbox), 3); @@ -989,6 +990,7 @@ fe_dcc_open_chat_win (int passive) dcccwin.window = mg_create_generic_tab ("DCCChat", _(DISPLAY_NAME": DCC Chat List"), FALSE, TRUE, dcc_chat_close_cb, NULL, 550, 180, &vbox, 0); + gtkutil_destroy_on_esc (dcccwin.window); gtk_container_set_border_width (GTK_CONTAINER (dcccwin.window), 3); gtk_box_set_spacing (GTK_BOX (vbox), 3); diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index a29a6fda..7ed55cbd 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -604,14 +604,6 @@ fe_is_chanwindow (struct server *serv) return 1; } -int -fe_is_banwindow (struct session *sess) -{ - if (!sess->res->banlist_window) - return 0; - return 1; -} - void fe_notify_update (char *name) { diff --git a/src/fe-gtk/fe-gtk.h b/src/fe-gtk/fe-gtk.h index 313afc4b..d15980c6 100644 --- a/src/fe-gtk/fe-gtk.h +++ b/src/fe-gtk/fe-gtk.h @@ -29,6 +29,7 @@ #include <gtk/gtkwidget.h> #include <gtk/gtkcontainer.h> #include <gtk/gtksignal.h> +#include "banlist.h" #undef gtk_signal_connect #define gtk_signal_connect g_signal_connect @@ -97,10 +98,7 @@ struct server_gui typedef struct restore_gui { - /* banlist stuff */ - GtkWidget *banlist_window; - GtkWidget *banlist_treeview; - GtkWidget *banlist_butRefresh; + banlist_info *banlist; void *tab; /* (chan *) */ diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index d032cf48..3743b5e3 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -45,6 +45,7 @@ #include <gtk/gtkcellrenderertoggle.h> #include <gtk/gtkversion.h> #include <gtk/gtkfilechooserdialog.h> +#include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" #include "../common/fe.h" @@ -338,6 +339,20 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte gtk_widget_show (dialog); } +static gboolean +gtkutil_esc_destroy (GtkWidget * win, GdkEventKey * key, gpointer userdata) +{ + if (key->keyval == GDK_Escape) + gtk_widget_destroy (win); + return FALSE; +} + +void +gtkutil_destroy_on_esc (GtkWidget *win) +{ + g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (gtkutil_esc_destroy), win); +} + void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad) { diff --git a/src/fe-gtk/gtkutil.h b/src/fe-gtk/gtkutil.h index 65b5c079..ad0c36ba 100644 --- a/src/fe-gtk/gtkutil.h +++ b/src/fe-gtk/gtkutil.h @@ -12,6 +12,7 @@ typedef void (*filereqcallback) (void *, char *file); void gtkutil_file_req (const char *title, void *callback, void *userdata, char *filter, char *extensions, int flags); void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad); +void gtkutil_destroy_on_esc (GtkWidget *win); GtkWidget *gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback, void *userdata, char *labeltext); void gtkutil_label_new (char *text, GtkWidget * box); diff --git a/src/fe-gtk/ignoregui.c b/src/fe-gtk/ignoregui.c index dca4384b..34a06837 100644 --- a/src/fe-gtk/ignoregui.c +++ b/src/fe-gtk/ignoregui.c @@ -273,13 +273,15 @@ ignore_store_new (int cancel, char *mask, gpointer data) } static void -ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused) +ignore_clear_cb (GtkDialog *dialog, gint response) { GtkListStore *store = GTK_LIST_STORE (get_store ()); GtkTreeIter iter; char *mask; - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) + gtk_widget_destroy (GTK_WIDGET (dialog)); + + if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter) && response == GTK_RESPONSE_OK) { /* remove from ignore_list */ do @@ -297,6 +299,20 @@ ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused) } static void +ignore_clear_entry_clicked (GtkWidget * wid) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (NULL, 0, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, + _("Are you sure you want to remove all ignores?")); + g_signal_connect (G_OBJECT (dialog), "response", + G_CALLBACK (ignore_clear_cb), NULL); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + gtk_widget_show (dialog); +} + +static void ignore_new_entry_clicked (GtkWidget * wid, struct session *sess) { fe_get_str (_("Enter mask to ignore:"), "nick!userid@host.com", @@ -349,6 +365,7 @@ ignore_gui_open () mg_create_generic_tab ("IgnoreList", _(DISPLAY_NAME": Ignore list"), FALSE, TRUE, close_ignore_gui_callback, NULL, 600, 256, &vbox, 0); + gtkutil_destroy_on_esc (ignorewin); view = ignore_treeview_new (vbox); g_object_set_data (G_OBJECT (ignorewin), "view", view); diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 41344c8f..2d02c59d 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -3530,8 +3530,8 @@ fe_server_callback (server *serv) void fe_session_callback (session *sess) { - if (sess->res->banlist_window) - mg_close_gen (NULL, sess->res->banlist_window); + if (sess->res->banlist && sess->res->banlist->window) + mg_close_gen (NULL, sess->res->banlist->window); if (sess->res->input_text) free (sess->res->input_text); diff --git a/src/fe-gtk/notifygui.c b/src/fe-gtk/notifygui.c index 0559734c..4d144258 100644 --- a/src/fe-gtk/notifygui.c +++ b/src/fe-gtk/notifygui.c @@ -413,6 +413,7 @@ notify_opengui (void) notify_window = mg_create_generic_tab ("Notify", _(DISPLAY_NAME": Friends List"), FALSE, TRUE, notify_closegui, NULL, 400, 250, &vbox, 0); + gtkutil_destroy_on_esc (notify_window); view = notify_treeview_new (vbox); g_object_set_data (G_OBJECT (notify_window), "view", view); diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index 293535cc..b2cb95d7 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -219,6 +219,7 @@ plugingui_open (void) plugin_window = mg_create_generic_tab ("Addons", _(DISPLAY_NAME": Plugins and Scripts"), FALSE, TRUE, plugingui_close, NULL, 500, 250, &vbox, 0); + gtkutil_destroy_on_esc (plugin_window); view = plugingui_treeview_new (vbox); g_object_set_data (G_OBJECT (plugin_window), "view", view); diff --git a/src/fe-gtk/rawlog.c b/src/fe-gtk/rawlog.c index 6764034f..651ca1ec 100644 --- a/src/fe-gtk/rawlog.c +++ b/src/fe-gtk/rawlog.c @@ -86,7 +86,7 @@ rawlog_savebutton (GtkWidget * wid, server *serv) return FALSE; } -static void +static gboolean rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { /* Copy rawlog selection to clipboard when Ctrl+Shift+C is pressed, @@ -99,13 +99,7 @@ rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { gtk_xtext_copy_selection (userdata); } - /* close_rawlog is given to mg_create_generic_tab as - * close_callback, it should take care of the rest. - */ - else if (key->keyval == GDK_Escape) - { - gtk_widget_destroy (wid); - } + return FALSE; } void @@ -124,6 +118,7 @@ open_rawlog (struct server *serv) serv->gui->rawlog_window = mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv, 640, 320, &vbox, serv); + gtkutil_destroy_on_esc (serv->gui->rawlog_window); hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (vbox), hbox); diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c index 41a1a642..f2940e70 100644 --- a/src/fe-gtk/search.c +++ b/src/fe-gtk/search.c @@ -32,7 +32,6 @@ #include <gtk/gtkvseparator.h> #include <gtk/gtkradiobutton.h> #include <gtk/gtktogglebutton.h> -#include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" #include "../common/fe.h" @@ -119,14 +118,6 @@ search_entry_cb (GtkWidget * entry, session * sess) search_search (sess, gtk_entry_get_text (GTK_ENTRY (entry))); } -static gboolean -search_key_cb (GtkWidget * window, GdkEventKey * key, gpointer userdata) -{ - if (key->keyval == GDK_Escape) - gtk_widget_destroy (window); - return FALSE; -} - static void search_caseign_cb (GtkToggleButton * but, session * sess) { @@ -238,7 +229,7 @@ search_open (session * sess) add_tip (wid, "Close this box, reset highlighted search items, and stop searching new lines."); /* Add recognition of the ESC key to close the box */ - g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (search_key_cb), win); + gtkutil_destroy_on_esc (win); /* That's all, folks */ searchwin = win; diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index 4aeaf00f..813a85d5 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -93,7 +93,6 @@ static GtkWidget *servlist_open_edit (GtkWidget *parent, ircnet *net); static const char *pages[]= { - "UTF-8 (Unicode)", IRC_DEFAULT_CHARSET, "ISO-8859-15 (Western Europe)", "ISO-8859-2 (Central Europe)", diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 71162792..d7561520 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -322,6 +322,14 @@ static const char *const focusnewtabsmenu[] = NULL }; +static const char *const noticeposmenu[] = +{ + N_("Automatic"), + N_("In an extra tab"), + N_("In the front tab"), + NULL +}; + static const char *const swtype[] = { N_("Tabs"), /* 0 tabs */ @@ -335,13 +343,13 @@ static const setting tabs_settings[] = /*{ST_HEADER, N_("Channel Switcher"),0,0,0},*/ {ST_RADIO, N_("Switcher type:"),P_OFFINTNL(hex_gui_tab_layout), 0, swtype, 0}, {ST_TOGGLE, N_("Open an extra tab for server messages"), P_OFFINTNL(hex_gui_tab_server), 0, 0, 0}, - {ST_TOGGLE, N_("Open an extra tab for server notices"), P_OFFINTNL(hex_gui_tab_notices), 0, 0, 0}, {ST_TOGGLE, N_("Open a new tab when you receive a private message"), P_OFFINTNL(hex_gui_autoopen_dialog), 0, 0, 0}, {ST_TOGGLE, N_("Sort tabs in alphabetical order"), P_OFFINTNL(hex_gui_tab_sort), 0, 0, 0}, {ST_TOGGLE, N_("Show icons in the channel tree"), P_OFFINTNL(hex_gui_tab_icons), 0, 0, 0}, {ST_TOGGLE, N_("Show dotted lines in the channel tree"), P_OFFINTNL(hex_gui_tab_dots), 0, 0, 0}, {ST_TOGGLE, N_("Smaller text"), P_OFFINTNL(hex_gui_tab_small), 0, 0, 0}, {ST_MENU, N_("Focus new tabs:"), P_OFFINTNL(hex_gui_tab_newtofront), 0, focusnewtabsmenu, 0}, + {ST_MENU, N_("Placement of notices:"), P_OFFINTNL(hex_irc_notice_pos), 0, noticeposmenu, 0}, {ST_MENU, N_("Show channel switcher at:"), P_OFFINTNL(hex_gui_tab_pos), 0, cspos, 1}, {ST_NUMBER, N_("Shorten tab labels to:"), P_OFFINTNL(hex_gui_tab_trunc), 0, (const char **)N_("letters."), 99}, @@ -494,6 +502,7 @@ static const setting general_settings[] = static const setting advanced_settings[] = { {ST_HEADER, N_("Advanced Settings"),0,0,0}, + {ST_ENTRY, N_("Real name:"), P_OFFSETNL(hex_irc_real_name), 0, 0, sizeof prefs.hex_irc_real_name}, #ifdef WIN32 {ST_ENTRY, N_("Alternative fonts:"), P_OFFSETNL(hex_text_font_alternative), "Separate multiple entries with commas without spaces before or after.", 0, sizeof prefs.hex_text_font_alternative}, #endif @@ -2221,7 +2230,7 @@ setup_apply (struct hexchatprefs *pr) if (DIFF (hex_gui_compact)) noapply = TRUE; if (DIFF (hex_gui_input_icon)) - noapply = TRUE; + noapply = TRUE; if (DIFF (hex_gui_input_nick)) noapply = TRUE; if (DIFF (hex_gui_lagometer)) diff --git a/src/fe-gtk/urlgrab.c b/src/fe-gtk/urlgrab.c index b8a40a35..0e27efdc 100644 --- a/src/fe-gtk/urlgrab.c +++ b/src/fe-gtk/urlgrab.c @@ -198,6 +198,7 @@ url_opengui () urlgrabberwindow = mg_create_generic_tab ("UrlGrabber", _(DISPLAY_NAME": URL Grabber"), FALSE, TRUE, url_closegui, NULL, 400, 256, &vbox, 0); + gtkutil_destroy_on_esc (urlgrabberwindow); view = url_treeview_new (vbox); g_object_set_data (G_OBJECT (urlgrabberwindow), "model", gtk_tree_view_get_model (GTK_TREE_VIEW (view))); diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6005e265..5b85022e 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -90,15 +90,8 @@ #endif /* is delimiter */ -#if 0 -/* () is used by Wikipedia */ -#define is_del(c) \ - (c == ' ' || c == '\n' || c == ')' || c == '(' || \ - c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0) -#endif #define is_del(c) \ - (c == ' ' || c == '\n' || c == '>' || c == '<' || \ - c == ATTR_RESET || c == ATTR_BOLD || c == 0) + (c == ' ' || c == '\n' || c == '>' || c == '<' || c == 0) #ifdef SCROLL_HACK /* force scrolling off */ |