| 1094 | } |
| 1095 | |
| 1096 | CaptureSettings CaptureDialog::LoadSettingsFromDisk(const rdcstr &filename) |
| 1097 | { |
| 1098 | QFile f(filename); |
| 1099 | if(f.open(QIODevice::ReadOnly | QIODevice::Text)) |
| 1100 | { |
| 1101 | QVariantMap values; |
| 1102 | |
| 1103 | bool success = LoadFromJSON(values, f, JSON_ID, JSON_VER); |
| 1104 | |
| 1105 | if(success) |
| 1106 | { |
| 1107 | return CaptureSettings(values[lit("settings")]); |
| 1108 | } |
| 1109 | else |
| 1110 | { |
| 1111 | RDDialog::critical(this, tr("Error loading config"), |
| 1112 | tr("Couldn't interpret settings in %1.").arg(filename)); |
| 1113 | } |
| 1114 | } |
| 1115 | else |
| 1116 | { |
| 1117 | RDDialog::critical(this, tr("Error loading config"), tr("Couldn't open path %1.").arg(filename)); |
| 1118 | } |
| 1119 | |
| 1120 | return CaptureSettings(); |
| 1121 | } |
| 1122 | |
| 1123 | void CaptureDialog::UpdateGlobalHook() |
| 1124 | { |
nothing calls this directly
no test coverage detected