This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-07-01 16:11:46 +03:00
parent c68783fc21
commit d860ce1847
3 changed files with 45 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pika-drivers" name = "pika-drivers"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

2
debian/changelog vendored
View File

@ -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 * initial release

View File

@ -37,6 +37,7 @@ fn build_ui(app: &Application) {
glib::set_application_name("Pika Drivers"); glib::set_application_name("Pika Drivers");
let loading_box = gtk::Box::builder() let loading_box = gtk::Box::builder()
.orientation(Orientation::Vertical)
.margin_top(20) .margin_top(20)
.margin_bottom(20) .margin_bottom(20)
.margin_start(20) .margin_start(20)
@ -45,6 +46,43 @@ fn build_ui(app: &Application) {
.hexpand(true) .hexpand(true)
.build(); .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() let window = gtk::ApplicationWindow::builder()
.title("PikaOS Driver Manager") .title("PikaOS Driver Manager")
.application(app) .application(app)
@ -61,6 +99,7 @@ fn build_ui(app: &Application) {
let credits_window_box = gtk::Box::builder() let credits_window_box = gtk::Box::builder()
.orientation(Orientation::Vertical) .orientation(Orientation::Vertical)
.build(); .build();
let credits_icon = gtk::Image::builder() let credits_icon = gtk::Image::builder()
.icon_name("pika-drivers") .icon_name("pika-drivers")
.margin_top(12) .margin_top(12)
@ -136,7 +175,7 @@ fn build_ui(app: &Application) {
None, None,
clone!(@weak window => @default-return Continue(false), clone!(@weak window => @default-return Continue(false),
move |sent_output| { move |sent_output| {
println!("{}", sent_output); get_drivers(&window, sent_output);
Continue(true) 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() let main_box = gtk::Box::builder()
.orientation(Orientation::Vertical) .orientation(Orientation::Vertical)
.build(); .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))); driver_button.connect_clicked(clone!(@weak driver_button => move |_| modify_package(&driver_string, &driver_button_icon)));
main_window.set_child(Some(&window_box));
} }