fix: leave LUT menu tracking before opening file and browser panels
这个提交包含在:
1 父节点
cc7f9c952a
当前提交
d64430cd66
5 个文件已更改
+37
-10
没有与搜索条件相匹配的文件
+18
-6
@@ -390,6 +390,7 @@ static NSImage *DYWheelImage(void) {
|
||||
NSMutableDictionary *_assetLoads,*_assetLoadIDs;
|
||||
NSUInteger _nextAssetLoadID;
|
||||
NSProgress *_menuScan;
|
||||
NSDictionary *_pendingAssetMenuCommand;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -440,7 +441,7 @@ static NSImage *DYWheelImage(void) {
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc {
|
||||
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads release];[_assetLoadIDs release];[_menuScan cancel];[_menuScan release];
|
||||
for(NSProgress *p in _assetLoads.allValues)[p cancel];[_assetLoads release];[_assetLoadIDs release];[_menuScan cancel];[_menuScan release];[_pendingAssetMenuCommand release];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[_brand release]; [_subtitle release]; [_resetAll release]; [_save release]; [_load release]; [_export release];
|
||||
[_scroll release]; [_document release]; [_sections release]; [_cards release]; [_controls release]; [_assetButtons release]; [_graphics release]; [_sampler release];
|
||||
@@ -828,6 +829,7 @@ static NSImage *DYWheelImage(void) {
|
||||
[self postChanged];
|
||||
}
|
||||
- (void)chooseAsset:(NSButton *)sender {
|
||||
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=nil;
|
||||
if(!_menuScan)_menuScan=[[_library reloadAsync:^(NSError *error){[_menuScan release];_menuScan=nil;}]retain];
|
||||
NSMenu *menu=[[[NSMenu alloc]initWithTitle:@"LUT"]autorelease];
|
||||
NSMenuItem *none=[menu addItemWithTitle:@"无" action:@selector(assetMenuItem:) keyEquivalent:@""];none.target=self;none.representedObject=@{@"key":sender.identifier,@"path":@"",@"profile":@0};
|
||||
@@ -841,13 +843,23 @@ static NSImage *DYWheelImage(void) {
|
||||
}
|
||||
if(_library.entries.count>100){NSMenuItem *more=[menu addItemWithTitle:@"更多 LUT,请打开缩略图浏览库…" action:@selector(assetMenuBrowse:) keyEquivalent:@""];more.target=self;more.representedObject=sender.identifier;}
|
||||
[menu popUpMenuPositioningItem:nil atLocation:NSMakePoint(0,sender.bounds.size.height) inView:sender];
|
||||
// Return from menu tracking and the remote button action before opening a panel.
|
||||
NSDictionary *command=[_pendingAssetMenuCommand autorelease];_pendingAssetMenuCommand=nil;
|
||||
if(command)dispatch_async(dispatch_get_main_queue(),^{if(self.window)[self performAssetMenuCommand:command];});
|
||||
}
|
||||
- (void)assetMenuBrowse:(NSMenuItem *)item {NSButton *button=_assetButtons[item.representedObject][@"browse"];[self browseAsset:button];}
|
||||
- (void)assetMenuFile:(NSMenuItem *)item {[self chooseFileForKey:item.representedObject];}
|
||||
- (void)assetMenuItem:(NSMenuItem *)item {
|
||||
NSString *key=item.representedObject[@"key"],*path=item.representedObject[@"path"];
|
||||
- (void)queueAssetMenuCommand:(NSString *)kind payload:(id)payload {
|
||||
[_pendingAssetMenuCommand release];_pendingAssetMenuCommand=[@{@"kind":kind,@"payload":payload}copy];
|
||||
}
|
||||
- (void)assetMenuBrowse:(NSMenuItem *)item {[self queueAssetMenuCommand:@"browse" payload:item.representedObject];}
|
||||
- (void)assetMenuFile:(NSMenuItem *)item {[self queueAssetMenuCommand:@"file" payload:item.representedObject];}
|
||||
- (void)assetMenuItem:(NSMenuItem *)item {[self queueAssetMenuCommand:@"item" payload:item.representedObject];}
|
||||
- (void)performAssetMenuCommand:(NSDictionary *)command {
|
||||
NSString *kind=command[@"kind"];id payload=command[@"payload"];
|
||||
if([kind isEqual:@"browse"]){[self browseAsset:_assetButtons[payload][@"browse"]];return;}
|
||||
if([kind isEqual:@"file"]){[self chooseFileForKey:payload];return;}
|
||||
NSString *key=payload[@"key"],*path=payload[@"path"];
|
||||
[self setAssetPath:path forKey:key];
|
||||
if([key isEqual:@"input"]&&item.representedObject[@"profile"]){id<FxCustomParameterActionAPI_v4> a=[self actionAPI];[a startAction:self];@try{[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setFloatValue:[item.representedObject[@"profile"]doubleValue] toParameter:2013 atTime:a.currentTime];}@finally{[a endAction:self];}[self postChanged];}
|
||||
if([key isEqual:@"input"]&&payload[@"profile"]){id<FxCustomParameterActionAPI_v4> a=[self actionAPI];[a startAction:self];@try{[[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]setFloatValue:[payload[@"profile"]doubleValue] toParameter:2013 atTime:a.currentTime];}@finally{[a endAction:self];}[self postChanged];}
|
||||
}
|
||||
- (void)chooseFileForKey:(NSString *)key {
|
||||
NSOpenPanel *panel=[NSOpenPanel openPanel];panel.allowedFileTypes=@[@"cube"];panel.allowsMultipleSelection=NO;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>13</string>
|
||||
<string>14</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>13</string>
|
||||
<string>14</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户