RR: Internet Checks!
This commit is contained in:
parent
56ae401374
commit
54e30ff332
50
src/first_setup/update_carousel.rs
Normal file
50
src/first_setup/update_carousel.rs
Normal file
@ -0,0 +1,50 @@
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
// GTK crates
|
||||
/// Use all gtk4 libraries (gtk4 -> gtk because cargo)
|
||||
/// Use all libadwaita libraries (libadwaita -> adw because cargo)
|
||||
use gtk::prelude::*;
|
||||
use gtk::*;
|
||||
use adw::prelude::*;
|
||||
use adw::*;
|
||||
use adw::ffi::ADW_TOOLBAR_FLAT;
|
||||
use glib::*;
|
||||
use gdk::Display;
|
||||
|
||||
pub fn update_carousel(first_setup_carousel: &adw::Carousel, internet_connected: &Rc<RefCell<bool>>) {
|
||||
|
||||
let internet_connected_status = internet_connected.clone();
|
||||
|
||||
let first_setup_update_box = gtk::Box::builder()
|
||||
// that puts items vertically
|
||||
.orientation(Orientation::Vertical)
|
||||
.vexpand(true)
|
||||
.valign(Align::Center)
|
||||
.hexpand(true)
|
||||
.vexpand(true)
|
||||
.build();
|
||||
|
||||
let first_setup_initial_box_text = adw::StatusPage::builder()
|
||||
.icon_name("debian-swirl")
|
||||
.title("Welcome")
|
||||
.description("This wizard will help you finish your PikaOS installation.")
|
||||
.build();
|
||||
first_setup_initial_box_text.add_css_class("compact");
|
||||
|
||||
let first_setup_start_button = gtk::Button::builder()
|
||||
.label("Let's Start")
|
||||
.halign(Align::Center)
|
||||
.build();
|
||||
|
||||
first_setup_start_button.add_css_class("suggested-action");
|
||||
first_setup_start_button.add_css_class("pill");
|
||||
|
||||
first_setup_update_box.append(&first_setup_initial_box_text);
|
||||
first_setup_update_box.append(&first_setup_start_button);
|
||||
|
||||
first_setup_carousel.append(&first_setup_update_box);
|
||||
|
||||
first_setup_start_button.connect_clicked(clone!(@weak first_setup_carousel => move |_| {
|
||||
println!("{}", internet_connected_status.borrow_mut());
|
||||
}));
|
||||
}
|
@ -1 +1 @@
|
||||
{"rustc_fingerprint":11104695642277176061,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ward/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.75.0 (82e1608df 2023-12-21)\nbinary: rustc\ncommit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112\ncommit-date: 2023-12-21\nhost: x86_64-unknown-linux-gnu\nrelease: 1.75.0\nLLVM version: 17.0.6\n","stderr":""}},"successes":{}}
|
||||
{"rustc_fingerprint":11104695642277176061,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.75.0 (82e1608df 2023-12-21)\nbinary: rustc\ncommit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112\ncommit-date: 2023-12-21\nhost: x86_64-unknown-linux-gnu\nrelease: 1.75.0\nLLVM version: 17.0.6\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ward/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
|
Loading…
Reference in New Issue
Block a user