diff options
author | jcid <devnull@localhost> | 2008-09-08 17:02:16 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-09-08 17:02:16 +0200 |
commit | 5205356fef9cf35d3ed759c9f6960ebd34d772f9 (patch) | |
tree | 74f7f63c95fc682bb8b787a9d047d7b20b2d9f6b /src | |
parent | 9d0c154884a9b10c2e45f269be0bb686da1c98c9 (diff) |
- Fixed the "Load Images" menu item in the page popup.
Diffstat (limited to 'src')
-rw-r--r-- | src/html.cc | 12 | ||||
-rw-r--r-- | src/html_common.hh | 1 | ||||
-rw-r--r-- | src/menu.cc | 8 | ||||
-rw-r--r-- | src/menu.hh | 2 | ||||
-rw-r--r-- | src/uicmd.cc | 4 | ||||
-rw-r--r-- | src/uicmd.hh | 2 |
6 files changed, 20 insertions, 9 deletions
diff --git a/src/html.cc b/src/html.cc index 40ef31c6..806e5950 100644 --- a/src/html.cc +++ b/src/html.cc @@ -701,6 +701,16 @@ DilloHtmlForm *DilloHtml::getCurrentForm () return forms->get (forms->size() - 1); } +bool_t DilloHtml::unloadedImages() +{ + for (int i = 0; i < images->size(); i++) { + if (images->get(i)->image != NULL) { + return TRUE; + } + } + return FALSE; +} + /* * Load images if they were disabled. */ @@ -756,7 +766,7 @@ bool DilloHtml::HtmlLinkReceiver::press (Widget *widget, int link, int img, if (link == -1) { a_UIcmd_page_popup(bw, a_History_get_url(NAV_TOP_UIDX(bw)), bw->num_page_bugs ? bw->page_bugs->str:NULL, - prefs.load_images); + html->unloadedImages()); ret = true; } else { a_UIcmd_link_popup(bw, html->links->get(link)); diff --git a/src/html_common.hh b/src/html_common.hh index aac9f189..47b0c1a7 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -221,6 +221,7 @@ public: int formNew(DilloHtmlMethod method, const DilloUrl *action, DilloHtmlEnc enc, const char *charset); DilloHtmlForm *getCurrentForm (); + bool_t unloadedImages(); void loadImages (const DilloUrl *pattern); }; diff --git a/src/menu.cc b/src/menu.cc index 8f5f8124..111e6182 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -232,7 +232,7 @@ static void Menu_history_cb(Widget *wid, void *data) * Page popup menu (construction & popup) */ void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, - const char *bugs_txt, int prefs_load_images) + const char *bugs_txt, bool_t unloaded_imgs) { // One menu for every browser window static PopupMenu *pm = 0; @@ -275,10 +275,10 @@ void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, else view_page_bugs_item->activate(); - if (prefs_load_images == 1) - load_images_item->deactivate(); - else + if (unloaded_imgs == TRUE) load_images_item->activate(); + else + load_images_item->deactivate(); // NULL is wildcard load_images_item->user_data(NULL); diff --git a/src/menu.hh b/src/menu.hh index efa5b27e..bbdbae1c 100644 --- a/src/menu.hh +++ b/src/menu.hh @@ -8,7 +8,7 @@ extern "C" { #endif /* __cplusplus */ void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, - const char *bugs_txt, int prefs_load_images); + const char *bugs_txt, bool_t unloaded_imgs); void a_Menu_link_popup(BrowserWindow *bw, const DilloUrl *url); void a_Menu_image_popup(BrowserWindow *bw, const DilloUrl *url, DilloUrl *link_url); diff --git a/src/uicmd.cc b/src/uicmd.cc index d1761fca..93f49adf 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -456,9 +456,9 @@ void a_UIcmd_add_bookmark(BrowserWindow *bw, const DilloUrl *url) * Popup the page menu */ void a_UIcmd_page_popup(void *vbw, const DilloUrl *url, - const char *bugs_txt, int prefs_load_images) + const char *bugs_txt, bool_t unloaded_imgs) { - a_Menu_page_popup((BrowserWindow*)vbw, url, bugs_txt, prefs_load_images); + a_Menu_page_popup((BrowserWindow*)vbw, url, bugs_txt, unloaded_imgs); } /* diff --git a/src/uicmd.hh b/src/uicmd.hh index 91c14390..b469beef 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -32,7 +32,7 @@ void a_UIcmd_findtext_dialog(BrowserWindow *bw); void a_UIcmd_findtext_search(BrowserWindow *bw, const char *key, int case_sens); void a_UIcmd_findtext_reset(BrowserWindow *bw); void a_UIcmd_page_popup(void *vbw, const DilloUrl *url, - const char *bugs_txt, int prefs_load_images); + const char *bugs_txt, bool_t unloaded_imgs); void a_UIcmd_link_popup(void *vbw, const DilloUrl *url); void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, DilloUrl *link_url); void a_UIcmd_copy_urlstr(BrowserWindow *bw, const char *urlstr); |