patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 0ac55683eca70003cd861d72f694a66ac2ecda8d 1301 bytes (raw)
name: tools/spectrum-installer/src/main.rs 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
// SPDX-License-Identifier: EUPL-1.2+
// SPDX-FileCopyrightText: 2025 Johannes Süllner <johannes.suellner@mailbox.org>

mod destination_device;
mod pages;

use iced::Element;
use iced::Size;
use iced::Subscription;
use iced::Task;
use pages::Event;

fn main() -> iced::Result {
    iced::application(
        SpectrumInstaller::new,
        SpectrumInstaller::update,
        SpectrumInstaller::view,
    )
    .subscription(SpectrumInstaller::subscription)
    .font(iced_fonts::BOOTSTRAP_FONT_BYTES)
    .title("Spectrum installer")
    .window_size(Size::new(pages::WINDOW_WIDTH, pages::WINDOW_HEIGHT))
    .resizable(false)
    .run()
}

struct SpectrumInstaller {
    current_page: Box<dyn pages::Page>,
}

impl SpectrumInstaller {
    fn new() -> Self {
        Self {
            current_page: Box::new(pages::INITAL_PAGE),
        }
    }

    fn update(&mut self, event: pages::Event) -> Task<Event> {
        let (maybe_new_page, task) = self.current_page.update(event);
        if let Some(new_page) = maybe_new_page {
            self.current_page = new_page;
        }
        task
    }

    fn view(&self) -> Element<'_, pages::Event> {
        self.current_page.view()
    }

    fn subscription(&self) -> Subscription<pages::Event> {
        self.current_page.subscription()
    }
}

debug log:

solving 0ac5568 ...
found 0ac5568 in https://inbox.spectrum-os.org/spectrum-devel/20260204175543.22164-3-johannes.suellner@mailbox.org/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20260204175543.22164-3-johannes.suellner@mailbox.org/
diff --git a/tools/spectrum-installer/src/main.rs b/tools/spectrum-installer/src/main.rs
new file mode 100644
index 0000000..0ac5568

Checking patch tools/spectrum-installer/src/main.rs...
Applied patch tools/spectrum-installer/src/main.rs cleanly.

index at:
100644 0ac55683eca70003cd861d72f694a66ac2ecda8d	tools/spectrum-installer/src/main.rs

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).