2013-03-31 15:44:48 -04:00
|
|
|
/* HexChat
|
|
|
|
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
|
|
* Copyright (C) 2009-2013 Berke Viktor.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2013-03-31 19:02:03 -04:00
|
|
|
#ifndef HEXCHAT_BANLIST_H
|
|
|
|
#define HEXCHAT_BANLIST_H
|
Redesign the Ban List window. Closes Issues #303, #342, #427
This is a combination of 18 commits.
The first commit's message is:
Here is the initial banlist branch of RichardHitt/hexchat.
Changed files are only src/fe-gtk/{banlist.c,fe-gtk.h}.
This version works and contains my first efforts at selective
sensitization of radio buttons and control buttons.
From this point I intend to undertake a stepwise redesign.
Step 1 will be to make the existing banlist code work for
multiple simultaneous banlist windows (for different channels,
obviously). It will be a hackathon with the only goal of getting
it working.
Step 2 will be the objectization and alpha-stage tidying-up of
all the terrible looking stuff I will have done in Step 1.
This is the 2nd commit message:
Here's the post-Step-1 commit. It works for multiple banlist windows.
Note particularly what I've done to banlist.h.
Note that for many functions in banlist.c the argument is now
a banlist_info *, rather than a session *.
Note in banlist.c the initialization of array modes[] which
contains driving information for the checkboxes.
Of course those checkboxes aren't yet implemented. Maybe in Step 2
I will change to checkboxes from radio buttons; but definitely I will
change to letting modes[] drive processing.
This is the 3rd commit message:
Converted to checkboxes. Much additional work.
Note that the infrastructure for Auto-invite is not yet
present in the hexchat tree. I'm nearly done with banlist,
I think!
This is the 4th commit message:
Fleshed out 'invite'. Tagged masks uniformly, e.g. (b) (e) (I).
General cleanup, nearly at the point of beta quality.
This is the 5th commit message:
Added fourth mode type: quiet. Did lots and lots of cleanup. Beta-ready?
This is the 6th commit message:
Get the banlist timestamps properly sortable.
This is the 7th commit message:
Redesign the supports_foo() routines. Now they're responsible for setting
the flags in ->capable, ->readable, ->writeable.
This is the 8th commit message:
Deleted a couple of RBH comments.
This is the 9th commit message:
Now the ESC key will close the banlist window.
This is the 10th commit message:
Fix the fe-text occurrence of fe_add_ban_list().
This is the 11th commit message:
Fixed also fe_ban_list_end() and removed fe_is_banwindow().
This is the 12th commit message:
Use old-style initialization for array of structures modes[]
This is the 13th commit message:
Oops, incomplete regression of modes[] initialization. This fixes.
This is the 14th commit message:
Fixed strptime buy implementing a special version here.
Fixed column width concerns by setting resizable and autosize.
This is the 15th commit message:
Get rid of testing line.
This is the 16th commit message:
Changed to gtkutil_destroy_on_esc ()
This is the 17th commit message:
Remove no-longer-used functnion
This is the 18th commit message:
Minor cleanups to banlist.c, banlist.h
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
Author: RichardHitt <rbh00@netcom.com>
Committer: Richard Hitt <rbh00@f17.rbh00.pacbell.net>
Not currently on any branch.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: src/common/fe.h
modified: src/common/hexchat.h
modified: src/common/inbound.c
modified: src/common/modes.c
modified: src/common/proto-irc.c
modified: src/common/server.c
modified: src/fe-gtk/banlist.c
modified: src/fe-gtk/banlist.h
modified: src/fe-gtk/fe-gtk.c
modified: src/fe-gtk/fe-gtk.h
modified: src/fe-gtk/maingui.c
modified: src/fe-text/fe-text.c
2013-03-05 03:13:51 -05:00
|
|
|
|
|
|
|
#include "../common/hexchat.h"
|
2011-02-23 22:14:30 -05:00
|
|
|
void banlist_opengui (session *sess);
|
Redesign the Ban List window. Closes Issues #303, #342, #427
This is a combination of 18 commits.
The first commit's message is:
Here is the initial banlist branch of RichardHitt/hexchat.
Changed files are only src/fe-gtk/{banlist.c,fe-gtk.h}.
This version works and contains my first efforts at selective
sensitization of radio buttons and control buttons.
From this point I intend to undertake a stepwise redesign.
Step 1 will be to make the existing banlist code work for
multiple simultaneous banlist windows (for different channels,
obviously). It will be a hackathon with the only goal of getting
it working.
Step 2 will be the objectization and alpha-stage tidying-up of
all the terrible looking stuff I will have done in Step 1.
This is the 2nd commit message:
Here's the post-Step-1 commit. It works for multiple banlist windows.
Note particularly what I've done to banlist.h.
Note that for many functions in banlist.c the argument is now
a banlist_info *, rather than a session *.
Note in banlist.c the initialization of array modes[] which
contains driving information for the checkboxes.
Of course those checkboxes aren't yet implemented. Maybe in Step 2
I will change to checkboxes from radio buttons; but definitely I will
change to letting modes[] drive processing.
This is the 3rd commit message:
Converted to checkboxes. Much additional work.
Note that the infrastructure for Auto-invite is not yet
present in the hexchat tree. I'm nearly done with banlist,
I think!
This is the 4th commit message:
Fleshed out 'invite'. Tagged masks uniformly, e.g. (b) (e) (I).
General cleanup, nearly at the point of beta quality.
This is the 5th commit message:
Added fourth mode type: quiet. Did lots and lots of cleanup. Beta-ready?
This is the 6th commit message:
Get the banlist timestamps properly sortable.
This is the 7th commit message:
Redesign the supports_foo() routines. Now they're responsible for setting
the flags in ->capable, ->readable, ->writeable.
This is the 8th commit message:
Deleted a couple of RBH comments.
This is the 9th commit message:
Now the ESC key will close the banlist window.
This is the 10th commit message:
Fix the fe-text occurrence of fe_add_ban_list().
This is the 11th commit message:
Fixed also fe_ban_list_end() and removed fe_is_banwindow().
This is the 12th commit message:
Use old-style initialization for array of structures modes[]
This is the 13th commit message:
Oops, incomplete regression of modes[] initialization. This fixes.
This is the 14th commit message:
Fixed strptime buy implementing a special version here.
Fixed column width concerns by setting resizable and autosize.
This is the 15th commit message:
Get rid of testing line.
This is the 16th commit message:
Changed to gtkutil_destroy_on_esc ()
This is the 17th commit message:
Remove no-longer-used functnion
This is the 18th commit message:
Minor cleanups to banlist.c, banlist.h
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
Author: RichardHitt <rbh00@netcom.com>
Committer: Richard Hitt <rbh00@f17.rbh00.pacbell.net>
Not currently on any branch.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: src/common/fe.h
modified: src/common/hexchat.h
modified: src/common/inbound.c
modified: src/common/modes.c
modified: src/common/proto-irc.c
modified: src/common/server.c
modified: src/fe-gtk/banlist.c
modified: src/fe-gtk/banlist.h
modified: src/fe-gtk/fe-gtk.c
modified: src/fe-gtk/fe-gtk.h
modified: src/fe-gtk/maingui.c
modified: src/fe-text/fe-text.c
2013-03-05 03:13:51 -05:00
|
|
|
|
|
|
|
#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 {
|
|
|
|
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 *checkboxes[MODE_CT];
|
|
|
|
GtkWidget *but_remove;
|
|
|
|
GtkWidget *but_crop;
|
|
|
|
GtkWidget *but_clear;
|
|
|
|
GtkWidget *but_refresh;
|
|
|
|
} banlist_info;
|
2013-03-25 19:16:51 -04:00
|
|
|
|
|
|
|
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;
|
2013-03-31 19:02:03 -04:00
|
|
|
|
|
|
|
#endif /* HEXCHAT_BANLIST_H */
|