Update the URL hotlist icon when entries are deleted from the hotlist.

This does not currently spot entries which are edited.
This commit is contained in:
Steve Fryatt 2013-12-30 16:20:37 +00:00
parent 6300c7ed90
commit f64c8ed9ef
3 changed files with 24 additions and 0 deletions

View File

@ -241,6 +241,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action)
switch (action) {
case TOOLBAR_BUTTON_DELETE:
hotlist_keypress(KEY_DELETE_LEFT);
ro_toolbar_update_all_hotlists();
break;
case TOOLBAR_BUTTON_EXPAND:
@ -410,6 +411,7 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
return true;
case TREE_SELECTION_DELETE:
hotlist_keypress(KEY_DELETE_LEFT);
ro_toolbar_update_all_hotlists();
return true;
case TREE_SELECT_ALL:
hotlist_keypress(KEY_SELECT_ALL);

View File

@ -1618,6 +1618,21 @@ const char *ro_toolbar_get_url(struct toolbar *toolbar)
}
/* This is an exported interface documented in toolbar.h */
void ro_toolbar_update_all_hotlists(void)
{
struct toolbar *bar;
bar = ro_toolbar_bars;
while (bar != NULL) {
ro_toolbar_update_hotlist(bar);
bar = bar->next;
}
}
/* This is an exported interface documented in toolbar.h */
void ro_toolbar_update_hotlist(struct toolbar *toolbar)

View File

@ -385,6 +385,13 @@ void ro_toolbar_set_url(struct toolbar *toolbar, const char *url,
const char *ro_toolbar_get_url(struct toolbar *toolbar);
/**
* Update the state of the URL Bar hotlist icons in all open toolbars.
*/
void ro_toolbar_update_all_hotlists(void);
/**
* Update the state of a toolbar's URL Bar hotlist icon to reflect any changes
* to the URL or the hotlist contents.