summaryrefslogtreecommitdiff
path: root/cocoa/BrowserWindowController.m
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-01-26 13:35:07 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-01-26 13:35:07 +0000
commitda01624374ea884fffb15d10a295ded84c6619af (patch)
tree4686c7d2ba11f2f0a34c814d10d8072078366165 /cocoa/BrowserWindowController.m
parent7b2694e9f6c35d9f50c3fb3cf38b0fc766478162 (diff)
downloadnetsurf-da01624374ea884fffb15d10a295ded84c6619af.tar.gz
netsurf-da01624374ea884fffb15d10a295ded84c6619af.tar.bz2
Enabling back/forward buttons only if appropriate.
svn path=/trunk/netsurf/; revision=11494
Diffstat (limited to 'cocoa/BrowserWindowController.m')
-rw-r--r--cocoa/BrowserWindowController.m29
1 files changed, 29 insertions, 0 deletions
diff --git a/cocoa/BrowserWindowController.m b/cocoa/BrowserWindowController.m
index 019807513..21e787b03 100644
--- a/cocoa/BrowserWindowController.m
+++ b/cocoa/BrowserWindowController.m
@@ -30,6 +30,7 @@
@synthesize tabBar;
@synthesize tabView;
@synthesize urlField;
+@synthesize navigationControl;
@synthesize activeBrowser;
@synthesize activeBrowserController;
@@ -46,6 +47,7 @@
[self setTabBar: nil];
[self setTabView: nil];
[self setUrlField: nil];
+ [self setNavigationControl: nil];
[super dealloc];
}
@@ -64,6 +66,13 @@
[urlField setRefreshAction: @selector(reloadPage:)];
[urlField bind: @"favicon" toObject: activeBrowserController withKeyPath: @"selection.favicon" options: nil];
+
+ [self bind: @"canGoBack"
+ toObject: activeBrowserController withKeyPath: @"selection.canGoBack"
+ options: nil];
+ [self bind: @"canGoForward"
+ toObject: activeBrowserController withKeyPath: @"selection.canGoForward"
+ options: nil];
}
- (void) addTab: (BrowserViewController *)browser;
@@ -110,6 +119,26 @@ extern NSString * const kHomepageURL;
[self setNextResponder: activeBrowser];
}
+- (void) setCanGoBack: (BOOL)can;
+{
+ [navigationControl setEnabled: can forSegment: 0];
+}
+
+- (BOOL) canGoBack;
+{
+ return [navigationControl isEnabledForSegment: 0];
+}
+
+- (void) setCanGoForward: (BOOL)can;
+{
+ [navigationControl setEnabled: can forSegment: 1];
+}
+
+- (BOOL) canGoForward;
+{
+ return [navigationControl isEnabledForSegment: 1];
+}
+
#pragma mark -
#pragma mark Tab bar delegate