mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Override application:openFiles: instead of application:openFile:
This commit is contained in:
parent
49f11648b3
commit
5ef931b7d4
@ -14,7 +14,7 @@
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app;
|
||||
- (void)applicationWillTerminate:(NSNotification*)notification;
|
||||
- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename;
|
||||
- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
@ -36,15 +36,20 @@
|
||||
she::queue_event(ev);
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename
|
||||
- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
files.push_back([filename UTF8String]);
|
||||
for (int i=0; i<[filenames count]; ++i) {
|
||||
NSString* fn = [filenames objectAtIndex: i];
|
||||
files.push_back([fn UTF8String]);
|
||||
}
|
||||
|
||||
she::Event ev;
|
||||
ev.setType(she::Event::DropFiles);
|
||||
ev.setFiles(files);
|
||||
she::queue_event(ev);
|
||||
|
||||
[app replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user