Begin work on downloads window

This commit is contained in:
anthony 2020-12-08 20:25:10 +00:00
parent 2bdfe481f2
commit f0aeee7f97
9 changed files with 56 additions and 1 deletions

View File

@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
@interface AppDelegate: NSResponder<NSApplicationDelegate> {
@private
id downloadsWindowController;
}
-(void)showDownloadsWindow;
@end

View File

@ -10,6 +10,7 @@
#import "tables/tables.h"
#import "tables/misc.h"
#import "netsurf/browser_window.h"
#import "DownloadsWindowController.h"
/**
* Set option defaults for (taken from the cocoa frontend)
@ -55,6 +56,16 @@ static nserror set_defaults(struct nsoption_s *defaults)
}
}
-(void)showDownloadsWindow {
NSLog(@"Showing downloads ...");
if (!downloadsWindowController) {
downloadsWindowController = [[DownloadsWindowController alloc] init];
[downloadsWindowController loadWindow];
} else {
[downloadsWindowController showWindow: self];
}
}
@end
int main(int argc, char **argv) {

View File

@ -0,0 +1,8 @@
#import <Cocoa/Cocoa.h>
@interface DownloadsWindowController: NSWindowController {
id tableView;
}
@end

View File

@ -0,0 +1,18 @@
#import <Cocoa/Cocoa.h>
#import "DownloadsWindowController.h"
@implementation DownloadsWindowController
-(id)init {
if (self = [super initWithWindowNibName: @"Downloads"]) {
//...
}
return self;
}
-(void)awakeFromNib {
NSLog(@"Awoke from nib...");
}
@end

View File

@ -40,6 +40,7 @@ VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/ver
S_FRONTEND := \
AppDelegate.m \
BrowserWindowController.m \
DownloadsWindowController.m \
PlotView.m \
NetsurfCallback.m \
tables/misc.m \
@ -66,6 +67,7 @@ EXETARGET := NetSurf
R_RESOURCES := \
Menu.gorm \
Browser.gorm \
Downloads.gorm \
R_RESOURCES := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(R_RESOURCES))

View File

@ -0,0 +1,11 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
DownloadsWindowController = {
Actions = (
);
Outlets = (
tableView
);
Super = NSWindowController;
};
}

Binary file not shown.

Binary file not shown.

View File

@ -8,9 +8,11 @@
/****** Download ******/
/**********************/
// Create and display a downloads window?
// This won't really return a window ref, but a ref to a download item.
static struct gui_download_window *gnustep_download_create(struct download_context *ctx, struct gui_window *parent) {
NSLog(@"gnustep_download_create");
// Save dialog.. then...
[[NSApp delegate] showDownloadsWindow];
return NULL;
}