mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[status] Introduced print_screen_status_delayed.
For cases when status is updated often. For example uploads or downloads.
This commit is contained in:
parent
02f9682e79
commit
54f1426e43
@ -17,6 +17,7 @@
|
||||
#include "document/renderer.h"
|
||||
#include "document/view.h"
|
||||
#include "intl/libintl.h"
|
||||
#include "main/timer.h"
|
||||
#include "network/connection.h"
|
||||
#include "network/progress.h"
|
||||
#include "network/state.h"
|
||||
@ -40,7 +41,6 @@
|
||||
#include "viewer/text/link.h"
|
||||
#include "viewer/text/view.h"
|
||||
|
||||
|
||||
char *
|
||||
get_download_msg(struct download *download, struct terminal *term,
|
||||
int wide, int full, const char *separator)
|
||||
@ -576,3 +576,19 @@ print_screen_status(struct session *ses)
|
||||
|
||||
redraw_windows(REDRAW_IN_FRONT_OF_WINDOW, ses->tab);
|
||||
}
|
||||
|
||||
static void
|
||||
print_screen_status_clear_timer(struct session *ses)
|
||||
{
|
||||
ses->status_redraw_timer = TIMER_ID_UNDEF;
|
||||
print_screen_status(ses);
|
||||
}
|
||||
|
||||
void
|
||||
print_screen_status_delayed(struct session *ses)
|
||||
{
|
||||
/* Redraw after 100ms. */
|
||||
if (ses->status_redraw_timer == TIMER_ID_UNDEF) {
|
||||
install_timer(&ses->status_redraw_timer, 100, print_screen_status_clear_timer, ses);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ struct session;
|
||||
struct terminal;
|
||||
|
||||
void print_screen_status(struct session *);
|
||||
void print_screen_status_delayed(struct session *);
|
||||
|
||||
void update_status(void);
|
||||
|
||||
|
@ -771,7 +771,7 @@ doc_loading_callback(struct download *download, struct session *ses)
|
||||
}
|
||||
|
||||
check_questions_queue(ses);
|
||||
print_screen_status(ses);
|
||||
print_screen_status_delayed(ses);
|
||||
|
||||
#ifdef CONFIG_GLOBHIST
|
||||
if (download->pri != PRI_CSS) {
|
||||
@ -1049,6 +1049,7 @@ init_session(struct session *base_session, struct terminal *term,
|
||||
init_list(ses->type_queries);
|
||||
ses->task.type = TASK_NONE;
|
||||
ses->display_timer = TIMER_ID_UNDEF;
|
||||
ses->status_redraw_timer = TIMER_ID_UNDEF;
|
||||
|
||||
#ifdef CONFIG_LEDS
|
||||
init_led_panel(&ses->status.leds);
|
||||
@ -1378,6 +1379,7 @@ destroy_session(struct session *ses)
|
||||
if (ses->loading_uri) done_uri(ses->loading_uri);
|
||||
|
||||
kill_timer(&ses->display_timer);
|
||||
kill_timer(&ses->status_redraw_timer);
|
||||
|
||||
while (!list_empty(ses->type_queries))
|
||||
done_type_query((struct type_query *)ses->type_queries.next);
|
||||
|
@ -234,6 +234,7 @@ struct session {
|
||||
struct kbdprefix kbdprefix;
|
||||
int exit_query;
|
||||
timer_id_T display_timer;
|
||||
timer_id_T status_redraw_timer;
|
||||
|
||||
/** The text input form insert mode. It is a tristate controlled by the
|
||||
* boolean document.browse.forms.insert_mode option. When disabled we
|
||||
|
@ -577,7 +577,7 @@ loading_callback(struct download *download, struct session *ses)
|
||||
|
||||
end:
|
||||
check_questions_queue(ses);
|
||||
print_screen_status(ses);
|
||||
print_screen_status_delayed(ses);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user