summaryrefslogtreecommitdiff
path: root/src/gui/gtk
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-30 17:18:28 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-10-30 17:18:28 +0100
commit6f442bbfc13a73f9b993f5bbd5928cab9a1321c4 (patch)
treeb3367af39b4ec208f4b72fc458edb44b2c47b556 /src/gui/gtk
parent2f68ec7f3655efc9f814b2f4298d27029d1c6824 (diff)
downloadweechat-6f442bbfc13a73f9b993f5bbd5928cab9a1321c4.zip
Add new features to logger plugin (command /logger, log level, level by buffer, mask by buffer, ..), fix some bugs
New features: - new command /logger - log level, to log only some messages, according to importance (task #8592) - level by buffer: custom level for some buffers (or group of buffers) - log filename mask by buffer (or group of buffers) - marker line is added after display of backlog - add "delete" callback for config file sections - add "mkdir_parents" function to plugin API - remove old log options in IRC plugin Bug fix: - marker line is set only when user switches buffer (not when a plugin force switch, like IRC plugin does when opening server or channel buffer) - backlog fixed (sometimes lines were not properly displayed)
Diffstat (limited to 'src/gui/gtk')
-rw-r--r--src/gui/gtk/gui-gtk-window.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index b7a683ea6..2872c54d0 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -183,7 +183,7 @@ gui_window_switch (struct t_gui_window *window)
gui_current_window = window;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
}
@@ -193,7 +193,9 @@ gui_window_switch (struct t_gui_window *window)
*/
void
-gui_window_switch_to_buffer (struct t_gui_window *window, struct t_gui_buffer *buffer)
+gui_window_switch_to_buffer (struct t_gui_window *window,
+ struct t_gui_buffer *buffer,
+ int set_last_read)
{
GtkTextIter start, end;
@@ -202,9 +204,16 @@ gui_window_switch_to_buffer (struct t_gui_window *window, struct t_gui_buffer *b
if (window->buffer != buffer)
{
- window->buffer->last_read_line = window->buffer->last_line;
- if (buffer->last_read_line == buffer->last_line)
- buffer->last_read_line = NULL;
+ window->start_line = NULL;
+ window->start_line_pos = 0;
+ gui_previous_buffer = window->buffer;
+ if (set_last_read)
+ {
+ if (window->buffer->num_displayed == 0)
+ window->buffer->last_read_line = window->buffer->last_line;
+ if (buffer->last_read_line == buffer->last_line)
+ buffer->last_read_line = NULL;
+ }
}
window->buffer = buffer;
@@ -490,10 +499,10 @@ gui_window_split_horiz (struct t_gui_window *window, int percentage)
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
- gui_window_switch_to_buffer (window, window->buffer);
+ gui_window_switch_to_buffer (window, window->buffer, 1);
gui_current_window = new_window;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
}
}
@@ -535,10 +544,10 @@ gui_window_split_vertic (struct t_gui_window *window, int percentage)
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
- gui_window_switch_to_buffer (window, window->buffer);
+ gui_window_switch_to_buffer (window, window->buffer, 1);
gui_current_window = new_window;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
/* create & draw separator */
@@ -599,7 +608,7 @@ gui_window_merge (struct t_gui_window *window)
gui_window_free (sister->window);
gui_window_tree_node_to_leaf (parent, window);
- gui_window_switch_to_buffer (window, window->buffer);
+ gui_window_switch_to_buffer (window, window->buffer, 1);
gui_window_redraw_buffer (window->buffer);
return 1;
}
@@ -688,7 +697,7 @@ gui_window_switch_up (struct t_gui_window *window)
(gui_window_side_by_side (window, ptr_win) == 1))
{
gui_current_window = ptr_win;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
return;
}
@@ -711,7 +720,7 @@ gui_window_switch_down (struct t_gui_window *window)
(gui_window_side_by_side (window, ptr_win) == 3))
{
gui_current_window = ptr_win;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
return;
}
@@ -734,7 +743,7 @@ gui_window_switch_left (struct t_gui_window *window)
(gui_window_side_by_side (window, ptr_win) == 4))
{
gui_current_window = ptr_win;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
return;
}
@@ -757,7 +766,7 @@ gui_window_switch_right (struct t_gui_window *window)
(gui_window_side_by_side (window, ptr_win) == 2))
{
gui_current_window = ptr_win;
- gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
+ gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
return;
}