added UI for `pijul change`
Dependencies
- [2]
337EO2TUadd selection callback to changelog UI (& fix deselection) - [3]
SOTD66FOset Changelog UI to display log from selected channel in ChannelsList UI - [4]
HZV5P57Ychanged channel and log views to use `ListView` (looks much cleaner) - [5]
XERTHGSYconsolidated `pijul log` UI elements into their own component - [6]
IQY5LHENadd GUI element to display simple `pijul log` results - [7]
G2CHQAOPparsed `pijul log` text blob into individual entries & fields - [*]
NSE6BLWAinit slint project from https://github.com/slint-ui/slint-rust-template - [*]
PL4TK55Oadded command-line argument to specify executable path - [*]
4RPYR65Cconnect GUI to pijul to display simple channel list - [*]
NCRTU7M4cargo init - [*]
6ECOC7L5parsed `pijul channel` text blob into individual UI components
Change contents
- edit in ui/app-window.slint at line 11
component DeltasList {in property <string> delta;VerticalBox {Text {vertical-stretch: 0;text: "change";} - edit in ui/app-window.slint at line 21
ScrollView {vertical-stretch: 1;viewport-width <=> text.width;viewport-height <=> text.height;text := Text {width: 100%;text: delta;}}}} - replacement in ui/app-window.slint at line 94
preferred-width: 500px;// preferred-width: 400px; - edit in ui/app-window.slint at line 191
preferred-width: 960px;preferred-height: 720px; - edit in ui/app-window.slint at line 199
in-out property <string> delta <=> deltas.delta; - edit in ui/app-window.slint at line 202
callback request-change-delta(string); - edit in ui/app-window.slint at line 211
if log.selected >= 0 {root.request-change-delta(changes_log[log.selected].hash)} else {delta = "";} - edit in ui/app-window.slint at line 222
horizontal-stretch: 0; - replacement in ui/app-window.slint at line 228
log := Changelog { }log := Changelog {horizontal-stretch: 2;selection-changed => {if log.selected >= 0 {root.request-change-delta(changes_log[log.selected].hash)} else {delta = "";}}}deltas := DeltasList {horizontal-stretch: 3;} - edit in src/main.rs at line 92
}});ui.on_request_change_delta({let ui_handle = ui.as_weak();move |change_hash: SharedString| {let change_hash = change_hash.as_str();let ui = ui_handle.unwrap();let exe_path_string = ui.get_exe_path();let exe_path = Path::new(exe_path_string.as_str());let repo_path_string = ui.get_repo_path();let repo_path = Path::new(repo_path_string.as_str());let change_output = cmds::change(exe_path, repo_path, change_hash);let delta = match change_output {Ok(delta) => delta,Err(e) => {println!("{:?}", e);return;}};ui.set_delta((&String::from(delta)[..]).into()); - edit in src/cmds.rs at line 51
}pub fn change(exe: &std::path::Path, repo: &std::path::Path, hash: &str) -> Result<String, Error> {let mut cmd = Command::new(exe);let cmd = cmd.arg("change").arg("--no-prompt").arg("--repository").arg(repo).arg(hash);let output = cmd.output()?;check_exit_status(cmd, output.status)?;// TODO this will fail when diffing binary dataOk(String::from_utf8(output.stdout)?) - edit in src/cmds.rs at line 67
///////////////////////////////////////////////////////////////////////////////// copied from https://users.rust-lang.org/t/best-error-handing-practices-when-using-std-command/42259/7 - edit in src/cmds.rs at line 87[13.2202][13.2202]
// end copy///////////////////////////////////////////////////////////////////////////////