mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
add print_text_after_time to specify time stamp for lines
add signal for line removal from textbuffer
This commit is contained in:
parent
113f1724d7
commit
e71c9f1b06
7 changed files with 30 additions and 9 deletions
|
|
@ -102,7 +102,7 @@ void gui_printtext(int xpos, int ypos, const char *str)
|
|||
next_xpos = next_ypos = -1;
|
||||
}
|
||||
|
||||
void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str)
|
||||
void gui_printtext_after_time(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str, time_t time)
|
||||
{
|
||||
GUI_WINDOW_REC *gui;
|
||||
|
||||
|
|
@ -110,10 +110,16 @@ void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str)
|
|||
|
||||
gui->use_insert_after = TRUE;
|
||||
gui->insert_after = prev;
|
||||
gui->insert_after_time = time;
|
||||
format_send_to_gui(dest, str);
|
||||
gui->use_insert_after = FALSE;
|
||||
}
|
||||
|
||||
void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str)
|
||||
{
|
||||
gui_printtext_after_time(dest, prev, str, 0);
|
||||
}
|
||||
|
||||
static void remove_old_lines(TEXT_BUFFER_VIEW_REC *view)
|
||||
{
|
||||
LINE_REC *line;
|
||||
|
|
@ -199,9 +205,10 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
|
|||
}
|
||||
|
||||
lineinfo.level = dest == NULL ? 0 : dest->level;
|
||||
lineinfo.time = time(NULL);
|
||||
|
||||
gui = WINDOW_GUI(window);
|
||||
lineinfo.time = (gui->use_insert_after && gui->insert_after_time) ?
|
||||
gui->insert_after_time : time(NULL);
|
||||
|
||||
view = gui->view;
|
||||
insert_after = gui->use_insert_after ?
|
||||
gui->insert_after : view->buffer->cur_line;
|
||||
|
|
|
|||
|
|
@ -18,5 +18,6 @@ INDENT_FUNC get_default_indent_func(void);
|
|||
|
||||
void gui_printtext(int xpos, int ypos, const char *str);
|
||||
void gui_printtext_after(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str);
|
||||
void gui_printtext_after_time(TEXT_DEST_REC *dest, LINE_REC *prev, const char *str, time_t time);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ typedef struct {
|
|||
unsigned int sticky:1;
|
||||
unsigned int use_insert_after:1;
|
||||
LINE_REC *insert_after;
|
||||
time_t insert_after_time;
|
||||
} GUI_WINDOW_REC;
|
||||
|
||||
void gui_windows_init(void);
|
||||
|
|
|
|||
|
|
@ -1141,6 +1141,8 @@ void textbuffer_view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
|
|||
g_return_if_fail(view != NULL);
|
||||
g_return_if_fail(line != NULL);
|
||||
|
||||
signal_emit("gui textbuffer line removed", 3, view, line, line->prev);
|
||||
|
||||
linecount = view_get_linecount(view, line);
|
||||
update_counter = view->cache->update_counter+1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue