From cc7f9c952a2beee7568695657fb3f8b74fd68a5e Mon Sep 17 00:00:00 2001 From: mac Date: Sun, 1 Nov 2026 11:17:31 +0800 Subject: [PATCH] fix: retain FxPlug-compatible file dialogs and preserve previous app through host acceptance --- README.md | 2 +- tools/deliver.py | 10 +++++++--- 大鱼调色/Plugin/DYInspector.mm | 4 ++-- 大鱼调色/Plugin/DYLUTBrowser.mm | 5 ++++- 大鱼调色/Plugin/Info.plist | 2 +- 大鱼调色/Wrapper Application/Info.plist | 2 +- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 27cf375..173b666 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ - [主题与 LUT 库的 FCP 验收](verification/HostThemeLUT.json) - [早期调色链的 FCP 验收](verification/Host.json) -当前版本为 1.1.3(12),源码标签 `v1.1.3-async-lut-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。 +当前版本为 1.1.3(13),源码标签 `v1.1.3-async-lut-20261101`。所有调色分组统一为展开即启用、折叠即停用;新建实例与全部还原只展开基础调节。折叠保留参数和 LUT 路径,重新展开继续使用;打开已保存的调色时按各组实际启用状态展开。基础调节同时控制其光影、白平衡与颜色子组。 程序图标与 FCP 缩略图采用统一的光谱鱼。两张原始生成图及提示词保存在 `design/`;运行 `python3 tools/build_brand_assets.py` 使用 macOS 工具导出 ICNS、640×360 与 240×135 的效果预览。 diff --git a/tools/deliver.py b/tools/deliver.py index e245108..3b99ca8 100644 --- a/tools/deliver.py +++ b/tools/deliver.py @@ -87,18 +87,22 @@ def main(): if target.exists():os.chflags(target,0) shutil.copy2(source,target);os.chflags(target,2) # All generated copies are removed before final registry/host verification. - for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]+([(old,'com.dayu.color')] if old else []): + for copy,expected in [(APP,'com.dayu.color'),(LOOSE,'com.dayu.color.XPC')]: if copy.exists():identity(copy,expected);unregister(copy/PLUGIN if copy.suffix=='.app' else copy);shutil.rmtree(copy) - old=None;archive.unlink();backup=CACHE/'previous-template.moef' + if old:unregister(old/PLUGIN) + archive.unlink();backup=CACHE/'previous-template.moef' if backup.exists():backup.unlink() run('pluginkit','-a',str(DEST/PLUGIN));registry=run('pluginkit','-m','-A','-D','-v','-i','com.dayu.color.XPC') entries=[l for l in registry.splitlines() if 'com.dayu.color.XPC(' in l] if len(entries)!=1 or not entries[0].rstrip().endswith('\t'+str(DEST/PLUGIN)):raise RuntimeError('PluginKit发现多份/错误版本: '+registry) record=dict(status='installed-awaiting-host-verification',path=str(DEST),bundleID='com.dayu.color',version=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleShortVersionString'],build=plistlib.loads((DEST/'Contents/Info.plist').read_bytes())['CFBundleVersion'],team='B3W25FX5H5',notaryID=result['id'],notaryStatus=result['status'],gatekeeper=gate,sourceCommit=run('git','rev-parse','HEAD'),templatePath=str(TEMPLATE),templateSHA256=hashlib.sha256(TEMPLATE.read_bytes()).hexdigest(),shaderSHA256=hashlib.sha256((DEST/PLUGIN/'Contents/Resources/default.metallib').read_bytes()).hexdigest()) + if old:record['previousInstallBackup']=str(old) output=ROOT/'verification/Delivery.json';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n') run('open',str(DEST));print('FORMAL_INSTALLED. Run installed self-test and host verification; type complete only after success. Type leave to preserve pending state.',flush=True) for decision in sys.stdin: - if decision.strip()=='complete':record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break + if decision.strip()=='complete': + if old and old.exists():identity(old,'com.dayu.color');unregister(old/PLUGIN);shutil.rmtree(old);old=None + record.pop('previousInstallBackup',None);record['status']='verified';output.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n');break if decision.strip()=='leave':break finally: if stage and stage.exists():shutil.rmtree(stage) diff --git a/大鱼调色/Plugin/DYInspector.mm b/大鱼调色/Plugin/DYInspector.mm index 181479e..0dc4673 100644 --- a/大鱼调色/Plugin/DYInspector.mm +++ b/大鱼调色/Plugin/DYInspector.mm @@ -623,7 +623,7 @@ static NSImage *DYWheelImage(void) { - (void)layout { [super layout]; CGFloat w=MAX(280,self.bounds.size.width),h=self.bounds.size.height; - _brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,23,13); + _brand.frame=NSMakeRect(16,14,112,26);_subtitle.frame=NSMakeRect(130,21,40,13); for(NSInteger i=0;i<5;i++)[_themeButtons[i]setFrame:NSMakeRect(w-146+i*22,17,21,22)]; _resetAll.frame=NSMakeRect(w-33,16,23,24); CGFloat gap=7,bw=(w-32-gap*2)/3; @@ -852,7 +852,7 @@ static NSImage *DYWheelImage(void) { - (void)chooseFileForKey:(NSString *)key { NSOpenPanel *panel=[NSOpenPanel openPanel];panel.allowedFileTypes=@[@"cube"];panel.allowsMultipleSelection=NO; panel.canChooseDirectories=NO;panel.message=@"选择 .cube 立体 LUT"; - [panel beginWithCompletionHandler:^(NSModalResponse response){if(response==NSModalResponseOK&&self.window)[self setAssetPath:panel.URL.path forKey:key];}]; + if([panel runModal]==NSModalResponseOK&&self.window)[self setAssetPath:panel.URL.path forKey:key]; } - (void)browseAsset:(NSButton *)sender { [_browser close];[_browser release];_browser=nil; diff --git a/大鱼调色/Plugin/DYLUTBrowser.mm b/大鱼调色/Plugin/DYLUTBrowser.mm index cf42f89..f47bb7e 100644 --- a/大鱼调色/Plugin/DYLUTBrowser.mm +++ b/大鱼调色/Plugin/DYLUTBrowser.mm @@ -425,7 +425,10 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b if(_libraryTask||_importing||_closed)return; NSOpenPanel *panel=[NSOpenPanel openPanel];panel.canChooseFiles=!folders;panel.canChooseDirectories=folders;panel.allowsMultipleSelection=YES;panel.title=folders?@"导入 LUT 文件夹":@"导入 LUT 文件";panel.message=folders?@"所选文件夹中的 .cube 文件会按目录复制到大鱼调色 LUT 库。":@"选择要复制到大鱼调色 LUT 库的 .cube 文件。"; if(!folders)panel.allowedFileTypes=@[@"cube"]; - _importing=YES;[panel beginWithCompletionHandler:^(NSModalResponse response){_importing=NO;if(response==NSModalResponseOK&&!_closed)[self importSelectedURLs:panel.URLs];}]; + // FxPlug bridges the modal chooser; the asynchronous AppKit chooser cannot + // become key in the service. Only choosing a path is modal; file work is not. + _importing=YES;NSModalResponse response=[panel runModal];_importing=NO; + if(response==NSModalResponseOK&&!_closed)[self importSelectedURLs:panel.URLs]; } - (void)importFiles:(id)sender{[self importPanelForFolders:NO];} - (void)importFolder:(id)sender{[self importPanelForFolders:YES];} diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index a335b7b..07b7ad2 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.1.3 CFBundleVersion - 12 + 13 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index 8e6be3c..6186ae1 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.1.3 CFBundleVersion - 12 + 13 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright