Complete Modern desktop widgets and file libraries (by Codex)
This commit is contained in:
1 parent
db89d889f7
commit
31bcf93205
43 files changed
+3134
-484
No files matched your search
@@ -250,7 +250,14 @@ void DemoSource::save(const fs::path &file, const Json &desktop) {
|
||||
saved_ = state_;
|
||||
}
|
||||
Json DemoSource::load(const fs::path &file) {
|
||||
auto data = Json::parse(editor::read_file(file));
|
||||
return load_data(Json::parse(editor::read_file(file)));
|
||||
}
|
||||
bool DemoSource::mark_saved(uint64_t expected_revision) {
|
||||
if (revision_ != expected_revision) return false;
|
||||
saved_ = state_;
|
||||
return true;
|
||||
}
|
||||
Json DemoSource::load_data(Json data) {
|
||||
if (data.value("schema", "") != "openbmh-ui-demo@1" ||
|
||||
data.value("world", "") != catalog_->manifest().value("id", ""))
|
||||
throw editor::Error("wrong_demo_world");
|
||||
|
||||
Reference in new issue
Block a user