Esempio n. 1
0
void
gui_main_end (int clean_exit)
{
    if (clean_exit)
    {
        /* remove bar items and bars */
        gui_bar_item_end ();
        gui_bar_free_all ();
        
        /* remove filters */
        gui_filter_free_all ();
        
        /* free clipboard buffer */
        if (gui_input_clipboard)
            free(gui_input_clipboard);
        
        /* delete layout saved */
        gui_layout_window_remove_all (&gui_layout_windows);
        gui_layout_buffer_remove_all (&gui_layout_buffers, &last_gui_layout_buffer);
        
        /* delete all windows */
        while (gui_windows)
        {
            gui_window_free (gui_windows);
            /* TODO: destroy Gtk widgets */
        }
        gui_window_tree_free (&gui_windows_tree);
        
        /* delete all buffers */
        while (gui_buffers)
        {
            gui_buffer_close (gui_buffers);
        }
        
        /* delete global history */
        gui_history_global_free ();
        
        /* reset title */
        if (CONFIG_BOOLEAN(config_look_set_title))
            gui_window_set_title (NULL);
        
        /* end color */
        gui_color_end ();
        
        /* free chat buffer */
        gui_chat_free_buffer ();
    }
}
Esempio n. 2
0
void
gui_main_end (int clean_exit)
{
    if (clean_exit)
    {
        /*
         * final refreshs, to see messages just before exiting
         * (if we are upgrading, don't refresh anything!)
         */
        if (!weechat_upgrading)
        {
            gui_main_refreshs ();
            if (gui_window_refresh_needed)
                gui_main_refreshs ();
        }

        /* disable bracketed paste mode */
        gui_window_set_bracketed_paste_mode (0);

        /* disable mouse */
        gui_mouse_disable ();

        /* remove bar items and bars */
        gui_bar_item_end ();
        gui_bar_free_all ();

        /* remove filters */
        gui_filter_free_all ();

        /* free clipboard buffer */
        if (gui_input_clipboard)
            free (gui_input_clipboard);

        /* delete layouts */
        gui_layout_remove_all ();

        /* delete all windows */
        while (gui_windows)
        {
            gui_window_free (gui_windows);
        }
        gui_window_tree_free (&gui_windows_tree);

        /* delete all buffers */
        while (gui_buffers)
        {
            gui_buffer_close (gui_buffers);
        }

        gui_init_ok = 0;

        /* delete global history */
        gui_history_global_free ();

        /* reset title */
        if (CONFIG_STRING(config_look_window_title)
            && CONFIG_STRING(config_look_window_title)[0])
        {
            gui_window_set_title (NULL);
        }

        /* end color */
        gui_color_end ();

        /* free some variables used for chat area */
        gui_chat_end ();

        /* free some variables used for nicklist */
        gui_nicklist_end ();

        /* free some variables used for hotlist */
        gui_hotlist_end ();
    }

    /* end of Curses output */
    refresh ();
    endwin ();
}