mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Cache manager: Add "Invalidate" button
Add an "Invalidate" button to the cache manager, which is useful when a cache entry is locked and cannot be deleted but one does not want ELinks to use that cache entry.
This commit is contained in:
parent
822e9d6921
commit
0ad5b642b4
1
NEWS
1
NEWS
@ -61,6 +61,7 @@ Miscellaneous:
|
||||
Especially useful for multi-file BitTorrent downloads.
|
||||
* Report if the Lua function edit_bookmark_dialog receives the wrong
|
||||
number or types of arguments instead of silently failing.
|
||||
* enhancement: Add ``Invalidate'' button to the cache manager.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
The following changes should be removed from NEWS before ELinks 0.13.0
|
||||
|
20
src/cache/dialogs.c
vendored
20
src/cache/dialogs.c
vendored
@ -242,12 +242,32 @@ static const struct listbox_ops cache_entry_listbox_ops = {
|
||||
&cache_messages,
|
||||
};
|
||||
|
||||
static widget_handler_status_T
|
||||
push_invalidate_button(struct dialog_data *dlg_data, struct widget_data *button)
|
||||
{
|
||||
struct terminal *term = dlg_data->win->term;
|
||||
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
|
||||
struct cache_entry *cached = box->sel->udata;
|
||||
|
||||
if (!box->sel || !box->sel->udata) return EVENT_PROCESSED;
|
||||
|
||||
assert(box->sel->type == BI_LEAF);
|
||||
|
||||
cached->valid = 0;
|
||||
|
||||
info_box(term, 0, N_("Cache entry invalidated"), ALIGN_CENTER,
|
||||
N_("Cache entry invalidated."));
|
||||
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
static const struct hierbox_browser_button cache_buttons[] = {
|
||||
/* [gettext_accelerator_context(.cache_buttons)] */
|
||||
{ N_("~Info"), push_hierbox_info_button, 1 },
|
||||
{ N_("~Goto"), push_hierbox_goto_button, 1 },
|
||||
{ N_("~Delete"), push_hierbox_delete_button, 1 },
|
||||
{ N_("~Search"), push_hierbox_search_button, 1 },
|
||||
{ N_("In~validate"), push_invalidate_button, 1 },
|
||||
};
|
||||
|
||||
struct_hierbox_browser(
|
||||
|
Loading…
Reference in New Issue
Block a user