set Changelog UI to display log from selected channel in ChannelsList UI

CrepeGoat
Oct 12, 2024, 4:04 AM
SOTD66FO7FA67P4DEOYPKURE45J45PTFVT66OF54SUYJYUBAADJQC

Dependencies

  • [2] XERTHGSY consolidated `pijul log` UI elements into their own component
  • [3] PL4TK55O added command-line argument to specify executable path
  • [4] IQY5LHEN add GUI element to display simple `pijul log` results
  • [5] 6M4YFQEB added command-line argument to specify repository path
  • [6] G2CHQAOP parsed `pijul log` text blob into individual entries & fields
  • [7] 6ECOC7L5 parsed `pijul channel` text blob into individual UI components
  • [8] NSE6BLWA init slint project from https://github.com/slint-ui/slint-rust-template
  • [9] 4RPYR65C connect GUI to pijul to display simple channel list
  • [*] NCRTU7M4 cargo init

Change contents

  • replacement in ui/app-window.slint at line 177
    [4.84][4.132:168]()
    callback request-changes-log();
    [4.84]
    [4.168]
    callback request-changes-log(string);
  • replacement in ui/app-window.slint at line 185
    [4.215][4.260:304]()
    root.request-changes-log();
    [4.215]
    [4.454]
    root.request-changes-log(chs.channels[chs.selected]);
  • replacement in ui/app-window.slint at line 191
    [4.363][2.607:643]()
    chs := ChannelsList { }
    [4.363]
    [4.872]
    chs := ChannelsList {
    selection-changed => {
    root.request-changes-log(chs.channels[chs.selected]);
    }
    }
  • replacement in src/main.rs at line 55
    [4.1134][4.1134:1152]()
    move || {
    [4.1134]
    [4.1152]
    move |ch_name: SharedString| {
    let ch_name = ch_name.as_str();
  • replacement in src/main.rs at line 64
    [3.594][3.594:649]()
    let log_output = log(exe_path, repo_path);
    [3.594]
    [4.1384]
    let log_output = log(
    exe_path,
    repo_path,
    Some(ch_name).filter(|cn| !cn.is_empty()),
    );
  • replacement in src/cmds.rs at line 33
    [4.1845][4.1837:1935]()
    pub fn log(exe: &std::path::Path, repo: &std::path::Path) -> Result<Vec<ChangelogEntry>, Error> {
    [4.1845]
    [4.1930]
    pub fn log(
    exe: &std::path::Path,
    repo: &std::path::Path,
    ch_name_maybe: Option<&str>,
    ) -> Result<Vec<ChangelogEntry>, Error> {
  • replacement in src/cmds.rs at line 39
    [4.1967][4.1967:2005]()
    let cmd = cmd
    .arg("log")
    [4.1967]
    [4.1147]
    cmd.arg("log")
  • edit in src/cmds.rs at line 45
    [4.2009]
    [4.1224]
    if let Some(ch_name) = ch_name_maybe {
    cmd.arg("--channel").arg(ch_name);
    }
  • replacement in src/cmds.rs at line 49
    [4.1256][4.1256:1300]()
    check_exit_status(cmd, output.status)?;
    [4.1256]
    [4.2010]
    check_exit_status(&cmd, output.status)?;