Introduce ‘reusable’ property to OakHTMLOutputView

This defaults to YES but can be set to NO if an output view should not be re-used (even though no command is currently running).
This commit is contained in:
Allan Odgaard
2016-10-03 21:39:55 +02:00
parent 7255692cbf
commit 6245fa17d5
4 changed files with 12 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
@property (nonatomic) NSUUID* commandIdentifier; // UUID from initial load request
@property (nonatomic, getter = isRunningCommand, readonly) BOOL runningCommand;
@property (nonatomic, getter = isVisible, readonly) BOOL visible;
@property (nonatomic, getter = isReusable) BOOL reusable;
// Read-only access to the webview is given to allow reading page title, etc.
@property (nonatomic, readonly) WebView* webView;

View File

@@ -9,4 +9,5 @@ PUBLIC @interface OakHTMLOutputView : HOBrowserView
@property (nonatomic, readonly) NSString* mainFrameTitle;
@property (nonatomic) NSUUID* commandIdentifier; // UUID from initial load request
@property (nonatomic, getter = isRunningCommand, readonly) BOOL runningCommand;
@property (nonatomic, getter = isReusable) BOOL reusable;
@end

View File

@@ -24,6 +24,15 @@
return [NSSet setWithObjects:@"webView.mainFrameTitle", nil];
}
- (instancetype)initWithFrame:(NSRect)aRect
{
if(self = [super initWithFrame:aRect])
{
_reusable = YES;
}
return self;
}
- (void)loadRequest:(NSURLRequest*)aRequest environment:(std::map<std::string, std::string> const&)anEnvironment autoScrolls:(BOOL)flag
{
if(flag)