2000-04-26 04:03:38 -04:00
|
|
|
/*
|
|
|
|
fe-settings.c : irssi
|
|
|
|
|
|
|
|
Copyright (C) 1999 Timo Sirainen
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2007-05-08 14:41:10 -04:00
|
|
|
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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2000-04-26 04:03:38 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "module.h"
|
|
|
|
#include "module-formats.h"
|
|
|
|
#include "signals.h"
|
|
|
|
#include "commands.h"
|
2000-08-26 11:39:44 -04:00
|
|
|
#include "servers.h"
|
2000-05-04 06:32:42 -04:00
|
|
|
#include "misc.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "lib-config/iconfig.h"
|
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
#include "levels.h"
|
2000-10-28 16:14:19 -04:00
|
|
|
#include "printtext.h"
|
2001-01-04 13:01:51 -05:00
|
|
|
#include "keyboard.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
static void set_print(SETTINGS_REC *rec)
|
|
|
|
{
|
2007-04-29 07:20:36 -04:00
|
|
|
char *value;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2007-04-29 07:20:36 -04:00
|
|
|
value = settings_get_print(rec);
|
2001-05-26 15:20:45 -04:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_SET_ITEM,
|
|
|
|
rec->key, value);
|
2007-04-29 07:20:36 -04:00
|
|
|
g_free(value);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2007-06-05 08:03:18 -04:00
|
|
|
static void set_print_pattern(const char *pattern)
|
|
|
|
{
|
|
|
|
GSList *sets, *tmp;
|
|
|
|
const char *last_section;
|
|
|
|
|
|
|
|
last_section = "";
|
|
|
|
sets = settings_get_sorted();
|
|
|
|
for (tmp = sets; tmp != NULL; tmp = tmp->next) {
|
|
|
|
SETTINGS_REC *rec = tmp->data;
|
|
|
|
|
|
|
|
if (stristr(rec->key, pattern) == NULL)
|
|
|
|
continue;
|
|
|
|
if (strcmp(last_section, rec->section) != 0) {
|
|
|
|
/* print section */
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
|
|
|
TXT_SET_TITLE, rec->section);
|
|
|
|
last_section = rec->section;
|
|
|
|
}
|
|
|
|
set_print(rec);
|
|
|
|
}
|
|
|
|
g_slist_free(sets);
|
|
|
|
}
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
static void set_boolean(const char *key, const char *value)
|
|
|
|
{
|
2008-03-09 08:01:16 -04:00
|
|
|
if (g_ascii_strcasecmp(value, "ON") == 0)
|
2000-12-17 00:44:45 -05:00
|
|
|
settings_set_bool(key, TRUE);
|
2008-03-09 08:01:16 -04:00
|
|
|
else if (g_ascii_strcasecmp(value, "OFF") == 0)
|
2000-12-17 00:44:45 -05:00
|
|
|
settings_set_bool(key, FALSE);
|
2008-03-09 08:01:16 -04:00
|
|
|
else if (g_ascii_strcasecmp(value, "TOGGLE") == 0)
|
2000-12-17 00:44:45 -05:00
|
|
|
settings_set_bool(key, !settings_get_bool(key));
|
2000-04-26 04:03:38 -04:00
|
|
|
else
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_NOT_TOGGLE);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2002-06-06 16:22:38 -04:00
|
|
|
/* SYNTAX: SET [-clear | -default] [<key> [<value>]] */
|
2000-04-26 04:03:38 -04:00
|
|
|
static void cmd_set(char *data)
|
|
|
|
{
|
2000-07-04 15:36:36 -04:00
|
|
|
GHashTable *optlist;
|
2000-07-10 19:00:56 -04:00
|
|
|
char *key, *value;
|
2000-06-17 21:18:12 -04:00
|
|
|
void *free_arg;
|
2007-06-05 08:03:18 -04:00
|
|
|
int clear, set_default;
|
|
|
|
SETTINGS_REC *rec;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-07-04 15:36:36 -04:00
|
|
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_OPTIONS,
|
|
|
|
"set", &optlist, &key, &value))
|
2000-06-17 21:18:12 -04:00
|
|
|
return;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-07-04 15:36:36 -04:00
|
|
|
clear = g_hash_table_lookup(optlist, "clear") != NULL;
|
2002-06-06 16:22:38 -04:00
|
|
|
set_default = g_hash_table_lookup(optlist, "default") != NULL;
|
2000-07-04 15:36:36 -04:00
|
|
|
|
2004-03-23 14:20:45 -05:00
|
|
|
if (*key == '\0')
|
|
|
|
clear = set_default = FALSE;
|
|
|
|
|
2007-06-05 08:03:18 -04:00
|
|
|
if (!(clear || set_default || *value != '\0'))
|
|
|
|
set_print_pattern(key);
|
|
|
|
else {
|
|
|
|
rec = settings_get_record(key);
|
|
|
|
if (rec != NULL) {
|
2000-04-26 04:03:38 -04:00
|
|
|
/* change the setting */
|
|
|
|
switch (rec->type) {
|
|
|
|
case SETTING_TYPE_BOOLEAN:
|
2001-03-03 11:14:28 -05:00
|
|
|
if (clear)
|
|
|
|
settings_set_bool(key, FALSE);
|
2002-06-06 16:22:38 -04:00
|
|
|
else if (set_default)
|
2002-12-28 12:54:13 -05:00
|
|
|
settings_set_bool(key, rec->default_value.v_bool);
|
2002-06-06 16:22:38 -04:00
|
|
|
else
|
2001-03-03 11:14:28 -05:00
|
|
|
set_boolean(key, value);
|
2000-04-26 04:03:38 -04:00
|
|
|
break;
|
|
|
|
case SETTING_TYPE_INT:
|
2002-06-06 16:22:38 -04:00
|
|
|
settings_set_int(key, clear ? 0 :
|
2002-12-28 12:54:13 -05:00
|
|
|
set_default ? rec->default_value.v_int :
|
2002-06-06 16:22:38 -04:00
|
|
|
atoi(value));
|
2000-04-26 04:03:38 -04:00
|
|
|
break;
|
|
|
|
case SETTING_TYPE_STRING:
|
2002-06-06 16:22:38 -04:00
|
|
|
settings_set_str(key, clear ? "" :
|
2002-12-28 12:54:13 -05:00
|
|
|
set_default ? rec->default_value.v_string :
|
2002-06-06 16:22:38 -04:00
|
|
|
value);
|
2000-04-26 04:03:38 -04:00
|
|
|
break;
|
2002-12-28 12:54:13 -05:00
|
|
|
case SETTING_TYPE_TIME:
|
|
|
|
if (!settings_set_time(key, clear ? "0" :
|
|
|
|
set_default ? rec->default_value.v_string : value))
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
|
|
|
TXT_INVALID_TIME);
|
|
|
|
break;
|
|
|
|
case SETTING_TYPE_LEVEL:
|
|
|
|
if (!settings_set_level(key, clear ? "" :
|
|
|
|
set_default ? rec->default_value.v_string : value))
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
|
|
|
TXT_INVALID_LEVEL);
|
|
|
|
break;
|
|
|
|
case SETTING_TYPE_SIZE:
|
|
|
|
if (!settings_set_size(key, clear ? "0" :
|
|
|
|
set_default ? rec->default_value.v_string : value))
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
|
|
|
TXT_INVALID_SIZE);
|
|
|
|
break;
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
signal_emit("setup changed", 0);
|
2007-06-05 08:03:18 -04:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
|
|
|
TXT_SET_TITLE, rec->section);
|
|
|
|
set_print(rec);
|
|
|
|
} else
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
|
|
|
TXT_SET_UNKNOWN, key);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-06-17 21:18:12 -04:00
|
|
|
cmd_params_free(free_arg);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-07-23 19:19:22 -04:00
|
|
|
/* SYNTAX: TOGGLE <key> [on|off|toggle] */
|
2000-04-26 04:03:38 -04:00
|
|
|
static void cmd_toggle(const char *data)
|
|
|
|
{
|
2000-06-17 21:18:12 -04:00
|
|
|
char *key, *value;
|
|
|
|
void *free_arg;
|
2000-04-26 04:03:38 -04:00
|
|
|
int type;
|
|
|
|
|
2000-06-17 21:18:12 -04:00
|
|
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &key, &value))
|
|
|
|
return;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-02-19 02:16:32 -05:00
|
|
|
if (*key == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
type = settings_get_type(key);
|
|
|
|
if (type == -1)
|
2001-05-26 15:20:45 -04:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_SET_UNKNOWN, key);
|
2000-04-26 04:03:38 -04:00
|
|
|
else if (type != SETTING_TYPE_BOOLEAN)
|
2001-05-26 15:20:45 -04:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_SET_NOT_BOOLEAN, key);
|
2000-04-26 04:03:38 -04:00
|
|
|
else {
|
|
|
|
set_boolean(key, *value != '\0' ? value : "TOGGLE");
|
|
|
|
set_print(settings_get_record(key));
|
2001-07-30 08:24:24 -04:00
|
|
|
signal_emit("setup changed", 0);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-06-17 21:18:12 -04:00
|
|
|
cmd_params_free(free_arg);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-06-18 06:25:39 -04:00
|
|
|
static int config_key_compare(CONFIG_NODE *node1, CONFIG_NODE *node2)
|
|
|
|
{
|
|
|
|
return g_strcasecmp(node1->key, node2->key);
|
|
|
|
}
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
static void show_aliases(const char *alias)
|
|
|
|
{
|
|
|
|
CONFIG_NODE *node;
|
2000-06-18 06:25:39 -04:00
|
|
|
GSList *tmp, *list;
|
2000-04-26 04:03:38 -04:00
|
|
|
int aliaslen;
|
|
|
|
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_HEADER);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
node = iconfig_node_traverse("aliases", FALSE);
|
2002-02-02 12:37:44 -05:00
|
|
|
tmp = node == NULL ? NULL : config_node_first(node->value);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-18 06:25:39 -04:00
|
|
|
/* first get the list of aliases sorted */
|
|
|
|
list = NULL;
|
2000-04-26 04:03:38 -04:00
|
|
|
aliaslen = strlen(alias);
|
2002-02-02 12:37:44 -05:00
|
|
|
for (; tmp != NULL; tmp = config_node_next(tmp)) {
|
2000-04-26 04:03:38 -04:00
|
|
|
CONFIG_NODE *node = tmp->data;
|
|
|
|
|
|
|
|
if (node->type != NODE_TYPE_KEY)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (aliaslen != 0 && g_strncasecmp(node->key, alias, aliaslen) != 0)
|
|
|
|
continue;
|
|
|
|
|
2000-06-18 06:25:39 -04:00
|
|
|
list = g_slist_insert_sorted(list, node, (GCompareFunc) config_key_compare);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* print the aliases */
|
|
|
|
for (tmp = list; tmp != NULL; tmp = tmp->next) {
|
|
|
|
CONFIG_NODE *node = tmp->data;
|
|
|
|
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_LINE,
|
2000-04-26 04:03:38 -04:00
|
|
|
node->key, node->value);
|
|
|
|
}
|
2000-06-18 06:25:39 -04:00
|
|
|
g_slist_free(list);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_ALIASLIST_FOOTER);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void alias_remove(const char *alias)
|
|
|
|
{
|
|
|
|
if (iconfig_get_str("aliases", alias, NULL) == NULL)
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_NOT_FOUND, alias);
|
2000-04-26 04:03:38 -04:00
|
|
|
else {
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_REMOVED, alias);
|
2000-04-26 04:03:38 -04:00
|
|
|
iconfig_set_str("aliases", alias, NULL);
|
2002-05-12 10:06:08 -04:00
|
|
|
|
2002-05-12 10:23:05 -04:00
|
|
|
signal_emit("alias removed", 1, alias);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-23 19:19:22 -04:00
|
|
|
/* SYNTAX: ALIAS [[-]<alias> [<command>]] */
|
2000-04-26 04:03:38 -04:00
|
|
|
static void cmd_alias(const char *data)
|
|
|
|
{
|
2000-06-17 21:18:12 -04:00
|
|
|
char *alias, *value;
|
|
|
|
void *free_arg;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
2000-06-17 21:18:12 -04:00
|
|
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &alias, &value))
|
|
|
|
return;
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
if (*alias == '-') {
|
|
|
|
if (alias[1] != '\0') alias_remove(alias+1);
|
|
|
|
} else if (*alias == '\0' || *value == '\0')
|
|
|
|
show_aliases(alias);
|
|
|
|
else {
|
2001-01-07 14:42:59 -05:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_ALIAS_ADDED, alias);
|
2000-04-26 04:03:38 -04:00
|
|
|
iconfig_set_str("aliases", alias, value);
|
2002-05-12 10:23:05 -04:00
|
|
|
signal_emit("alias added", 2, alias, value);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
2000-06-17 21:18:12 -04:00
|
|
|
cmd_params_free(free_arg);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-07-23 19:19:22 -04:00
|
|
|
/* SYNTAX: UNALIAS <alias> */
|
2000-04-26 04:03:38 -04:00
|
|
|
static void cmd_unalias(const char *data)
|
|
|
|
{
|
2002-06-04 17:23:34 -04:00
|
|
|
char *alias;
|
|
|
|
void *free_arg;
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
2002-06-04 17:23:34 -04:00
|
|
|
if (!cmd_get_params(data, &free_arg, 1, &alias))
|
|
|
|
return;
|
|
|
|
if (*alias == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
|
|
|
|
|
|
|
alias_remove(alias);
|
|
|
|
cmd_params_free(free_arg);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-07-23 19:19:22 -04:00
|
|
|
/* SYNTAX: RELOAD [<file>] */
|
2000-07-22 18:05:29 -04:00
|
|
|
static void cmd_reload(const char *data)
|
|
|
|
{
|
2001-07-28 20:27:23 -04:00
|
|
|
const char *fname;
|
|
|
|
|
|
|
|
fname = *data == '\0' ? get_irssi_config() : data;
|
2000-07-22 18:05:29 -04:00
|
|
|
|
|
|
|
if (settings_reread(fname)) {
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
2001-01-07 14:42:59 -05:00
|
|
|
TXT_CONFIG_RELOADED, fname);
|
2000-07-22 18:05:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-10-15 15:21:21 -04:00
|
|
|
static void settings_save_fe(const char *fname)
|
|
|
|
{
|
2001-11-14 11:28:56 -05:00
|
|
|
if (settings_save(fname, FALSE /* not autosaved */)) {
|
2000-10-15 15:21:21 -04:00
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
2001-01-07 14:42:59 -05:00
|
|
|
TXT_CONFIG_SAVED, fname);
|
2000-10-15 15:21:21 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void settings_save_confirm(const char *line, char *fname)
|
|
|
|
{
|
2002-01-27 15:45:59 -05:00
|
|
|
if (i_toupper(line[0]) == 'Y')
|
2000-10-15 15:21:21 -04:00
|
|
|
settings_save_fe(fname);
|
|
|
|
g_free(fname);
|
|
|
|
}
|
|
|
|
|
2000-07-23 19:19:22 -04:00
|
|
|
/* SYNTAX: SAVE [<file>] */
|
2000-07-22 18:05:29 -04:00
|
|
|
static void cmd_save(const char *data)
|
|
|
|
{
|
2002-01-18 11:23:57 -05:00
|
|
|
GHashTable *optlist;
|
|
|
|
char *format, *fname;
|
|
|
|
void *free_arg;
|
2000-10-15 15:21:21 -04:00
|
|
|
|
2002-01-18 11:23:57 -05:00
|
|
|
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
|
|
|
|
"save", &optlist, &fname))
|
2000-10-15 15:21:21 -04:00
|
|
|
return;
|
|
|
|
|
2002-01-18 11:23:57 -05:00
|
|
|
if (*fname == '\0')
|
|
|
|
fname = mainconfig->fname;
|
|
|
|
|
|
|
|
if (!irssi_config_is_changed(fname))
|
|
|
|
settings_save_fe(fname);
|
|
|
|
else {
|
|
|
|
/* config file modified outside irssi */
|
|
|
|
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
|
|
|
TXT_CONFIG_MODIFIED, fname);
|
|
|
|
|
|
|
|
format = format_get_text(MODULE_NAME, NULL, NULL, NULL,
|
|
|
|
TXT_OVERWRITE_CONFIG);
|
|
|
|
keyboard_entry_redirect((SIGNAL_FUNC) settings_save_confirm,
|
|
|
|
format, 0, g_strdup(fname));
|
|
|
|
g_free(format);
|
|
|
|
}
|
2001-05-17 16:13:59 -04:00
|
|
|
|
2002-01-18 11:23:57 -05:00
|
|
|
cmd_params_free(free_arg);
|
2000-07-22 18:05:29 -04:00
|
|
|
}
|
|
|
|
|
2001-03-16 18:57:24 -05:00
|
|
|
static void settings_clean_confirm(const char *line)
|
|
|
|
{
|
2002-01-27 15:45:59 -05:00
|
|
|
if (i_toupper(line[0]) == 'Y')
|
2001-03-16 18:57:24 -05:00
|
|
|
settings_clean_invalid();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sig_settings_errors(const char *msg)
|
|
|
|
{
|
|
|
|
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "%s", msg);
|
|
|
|
keyboard_entry_redirect((SIGNAL_FUNC) settings_clean_confirm,
|
2001-05-17 16:13:59 -04:00
|
|
|
"Remove unknown settings from config file (Y/n)?",
|
2001-03-16 18:57:24 -05:00
|
|
|
0, NULL);
|
|
|
|
}
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void fe_settings_init(void)
|
|
|
|
{
|
|
|
|
command_bind("set", NULL, (SIGNAL_FUNC) cmd_set);
|
|
|
|
command_bind("toggle", NULL, (SIGNAL_FUNC) cmd_toggle);
|
|
|
|
command_bind("alias", NULL, (SIGNAL_FUNC) cmd_alias);
|
|
|
|
command_bind("unalias", NULL, (SIGNAL_FUNC) cmd_unalias);
|
2000-07-22 18:05:29 -04:00
|
|
|
command_bind("reload", NULL, (SIGNAL_FUNC) cmd_reload);
|
|
|
|
command_bind("save", NULL, (SIGNAL_FUNC) cmd_save);
|
2002-06-06 16:22:38 -04:00
|
|
|
command_set_options("set", "clear default");
|
2001-03-16 18:57:24 -05:00
|
|
|
|
|
|
|
signal_add("settings errors", (SIGNAL_FUNC) sig_settings_errors);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void fe_settings_deinit(void)
|
|
|
|
{
|
|
|
|
command_unbind("set", (SIGNAL_FUNC) cmd_set);
|
|
|
|
command_unbind("toggle", (SIGNAL_FUNC) cmd_toggle);
|
|
|
|
command_unbind("alias", (SIGNAL_FUNC) cmd_alias);
|
|
|
|
command_unbind("unalias", (SIGNAL_FUNC) cmd_unalias);
|
2000-07-22 18:05:29 -04:00
|
|
|
command_unbind("reload", (SIGNAL_FUNC) cmd_reload);
|
|
|
|
command_unbind("save", (SIGNAL_FUNC) cmd_save);
|
2001-03-16 18:57:24 -05:00
|
|
|
|
|
|
|
signal_remove("settings errors", (SIGNAL_FUNC) sig_settings_errors);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|