| 192 | acRun.fromPack(pack.get("actions").toArray()); |
| 193 | acEnd.fromPack(pack.get("actionsEnding").toArray()); |
| 194 | acEnt.fromPack(pack.get("actionsEntry").toArray()); |
| 195 | } |
| 196 | |
| 197 | #if !defined(Q_ENCRYPT) || defined(Q_ENCRYPT_CVT) |
| 198 | bool LoadJsonMacro(Macro& macro, const QString& path, const QString& name) |
| 199 | { |
| 200 | QByteArray text; |
| 201 | if (!File::LoadText(path, text)) |
| 202 | { |
| 203 | MsgBox::Error(reinterpret_cast<const wchar_t*>(name.utf16()), lang_trans("加载宏失败").toStdWString()); |
| 204 | return false; |
| 205 | } |
| 206 | QJsonDocument json(QJsonDocument::fromJson(text)); |
| 207 | if (!json.isObject()) |
| 208 | { |
| 209 | MsgBox::Error(reinterpret_cast<const wchar_t*>(name.utf16()), lang_trans("宏数据错误").toStdWString()); |
| 210 | return false; |
| 211 | } |
| 212 | macro.storageType = Macro::StorageType::JSON; |
| 213 | macro.name = name; |
| 214 | macro.fromJson(json.object()); |
| 215 | return true; |