From da01624374ea884fffb15d10a295ded84c6619af Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Wed, 26 Jan 2011 13:35:07 +0000 Subject: Enabling back/forward buttons only if appropriate. svn path=/trunk/netsurf/; revision=11494 --- cocoa/BrowserViewController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cocoa/BrowserViewController.m') diff --git a/cocoa/BrowserViewController.m b/cocoa/BrowserViewController.m index 3d35f8f0a..0afe4b2f7 100644 --- a/cocoa/BrowserViewController.m +++ b/cocoa/BrowserViewController.m @@ -38,6 +38,8 @@ @synthesize status; @synthesize isProcessing; @synthesize favicon; +@synthesize canGoBack; +@synthesize canGoForward; - (void) dealloc; { @@ -95,6 +97,7 @@ { if (browser && history_back_available( browser->history )) { history_back(browser, browser->history); + [self updateBackForward]; } } @@ -102,6 +105,7 @@ { if (browser && history_forward_available( browser->history )) { history_forward(browser, browser->history); + [self updateBackForward]; } } @@ -152,4 +156,15 @@ static inline bool compare_float( float a, float b ) } +- (void) updateBackForward; +{ + [self setCanGoBack: browser != NULL && history_back_available( browser->history )]; + [self setCanGoForward: browser != NULL && history_forward_available( browser->history )]; +} + +- (void) contentUpdated; +{ + [browserView setHistoryVisible: NO]; +} + @end -- cgit v1.2.3