minor changes

This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2023-07-01 17:11:54 +03:00
parent cbe37794c4
commit 602c50f0ed
3 changed files with 19 additions and 4 deletions

3
data/dialog-error.sh Executable file
View File

@ -0,0 +1,3 @@
#! /bin/bash
zenity --error --text "There was a problem installing the following driver: "$1""

6
data/dialog-success.sh Executable file
View File

@ -0,0 +1,6 @@
#! /bin/bash
if zenity --question --text ""$1" has been processed successfully. Would you like to reboot for changes to take effect?"
then
systemctl reboot
fi

View File

@ -4,7 +4,6 @@ use gtk::prelude::*;
use gtk::*; use gtk::*;
use glib::*; use glib::*;
use gdk::Display; use gdk::Display;
use std::sync::mpsc::channel;
const PROJECT_VERSION: &str = env!("CARGO_PKG_VERSION"); const PROJECT_VERSION: &str = env!("CARGO_PKG_VERSION");
@ -202,6 +201,13 @@ fn modify_package(package: &str, driver_button: &Image) {
println!("Installation was successful!\n"); println!("Installation was successful!\n");
println!("Refreshing GUI Labels.\n"); println!("Refreshing GUI Labels.\n");
driver_button_refresh(package, driver_button); driver_button_refresh(package, driver_button);
let _success_command = Command::new("bash")
.arg("-c")
.arg("/usr/lib/pika/drivers/dialog-success.sh \"$1\"")
.arg("bash") // $0
.arg(&str_pkg) // $1
.spawn()
.unwrap();
} else { } else {
println!("Installation Command has ended.\n"); println!("Installation Command has ended.\n");
println!("Installation was failed :(\n"); println!("Installation was failed :(\n");
@ -213,7 +219,7 @@ fn modify_package(package: &str, driver_button: &Image) {
.arg("/usr/lib/pika/drivers/dialog-error.sh \"$1\"") .arg("/usr/lib/pika/drivers/dialog-error.sh \"$1\"")
.arg("bash") // $0 .arg("bash") // $0
.arg(&str_pkg) // $1 .arg(&str_pkg) // $1
.output() .spawn()
.unwrap(); .unwrap();
} }
} }
@ -292,6 +298,7 @@ fn get_drivers(main_window: &ApplicationWindow, ubuntu_drivers_list_utf8: String
.build(); .build();
let driver_label = gtk::Label::builder() let driver_label = gtk::Label::builder()
.vexpand(true)
.margin_top(12) .margin_top(12)
.build(); .build();
driver_label.add_css_class("startLabel"); driver_label.add_css_class("startLabel");
@ -376,11 +383,10 @@ fn get_drivers(main_window: &ApplicationWindow, ubuntu_drivers_list_utf8: String
.build(); .build();
let driver_middle_part_description_label = gtk::Label::builder() let driver_middle_part_description_label = gtk::Label::builder()
.margin_top(12)
.margin_bottom(12)
.margin_start(12) .margin_start(12)
.margin_end(12) .margin_end(12)
.hexpand(true) .hexpand(true)
.vexpand(true)
.halign(Align::Start) .halign(Align::Start)
.justify(Justification::Left) .justify(Justification::Left)
.build(); .build();