@@ -744,6 +744,23 @@ private async Task SaveConfig(bool githubProxyCheck = true)//保存配置文件
744744 if ( ! Directory . Exists ( configDirPath ) )
745745 Directory . CreateDirectory ( configDirPath ) ;
746746
747+ string moreYamlPath = Path . Combine ( configDirPath , "more.yaml" ) ;
748+ if ( File . Exists ( moreYamlPath ) )
749+ {
750+ // 读取more.yaml的内容
751+ string moreYamlContent = File . ReadAllText ( moreYamlPath ) ;
752+
753+ // 确保more.yaml内容以换行开始
754+ if ( ! moreYamlContent . StartsWith ( "\n " ) && ! moreYamlContent . StartsWith ( "\r \n " ) )
755+ {
756+ yamlContent += "\n " ; // 添加换行符作为分隔
757+ }
758+
759+ // 将more.yaml的内容追加到要写入的config.yaml内容后
760+ yamlContent += moreYamlContent ;
761+
762+ Log ( $ "已将补充参数配置 more.yaml 内容追加到配置文件") ;
763+ }
747764 // 写入YAML文件
748765 File . WriteAllText ( configFilePath , yamlContent ) ;
749766 }
@@ -2903,5 +2920,30 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
29032920 aboutWindow . TopMost = true ;
29042921 } ) ) ;
29052922 }
2923+
2924+ private void button8_Click ( object sender , EventArgs e )
2925+ {
2926+ try
2927+ {
2928+ // 创建MoreYAML窗口实例
2929+ MoreYAML moreYamlWindow = new MoreYAML ( ) ;
2930+
2931+ // 显示为模态对话框,这会阻塞主线程直到窗口关闭
2932+ DialogResult result = moreYamlWindow . ShowDialog ( this ) ;
2933+
2934+ // 如果需要,可以处理对话框的返回结果
2935+ if ( result == DialogResult . OK )
2936+ {
2937+ // 用户点击了"确定"或某种完成操作的按钮
2938+ Log ( "补充参数配置已成功保存到 more.yaml 文件!设置已应用" ) ;
2939+ }
2940+ }
2941+ catch ( Exception ex )
2942+ {
2943+ Log ( $ "打开MoreYAML窗口时出错: { ex . Message } ", true ) ;
2944+ MessageBox . Show ( $ "打开MoreYAML窗口时出错: { ex . Message } ", "错误" ,
2945+ MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
2946+ }
2947+ }
29062948 }
29072949}
0 commit comments