Variable cleanup for input_*

This commit is contained in:
Berke Viktor
2012-10-22 14:18:20 +02:00
parent bf27d43052
commit 5c49b45a6d
12 changed files with 85 additions and 90 deletions

View File

@@ -500,27 +500,25 @@ const struct prefs vars[] =
{"gui_win_ucount", P_OFFINT (hex_gui_win_ucount), TYPE_BOOL},
{"gui_win_width", P_OFFINT (hex_gui_win_width), TYPE_INT},
#ifdef WIN32
{"identd", P_OFFINT (identd), TYPE_BOOL},
#endif
{"identd", P_OFFINT (hex_identd), TYPE_BOOL},
{"input_balloon_chans", P_OFFINT (input_balloon_chans), TYPE_BOOL},
{"input_balloon_hilight", P_OFFINT (input_balloon_hilight), TYPE_BOOL},
{"input_balloon_priv", P_OFFINT (input_balloon_priv), TYPE_BOOL},
{"input_balloon_time", P_OFFINT (input_balloon_time), TYPE_INT},
{"input_beep_chans", P_OFFINT (input_beep_chans), TYPE_BOOL},
{"input_beep_hilight", P_OFFINT (input_beep_hilight), TYPE_BOOL},
{"input_beep_priv", P_OFFINT (input_beep_priv), TYPE_BOOL},
{"input_command_char", P_OFFSET (cmdchar), TYPE_STR},
{"input_filter_beep", P_OFFINT (filterbeep), TYPE_BOOL},
{"input_flash_chans", P_OFFINT (input_flash_chans), TYPE_BOOL},
{"input_flash_hilight", P_OFFINT (input_flash_hilight), TYPE_BOOL},
{"input_flash_priv", P_OFFINT (input_flash_priv), TYPE_BOOL},
{"input_perc_ascii", P_OFFINT (perc_ascii), TYPE_BOOL},
{"input_perc_color", P_OFFINT (perc_color), TYPE_BOOL},
{"input_tray_chans", P_OFFINT (input_tray_chans), TYPE_BOOL},
{"input_tray_hilight", P_OFFINT (input_tray_hilight), TYPE_BOOL},
{"input_tray_priv", P_OFFINT (input_tray_priv), TYPE_BOOL},
{"input_balloon_chans", P_OFFINT (hex_input_balloon_chans), TYPE_BOOL},
{"input_balloon_hilight", P_OFFINT (hex_input_balloon_hilight), TYPE_BOOL},
{"input_balloon_priv", P_OFFINT (hex_input_balloon_priv), TYPE_BOOL},
{"input_balloon_time", P_OFFINT (hex_input_balloon_time), TYPE_INT},
{"input_beep_chans", P_OFFINT (hex_input_beep_chans), TYPE_BOOL},
{"input_beep_hilight", P_OFFINT (hex_input_beep_hilight), TYPE_BOOL},
{"input_beep_priv", P_OFFINT (hex_input_beep_priv), TYPE_BOOL},
{"input_command_char", P_OFFSET (hex_input_command_char), TYPE_STR},
{"input_filter_beep", P_OFFINT (hex_input_filter_beep), TYPE_BOOL},
{"input_flash_chans", P_OFFINT (hex_input_flash_chans), TYPE_BOOL},
{"input_flash_hilight", P_OFFINT (hex_input_flash_hilight), TYPE_BOOL},
{"input_flash_priv", P_OFFINT (hex_input_flash_priv), TYPE_BOOL},
{"input_perc_ascii", P_OFFINT (hex_input_perc_ascii), TYPE_BOOL},
{"input_perc_color", P_OFFINT (hex_input_perc_color), TYPE_BOOL},
{"input_tray_chans", P_OFFINT (hex_input_tray_chans), TYPE_BOOL},
{"input_tray_hilight", P_OFFINT (hex_input_tray_hilight), TYPE_BOOL},
{"input_tray_priv", P_OFFINT (hex_input_tray_priv), TYPE_BOOL},
{"irc_auto_rejoin", P_OFFINT (autorejoin), TYPE_BOOL},
{"irc_ban_type", P_OFFINT (bantype), TYPE_INT},
@@ -670,7 +668,7 @@ load_config (void)
prefs.hex_away_show_once = 1;
prefs.indent_nicks = 1;
prefs.thin_separator = 1;
prefs.identd = 1;
prefs.hex_identd = 1;
#ifndef WIN32
prefs.hex_dcc_fast_send = 1;
#endif
@@ -738,9 +736,9 @@ load_config (void)
prefs.hex_gui_ulist_pos = 3;
prefs.hex_gui_win_save = 1;
prefs.bantype = 2;
prefs.input_balloon_time = 20;
prefs.input_flash_priv = prefs.input_flash_hilight = 1;
prefs.input_tray_priv = prefs.input_tray_hilight = 1;
prefs.hex_input_balloon_time = 20;
prefs.hex_input_flash_priv = prefs.hex_input_flash_hilight = 1;
prefs.hex_input_tray_priv = prefs.hex_input_tray_hilight = 1;
prefs.hex_dcc_auto_recv = 2; /* browse mode */
prefs.url_grabber = 1;
prefs.url_grabber_limit = 100; /* 0 means unlimited */
@@ -751,7 +749,7 @@ load_config (void)
strcpy (prefs.timestamp_log_format, "%b %d %H:%M:%S ");
strcpy (prefs.logmask, "%n-%c.log");
strcpy (prefs.hex_completion_suffix, ",");
strcpy (prefs.cmdchar, "/");
strcpy (prefs.hex_input_command_char, "/");
strcpy (prefs.nick1, username);
strcpy (prefs.nick2, username);
strcat (prefs.nick2, "_");

