Merged from silc_1_0_branch (second merge).
[silc.git] / apps / irssi / src / fe-common / core / fe-common-core.c
index 89c17c7fc6b55c95d0e45fbc2c81c23b6e0a4244..bc556a6a5db81fc1b2fc208e0757e69c84a4a810 100644 (file)
@@ -31,6 +31,7 @@
 #include "servers-setup.h"
 
 #include "autorun.h"
+#include "fe-core-commands.h"
 #include "fe-queries.h"
 #include "hilight-text.h"
 #include "command-history.h"
@@ -91,9 +92,6 @@ void fe_settings_deinit(void);
 void window_commands_init(void);
 void window_commands_deinit(void);
 
-void fe_core_commands_init(void);
-void fe_core_commands_deinit(void);
-
 static void print_version(void)
 {
        printf(PACKAGE" " IRSSI_VERSION" (%d %04d)\n",
@@ -134,7 +132,7 @@ void fe_common_core_init(void)
        static struct poptOption options[] = {
                { NULL, '\0', POPT_ARG_INCLUDE_TABLE, version_options, 0, NULL, NULL },
                POPT_AUTOHELP
-               { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/ircnet", "SERVER" },
+               { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server", "SERVER" },
                { "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" },
                { "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" },
                { "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, "Disable autoconnecting", NULL },
@@ -145,7 +143,7 @@ void fe_common_core_init(void)
 
        autocon_server = NULL;
        autocon_password = NULL;
-       autocon_port = 6667;
+       autocon_port = 0;
        no_autoconnect = FALSE;
        cmdline_nick = NULL;
        cmdline_hostname = NULL;
@@ -161,7 +159,7 @@ void fe_common_core_init(void)
        settings_add_bool("lookandfeel", "beep_when_away", TRUE);
 
        settings_add_bool("lookandfeel", "hide_text_style", FALSE);
-       settings_add_bool("lookandfeel", "hide_mirc_colors", FALSE);
+       settings_add_bool("lookandfeel", "hide_colors", FALSE);
        settings_add_bool("lookandfeel", "hide_server_tags", FALSE);
 
        settings_add_bool("lookandfeel", "use_status_window", TRUE);
@@ -240,7 +238,7 @@ void fe_common_core_deinit(void)
         fe_queries_deinit();
 
        fe_messages_deinit();
-       fe_ignore_messages_init();
+       fe_ignore_messages_deinit();
 
         theme_unregister();
        themes_deinit();
@@ -269,13 +267,15 @@ void glog_func(const char *log_domain, GLogLevelFlags log_level,
        }
 
        if (windows == NULL)
-               fprintf(stderr, "GLib %s: %s", reason, message);
+               fprintf(stderr, "GLib %s: %s\n", reason, message);
        else {
                printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
                            TXT_GLIB_ERROR, reason, message);
        }
 }
 
+#define MSGS_WINDOW_LEVELS (MSGLEVEL_MSGS|MSGLEVEL_ACTIONS|MSGLEVEL_DCCMSGS)
+
 static void create_windows(void)
 {
        WINDOW_REC *window;
@@ -289,14 +289,14 @@ static void create_windows(void)
                window_set_name(window, "(status)");
                window_set_level(window, MSGLEVEL_ALL ^
                                 (settings_get_bool("use_msgs_window") ?
-                                 (MSGLEVEL_MSGS|MSGLEVEL_DCCMSGS) : 0));
+                                 MSGS_WINDOW_LEVELS : 0));
                 window_set_immortal(window, TRUE);
        }
 
        if (settings_get_bool("use_msgs_window")) {
                window = window_create(NULL, TRUE);
                window_set_name(window, "(msgs)");
-               window_set_level(window, MSGLEVEL_MSGS|MSGLEVEL_DCCMSGS);
+               window_set_level(window, MSGS_WINDOW_LEVELS);
                 window_set_immortal(window, TRUE);
        }