From 8f7f553a23f654cf96ce3bc34ca1175836a8327d Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Mon, 26 Feb 2024 17:01:43 +0300 Subject: [PATCH] Make sure updates don't interact with inputless terminal --- locales/bg_BG.json | 1 + locales/de_DE.json | 1 + locales/en_US.json | 1 + locales/fr_FR.json | 1 + locales/it_IT.json | 1 + locales/sv_SE.json | 1 + src/build_ui.rs | 12 +++++------- src/config.rs | 8 +++----- src/first_setup/codec_carousel/mod.rs | 9 ++++++--- src/first_setup/gameutils_carousel/mod.rs | 9 ++++++--- src/first_setup/update_carousel/mod.rs | 9 ++++++--- 11 files changed, 32 insertions(+), 21 deletions(-) diff --git a/locales/bg_BG.json b/locales/bg_BG.json index c77d34e..129100b 100644 --- a/locales/bg_BG.json +++ b/locales/bg_BG.json @@ -1,4 +1,5 @@ { + "app_name": "", "first_setup_initial_box_text_title": "Добре дошли", "first_setup_initial_box_text_description": "Този асистент ще ви помогне да извършите инсталацията на PikaOS.", "first_setup_start_button_label": "Нека започнем", diff --git a/locales/de_DE.json b/locales/de_DE.json index 9657d09..7601919 100644 --- a/locales/de_DE.json +++ b/locales/de_DE.json @@ -1,4 +1,5 @@ { + "app_name": "", "first_setup_initial_box_text_title": "Willkommen", "first_setup_initial_box_text_description": "Dieser Assistent wird dir dabei helfen deine PikaOS installation abzuschließen.", "first_setup_start_button_label": "Lasst uns beginnen", diff --git a/locales/en_US.json b/locales/en_US.json index 473988e..8b5ecdb 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -1,4 +1,5 @@ { + "app_name": "PikaOS First Setup", "first_setup_initial_box_text_title": "Welcome", "first_setup_initial_box_text_description": "This wizard will help you finish your PikaOS installation.", "first_setup_start_button_label": "Let's Start", diff --git a/locales/fr_FR.json b/locales/fr_FR.json index abedf05..3b2b23e 100644 --- a/locales/fr_FR.json +++ b/locales/fr_FR.json @@ -1,4 +1,5 @@ { + "app_name": "", "first_setup_initial_box_text_title": "Bienvenue", "first_setup_initial_box_text_description": "Cet assistant vous aidera à terminer l'installation de PikaOS", "first_setup_start_button_label": "Commencer", diff --git a/locales/it_IT.json b/locales/it_IT.json index 8f612d5..bbca459 100644 --- a/locales/it_IT.json +++ b/locales/it_IT.json @@ -1,4 +1,5 @@ { + "app_name": "", "first_setup_initial_box_text_title": "Benvenuto", "first_setup_initial_box_text_description": "Questo programma ti aiuterà a finire la tua installazione di PikaOS.", "first_setup_start_button_label": "Cominciamo", diff --git a/locales/sv_SE.json b/locales/sv_SE.json index 533e37a..5813f1f 100644 --- a/locales/sv_SE.json +++ b/locales/sv_SE.json @@ -1,4 +1,5 @@ { + "app_name": "", "first_setup_initial_box_text_title": "Välkommen", "first_setup_initial_box_text_description": "Den här installationsguiden hjälper dig att slutföra din PikaOS installation.", "first_setup_start_button_label": "Påbörja", diff --git a/src/build_ui.rs b/src/build_ui.rs index cf2eb20..2dc261e 100644 --- a/src/build_ui.rs +++ b/src/build_ui.rs @@ -3,30 +3,28 @@ use adw::prelude::*; use adw::*; /// Use all gtk4 libraries (gtk4 -> gtk because cargo) /// Use all libadwaita libraries (libadwaita -> adw because cargo) - +use crate::config::APP_ICON; // application crates /// first setup crates use crate::first_setup::*; pub fn build_ui(app: &adw::Application) { // setup glib - gtk::glib::set_prgname(Some("PikaOS First Setup")); - glib::set_application_name("PikaOS First Setup"); + gtk::glib::set_prgname(Some(t!("app_name").to_string())); + glib::set_application_name(&t!("app_name").to_string()); // create the main Application window let window = adw::ApplicationWindow::builder() // The text on the titlebar - .title("PikaOS First Setup") + .title(t!("app_name")) // link it to the application "app" .application(app) // Add the box called "window_box" to it // Application icon - .icon_name("com.github.pikaos-linux.pikafirstsetup") + .icon_name(APP_ICON) // Minimum Size/Default .width_request(700) .height_request(500) - // Hide window instead of destroy - .hide_on_close(true) .deletable(false) // Startup .startup_id("com.github.pikaos-linux.pikafirstsetup") diff --git a/src/config.rs b/src/config.rs index c424d79..5e9b3ea 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,7 +1,5 @@ pub const APP_ID: &str = "com.github.pikaos-linux.pikafirstsetup"; -//pub const GETTEXT_PACKAGE: &str = env!("CARGO_PKG_NAME"); -//pub const LOCALEDIR: &str = "/usr/share/locale"; -//pub const PKGDATADIR: &str = " /usr/share"; -//pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource"); -//pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub const DISTRO_ICON: &str = "pika-logo"; +//pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const APP_ICON: &str = "com.github.pikaos-linux.pikawelcome"; +//pub const APP_GITHUB: &str = "https://github.com/PikaOS-Linux/pkg-pika-welcome"; \ No newline at end of file diff --git a/src/first_setup/codec_carousel/mod.rs b/src/first_setup/codec_carousel/mod.rs index f6e7e7a..8375626 100644 --- a/src/first_setup/codec_carousel/mod.rs +++ b/src/first_setup/codec_carousel/mod.rs @@ -20,11 +20,14 @@ use duct::cmd; use std::io::prelude::*; use std::io::BufReader; -const CODEC_INSTALL_PROG: &str = " +const CODEC_INSTALL_PROG: &str = r###" #! /bin/bash set -e -/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-codecs-meta -y -"; +export DEBIAN_FRONTEND=noninteractive +DEBIAN_FRONTEND=noninteractive +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y -o Dpkg::Options::="--force-confnew" || exit 1 +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-codecs-meta -y -o Dpkg::Options::="--force-confnew" || exit 1 +"###; fn codec_install( log_loop_sender: async_channel::Sender, diff --git a/src/first_setup/gameutils_carousel/mod.rs b/src/first_setup/gameutils_carousel/mod.rs index ccf43e5..e153af5 100644 --- a/src/first_setup/gameutils_carousel/mod.rs +++ b/src/first_setup/gameutils_carousel/mod.rs @@ -20,11 +20,14 @@ use duct::cmd; use std::io::prelude::*; use std::io::BufReader; -const GAMEUTILS_INSTALL_PROG: &str = " +const GAMEUTILS_INSTALL_PROG: &str = r###" #! /bin/bash set -e -/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-gameutils-meta -y -"; +export DEBIAN_FRONTEND=noninteractive +DEBIAN_FRONTEND=noninteractive +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y -o Dpkg::Options::="--force-confnew" || exit 1 +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-gameutils-meta -y -o Dpkg::Options::="--force-confnew" || exit 1 +"###; fn gameutils_install( log_loop_sender: async_channel::Sender, diff --git a/src/first_setup/update_carousel/mod.rs b/src/first_setup/update_carousel/mod.rs index 415413f..ed419e1 100644 --- a/src/first_setup/update_carousel/mod.rs +++ b/src/first_setup/update_carousel/mod.rs @@ -20,11 +20,14 @@ use duct::cmd; use std::io::prelude::*; use std::io::BufReader; -const APT_UPDATE_PROG: &str = " +const APT_UPDATE_PROG: &str = r###" #! /bin/bash set -e -/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt full-upgrade -y -"; +export DEBIAN_FRONTEND=noninteractive +DEBIAN_FRONTEND=noninteractive +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y -o Dpkg::Options::="--force-confnew" || exit 1 +/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt full-upgrade -y -o Dpkg::Options::="--force-confnew" || exit 1 +"###; fn apt_update( log_loop_sender: async_channel::Sender,