From b80c564692eb545f029c168404ed027db07d7840 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Fri, 23 Feb 2024 20:03:49 +0300 Subject: [PATCH] Final touches before translation --- ...> com.github.pikaos-linux.pikadrivers.svg} | 0 data/generate_package_info.sh | 24 ------------------- src/build_ui/mod.rs | 9 ++++--- src/config.rs | 4 ++-- 4 files changed, 6 insertions(+), 31 deletions(-) rename data/{pika-drivers.svg => com.github.pikaos-linux.pikadrivers.svg} (100%) diff --git a/data/pika-drivers.svg b/data/com.github.pikaos-linux.pikadrivers.svg similarity index 100% rename from data/pika-drivers.svg rename to data/com.github.pikaos-linux.pikadrivers.svg diff --git a/data/generate_package_info.sh b/data/generate_package_info.sh index 438211e..2435e7e 100755 --- a/data/generate_package_info.sh +++ b/data/generate_package_info.sh @@ -11,28 +11,4 @@ then elif [[ $1 == "description" ]] then apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1 -elif [[ $1 == "device" ]] -then - if echo "$2" | grep -i -E 'pika-rocm-meta|vulkan-amdgpu-pro|amf-amdgpu-pro|amdvlk|opencl-legacy-amdgpu-pro-icd|amdgpu-pro-oglp' &> /dev/null - then - DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i AMD)" - elif echo "$2" | grep -i -E 'xone' &> /dev/null - then - DEVICE="$(lsusb | grep -i xbox)" - elif echo "$2" | grep -i -E 'intel' &> /dev/null - then - DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i intel)" - elif echo "$2" | grep -i -E 'nvidia' &> /dev/null - then - DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -i nvidia)" - elif echo "$2" | grep -i -E 'mesa' &> /dev/null - then - DEVICE="$(lspci | grep -i -E 'vga|display|3d' | grep -vi nvidia)" - fi - if [[ ! -z $DEVICE ]] - then - echo "$DEVICE" - else - echo "UNKNOWN!" - fi fi \ No newline at end of file diff --git a/src/build_ui/mod.rs b/src/build_ui/mod.rs index 3313c0c..51e54f5 100644 --- a/src/build_ui/mod.rs +++ b/src/build_ui/mod.rs @@ -58,8 +58,8 @@ pub fn build_ui(app: &adw::Application) { .margin_top(20) .margin_bottom(20) .margin_start(20) - .vexpand(true) - .hexpand(true) + .width_request(120) + .height_request(120) .margin_end(20) .build(); @@ -123,7 +123,7 @@ pub fn build_ui(app: &adw::Application) { credits_button.connect_clicked(clone!(@weak credits_button => move |_| credits_window.present())); println!("Downloading driver DB..."); - let data = reqwest::blocking::get("https://raw.githubusercontent.com/PikaOS-Linux/pkg-pika-drivers/main/driver-db.json").unwrap().text().unwrap(); + let data = reqwest::blocking::get(DRIVER_DB_JSON_URL).unwrap().text().unwrap(); let (drive_hws_sender, drive_hws_receiver) = async_channel::unbounded(); let drive_hws_sender = drive_hws_sender.clone(); @@ -185,7 +185,7 @@ pub fn build_ui(app: &adw::Application) { // The main loop executes the asynchronous block drive_hws_main_context.spawn_local(clone!(@weak content_box, @weak loading_box, @strong data => async move { while let Ok(drive_hws_state) = drive_hws_receiver.recv().await { - get_drivers(&content_box, &loading_box, drive_hws_state, &window, &data); + get_drivers(&content_box, &loading_box, drive_hws_state, &window); } })); } @@ -219,7 +219,6 @@ fn get_drivers( loading_box: >k::Box, driver_array: Vec, window: &adw::ApplicationWindow, - json_data: &String ) { let main_box = gtk::Box::builder() .margin_top(20) diff --git a/src/config.rs b/src/config.rs index 4b70d69..7f32494 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,7 +1,7 @@ pub const APP_ID: &str = "com.github.pikaos-linux.pikadrivers"; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); -pub const APP_ICON: &str = "pika-drivers"; - +pub const APP_ICON: &str = "com.github.pikaos-linux.pikadrivers"; pub const APP_NAME: &str = "PikaOS Driver Manager"; pub const APP_DEV: &str = "Cosmo"; pub const APP_GITHUB: &str = "https://github.com/PikaOS-Linux/pkg-pika-drivers"; +pub const DRIVER_DB_JSON_URL : &str = "https://raw.githubusercontent.com/PikaOS-Linux/pkg-pika-drivers/main/driver-db.json"; \ No newline at end of file