Fixed some thinks that seemed to have gotten broken after unrecording the WIP change, that worked before I unrecorded it and had fixed it. Though gui seems to not work now, but it does compile.
Dependencies
- [2]
NSE6BLWAinit slint project from https://github.com/slint-ui/slint-rust-template - [3]
4RPYR65Cconnect GUI to pijul to display simple channel list - [4]
IQY5LHENadd GUI element to display simple `pijul log` results - [5]
G2CHQAOPparsed `pijul log` text blob into individual entries & fields - [6]
6ECOC7L5parsed `pijul channel` text blob into individual UI components - [7]
6M4YFQEBadded command-line argument to specify repository path - [8]
ZGSCV5DIsplit channel labels into discrete component - [9]
SOTD66FOset Changelog UI to display log from selected channel in ChannelsList UI - [10]
F6YAQWVDadded UI for `pijul change` - [11]
BD456SZFadded diff view - [12]
3W2E3DX2added counter for pending diff files - [13]
V3SZ2LL2refactored UI update logic into discrete functions - [14]
6G2N6O4Crefactored channels data into `ChannelsData` struct - [15]
24AA2GFBFork from https://nest.pijul.com/CrepeGoat/pijul-gui, though it was in a broken state. Is this RepoCommander which seems to have been taken down https://discourse.pijul.org/t/repocommander-first-gui-for-pijul-help-volunteers-needed/1095? - [16]
RT22YHJFchange spacing of active channel indicator for aesthetics - [17]
337EO2TUadd selection callback to changelog UI (& fix deselection) - [18]
M5HBKVCEadd selection callback to channel list UI (& fix deselect) - [19]
XERTHGSYconsolidated `pijul log` UI elements into their own component - [20]
PL4TK55Oadded command-line argument to specify executable path - [*]
NCRTU7M4cargo init
Change contents
- edit in ui/app-window.slint at line 154
component ChannelsList {in-out property <[string]> channels;in-out property <int> active;VerticalBox {alignment: start;spacing: 0;preferred-width: 150px; - edit in ui/app-window.slint at line 155
Text {text: "channels";for ch in channels: Text {text: "\{ch}";}}}} - replacement in ui/app-window.slint at line 198
component ChannelsListView {component ChannelsList { - edit in ui/app-window.slint at line 233
in-out property <[string]> channels <=> chs.channels;in-out property <int> active-channel <=> chs.active; - edit in ui/app-window.slint at line 243[9.42]→[10.575:618](∅→∅),[10.618]→[12.260:303](∅→∅),[12.303]→[11.996:1038](∅→∅),[10.618]→[11.996:1038](∅→∅),[11.1038]→[13.0:144](∅→∅),[13.144]→[14.276:405](∅→∅),[14.405]→[13.207:246](∅→∅),[12.367]→[13.207:246](∅→∅),[13.246]→[11.1070:1142](∅→∅),[12.367]→[11.1070:1142](∅→∅),[11.1070]→[11.1070:1142](∅→∅),[11.1212]→[11.1212:1229](∅→∅),[14.472]→[11.1293:1309](∅→∅),[11.1293]→[11.1293:1309](∅→∅)
callback request-change-delta(string);callback request-diff-summary(string);callback request-diff-delta(string);function fill-chs() {chs.deselect();root.request-channel-list();}function fill-log() {log.deselect();root.request-changes-log(chs.data.names[chs.selected]);root.request-diff-summary(chs.data.names[chs.selected]);}function fill-diff-view() {if log.selected >= 0 && log.selected < log.changes_log.length {} else {}} - replacement in ui/app-window.slint at line 256
//chs := ChannelsList {// channels: [];// active: 0;// preferred-width: 500px;//}chs := ChannelsListView {chs := ChannelsList { - edit in ui/app-window.slint at line 276
callback request-changes-log(string);callback request-change-delta(string);callback request-diff-summary(string);callback request-diff-delta(string);function fill-chs() {chs.deselect();root.request-channel-list();}function fill-log() {log.deselect();root.request-changes-log(chs.data.names[chs.selected]);root.request-diff-summary(chs.data.names[chs.selected]);}function fill-diff-view() {if log.selected >= 0 && log.selected < log.changes_log.length {root.request-change-delta(changes_log[log.selected].hash)} else {root.request-diff-delta(chs.data.names[chs.selected])}} - edit in src/main.rs at line 48
ui.set_channels((&channel_strs[..]).into());ui.set_active_channel(i32::try_from(channel_list.active).unwrap_or(-1));let channel_strs = channel_list.entries.into_iter().map(SharedString::from).collect::<Vec<_>>(); - replacement in src/main.rs at line 206
}[7.1377]} - edit in src/cmds.rs at line 4
pub fn channel(exe: &std::path::Path, repo: &std::path::Path) -> Result<ChannelsList, Error> { - edit in src/cmds.rs at line 13
parse_channel_output(output.stdout)}fn parse_channel_output(output: Vec<u8>) -> Result<ChannelsList, Error> {let channels_str = String::from_utf8(output)?;let channels_list = channels_str.split('\n').map(|substr| substr.trim()).fold(ChannelsList::new(),|mut channels_list, ch_str| {if ch_str.starts_with("* ") {channels_list.active = channels_list.entries.len();channels_list.entries.push(ch_str[2..].to_string());} else {channels_list.entries.push(ch_str.to_string());}channels_list},);Ok(channels_list) - edit in src/cmds.rs at line 137
#[derive(Debug)]pub struct ChannelsList {pub(crate) entries: Vec<String>,pub(crate) active: usize,} - edit in src/cmds.rs at line 144
}impl ChannelsList {pub(crate) fn new() -> Self {Self {entries: Vec::new(),active: usize::MAX,}} - replacement in src/cmds.rs at line 161
}[5.2277]}