updates
[silc.git] / apps / irssi / src / fe-text / silc.c
index 9112b568506c17e3eb93b4e53051975b3c30561a..32ec6bd2082f7b281e2d5a72385c17b5515448ef 100644 (file)
@@ -83,7 +83,7 @@ static int display_firsttimer = FALSE;
 
 static void sig_exit(void)
 {
-       g_main_quit(main_loop);
+        quitting = TRUE;
 }
 
 /* redraw irssi's screen.. */
@@ -148,17 +148,18 @@ static void textui_finish_init(void)
 #endif
        signal_emit("irssi init finished", 0);
 
+#if 0
        if (display_firsttimer) {
                printtext_window(active_win, MSGLEVEL_CLIENTNOTICE,
                                 "%s", firsttimer_text);
        }
+#endif
 
        screen_refresh_thaw();
 }
 
 static void textui_deinit(void)
 {
-       quitting = TRUE;
        signal(SIGINT, SIG_DFL);
 
         screen_refresh_freeze();
@@ -204,7 +205,7 @@ static void check_oldcrap(void)
         int found;
 
         /* check that default.theme is up-to-date */
-       path = g_strdup_printf("%s/.irssi/default.theme", g_get_home_dir());
+       path = g_strdup_printf("%s/.silc/default.theme", g_get_home_dir());
        f = fopen(path, "r+");
        if (f == NULL) {
                g_free(path);
@@ -220,7 +221,7 @@ static void check_oldcrap(void)
                return;
        }
 
-       printf("\nYou seem to have old default.theme in ~/.irssi/ directory.\n");
+       printf("\nYou seem to have old default.theme in ~/.silc/ directory.\n");
         printf("Themeing system has changed a bit since last irssi release,\n");
         printf("you should either delete your old default.theme or manually\n");
         printf("merge it with the new default.theme.\n\n");
@@ -238,7 +239,7 @@ static void check_files(void)
        struct stat statbuf;
         char *path;
 
-        path = g_strdup_printf("%s/.irssi", g_get_home_dir());
+        path = g_strdup_printf("%s/.silc", g_get_home_dir());
        if (stat(path, &statbuf) != 0) {
                /* ~/.irssi doesn't exist, first time running irssi */
                display_firsttimer = TRUE;
@@ -278,15 +279,23 @@ int main(int argc, char **argv)
        textdomain(PACKAGE);
 #endif
 
+       quitting = FALSE;
+
        textui_init();
        args_execute(argc, argv);
+       silc_init_finish();
 
        if (!init_screen())
                g_error("Can't initialize screen handling, quitting.\n");
 
        textui_finish_init();
        main_loop = g_main_new(TRUE);
-       g_main_run(main_loop);
+
+       while (!quitting) {
+               g_main_iteration(TRUE);
+                screen_check_resizes();
+       }
+
        g_main_destroy(main_loop);
        textui_deinit();