From d860ce1847559e526c68ab9efe936b78dd68cdc1 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" Date: Sat, 1 Jul 2023 16:11:46 +0300 Subject: [PATCH] 0.2.1 --- Cargo.toml | 2 +- debian/changelog | 2 +- src/main.rs | 45 +++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 556d330..0c513c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pika-drivers" -version = "0.2.0" +version = "0.2.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/debian/changelog b/debian/changelog index 00cdb1a..d3a11ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pika-drivers (0.2.0-99pika1.lunar) lunar; urgency=medium +pika-drivers (0.2.1-99pika1.lunar) lunar; urgency=medium * initial release diff --git a/src/main.rs b/src/main.rs index 5c21cca..e0024b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ fn build_ui(app: &Application) { glib::set_application_name("Pika Drivers"); let loading_box = gtk::Box::builder() + .orientation(Orientation::Vertical) .margin_top(20) .margin_bottom(20) .margin_start(20) @@ -44,6 +45,43 @@ fn build_ui(app: &Application) { .vexpand(true) .hexpand(true) .build(); + + + let loading_icon = gtk::Image::builder() + .icon_name("pika-drivers") + .margin_top(20) + .margin_bottom(20) + .margin_start(20) + .vexpand(true) + .hexpand(true) + .margin_end(20) + .pixel_size(256) + .build(); + + let loading_spinner = gtk::Spinner::builder() + .margin_top(20) + .margin_bottom(20) + .margin_start(20) + .vexpand(true) + .hexpand(true) + .margin_end(20) + .build(); + + let loading_label = gtk::Label::builder() + .label("Scanning for drivers...") + .margin_top(20) + .margin_bottom(20) + .margin_start(20) + .vexpand(true) + .hexpand(true) + .margin_end(20) + .build(); + + loading_spinner.start(); + + loading_box.append(&loading_icon); + loading_box.append(&loading_spinner); + loading_box.append(&loading_label); let window = gtk::ApplicationWindow::builder() .title("PikaOS Driver Manager") @@ -61,6 +99,7 @@ fn build_ui(app: &Application) { let credits_window_box = gtk::Box::builder() .orientation(Orientation::Vertical) .build(); + let credits_icon = gtk::Image::builder() .icon_name("pika-drivers") .margin_top(12) @@ -136,7 +175,7 @@ fn build_ui(app: &Application) { None, clone!(@weak window => @default-return Continue(false), move |sent_output| { - println!("{}", sent_output); + get_drivers(&window, sent_output); Continue(true) } ), @@ -203,7 +242,7 @@ fn driver_button_refresh(driver: &str, driver_button: &Image) { } } -fn get_drivers(main_window: &ApplicationWindow, ubuntu_drivers_list_utf8: &str) { +fn get_drivers(main_window: &ApplicationWindow, ubuntu_drivers_list_utf8: String) { let main_box = gtk::Box::builder() .orientation(Orientation::Vertical) .build(); @@ -388,6 +427,8 @@ fn get_drivers(main_window: &ApplicationWindow, ubuntu_drivers_list_utf8: &str) driver_button.connect_clicked(clone!(@weak driver_button => move |_| modify_package(&driver_string, &driver_button_icon))); + main_window.set_child(Some(&window_box)); + }