]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: pass `Cursive` instance to installer view constructors
authorChristoph Heiss <c.heiss@proxmox.com>
Tue, 30 May 2023 09:31:24 +0000 (11:31 +0200)
committerChristoph Heiss <c.heiss@proxmox.com>
Wed, 14 Jun 2023 08:39:56 +0000 (10:39 +0200)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Makefile
proxmox-tui-installer/src/main.rs

index d6ba0d14c83fd129c253ca6ef7dd7e4469bfb381..203168fa434f3613b8730a63bf63ab0c15a6f685 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,16 @@
 include /usr/share/dpkg/pkg-info.mk
 
+CARGO ?= cargo
+
+TUI_INSTALLER_BIN := proxmox-tui-installer
+
+ifeq ($(BUILD_MODE), release)
+CARGO_BUILD_ARGS += --release
+CARGO_COMPILEDIR := target/release
+else
+CARGO_COMPILEDIR := target/debug
+endif
+
 DEB=proxmox-installer_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
 
 INSTALLER_SOURCES=$(shell git ls-files) country.dat
index dfd1edf38a38ff80716a1350d8d6d12fdcf2d1d6..bb7033928be56a22e5c66ed6a9007058cb942330 100644 (file)
@@ -54,10 +54,13 @@ fn main() {
     siv.run();
 }
 
-fn add_next_screen(constructor: &dyn Fn() -> InstallerView) -> Box<dyn Fn(&mut Cursive) + '_> {
+fn add_next_screen(
+    constructor: &dyn Fn(&mut Cursive) -> InstallerView,
+) -> Box<dyn Fn(&mut Cursive) + '_> {
     Box::new(|siv: &mut Cursive| {
+        let v = constructor(siv);
         siv.add_active_screen();
-        siv.screen_mut().add_layer(constructor());
+        siv.screen_mut().add_layer(v);
     })
 }
 
@@ -124,6 +127,6 @@ fn license_dialog() -> InstallerView {
     InstallerView::new(inner)
 }
 
-fn bootdisk_dialog() -> InstallerView {
+fn bootdisk_dialog(siv: &mut Cursive) -> InstallerView {
     InstallerView::new(DummyView)
 }