File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change 1- // src/actions.rs
2- use gtk:: prelude:: * ;
31use gtk:: Label ;
42use std:: process:: Command ;
53use webbrowser;
@@ -21,19 +19,6 @@ impl Actions {
2119 }
2220 }
2321
24- pub fn run_command_with_feedback ( & self , cmd : & str ) {
25- let full_cmd = format ! ( "bash -c '{}'" , cmd) ;
26- let result = Command :: new ( "pkexec" )
27- . arg ( & full_cmd)
28- . status ( ) ;
29-
30- let cmd_name = cmd. split ( '/' ) . last ( ) . unwrap_or ( cmd) ;
31- match result {
32- Ok ( status) if status. success ( ) => self . update_subtitle ( & format ! ( "Uruchomiono: {}." , cmd_name) ) ,
33- _ => self . update_subtitle ( & format ! ( "Błąd podczas uruchamiania: {}." , cmd_name) ) ,
34- }
35- }
36-
3722 pub fn open_website ( & self ) {
3823 if webbrowser:: open ( "https://hackeros-linux-system.github.io/HackerOS-Website/Home-page.html" ) . is_ok ( ) {
3924 self . update_subtitle ( "Otworzono stronę HackerOS." ) ;
@@ -81,10 +66,9 @@ impl Actions {
8166 pub fn update_system ( & self ) {
8267 let terminal_cmd = "alacritty -e bash -c \" hacker update; read -p 'Chcesz zamknąć terminal? (t/n) ' answer; if [ \" $answer\" = 't' ]; then exit; else echo 'Terminal pozostanie otwarty.'; read; fi\" " ;
8368 let result = Command :: new ( "sh" )
84- . arg ( "-c" )
85- . arg ( terminal_cmd)
86- . status ( ) ;
87-
69+ . arg ( "-c" )
70+ . arg ( terminal_cmd)
71+ . status ( ) ;
8872 match result {
8973 Ok ( status) if status. success ( ) => self . update_subtitle ( "Rozpoczęto aktualizację systemu w terminalu." ) ,
9074 _ => self . update_subtitle ( "Błąd podczas uruchamiania aktualizacji systemu." ) ,
You can’t perform that action at this time.
0 commit comments