mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 04:08:12 +08:00
Integrate document-format storage into the editor (#4265)
* Integrate document-format storage into the editor * Address review feedback: drop redundant clones and dedupe metadata traversal * Extract DocumentHistory and move storage-metadata tests to their own file * Extract storage diffing/IO, gate validation and .gdd save behind preferences, restructure tests * Address PR review: save-format/path consistency, autosave persistence, and view-settings/diff fixes * Skip storage remount on .gdd open and split value/timestamp drift in attribute diff * Rename storage tests module and surface .gdd open failures with per-resource diff detail * Add debug-menu toggle to hide the storage preferences section * Hopefully fix async tests * Shorten comments * Fix tests * Review * Review * Review * Block on future mesages in tests * Review * Shorten comments --------- Co-authored-by: Timon <me@timon.zip>
This commit is contained in:
@@ -10,11 +10,18 @@ pub struct Editor {
|
||||
}
|
||||
|
||||
impl Editor {
|
||||
pub fn new(environment: Environment, uuid_random_seed: u64, resource_storage: Arc<dyn ResourceStorage>, mut application_io: PlatformApplicationIo, wake: Wake) -> Self {
|
||||
pub fn new(
|
||||
environment: Environment,
|
||||
uuid_random_seed: u64,
|
||||
resource_storage: Arc<dyn ResourceStorage>,
|
||||
working_copy_root: Option<std::path::PathBuf>,
|
||||
mut application_io: PlatformApplicationIo,
|
||||
wake: Wake,
|
||||
) -> Self {
|
||||
ENVIRONMENT.set(environment).expect("Editor shoud only be initialized once");
|
||||
graphene_std::uuid::set_uuid_seed(uuid_random_seed);
|
||||
|
||||
let mut dispatcher = Dispatcher::new(resource_storage);
|
||||
let mut dispatcher = Dispatcher::new(resource_storage, working_copy_root);
|
||||
dispatcher.message_handlers.future_message_handler.set_wake(wake);
|
||||
application_io.inject_resource_proxy(dispatcher.message_handlers.resource_storage_message_handler.resources());
|
||||
crate::node_graph_executor::replace_application_io(application_io);
|
||||
|
||||
Reference in New Issue
Block a user