From 84fbf4f747c73426cccb2b93f40debbf284e7486 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sat, 10 Feb 2024 00:58:49 +0300 Subject: [PATCH] RR: Add final page and resolve most warnings --- Cargo.lock | 144 ++------------------------ Cargo.toml | 2 - po/en_US.po | 9 ++ src/build_ui.rs | 6 -- src/config.rs | 4 +- src/connection_check.rs | 9 -- src/first_setup/codec_carousel.rs | 9 -- src/first_setup/driver_carousel.rs | 15 +-- src/first_setup/final_carousel.rs | 51 +++++++++ src/first_setup/first_setup.rs | 7 +- src/first_setup/gameutils_carousel.rs | 9 -- src/first_setup/initial_carousel.rs | 2 - src/first_setup/internet_carousel.rs | 4 - src/first_setup/mod.rs | 1 + src/first_setup/update_carousel.rs | 9 -- src/first_setup/user_carousel.rs | 13 +-- src/main.rs | 4 - src/save_window_size.rs | 12 +-- target/.rustc_info.json | 2 +- 19 files changed, 84 insertions(+), 228 deletions(-) delete mode 100644 src/connection_check.rs create mode 100644 src/first_setup/final_carousel.rs diff --git a/Cargo.lock b/Cargo.lock index bc8cf6f..6b25a7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,12 +36,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.4.2" @@ -60,7 +54,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.4.2", + "bitflags", "cairo-sys-rs", "glib", "libc", @@ -341,7 +335,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.4.2", + "bitflags", "futures-channel", "futures-core", "futures-executor", @@ -513,12 +507,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" - [[package]] name = "indexmap" version = "2.2.2" @@ -529,17 +517,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -663,7 +640,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -708,7 +685,6 @@ dependencies = [ "libadwaita", "os_pipe", "regex", - "zoha-vte4", ] [[package]] @@ -1041,37 +1017,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1080,93 +1032,51 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.0" @@ -1181,35 +1091,3 @@ checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] - -[[package]] -name = "zoha-vte4" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09b58dbfab3b62c5544cafadc504db3b7d12f21ac6e55048489dbf90c979caf" -dependencies = [ - "bitflags 1.3.2", - "gdk4", - "gio", - "glib", - "gtk4", - "io-lifetimes", - "libc", - "pango", - "zoha-vte4-sys", -] - -[[package]] -name = "zoha-vte4-sys" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749df284a2c2e68c2c359762b277854d533a4d50c7a216a3adf45cd5e5ee2993" -dependencies = [ - "gdk4-sys", - "gio-sys", - "glib", - "gtk4-sys", - "libc", - "pango-sys", - "system-deps", -] diff --git a/Cargo.toml b/Cargo.toml index 404b162..7091995 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,6 @@ name = "pika-first-setup-gtk4" version = "0.1.0" edition = "2021" -profile = "stable" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -12,6 +11,5 @@ gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] } async-channel = "2.1.1" regex = "1.10.3" gettext-rs = { version = "0.7", features = ["gettext-system"] } -vte = { version = "0.0.2", package = "zoha-vte4", features = ["v0_72"] } duct = "0.13.7" os_pipe = "1.1.5" diff --git a/po/en_US.po b/po/en_US.po index 5b5d58a..3a80254 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -167,3 +167,12 @@ msgstr "Open Driver manager" msgid "first_setup_driver_skip_button_label" msgstr "Skip Driver installation" + +msgid "first_setup_final_box_text_title" +msgstr "Initial Setup Complete!" + +msgid "first_setup_final_box_text_description" +msgstr "PikaOS initial post install setup has been completed.\nReboot one last time to enter your new user session." + +msgid "first_setup_reboot_button_label" +msgstr "Reboot" \ No newline at end of file diff --git a/src/build_ui.rs b/src/build_ui.rs index c936fec..ea03514 100644 --- a/src/build_ui.rs +++ b/src/build_ui.rs @@ -1,13 +1,7 @@ // GTK crates -use adw::ffi::{AdwToolbarStyle, ADW_TOOLBAR_FLAT}; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; -/// Use all gtk4 libraries (gtk4 -> gtk because cargo) -/// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; -use gtk::*; // application crates /// first setup crates diff --git a/src/config.rs b/src/config.rs index 770eeb8..6c0bbe3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,6 @@ pub const APP_ID: &str = "com.github.pikaos-linux.pikafirstsetup"; pub const GETTEXT_PACKAGE: &str = env!("CARGO_PKG_NAME"); pub const LOCALEDIR: &str = "/usr/share/locale"; -pub const PKGDATADIR: &str = " /usr/share"; +//pub const PKGDATADIR: &str = " /usr/share"; //pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource"); -pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +//pub const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/src/connection_check.rs b/src/connection_check.rs deleted file mode 100644 index 5699476..0000000 --- a/src/connection_check.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::io::prelude::*; -use std::net::TcpStream; -pub fn check_internet_connection() -> std::io::Result<()> { - let mut stream = TcpStream::connect("google.com:443")?; - - stream.write(&[1])?; - stream.read(&mut [0; 128])?; - Ok(()) -} diff --git a/src/first_setup/codec_carousel.rs b/src/first_setup/codec_carousel.rs index d200116..d6404f4 100644 --- a/src/first_setup/codec_carousel.rs +++ b/src/first_setup/codec_carousel.rs @@ -1,17 +1,12 @@ use std::cell::RefCell; use std::rc::Rc; // GTK crates -use adw::ffi::ADW_TOOLBAR_FLAT; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; -use vte::prelude::*; -use vte::*; use gettextrs::gettext; @@ -19,13 +14,9 @@ use std::{thread, time}; use std::{ error::Error, - io::Error as ErrorIO, - io::{ErrorKind, Read, Write}, - process::{Command, Stdio}, }; use duct::cmd; -use os_pipe::*; use std::io::prelude::*; use std::io::BufReader; diff --git a/src/first_setup/driver_carousel.rs b/src/first_setup/driver_carousel.rs index 05a0d59..a094068 100644 --- a/src/first_setup/driver_carousel.rs +++ b/src/first_setup/driver_carousel.rs @@ -1,34 +1,21 @@ use std::cell::RefCell; use std::rc::Rc; // GTK crates -use adw::ffi::ADW_TOOLBAR_FLAT; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; -use vte::prelude::*; -use vte::*; use gettextrs::gettext; use std::{thread, time}; use std::{ - error::Error, - io::Error as ErrorIO, - io::{ErrorKind, Read, Write}, - process::{Command, Stdio}, + process::{Command}, }; -use duct::cmd; -use os_pipe::*; -use std::io::prelude::*; -use std::io::BufReader; - pub fn driver_carousel( first_setup_carousel: &adw::Carousel, internet_connected: &Rc>, diff --git a/src/first_setup/final_carousel.rs b/src/first_setup/final_carousel.rs new file mode 100644 index 0000000..eac141f --- /dev/null +++ b/src/first_setup/final_carousel.rs @@ -0,0 +1,51 @@ +// GTK crates +use adw::prelude::*; +use adw::*; +/// Use all gtk4 libraries (gtk4 -> gtk because cargo) +/// Use all libadwaita libraries (libadwaita -> adw because cargo) +use gtk::*; + +use gettextrs::gettext; + +use duct::cmd; + +const REBOOT_PROG: &str = r###" +#! /bin/bash +userdel -r -f pikaos +reboot +"###; + +pub fn final_carousel(first_setup_carousel: &adw::Carousel) { + let first_setup_final_box = gtk::Box::builder() + // that puts items vertically + .orientation(Orientation::Vertical) + .vexpand(true) + .valign(Align::Center) + .hexpand(true) + .vexpand(true) + .build(); + + let first_setup_final_box_text = adw::StatusPage::builder() + .icon_name("emblem-favorite") + .title(gettext("first_setup_final_box_text_title")) + .description(gettext("first_setup_final_box_text_description")) + .build(); + first_setup_final_box_text.add_css_class("compact"); + + let first_setup_start_button = gtk::Button::builder() + .label(gettext("first_setup_reboot_button_label")) + .halign(Align::Center) + .build(); + + first_setup_start_button.add_css_class("suggested-action"); + first_setup_start_button.add_css_class("pill"); + + first_setup_final_box.append(&first_setup_final_box_text); + first_setup_final_box.append(&first_setup_start_button); + + first_setup_carousel.append(&first_setup_final_box); + + first_setup_start_button.connect_clicked( move |_| { + let _ = cmd!("sudo", "bash", "-c", REBOOT_PROG).read(); + }); +} diff --git a/src/first_setup/first_setup.rs b/src/first_setup/first_setup.rs index 026e79e..0e31ccc 100644 --- a/src/first_setup/first_setup.rs +++ b/src/first_setup/first_setup.rs @@ -1,18 +1,13 @@ // GTK crates -use adw::ffi::ADW_TOOLBAR_FLAT; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; -use gtk::*; use gettextrs::gettext; // -use crate::connection_check::check_internet_connection; use std::cell::RefCell; use std::rc::Rc; @@ -24,6 +19,7 @@ use crate::first_setup::user_carousel::user_carousel; use crate::first_setup::driver_carousel::driver_carousel; use crate::first_setup::codec_carousel::codec_carousel; use crate::first_setup::gameutils_carousel::gameutils_carousel; +use crate::first_setup::final_carousel::final_carousel; pub fn first_setup(window: &adw::ApplicationWindow) { let first_setup_carousel = adw::Carousel::builder() @@ -71,6 +67,7 @@ pub fn first_setup(window: &adw::ApplicationWindow) { driver_carousel(&first_setup_carousel, &internet_connected); codec_carousel(&first_setup_carousel, &internet_connected, &window); gameutils_carousel(&first_setup_carousel, &internet_connected, &window); + final_carousel(&first_setup_carousel); // Add file to window window.set_content(Some(&first_setup_window_toolbarview)) diff --git a/src/first_setup/gameutils_carousel.rs b/src/first_setup/gameutils_carousel.rs index 14055c4..d0859a3 100644 --- a/src/first_setup/gameutils_carousel.rs +++ b/src/first_setup/gameutils_carousel.rs @@ -1,17 +1,12 @@ use std::cell::RefCell; use std::rc::Rc; // GTK crates -use adw::ffi::ADW_TOOLBAR_FLAT; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; -use vte::prelude::*; -use vte::*; use gettextrs::gettext; @@ -19,13 +14,9 @@ use std::{thread, time}; use std::{ error::Error, - io::Error as ErrorIO, - io::{ErrorKind, Read, Write}, - process::{Command, Stdio}, }; use duct::cmd; -use os_pipe::*; use std::io::prelude::*; use std::io::BufReader; diff --git a/src/first_setup/initial_carousel.rs b/src/first_setup/initial_carousel.rs index fa3e22d..7559ee4 100644 --- a/src/first_setup/initial_carousel.rs +++ b/src/first_setup/initial_carousel.rs @@ -1,11 +1,9 @@ // GTK crates use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; use gettextrs::gettext; diff --git a/src/first_setup/internet_carousel.rs b/src/first_setup/internet_carousel.rs index e6e9608..880d835 100644 --- a/src/first_setup/internet_carousel.rs +++ b/src/first_setup/internet_carousel.rs @@ -1,18 +1,14 @@ // GTK crates use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; use gettextrs::gettext; //use crate::check_internet_connection; -use gtk::gio::ffi::GAsyncReadyCallback; -use std::borrow::Borrow as the_rc_borrow; use std::cell::RefCell; use std::env; use std::process::Command; diff --git a/src/first_setup/mod.rs b/src/first_setup/mod.rs index 2a36736..f03c7ba 100644 --- a/src/first_setup/mod.rs +++ b/src/first_setup/mod.rs @@ -6,3 +6,4 @@ pub mod user_carousel; pub mod driver_carousel; pub mod codec_carousel; pub mod gameutils_carousel; +pub mod final_carousel; diff --git a/src/first_setup/update_carousel.rs b/src/first_setup/update_carousel.rs index e50b356..033a111 100644 --- a/src/first_setup/update_carousel.rs +++ b/src/first_setup/update_carousel.rs @@ -1,17 +1,12 @@ use std::cell::RefCell; use std::rc::Rc; // GTK crates -use adw::ffi::ADW_TOOLBAR_FLAT; use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; -use vte::prelude::*; -use vte::*; use gettextrs::gettext; @@ -19,13 +14,9 @@ use std::{thread, time}; use std::{ error::Error, - io::Error as ErrorIO, - io::{ErrorKind, Read, Write}, - process::{Command, Stdio}, }; use duct::cmd; -use os_pipe::*; use std::io::prelude::*; use std::io::BufReader; diff --git a/src/first_setup/user_carousel.rs b/src/first_setup/user_carousel.rs index e317a01..e6a0350 100644 --- a/src/first_setup/user_carousel.rs +++ b/src/first_setup/user_carousel.rs @@ -1,25 +1,18 @@ // GTK crates use adw::prelude::*; use adw::*; -use gdk::Display; use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; use gettextrs::gettext; -//use crate::check_internet_connection; -use gtk::gio::ffi::GAsyncReadyCallback; -use gtk::pango::TextTransform::Capitalize; -use gtk::Align::Center; +// use regex::Regex; -use std::borrow::Borrow as the_rc_borrow; use std::cell::RefCell; -use std::process::Command; use std::rc::Rc; -use std::{env, thread, time}; +use std::{thread, time}; use duct::cmd; const USER_CREATE_PROG: &str = r###" @@ -288,7 +281,7 @@ pub fn user_carousel(first_setup_carousel: &adw::Carousel) { })); user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_password, @weak user_info_full_name => move |_| { - cmd!("sudo", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read(); + let _ = cmd!("sudo", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text()).read(); first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true); })); } diff --git a/src/main.rs b/src/main.rs index a31abe3..bf69686 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,10 +4,8 @@ mod config; use adw::prelude::*; use adw::*; use gdk::Display; -use glib::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; use gtk::*; use gettextrs::{gettext, LocaleCategory}; @@ -18,8 +16,6 @@ mod build_ui; use crate::build_ui::build_ui; mod save_window_size; use crate::save_window_size::save_window_size; -mod connection_check; -use crate::connection_check::check_internet_connection; /// first setup crates mod first_setup; diff --git a/src/save_window_size.rs b/src/save_window_size.rs index 579bedf..161df86 100644 --- a/src/save_window_size.rs +++ b/src/save_window_size.rs @@ -1,18 +1,12 @@ // GTK crates use adw::prelude::*; use adw::*; -use gdk::Display; -use glib::*; -/// Use all gtk4 libraries (gtk4 -> gtk because cargo) -/// Use all libadwaita libraries (libadwaita -> adw because cargo) -use gtk::prelude::*; -use gtk::*; // Save current window size to glib pub fn save_window_size(window: &adw::ApplicationWindow, glib_settings: &gio::Settings) { let size = window.default_size(); - glib_settings.set_int("window-width", size.0); - glib_settings.set_int("window-height", size.1); - glib_settings.set_boolean("is-maximized", window.is_maximized()); + let _ = glib_settings.set_int("window-width", size.0); + let _ = glib_settings.set_int("window-height", size.1); + let _ = glib_settings.set_boolean("is-maximized", window.is_maximized()); } diff --git a/target/.rustc_info.json b/target/.rustc_info.json index bb8e03f..e001c22 100644 --- a/target/.rustc_info.json +++ b/target/.rustc_info.json @@ -1 +1 @@ -{"rustc_fingerprint":16368633458058699409,"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":""},"14371922958718593042":{"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\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\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\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file +{"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":{}} \ No newline at end of file