View File

@@ -2482,7 +2482,7 @@ load_perform_file (session *sess, char *file)
continue;
if (nl)
*nl = 0;
if (tbuf[0] == prefs.cmdchar[0])
if (tbuf[0] == prefs.hex_input_command_char[0])
handle_command (sess, tbuf + 1, TRUE);
else
handle_command (sess, tbuf, TRUE);
@@ -4123,7 +4123,7 @@ user_command (session * sess, char *tbuf, char *cmd, char *word[],
handle_command (sess, tbuf, TRUE);
}
/* handle text entered without a CMDchar prefix */
/* handle text entered without a hex_input_command_char prefix */
static void
handle_say (session *sess, char *text, int check_spch)
@@ -4151,8 +4151,8 @@ handle_say (session *sess, char *text, int check_spch)
if (len + NICKLEN >= newcmdlen)
newcmd = malloc (newcmdlen = len + NICKLEN + 1);
if (check_spch && prefs.perc_color)
check_special_chars (text, prefs.perc_ascii);
if (check_spch && prefs.hex_input_perc_color)
check_special_chars (text, prefs.hex_input_perc_ascii);
/* Python relies on this */
word[PDIWORDS] = NULL;
@@ -4306,8 +4306,8 @@ handle_command (session *sess, char *cmd, int check_spch)
if (int_cmd && !int_cmd->handle_quotes)
process_data_init (pdibuf, cmd, word, word_eol, FALSE, FALSE);
if (check_spch && prefs.perc_color)
check_special_chars (cmd, prefs.perc_ascii);
if (check_spch && prefs.hex_input_perc_color)
check_special_chars (cmd, prefs.hex_input_perc_ascii);
if (plugin_emit_command (sess, word[1], word, word_eol))
goto xit;
@@ -4388,20 +4388,20 @@ handle_user_input (session *sess, char *text, int history, int nocommand)
history_add (&sess->history, text);
/* is it NOT a command, just text? */
if (nocommand || text[0] != prefs.cmdchar[0])
if (nocommand || text[0] != prefs.hex_input_command_char[0])
{
handle_say (sess, text, TRUE);
return 1;
}
/* check for // */
if (text[0] == prefs.cmdchar[0] && text[1] == prefs.cmdchar[0])
if (text[0] == prefs.hex_input_command_char[0] && text[1] == prefs.hex_input_command_char[0])
{
handle_say (sess, text + 1, TRUE);
return 1;
}
if (prefs.cmdchar[0] == '/')
if (prefs.hex_input_command_char[0] == '/')
{
int i;
const char *unix_dirs [] = {

View File

@@ -967,7 +967,7 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv)
waitline2 (source, outbuf, sizeof outbuf);
EMIT_SIGNAL (XP_TE_CONNECT, sess, host, ip, outbuf, NULL, 0);
#ifdef WIN32
if (prefs.identd)
if (prefs.hex_identd)
{
if (serv->network && ((ircnet *)serv->network)->user)
{

View File

@@ -2203,9 +2203,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
case XP_TE_DPRIVMSG:
case XP_TE_PRIVACTION:
case XP_TE_DPRIVACTION:
if (chanopt_is_set_a (prefs.input_beep_priv, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_beep_priv, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess);
if (chanopt_is_set_a (prefs.input_flash_priv, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_flash_priv, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess);
/* why is this one different? because of plugin-tray.c's hooks! ugly */
if (sess->alert_tray == SET_ON)
@@ -2215,9 +2215,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
/* ===Highlighted message=== */
case XP_TE_HCHANACTION:
case XP_TE_HCHANMSG:
if (chanopt_is_set_a (prefs.input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess);
if (chanopt_is_set_a (prefs.input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess);
if (sess->alert_tray == SET_ON)
fe_tray_set_icon (FE_ICON_MESSAGE);
@@ -2226,9 +2226,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
/* ===Channel message=== */
case XP_TE_CHANACTION:
case XP_TE_CHANMSG:
if (chanopt_is_set_a (prefs.input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess);
if (chanopt_is_set_a (prefs.input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
if (chanopt_is_set_a (prefs.hex_input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess);
if (sess->alert_tray == SET_ON)
fe_tray_set_icon (FE_ICON_MESSAGE);

View File

@@ -113,6 +113,7 @@ struct hexchatprefs
char hex_dcc_ip[DOMAINLEN + 1];
char hex_dnsprogram[72];
char hex_gui_ulist_doubleclick[256];
char hex_input_command_char[4];
int hex_away_size_max;
int hex_away_timeout;
@@ -160,6 +161,7 @@ struct hexchatprefs
int hex_gui_win_state;
int hex_gui_win_top;
int hex_gui_win_width;
int hex_input_balloon_time;
unsigned int hex_away_auto_unmark;
unsigned int hex_away_omit_alerts;
@@ -210,6 +212,23 @@ struct hexchatprefs
unsigned int hex_gui_win_save;
unsigned int hex_gui_win_swap;
unsigned int hex_gui_win_ucount;
unsigned int hex_identd;
unsigned int hex_input_balloon_chans;
unsigned int hex_input_balloon_hilight;
unsigned int hex_input_balloon_priv;
unsigned int hex_input_beep_chans;
unsigned int hex_input_beep_hilight;
unsigned int hex_input_beep_priv;
unsigned int hex_input_filter_beep;
unsigned int hex_input_flash_chans;
unsigned int hex_input_flash_hilight;
unsigned int hex_input_flash_priv;
unsigned int hex_input_perc_ascii;
unsigned int hex_input_perc_color;
unsigned int hex_input_tray_chans;
unsigned int hex_input_tray_hilight;
unsigned int hex_input_tray_priv;
/* these are the legacy variables */
@@ -231,7 +250,6 @@ struct hexchatprefs
char irc_no_hilight[300];
char irc_nick_hilight[300];
char hostname[127];
char cmdchar[4];
char logmask[256];
char stamp_format[64];
char timestamp_log_format[64];
@@ -258,8 +276,6 @@ struct hexchatprefs
guint32 local_ip;
guint32 dcc_ip;
unsigned int perc_color;
unsigned int perc_ascii;
unsigned int autoreconnect;
unsigned int autoreconnectonfail;
unsigned int invisible;
@@ -276,24 +292,6 @@ struct hexchatprefs
unsigned int text_stripcolor_replay;
unsigned int text_stripcolor_topic;
unsigned int timestamp;
unsigned int filterbeep;
unsigned int input_balloon_chans;
unsigned int input_balloon_hilight;
unsigned int input_balloon_priv;
unsigned int input_balloon_time;
unsigned int input_beep_chans;
unsigned int input_beep_hilight;
unsigned int input_beep_priv;
unsigned int input_flash_chans;
unsigned int input_flash_hilight;
unsigned int input_flash_priv;
unsigned int input_tray_chans;
unsigned int input_tray_hilight;
unsigned int input_tray_priv;
unsigned int irc_join_delay;
unsigned int logging;
@@ -317,7 +315,6 @@ struct hexchatprefs
unsigned int wait_on_exit;
unsigned int confmode;
unsigned int utf8_locale;
unsigned int identd;
unsigned int url_grabber;
unsigned int url_grabber_limit;