126
121
void fe_common_core_register_options(void)
128
static struct poptOption options[] = {
130
{ "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/network", "SERVER" },
131
{ "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" },
132
{ "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" },
133
{ "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, "Disable autoconnecting", NULL },
134
{ "nick", 'n', POPT_ARG_STRING, &cmdline_nick, 0, "Specify nick to use", NULL },
135
{ "hostname", 'h', POPT_ARG_STRING, &cmdline_hostname, 0, "Specify host name to use", NULL },
136
{ NULL, '\0', 0, NULL }
123
static GOptionEntry options[] = {
124
{ "connect", 'c', 0, G_OPTION_ARG_STRING, &autocon_server, "Automatically connect to server/network", "SERVER" },
125
{ "password", 'w', 0, G_OPTION_ARG_STRING, &autocon_password, "Autoconnect password", "PASSWORD" },
126
{ "port", 'p', 0, G_OPTION_ARG_INT, &autocon_port, "Autoconnect port", "PORT" },
127
{ "noconnect", '!', 0, G_OPTION_ARG_NONE, &no_autoconnect, "Disable autoconnecting", NULL },
128
{ "nick", 'n', 0, G_OPTION_ARG_STRING, &cmdline_nick, "Specify nick to use", NULL },
129
{ "hostname", 'h', 0, G_OPTION_ARG_STRING, &cmdline_hostname, "Specify host name to use", NULL },
139
133
autocon_server = NULL;
163
159
settings_add_bool("lookandfeel", "use_status_window", TRUE);
164
160
settings_add_bool("lookandfeel", "use_msgs_window", FALSE);
165
#if defined (HAVE_NL_LANGINFO) && defined(CODESET)
166
settings_add_str("lookandfeel", "term_charset",
167
*nl_langinfo(CODESET) != '\0' ?
168
nl_langinfo(CODESET) : "ISO8859-1");
170
settings_add_str("lookandfeel", "term_charset", "ISO8859-1");
162
settings_add_str("lookandfeel", "term_charset", str);
173
164
theme_register(fecommon_core_formats);
397
386
create_windows();
389
static void autorun_startup(void)
396
/* open ~/.irssi/startup and run all commands in it */
397
path = g_strdup_printf("%s/startup", get_irssi_dir());
398
handle = g_io_channel_new_file(path, "r", NULL);
400
if (handle == NULL) {
405
g_io_channel_set_encoding(handle, NULL, NULL);
406
buf = g_string_sized_new(512);
407
while (g_io_channel_read_line_string(handle, buf, &tpos, NULL) == G_IO_STATUS_NORMAL) {
408
buf->str[tpos] = '\0';
409
if (buf->str[0] != '#') {
410
eval_special_string(buf->str, "",
411
active_win->active_server,
415
g_string_free(buf, TRUE);
417
g_io_channel_unref(handle);
400
420
void fe_common_core_finish_init(void)
402
422
int setup_changed;
443
463
autorun_startup();
444
464
autoconnect_servers();
467
gboolean strarray_find_dest(char **array, const TEXT_DEST_REC *dest)
469
g_return_val_if_fail(array != NULL, FALSE);
471
if (strarray_find(array, dest->target) != -1)
474
if (dest->server_tag != NULL) {
475
char *tagtarget = g_strdup_printf("%s/%s", dest->server_tag, dest->target);
476
int ret = strarray_find(array, tagtarget);