From 5c49b45a6deb80d604fd6114bb110358b6ee0687 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Mon, 22 Oct 2012 14:18:20 +0200 Subject: Variable cleanup for input_* --- src/common/cfgfiles.c | 50 ++++++++++++++++++++++++-------------------------- src/common/outbound.c | 18 +++++++++--------- src/common/server.c | 2 +- src/common/text.c | 12 ++++++------ src/common/xchat.h | 41 +++++++++++++++++++---------------------- 5 files changed, 59 insertions(+), 64 deletions(-) (limited to 'src/common') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index d8f610a7..036ea04d 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -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 - - {"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}, + {"identd", P_OFFINT (hex_identd), 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, "_"); diff --git a/src/common/outbound.c b/src/common/outbound.c index 4529c49e..93751fcf 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -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 [] = { diff --git a/src/common/server.c b/src/common/server.c index 7e9b18a4..66d9d0d6 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -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) { diff --git a/src/common/text.c b/src/common/text.c index bbd12f05..033b1b2f 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -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); diff --git a/src/common/xchat.h b/src/common/xchat.h index c7aee0f7..33b7822d 100644 --- a/src/common/xchat.h +++ b/src/common/xchat.h @@ -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; -- cgit 1.4.1