Skip to content

Commit

Permalink
Change warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Jul 11, 2024
1 parent e62b2a2 commit f9bf120
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
2 changes: 1 addition & 1 deletion crates/filesystem/src/path_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct Cache {

#[derive(Debug)]
pub struct FileSystem<F> {
pub(crate) fs: F,
fs: F,
cache: parking_lot::RwLock<Cache>,
}

Expand Down
15 changes: 0 additions & 15 deletions crates/filesystem/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,6 @@ impl FileSystem {
pub fn unload_project(&mut self) {
*self = FileSystem::Unloaded;
}

// gives access to the non-path cache'd filesystem, for when you need to do direct manipulation of the filesystem
// the path cache should be rebuilt after this!
pub fn raw_filesystem(&self) -> &impl crate::FileSystem {
match self {
FileSystem::Unloaded | FileSystem::HostLoaded(_) => panic!("not loaded"),
FileSystem::Loaded { filesystem, .. } => &filesystem.fs,
}
}

pub fn rebuild_path_cache(&self) {
if let Self::Loaded { filesystem, .. } = self {
filesystem.rebuild();
}
}
}

// Not platform specific
Expand Down
12 changes: 2 additions & 10 deletions crates/ui/src/windows/config_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Window {
}
}

const FORMAT_WARNING: &str = "Luminol will need to convert your project.\nThis is not 100% safe yet, make backups!\nPress OK to continue.";
const FORMAT_WARNING: &str = "While the option is provided,\nLuminol cannot convert between formats yet.\nIt can still read other formats, however."; // "Luminol will need to convert your project.\nThis is not 100% safe yet, make backups!\nPress OK to continue.";

impl luminol_core::Window for Window {
fn id(&self) -> egui::Id {
Expand Down Expand Up @@ -111,16 +111,8 @@ impl luminol_core::Window for Window {
)
.clicked();
if clicked {
update_state
.data
.convert_project(
update_state.filesystem.raw_filesystem(),
config,
self.selected_data_format,
)
.unwrap(); // TODO handle
update_state.filesystem.rebuild_path_cache(); // I do not like this solution. A dedicated tool for this would be more appropriate.
config.project.data_format = self.selected_data_format;
// TODO add conversion logic
}
}

Expand Down

0 comments on commit f9bf120

Please sign in to comment.