Files
yali-rs/src/steps/finish.rs
T

65 lines
2.0 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
use eframe::egui;
use rust_i18n::t;
use crate::installer::{GlobalState, InstallerStep};
use crate::ui::theme;
pub struct FinishStep;
impl InstallerStep for FinishStep {
fn name(&self) -> String { t!("finish").to_string() }
fn show(&mut self, ui: &mut egui::Ui, _state: &mut GlobalState) {
ui.add_space(32.0);
ui.vertical_centered(|ui| {
// Büyük onay simgesi
ui.label(
egui::RichText::new("")
.size(72.0)
.color(theme::c_success()),
);
ui.add_space(16.0);
ui.label(
egui::RichText::new(t!("finish_title"))
.size(24.0)
.strong()
.color(theme::c_text()),
);
ui.add_space(8.0);
ui.label(
egui::RichText::new(t!("finish_description"))
.size(14.0)
.color(theme::c_text_dim()),
);
ui.add_space(32.0);
// Yeniden Başlat — ana eylem butonu
if ui.add(
theme::primary_button(&t!("finish_restart"))
.min_size(egui::vec2(200.0, 44.0)),
).clicked() {
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
std::thread::spawn(|| {
std::thread::sleep(std::time::Duration::from_millis(500));
let _ = std::process::Command::new("reboot")
.arg("-f")
.spawn();
});
}
ui.add_space(12.0);
// Canlı masaüstüne dön — ikincil eylem
if ui.add(
theme::secondary_button(&t!("finish_live"))
.min_size(egui::vec2(200.0, 36.0)),
).clicked() {
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
}
});
}
fn is_complete(&self, _state: &GlobalState) -> bool { true }
}