patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob cd020f1e636b34314ad13f6b0ab4ab58b16f5f65 1260 bytes (raw)
name: tools/spectrum-installer/src/pages/mod.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
 
// SPDX-License-Identifier: EUPL-1.2+
// SPDX-FileCopyrightText: 2025 Johannes Süllner <johannes.suellner@mailbox.org>

use iced::{Subscription, Task};

mod completion;
mod confirmation;
mod disk_selection;
mod installation;
mod layout;
mod welcome;

pub const WINDOW_WIDTH: f32 = 750.0;
pub const WINDOW_HEIGHT: f32 = 650.0;

pub const MARGIN_VERTICAL: f32 = 25.0;
pub const MARGIN_LR: f32 = 15.0;
pub const BUTTON_TEXT_SIZE: u16 = 20;
pub const TITLE_TEXT_SIZE: u16 = 24;

type UpdateResult = (Option<Box<dyn Page>>, Task<Event>);

type InstallResult = Result<String, (u32, String)>;

pub trait Page {
    fn update(&mut self, event: Event) -> UpdateResult;
    fn view(&self) -> iced::Element<'_, Event>;
    fn subscription(&self) -> Subscription<Event> {
        Subscription::none()
    }
}

#[derive(Clone, Debug)]
pub enum Event {
    /* Pages are ordered as they appear during the installation. */
    PageWelcome(welcome::PageWelcomeEvent),
    PageDiskSelection(disk_selection::PageDiskSelectionEvent),
    PageConfirmation(confirmation::PageConfirmationEvent),
    PageInstallation(installation::PageInstallationEvent),
    PageCompletion(completion::PageCompletionEvent),
}

pub const INITAL_PAGE: welcome::PageWelcome = welcome::PageWelcome {};

debug log:

solving cd020f1 ...
found cd020f1 in https://inbox.spectrum-os.org/spectrum-devel/20260104140102.106960-5-johannes.suellner@mailbox.org/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20260104140102.106960-5-johannes.suellner@mailbox.org/
diff --git a/tools/spectrum-installer/src/pages/mod.rs b/tools/spectrum-installer/src/pages/mod.rs
new file mode 100644
index 0000000..cd020f1

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

index at:
100644 cd020f1e636b34314ad13f6b0ab4ab58b16f5f65	tools/spectrum-installer/src/pages/mod.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).