summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-31 23:16:56 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-31 23:16:56 +0000
commit674d240718b9b70604f571fb992f0439d4d62adf (patch)
treec7c01a8f29c1ea4b601ea97da9c136d775809ad0
parente32c3bcd3367fc71eef128a84ad9ac174189349c (diff)
downloadirssi-674d240718b9b70604f571fb992f0439d4d62adf.zip
You can change the default line indentation with /SET indent
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@570 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-text/gui-windows.c16
-rw-r--r--src/fe-text/irssi.c1
2 files changed, 14 insertions, 3 deletions
diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c
index e52ce673..fdec6438 100644
--- a/src/fe-text/gui-windows.c
+++ b/src/fe-text/gui-windows.c
@@ -23,6 +23,7 @@
#include "commands.h"
#include "server.h"
#include "misc.h"
+#include "settings.h"
#include "irc.h"
#include "channels.h"
@@ -39,10 +40,9 @@
/* how long to keep line cache in memory (seconds) */
#define LINE_CACHE_KEEP_TIME (10*60)
-#define DEFAULT_INDENT_POS 10
-
static int linecache_tag;
static int window_create_override;
+static int default_indent_pos;
static GUI_WINDOW_REC *gui_window_init(WINDOW_REC *window, MAIN_WINDOW_REC *parent)
{
@@ -263,7 +263,7 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line
rec = g_new(LINE_CACHE_REC, 1);
rec->last_access = time(NULL);
- xpos = 0; color = 0; indent_pos = DEFAULT_INDENT_POS;
+ xpos = 0; color = 0; indent_pos = default_indent_pos;
last_space = last_color = 0; last_space_ptr = NULL;
rec->count = 1; lines = NULL;
@@ -850,11 +850,19 @@ static int sig_check_linecache(void)
return 1;
}
+static void read_settings(void)
+{
+ default_indent_pos = settings_get_int("indent");
+}
+
void gui_windows_init(void)
{
+ settings_add_int("lookandfeel", "indent", 10);
+
window_create_override = -1;
linecache_tag = g_timeout_add(LINE_CACHE_CHECK_TIME, (GSourceFunc) sig_check_linecache, NULL);
+ read_settings();
signal_add("gui window create override", (SIGNAL_FUNC) sig_window_create_override);
signal_add("window created", (SIGNAL_FUNC) gui_window_created);
signal_add("window destroyed", (SIGNAL_FUNC) gui_window_destroyed);
@@ -862,6 +870,7 @@ void gui_windows_init(void)
signal_add("window item changed", (SIGNAL_FUNC) signal_window_item_update);
signal_add("window name changed", (SIGNAL_FUNC) signal_window_item_update);
signal_add("window item remove", (SIGNAL_FUNC) signal_window_item_update);
+ signal_add("setup changed", (SIGNAL_FUNC) read_settings);
}
void gui_windows_deinit(void)
@@ -878,4 +887,5 @@ void gui_windows_deinit(void)
signal_remove("window item changed", (SIGNAL_FUNC) signal_window_item_update);
signal_remove("window name changed", (SIGNAL_FUNC) signal_window_item_update);
signal_remove("window item remove", (SIGNAL_FUNC) signal_window_item_update);
+ signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
}
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index 55bed472..287a254b 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -82,6 +82,7 @@ static void textui_init(void)
irssi_gui = IRSSI_GUI_TEXT;
core_init();
irc_init();
+ //silc_init();
fe_common_core_init();
fe_common_irc_init();