2000-04-26 04:03:38 -04:00
|
|
|
/*
|
|
|
|
fe-common-core.c : irssi
|
|
|
|
|
|
|
|
Copyright (C) 1999-2000 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.
|
|
|
|
|
|
|
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2000-07-02 18:04:00 -04:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "module.h"
|
2000-05-15 04:25:45 -04:00
|
|
|
#include "module-formats.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "levels.h"
|
|
|
|
#include "settings.h"
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
#include "fe-queries.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "hilight-text.h"
|
|
|
|
#include "command-history.h"
|
2000-06-17 07:53:45 -04:00
|
|
|
#include "completion.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "keyboard.h"
|
|
|
|
#include "printtext.h"
|
|
|
|
#include "themes.h"
|
|
|
|
#include "translation.h"
|
|
|
|
#include "windows.h"
|
|
|
|
#include "window-items.h"
|
2000-07-31 21:02:46 -04:00
|
|
|
#include "window-save.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
#include <sys/signal.h>
|
|
|
|
|
|
|
|
void autorun_init(void);
|
|
|
|
void autorun_deinit(void);
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
void fe_channels_init(void);
|
|
|
|
void fe_channels_deinit(void);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void fe_core_log_init(void);
|
|
|
|
void fe_core_log_deinit(void);
|
|
|
|
|
2000-04-28 04:07:42 -04:00
|
|
|
void fe_log_init(void);
|
|
|
|
void fe_log_deinit(void);
|
|
|
|
|
2000-09-30 18:49:48 -04:00
|
|
|
void fe_messages_init(void);
|
|
|
|
void fe_messages_deinit(void);
|
|
|
|
|
2000-07-02 18:04:00 -04:00
|
|
|
void fe_modules_init(void);
|
|
|
|
void fe_modules_deinit(void);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void fe_server_init(void);
|
|
|
|
void fe_server_deinit(void);
|
|
|
|
|
|
|
|
void fe_settings_init(void);
|
|
|
|
void fe_settings_deinit(void);
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
void window_activity_init(void);
|
|
|
|
void window_activity_deinit(void);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-05-15 04:25:45 -04:00
|
|
|
void window_commands_init(void);
|
|
|
|
void window_commands_deinit(void);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void fe_core_commands_init(void);
|
|
|
|
void fe_core_commands_deinit(void);
|
|
|
|
|
|
|
|
void fe_common_core_init(void)
|
|
|
|
{
|
2000-05-04 06:32:42 -04:00
|
|
|
/*settings_add_bool("lookandfeel", "show_menubar", TRUE);
|
|
|
|
settings_add_bool("lookandfeel", "show_toolbar", FALSE);
|
|
|
|
settings_add_bool("lookandfeel", "show_statusbar", TRUE);
|
|
|
|
settings_add_bool("lookandfeel", "show_nicklist", TRUE);*/
|
|
|
|
settings_add_bool("lookandfeel", "timestamps", TRUE);
|
|
|
|
settings_add_bool("lookandfeel", "msgs_timestamps", FALSE);
|
|
|
|
settings_add_bool("lookandfeel", "hide_text_style", FALSE);
|
2000-07-30 14:37:49 -04:00
|
|
|
settings_add_bool("lookandfeel", "bell_beeps", FALSE);
|
|
|
|
settings_add_str("lookandfeel", "beep_on_msg", "");
|
|
|
|
settings_add_bool("lookandfeel", "beep_when_away", TRUE);
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2000-07-16 11:55:36 -04:00
|
|
|
settings_add_bool("lookandfeel", "use_status_window", TRUE);
|
2000-06-10 14:12:28 -04:00
|
|
|
settings_add_bool("lookandfeel", "use_msgs_window", FALSE);
|
2000-05-04 06:32:42 -04:00
|
|
|
/*settings_add_bool("lookandfeel", "autoraise_msgs_window", FALSE);*/
|
|
|
|
/*settings_add_bool("lookandfeel", "use_tabbed_windows", TRUE);
|
|
|
|
settings_add_int("lookandfeel", "tab_orientation", 3);*/
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-05-15 04:25:45 -04:00
|
|
|
themes_init();
|
|
|
|
theme_register(fecommon_core_formats);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
autorun_init();
|
|
|
|
hilight_text_init();
|
|
|
|
command_history_init();
|
2000-06-17 07:53:45 -04:00
|
|
|
completion_init();
|
2000-04-26 04:03:38 -04:00
|
|
|
keyboard_init();
|
|
|
|
printtext_init();
|
2000-09-02 14:53:58 -04:00
|
|
|
fe_channels_init();
|
|
|
|
fe_queries_init();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_log_init();
|
2000-09-30 18:49:48 -04:00
|
|
|
fe_messages_init();
|
2000-07-02 18:04:00 -04:00
|
|
|
fe_modules_init();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_server_init();
|
|
|
|
fe_settings_init();
|
|
|
|
translation_init();
|
|
|
|
windows_init();
|
2000-05-15 04:25:45 -04:00
|
|
|
window_activity_init();
|
|
|
|
window_commands_init();
|
2000-04-26 04:03:38 -04:00
|
|
|
window_items_init();
|
2000-08-12 18:58:16 -04:00
|
|
|
window_save_init();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_core_commands_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void fe_common_core_deinit(void)
|
|
|
|
{
|
|
|
|
autorun_deinit();
|
|
|
|
hilight_text_deinit();
|
|
|
|
command_history_deinit();
|
2000-06-17 07:53:45 -04:00
|
|
|
completion_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
keyboard_deinit();
|
|
|
|
printtext_deinit();
|
2000-09-02 14:53:58 -04:00
|
|
|
fe_channels_deinit();
|
|
|
|
fe_queries_deinit();
|
2000-09-30 18:49:48 -04:00
|
|
|
fe_messages_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_log_deinit();
|
2000-07-02 18:04:00 -04:00
|
|
|
fe_modules_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_server_deinit();
|
|
|
|
fe_settings_deinit();
|
|
|
|
translation_deinit();
|
|
|
|
windows_deinit();
|
2000-05-15 04:25:45 -04:00
|
|
|
window_activity_deinit();
|
|
|
|
window_commands_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
window_items_deinit();
|
2000-08-12 18:58:16 -04:00
|
|
|
window_save_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
fe_core_commands_deinit();
|
2000-05-15 04:25:45 -04:00
|
|
|
|
|
|
|
theme_unregister();
|
|
|
|
themes_deinit();
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void fe_common_core_finish_init(void)
|
|
|
|
{
|
|
|
|
WINDOW_REC *window;
|
|
|
|
|
2000-08-26 11:39:44 -04:00
|
|
|
signal_emit("irssi init read settings", 0);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
signal(SIGPIPE, SIG_IGN);
|
|
|
|
|
2000-07-31 21:02:46 -04:00
|
|
|
windows_restore();
|
|
|
|
if (windows != NULL)
|
|
|
|
return;
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
if (settings_get_bool("use_status_window")) {
|
2000-04-26 04:03:38 -04:00
|
|
|
window = window_create(NULL, TRUE);
|
|
|
|
window_set_name(window, "(status)");
|
2000-05-04 06:32:42 -04:00
|
|
|
window_set_level(window, MSGLEVEL_ALL ^
|
|
|
|
(settings_get_bool("use_msgs_window") ?
|
|
|
|
(MSGLEVEL_MSGS|MSGLEVEL_ACTIONS) : 0));
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
if (settings_get_bool("use_msgs_window")) {
|
2000-04-26 04:03:38 -04:00
|
|
|
window = window_create(NULL, TRUE);
|
|
|
|
window_set_name(window, "(msgs)");
|
|
|
|
window_set_level(window, MSGLEVEL_MSGS|MSGLEVEL_ACTIONS);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (windows == NULL) {
|
|
|
|
/* we have to have at least one window.. */
|
|
|
|
window = window_create(NULL, TRUE);
|
|
|
|
}
|
|
|
|
}
|