Desktop: Add support for opening a .graphite file from a path passed as a launch argument#3059
Conversation
|
Neither of your gitignore changes seem to make sense to me. Can you justify or remove them? |
|
I would generally prefer a proper cli implementation from the beginning (with clap etc.), not a temporary solution for only implementing file opening. @TrueDoctor I would need to implement basically all of this in my wrapper crate pr (#3039). Would you be fine with waiting with features that will have a easy way of implementing once the wrapper crate separation is done? |
I added those lines because I haven't created those folders but they were there as a result of a compilation step. Let me remove them. |
Are you in favor of closing this, then? I'll defer to your thinking on this. |
|
@c-mateo are you still interested in working on this? Would need a complete rework now that 3039 is merged. And I would still prefer implementing this with clap. |
|
I'll close this for now then, @timon-schelling's requested changes can be either a new PR or be part of this PR and reopened. |
|
Now the cli is properly implemented using clap and there's an option to select whether you desire to use cef's shared texture as Timon suggested on Discord. You can give me some ideas for more commands and options before merging |
timon-schelling
left a comment
There was a problem hiding this comment.
Generally good direction
| tracing::info!("Opening file from command line: {}", path.display()); | ||
| if let Ok(content) = std::fs::read(&path) { | ||
| let message = DesktopWrapperMessage::OpenFile { path, content }; | ||
| self.dispatch_desktop_wrapper_message(message); |
There was a problem hiding this comment.
Not a blocker but will need to be rewritten after #3247.
There was a problem hiding this comment.
I barely modified that section, just changed dispatch_desktop_wrapper_message for app_event_scheduler.schedule because calling dispatch_desktop_wrapper_message directly prevents the native open file dialog from showing up. I'm not sure if should have done something else but the cli is working.
|
Looks good, I will take a closer look after the developer meetup tomorrow and probably merge. Thanks |
timon-schelling
left a comment
There was a problem hiding this comment.
Thanks, good work. Sorry for taking so long. :)
Closes #3054