refactored channels data into `ChannelsData` struct

CrepeGoat
Oct 16, 2024, 10:44 PM
6G2N6O4CHFNTC4LORPLOV7NKJIK6XKRJE7Y5XCEYHB3RPUQIZOXAC

Dependencies

  • [2] 6M4YFQEB added command-line argument to specify repository path
  • [3] V3SZ2LL2 refactored UI update logic into discrete functions
  • [4] 6ECOC7L5 parsed `pijul channel` text blob into individual UI components
  • [5] IQY5LHEN add GUI element to display simple `pijul log` results
  • [6] XERTHGSY consolidated `pijul log` UI elements into their own component
  • [7] 4RPYR65C connect GUI to pijul to display simple channel list
  • [8] PL4TK55O added command-line argument to specify executable path
  • [9] 3W2E3DX2 added counter for pending diff files
  • [10] BD456SZF added diff view
  • [11] HZV5P57Y changed channel and log views to use `ListView` (looks much cleaner)
  • [12] M5HBKVCE add selection callback to channel list UI (& fix deselect)
  • [13] NSE6BLWA init slint project from https://github.com/slint-ui/slint-rust-template
  • [14] G2CHQAOP parsed `pijul log` text blob into individual entries & fields
  • [15] ZGSCV5DI split channel labels into discrete component
  • [16] F6YAQWVD added UI for `pijul change`
  • [*] NCRTU7M4 cargo init

Change contents

  • edit in ui/app-window.slint at line 10
    [4.168]
    [4.168]
    }
    export struct ChannelsData {
    names: [string],
    active: int,
  • replacement in ui/app-window.slint at line 205
    [4.121][4.121:196]()
    in-out property <[string]> channels;
    in-out property <int> active;
    [4.121]
    [4.149]
    in-out property <ChannelsData> data;
  • replacement in ui/app-window.slint at line 220
    [4.418][4.404:458]()
    for ch[index] in channels: ChannelEntry {
    [4.418]
    [4.458]
    for ch[index] in data.names: ChannelEntry {
  • replacement in ui/app-window.slint at line 222
    [4.484][4.484:525]()
    active: active == index;
    [4.484]
    [4.245]
    active: data.active == index;
  • replacement in ui/app-window.slint at line 244
    [4.35][4.792:907](),[2.36][4.792:907](),[4.161][4.792:907]()
    in-out property <[string]> channels <=> chs.channels;
    in-out property <int> active-channel <=> chs.active;
    [2.36]
    [4.538]
    in-out property <ChannelsData> channels <=> chs.data;
  • replacement in ui/app-window.slint at line 261
    [3.144][3.144:206](),[3.206][4.304:367](),[4.1070][4.304:367]()
    root.request-changes-log(chs.channels[chs.selected]);
    root.request-diff-summary(chs.channels[chs.selected]);
    [3.144]
    [3.207]
    root.request-changes-log(chs.data.names[chs.selected]);
    root.request-diff-summary(chs.data.names[chs.selected]);
  • replacement in ui/app-window.slint at line 269
    [4.1229][4.1229:1293]()
    root.request-diff-delta(chs.channels[chs.selected])
    [4.1229]
    [4.1293]
    root.request-diff-delta(chs.data.names[chs.selected])
  • replacement in src/main.rs at line 48
    [4.1298][4.1298:1440]()
    ui.set_channels((&channel_strs[..]).into());
    ui.set_active_channel(i32::try_from(channel_list.active).unwrap_or(-1));
    [4.1298]
    [4.1045]
    ui.set_channels(ChannelsData {
    names: (&channel_strs[..]).into(),
    active: i32::try_from(channel_list.active).unwrap_or(-1),
    });