feat: 完善插件系统;完善本地化;
This commit is contained in:
parent
a22e1f8f00
commit
da4e576d16
|
@ -1703,7 +1703,7 @@
|
|||
<translation>列 %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/mainwindow.cpp" line="3632"/>
|
||||
<location filename="../../src/dialog/mainwindow.cpp" line="3642"/>
|
||||
<source>ConfirmAPPSave</source>
|
||||
<translation>你尝试关闭程序,但仍存在未保存的文件或工作区,你确定保存这些更改吗?</translation>
|
||||
</message>
|
||||
|
@ -2171,167 +2171,172 @@
|
|||
<context>
|
||||
<name>PluginSystem</name>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="84"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="72"/>
|
||||
<source>LoadingPlugin</source>
|
||||
<translation>加载插件中:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="102"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="90"/>
|
||||
<source>InvalidPluginBrokenInfo</source>
|
||||
<translation>加载插件失败:损坏的插件数据</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="604"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="499"/>
|
||||
<source>AppClosingCanceled:</source>
|
||||
<translation>程序关闭被取消:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="616"/>
|
||||
<source>FoundDrvPluginCount</source>
|
||||
<translation>总计发现设备拓展插件数目:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="644"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="656"/>
|
||||
<source>RegisteredFnDup</source>
|
||||
<translation>注册重复函数对象</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="854"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="870"/>
|
||||
<source>ErrLoadPluginSign</source>
|
||||
<translation>插件加载失败:非法插件签名!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="858"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="874"/>
|
||||
<source>ErrLoadPluginSDKVersion</source>
|
||||
<translation>插件加载失败:非法插件 SDK 版本!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="862"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="878"/>
|
||||
<source>ErrLoadPluginNoName</source>
|
||||
<translation>插件加载失败:非法插件名称!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="887"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="903"/>
|
||||
<source>ErrLoadInitPlugin</source>
|
||||
<translation>插件加载失败:初始化插件失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="894"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="910"/>
|
||||
<source>PluginName :</source>
|
||||
<translation>插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="895"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="911"/>
|
||||
<source>PluginAuthor :</source>
|
||||
<translation>插件作者:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="896"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="912"/>
|
||||
<source>PluginWidgetRegister</source>
|
||||
<translation>注册插件对象中……</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1000"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1016"/>
|
||||
<source>ErrLoadExtPluginSign</source>
|
||||
<translation>设备拓展插件加载失败:非法插件签名!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1004"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1020"/>
|
||||
<source>ErrLoadExtPluginSDKVersion</source>
|
||||
<translation>设备拓展插件加载失败:非法插件 SDK 版本!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1008"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1024"/>
|
||||
<source>ErrLoadExtPluginNoName</source>
|
||||
<translation>设备拓展插件加载失败:非法插件名称!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1011"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1027"/>
|
||||
<source>ExtPluginName :</source>
|
||||
<translation>设备拓展插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1012"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1028"/>
|
||||
<source>ExtPluginAuthor :</source>
|
||||
<translation>设备拓展插件作者:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1013"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1029"/>
|
||||
<source>ExtPluginWidgetRegister</source>
|
||||
<translation>设备拓展注册插件对象中……</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1032"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1048"/>
|
||||
<source>ErrLoadInitExtPlugin</source>
|
||||
<translation>设备拓展插件加载失败:初始化插件失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1099"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1115"/>
|
||||
<source>EmptyNameDockWidget:</source>
|
||||
<translation>空的贴边组件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1109"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1125"/>
|
||||
<source>InvalidNameDockWidget:</source>
|
||||
<translation>无效贴边组件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1117"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1133"/>
|
||||
<source>InvalidNullDockWidget:</source>
|
||||
<translation>无效空贴边组件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1257"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1273"/>
|
||||
<source>[EvilCall]</source>
|
||||
<translation>【恶意调用】</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="2800"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="2842"/>
|
||||
<source>Not allowed operation in non-UI thread</source>
|
||||
<translation>该操作在非 UI 线程非法</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="626"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="638"/>
|
||||
<source>UnsafePluginDir</source>
|
||||
<translation>不安全的插件目录,请将插件目录设置为仅管理员账户可写</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="109"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="97"/>
|
||||
<source>InvalidPluginID</source>
|
||||
<translation>加载插件失败:非法插件标识符</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="112"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="100"/>
|
||||
<source>InvalidDupPlugin</source>
|
||||
<translation>加载插件失败:重复的插件标识符</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="540"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="552"/>
|
||||
<source>FoundPluginCount</source>
|
||||
<translation>总计发现插件数目:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="567"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="579"/>
|
||||
<source>PluginLoadingFailedSummary</source>
|
||||
<translation>有依赖插件加载失败总结</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="571"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="583"/>
|
||||
<source>- PluginName:</source>
|
||||
<translation>- 插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="572"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="584"/>
|
||||
<source>- Dependencies:</source>
|
||||
<translation>- 依赖:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="574"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="586"/>
|
||||
<source>PUID:</source>
|
||||
<translation>插件唯一标志符:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="575"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="587"/>
|
||||
<source>Version:</source>
|
||||
<translation>版本:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="582"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="594"/>
|
||||
<source>PluginLoadingFinished</source>
|
||||
<translation>加载插件完毕!</translation>
|
||||
</message>
|
||||
|
@ -5330,22 +5335,22 @@ Do you wish to keep up to date by reloading the file?</source>
|
|||
<translation>为 AngelScript 脚本提供调用主机 API 能力的内部插件。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1234"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1239"/>
|
||||
<source>RegisterScriptFnInvalidSig:</source>
|
||||
<translation>因脚本函数签名非法而注册失败:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1256"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1261"/>
|
||||
<source>InvalidEnumName:</source>
|
||||
<translation>非法枚举名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1264"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1269"/>
|
||||
<source>InvalidEnumValue:</source>
|
||||
<translation>非法枚举值:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1529"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1534"/>
|
||||
<source>NotSupportedQMetaType:</source>
|
||||
<translation>不支持的 QT 数据元类型:</translation>
|
||||
</message>
|
||||
|
|
|
@ -1703,7 +1703,7 @@
|
|||
<translation>列 %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/mainwindow.cpp" line="3632"/>
|
||||
<location filename="../../src/dialog/mainwindow.cpp" line="3642"/>
|
||||
<source>ConfirmAPPSave</source>
|
||||
<translation>你嘗試關閉程式,但仍存在未保存的檔或工作區,你確定保存這些更改嗎?</translation>
|
||||
</message>
|
||||
|
@ -2171,167 +2171,172 @@
|
|||
<context>
|
||||
<name>PluginSystem</name>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="84"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="72"/>
|
||||
<source>LoadingPlugin</source>
|
||||
<translation>加載插件中:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="102"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="90"/>
|
||||
<source>InvalidPluginBrokenInfo</source>
|
||||
<translation>加載插件失敗:損壞的插件數據</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="604"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="499"/>
|
||||
<source>AppClosingCanceled:</source>
|
||||
<translation>程式關閉被取消:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="616"/>
|
||||
<source>FoundDrvPluginCount</source>
|
||||
<translation>總計發現設備拓展插件數目:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="644"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="656"/>
|
||||
<source>RegisteredFnDup</source>
|
||||
<translation>註冊重複函數對象</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="854"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="870"/>
|
||||
<source>ErrLoadPluginSign</source>
|
||||
<translation>插件加載失敗:非法插件簽名!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="858"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="874"/>
|
||||
<source>ErrLoadPluginSDKVersion</source>
|
||||
<translation>插件加載失敗:非法插件 SDK 版本!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="862"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="878"/>
|
||||
<source>ErrLoadPluginNoName</source>
|
||||
<translation>插件加載失敗:非法插件名稱!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="887"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="903"/>
|
||||
<source>ErrLoadInitPlugin</source>
|
||||
<translation>插件加載失敗:初始化插件失敗!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="894"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="910"/>
|
||||
<source>PluginName :</source>
|
||||
<translation>插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="895"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="911"/>
|
||||
<source>PluginAuthor :</source>
|
||||
<translation>插件作者:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="896"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="912"/>
|
||||
<source>PluginWidgetRegister</source>
|
||||
<translation>註冊插件對象中……</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1000"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1016"/>
|
||||
<source>ErrLoadExtPluginSign</source>
|
||||
<translation>設備拓展插件加載失敗:非法插件簽名!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1004"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1020"/>
|
||||
<source>ErrLoadExtPluginSDKVersion</source>
|
||||
<translation>設備拓展插件加載失敗:非法插件 SDK 版本!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1008"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1024"/>
|
||||
<source>ErrLoadExtPluginNoName</source>
|
||||
<translation>設備拓展插件加載失敗:非法插件名稱!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1011"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1027"/>
|
||||
<source>ExtPluginName :</source>
|
||||
<translation>設備拓展插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1012"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1028"/>
|
||||
<source>ExtPluginAuthor :</source>
|
||||
<translation>設備拓展插件作者:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1013"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1029"/>
|
||||
<source>ExtPluginWidgetRegister</source>
|
||||
<translation>設備拓展註冊插件對象中……</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1032"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1048"/>
|
||||
<source>ErrLoadInitExtPlugin</source>
|
||||
<translation>設備拓展插件加載失敗:初始化插件失敗!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1099"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1115"/>
|
||||
<source>EmptyNameDockWidget:</source>
|
||||
<translation>空的貼邊組件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1109"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1125"/>
|
||||
<source>InvalidNameDockWidget:</source>
|
||||
<translation>無效貼邊組件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1117"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1133"/>
|
||||
<source>InvalidNullDockWidget:</source>
|
||||
<translation>無效空貼邊組件:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1257"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="1273"/>
|
||||
<source>[EvilCall]</source>
|
||||
<translation>【惡意調用】</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="2800"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="2842"/>
|
||||
<source>Not allowed operation in non-UI thread</source>
|
||||
<translation>該操作在非 UI 線程非法</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="626"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="638"/>
|
||||
<source>UnsafePluginDir</source>
|
||||
<translation>不安全的插件目錄,請將插件目錄設置為僅管理員帳戶可寫</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="109"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="97"/>
|
||||
<source>InvalidPluginID</source>
|
||||
<translation>加載插件失敗:非法插件識別字</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="112"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="100"/>
|
||||
<source>InvalidDupPlugin</source>
|
||||
<translation>加載插件失敗:重複的插件識別字</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="540"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="552"/>
|
||||
<source>FoundPluginCount</source>
|
||||
<translation>總計發現插件數目:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="567"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="579"/>
|
||||
<source>PluginLoadingFailedSummary</source>
|
||||
<translation>有依賴插件加載失敗總結</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="571"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="583"/>
|
||||
<source>- PluginName:</source>
|
||||
<translation>- 插件名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="572"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="584"/>
|
||||
<source>- Dependencies:</source>
|
||||
<translation>- 依賴:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="574"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="586"/>
|
||||
<source>PUID:</source>
|
||||
<translation>插件唯一標誌符:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="575"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="587"/>
|
||||
<source>Version:</source>
|
||||
<translation>版本:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="582"/>
|
||||
<location filename="../../src/plugin/pluginsystem.cpp" line="594"/>
|
||||
<source>PluginLoadingFinished</source>
|
||||
<translation>加載插件完畢!</translation>
|
||||
</message>
|
||||
|
@ -5330,22 +5335,22 @@ Do you wish to keep up to date by reloading the file?</source>
|
|||
<translation>為 AngelScript 腳本提供調用主機 API 能力的內部插件。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1234"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1239"/>
|
||||
<source>RegisterScriptFnInvalidSig:</source>
|
||||
<translation>因腳本函數簽名非法而註冊失敗:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1256"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1261"/>
|
||||
<source>InvalidEnumName:</source>
|
||||
<translation>非法枚舉名:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1264"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1269"/>
|
||||
<source>InvalidEnumValue:</source>
|
||||
<translation>非法枚舉值:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1529"/>
|
||||
<location filename="../../src/class/wingangelapi.cpp" line="1534"/>
|
||||
<source>NotSupportedQMetaType:</source>
|
||||
<translation>不支持的 QT 數據元類型:</translation>
|
||||
</message>
|
||||
|
|
|
@ -509,6 +509,11 @@ void WingAngelAPI::installHexReaderAPI(asIScriptEngine *engine) {
|
|||
std::bind(&WingHex::WingPlugin::Reader::currentDocFilename, reader),
|
||||
"string currentDocFilename()");
|
||||
|
||||
registerAPI<bool(void)>(
|
||||
engine,
|
||||
std::bind(&WingHex::WingPlugin::Reader::isInsertionMode, reader),
|
||||
"bool isInsertionMode()");
|
||||
|
||||
registerAPI<bool(void)>(
|
||||
engine, std::bind(&WingHex::WingPlugin::Reader::isReadOnly, reader),
|
||||
"bool isReadOnly()");
|
||||
|
|
|
@ -3600,7 +3600,17 @@ QJsonObject MainWindow::extractModelData(const QAbstractItemModel *model,
|
|||
|
||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
m_isOnClosing = true;
|
||||
// first checking the scripting dialog
|
||||
|
||||
// plugin first checking
|
||||
auto closing = PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::AppClosing, {});
|
||||
if (!closing) {
|
||||
event->ignore();
|
||||
m_isOnClosing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// then checking the scripting dialog
|
||||
if (!m_scriptDialog->about2Close()) {
|
||||
event->ignore();
|
||||
m_isOnClosing = false;
|
||||
|
@ -3662,6 +3672,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
|||
set.save();
|
||||
|
||||
LangService::instance().saveSnippets();
|
||||
PluginSystem::instance().destory();
|
||||
|
||||
FramelessMainWindow::closeEvent(event);
|
||||
}
|
||||
|
|
|
@ -107,6 +107,7 @@ signals:
|
|||
|
||||
// document
|
||||
Q_REQUIRED_RESULT bool isReadOnly();
|
||||
Q_REQUIRED_RESULT bool isInsertionMode();
|
||||
Q_REQUIRED_RESULT bool isKeepSize();
|
||||
Q_REQUIRED_RESULT bool isLocked();
|
||||
Q_REQUIRED_RESULT qsizetype documentLines();
|
||||
|
@ -437,15 +438,16 @@ public:
|
|||
enum class RegisteredEvent : uint {
|
||||
None,
|
||||
AppReady = 1u,
|
||||
SelectionChanged = 1u << 1,
|
||||
CursorPositionChanged = 1u << 2,
|
||||
FileOpened = 1u << 3,
|
||||
FileSaved = 1u << 4,
|
||||
FileSwitched = 1u << 5,
|
||||
FileClosed = 1u << 6,
|
||||
ScriptPragma = 1u << 7,
|
||||
PluginFileOpened = 1u << 8,
|
||||
PluginFileClosed = 1u << 9,
|
||||
AppClosing = 1u << 1,
|
||||
SelectionChanged = 1u << 2,
|
||||
CursorPositionChanged = 1u << 3,
|
||||
FileOpened = 1u << 4,
|
||||
FileSaved = 1u << 5,
|
||||
FileSwitched = 1u << 6,
|
||||
FileClosed = 1u << 7,
|
||||
ScriptPragma = 1u << 8,
|
||||
PluginFileOpened = 1u << 9,
|
||||
PluginFileClosed = 1u << 10,
|
||||
};
|
||||
Q_DECLARE_FLAGS(RegisteredEvents, RegisteredEvent)
|
||||
|
||||
|
@ -518,6 +520,8 @@ public:
|
|||
|
||||
virtual void eventReady() {}
|
||||
|
||||
virtual bool eventClosing() { return true; }
|
||||
|
||||
public:
|
||||
virtual bool eventOnScriptPragma(const QStringList &comments) {
|
||||
Q_UNUSED(comments);
|
||||
|
|
|
@ -41,20 +41,8 @@
|
|||
PluginSystem::PluginSystem(QObject *parent) : QObject(parent) {}
|
||||
|
||||
PluginSystem::~PluginSystem() {
|
||||
QDir udir(Utilities::getAppDataPath());
|
||||
auto plgset = QStringLiteral("plgset");
|
||||
udir.mkdir(plgset);
|
||||
if (!udir.cd(plgset)) {
|
||||
qApp->exit(int(CrashCode::PluginSetting));
|
||||
}
|
||||
|
||||
for (auto &item : _loadedplgs) {
|
||||
auto set = std::make_unique<QSettings>(
|
||||
udir.absoluteFilePath(item->metaObject()->className()),
|
||||
QSettings::Format::IniFormat);
|
||||
item->unload(set);
|
||||
delete item;
|
||||
}
|
||||
Q_ASSERT(_loadedplgs.isEmpty());
|
||||
Q_ASSERT(_loadeddevs.isEmpty());
|
||||
}
|
||||
|
||||
const QList<IWingPlugin *> &PluginSystem::plugins() const {
|
||||
|
@ -157,6 +145,15 @@ EditorView *PluginSystem::handle2EditorView(IWingPlugin *plg, int handle) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool PluginSystem::equalCompareHandle(const SharedUniqueId &id, int handle) {
|
||||
return (*id) == handle;
|
||||
}
|
||||
|
||||
int PluginSystem::getUIDHandle(const SharedUniqueId &id) {
|
||||
Q_ASSERT(id.data());
|
||||
return int(*id);
|
||||
}
|
||||
|
||||
PluginSystem::SharedUniqueId
|
||||
PluginSystem::assginHandleForPluginView(IWingPlugin *plg, EditorView *view) {
|
||||
if (plg == nullptr || view == nullptr) {
|
||||
|
@ -277,7 +274,8 @@ void PluginSystem::cleanUpEditorViewHandle(EditorView *view) {
|
|||
handles.begin(), handles.end(),
|
||||
[view, this](const PluginFileContext &v) {
|
||||
if (v.view == view) {
|
||||
if (v.fid == m_plgCurrentfid[v.linkedplg]) {
|
||||
if (equalCompareHandle(v.fid,
|
||||
m_plgCurrentfid[v.linkedplg])) {
|
||||
m_plgCurrentfid[v.linkedplg] = -1;
|
||||
}
|
||||
dispatchEvent(
|
||||
|
@ -294,12 +292,14 @@ void PluginSystem::cleanUpEditorViewHandle(EditorView *view) {
|
|||
#else
|
||||
handles.removeIf([view, this](const PluginFileContext &v) {
|
||||
if (v.view == view) {
|
||||
if (v.fid == m_plgCurrentfid[v.linkedplg]) {
|
||||
if (equalCompareHandle(v.fid,
|
||||
m_plgCurrentfid[v.linkedplg])) {
|
||||
m_plgCurrentfid[v.linkedplg] = -1;
|
||||
}
|
||||
dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileClosed,
|
||||
{quintptr(v.linkedplg), v.view->fileName(), int(v.fid),
|
||||
{quintptr(v.linkedplg), v.view->fileName(),
|
||||
getUIDHandle(v.fid),
|
||||
QVariant::fromValue(
|
||||
_win->getEditorViewFileType(view))});
|
||||
return true;
|
||||
|
@ -317,7 +317,7 @@ bool PluginSystem::closeEditor(IWingPlugin *plg, int handle, bool force) {
|
|||
auto &handles = m_plgviewMap[plg];
|
||||
auto r = std::find_if(handles.begin(), handles.end(),
|
||||
[handle](const PluginFileContext &d) {
|
||||
return (*d.fid) == handle;
|
||||
return equalCompareHandle(d.fid, handle);
|
||||
});
|
||||
if (r == handles.end()) {
|
||||
return false;
|
||||
|
@ -347,9 +347,10 @@ bool PluginSystem::closeHandle(IWingPlugin *plg, int handle) {
|
|||
return false;
|
||||
}
|
||||
auto &handles = m_plgviewMap[plg];
|
||||
auto r = std::find_if(
|
||||
handles.begin(), handles.end(),
|
||||
[handle](const PluginFileContext &d) { return (*d.fid) == handle; });
|
||||
auto r = std::find_if(handles.begin(), handles.end(),
|
||||
[handle](const PluginFileContext &d) {
|
||||
return equalCompareHandle(d.fid, handle);
|
||||
});
|
||||
if (r == handles.end()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -491,6 +492,17 @@ bool PluginSystem::dispatchEvent(IWingPlugin::RegisteredEvent event,
|
|||
fileType, fileName, id, {});
|
||||
}
|
||||
} break;
|
||||
case WingHex::IWingPlugin::RegisteredEvent::AppClosing:
|
||||
for (auto &plg : _evplgs[event]) {
|
||||
auto ret = plg->eventClosing();
|
||||
if (!ret) {
|
||||
Logger::warning(tr("AppClosingCanceled:") + plg->pluginName() +
|
||||
QStringLiteral(" (") + getPluginID(plg) +
|
||||
QStringLiteral(")"));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -695,6 +707,10 @@ void PluginSystem::registerEvents(IWingPlugin *plg) {
|
|||
_evplgs[IWingPlugin::RegisteredEvent::AppReady].append(plg);
|
||||
}
|
||||
|
||||
if (evs.testFlag(IWingPlugin::RegisteredEvent::AppClosing)) {
|
||||
_evplgs[IWingPlugin::RegisteredEvent::AppClosing].append(plg);
|
||||
}
|
||||
|
||||
if (evs.testFlag(IWingPlugin::RegisteredEvent::FileClosed)) {
|
||||
_evplgs[IWingPlugin::RegisteredEvent::FileClosed].append(plg);
|
||||
}
|
||||
|
@ -1295,6 +1311,14 @@ void PluginSystem::connectReaderInterface(IWingPlugin *plg) {
|
|||
}
|
||||
return QString();
|
||||
});
|
||||
connect(preader, &WingPlugin::Reader::isInsertionMode, _win, [=]() -> bool {
|
||||
auto e = pluginCurrentEditor(plg);
|
||||
if (e) {
|
||||
return e->hexEditor()->cursor()->insertionMode() ==
|
||||
QHexCursor::InsertMode;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
connect(preader, &WingPlugin::Reader::isLocked, _win, [=]() -> bool {
|
||||
auto e = pluginCurrentEditor(plg);
|
||||
if (e) {
|
||||
|
@ -2340,33 +2364,50 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
if (view) {
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
return ErrFile(int(*id));
|
||||
auto handle = getUIDHandle(id);
|
||||
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg),
|
||||
{},
|
||||
handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ErrFile::Error;
|
||||
}
|
||||
});
|
||||
connect(pctl, &WingPlugin::Controller::openWorkSpace, _win,
|
||||
[=](const QString &filename) -> ErrFile {
|
||||
if (!checkThreadAff()) {
|
||||
return ErrFile::NotAllowedInNoneGUIThread;
|
||||
connect(
|
||||
pctl, &WingPlugin::Controller::openWorkSpace, _win,
|
||||
[=](const QString &filename) -> ErrFile {
|
||||
if (!checkThreadAff()) {
|
||||
return ErrFile::NotAllowedInNoneGUIThread;
|
||||
}
|
||||
EditorView *view = nullptr;
|
||||
if (!checkPluginCanOpenedFile(plg)) {
|
||||
return ErrFile::TooManyOpenedFile;
|
||||
}
|
||||
auto ret = _win->openWorkSpace(filename, &view);
|
||||
if (view) {
|
||||
if (ret == ErrFile::AlreadyOpened &&
|
||||
checkPluginHasAlreadyOpened(plg, view)) {
|
||||
return ErrFile::AlreadyOpened;
|
||||
}
|
||||
EditorView *view = nullptr;
|
||||
if (!checkPluginCanOpenedFile(plg)) {
|
||||
return ErrFile::TooManyOpenedFile;
|
||||
}
|
||||
auto ret = _win->openWorkSpace(filename, &view);
|
||||
if (view) {
|
||||
if (ret == ErrFile::AlreadyOpened &&
|
||||
checkPluginHasAlreadyOpened(plg, view)) {
|
||||
return ErrFile::AlreadyOpened;
|
||||
}
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
return ErrFile(int(*id));
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
auto handle = getUIDHandle(id);
|
||||
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg), filename, handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
connect(
|
||||
pctl, &WingPlugin::Controller::openFile, _win,
|
||||
[=](const QString &filename) -> ErrFile {
|
||||
|
@ -2385,13 +2426,13 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
}
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
|
||||
auto handle = getUIDHandle(id);
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg), filename, int(*id),
|
||||
{quintptr(plg), filename, handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(int(*id));
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
|
@ -2416,12 +2457,13 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
|
||||
auto handle = getUIDHandle(id);
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg), file, int(*id),
|
||||
{quintptr(plg), file, handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(int(*id));
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
|
@ -2445,13 +2487,13 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
}
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
|
||||
auto handle = getUIDHandle(id);
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg), filename, int(*id),
|
||||
{quintptr(plg), filename, handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(int(*id));
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
|
@ -2474,13 +2516,13 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
}
|
||||
auto id = assginHandleForPluginView(plg, view);
|
||||
m_plgCurrentfid[plg] = id;
|
||||
|
||||
auto handle = getUIDHandle(id);
|
||||
PluginSystem::instance().dispatchEvent(
|
||||
IWingPlugin::RegisteredEvent::PluginFileOpened,
|
||||
{quintptr(plg), driver, int(*id),
|
||||
{quintptr(plg), driver, handle,
|
||||
QVariant::fromValue(_win->getEditorViewFileType(view))});
|
||||
|
||||
return ErrFile(int(*id));
|
||||
return ErrFile(handle);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
|
@ -2633,7 +2675,7 @@ void PluginSystem::connectControllerInterface(IWingPlugin *plg) {
|
|||
}
|
||||
auto &maps = m_plgviewMap[plg];
|
||||
for (auto &item : maps) {
|
||||
closeEditor(plg, item.fid, true);
|
||||
closeEditor(plg, getUIDHandle(item.fid), true);
|
||||
}
|
||||
m_plgCurrentfid[plg] = -1;
|
||||
maps.clear();
|
||||
|
@ -2853,6 +2895,33 @@ void PluginSystem::loadAllPlugin() {
|
|||
loadExtPlugin();
|
||||
}
|
||||
|
||||
void PluginSystem::destory() {
|
||||
QDir udir(Utilities::getAppDataPath());
|
||||
auto plgset = QStringLiteral("plgset");
|
||||
udir.mkdir(plgset);
|
||||
if (!udir.cd(plgset)) {
|
||||
qApp->exit(int(CrashCode::PluginSetting));
|
||||
}
|
||||
|
||||
for (auto &item : _loadedplgs) {
|
||||
auto set =
|
||||
std::make_unique<QSettings>(udir.absoluteFilePath(_pinfos[item].id),
|
||||
QSettings::Format::IniFormat);
|
||||
item->unload(set);
|
||||
delete item;
|
||||
}
|
||||
_loadedplgs.clear();
|
||||
|
||||
for (auto &item : _loadeddevs) {
|
||||
auto set =
|
||||
std::make_unique<QSettings>(udir.absoluteFilePath(_pinfos[item].id),
|
||||
QSettings::Format::IniFormat);
|
||||
item->unload(set);
|
||||
delete item;
|
||||
}
|
||||
_loadeddevs.clear();
|
||||
}
|
||||
|
||||
EditorView *PluginSystem::pluginCurrentEditor(IWingPlugin *plg) const {
|
||||
if (plg) {
|
||||
auto fid = m_plgCurrentfid[plg];
|
||||
|
@ -2874,9 +2943,10 @@ PluginSystem::pluginContextById(IWingPlugin *plg, int fid) const {
|
|||
return std::nullopt;
|
||||
}
|
||||
auto &handles = m_plgviewMap[plg];
|
||||
auto r = std::find_if(
|
||||
handles.begin(), handles.end(),
|
||||
[fid](const PluginFileContext &d) { return (*d.fid) == fid; });
|
||||
auto r = std::find_if(handles.begin(), handles.end(),
|
||||
[fid](const PluginFileContext &d) {
|
||||
return equalCompareHandle(d.fid, fid);
|
||||
});
|
||||
if (r == handles.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -2889,9 +2959,10 @@ PluginSystem::pluginContextByIdIt(IWingPlugin *plg, int fid) {
|
|||
if (fid < 0) {
|
||||
return std::nullopt;
|
||||
}
|
||||
auto r = std::find_if(
|
||||
handles.begin(), handles.end(),
|
||||
[fid](const PluginFileContext &d) { return (*d.fid) == fid; });
|
||||
auto r = std::find_if(handles.begin(), handles.end(),
|
||||
[fid](const PluginFileContext &d) {
|
||||
return equalCompareHandle(d.fid, fid);
|
||||
});
|
||||
if (r == handles.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
|
|
@ -142,6 +142,8 @@ public:
|
|||
void loadAllPlugin();
|
||||
void unloadAllPlugin();
|
||||
|
||||
void destory();
|
||||
|
||||
const QList<IWingPlugin *> &plugins() const;
|
||||
IWingPlugin *plugin(qsizetype index) const;
|
||||
|
||||
|
@ -188,6 +190,10 @@ private:
|
|||
SharedUniqueId assginHandleForPluginView(IWingPlugin *plg,
|
||||
EditorView *view);
|
||||
|
||||
static bool equalCompareHandle(const SharedUniqueId &id, int handle);
|
||||
|
||||
static int getUIDHandle(const SharedUniqueId &id);
|
||||
|
||||
private:
|
||||
PluginInfo parsePluginMetadata(const QJsonObject &meta);
|
||||
|
||||
|
|
Loading…
Reference in New Issue