mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 21:44:22 +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;
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app;
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app;
|
||||||
- (void)applicationWillTerminate:(NSNotification*)notification;
|
- (void)applicationWillTerminate:(NSNotification*)notification;
|
||||||
- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename;
|
- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,15 +36,20 @@
|
|||||||
she::queue_event(ev);
|
she::queue_event(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename
|
- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames
|
||||||
{
|
{
|
||||||
std::vector<std::string> files;
|
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;
|
she::Event ev;
|
||||||
ev.setType(she::Event::DropFiles);
|
ev.setType(she::Event::DropFiles);
|
||||||
ev.setFiles(files);
|
ev.setFiles(files);
|
||||||
she::queue_event(ev);
|
she::queue_event(ev);
|
||||||
|
|
||||||
|
[app replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user