diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86196dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +ubl-settings-bootloader.glade~ +test.cpp +.vscode +ubl-settings-bootloader +ubl-settings-bootloader_ru.po~ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..76288d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,162 @@ +#!/usr/bin/make -f + +#SHELL := /bin/bash +MAKEFILE_FILEPATH := $(abspath $(lastword $(MAKEFILE_LIST))) +MAKEFILE_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_FILEPATH)))) +MAKEFILE_PATH := $(dir $(MAKEFILE_FILEPATH)) + +CMAKE_COMMAND = cmake +CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source +CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile +#CMAKE_SOURCE_DIR = ./source +#CMAKE_BUILD_DIR = ./compile +FILE_VERSION = VERSION.md +DEPENDS = /bin/cmake +PREFIX ?= /usr +PKGNAME = $(MAKEFILE_DIR) +#PKGNAME = ubl-settings-bootloader + +default_target: all + +.PHONY: all init depend debug prepare check build uninstall install clean up_ver help + +all: init build + +init: + @echo "Initialize ..."; \ + sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ubl-settings-bootloader.cc; \ + echo "-- Build path: ${CMAKE_BUILD_DIR}" + +depend: + @echo "Check depends ..." + @for FILE_DEPEND in $(DEPENDS); do \ + if [ ! -f $${FILE_DEPEND} ]; then \ + echo "ERROR: Depend '$${FILE_DEPEND}' not found !"; \ + exit 1; \ + fi; \ + done; \ + echo "Check depends: OK" +# $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + +debug: + @echo "Debug ..." + if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ + $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \ + fi; \ + echo "Debug: OK" + +prepare: + @echo "Prepare ..."; \ + if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ + $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \ + fi; \ + echo "Prepare: OK" + +check: + @echo "Check ..."; \ + if [ -f ${CMAKE_BUILD_DIR}/${PKGNAME} ]; then \ + echo "Check: OK"; \ + else \ + echo "Check: ${CMAKE_BUILD_DIR}/${PKGNAME} not found !"; \ + exit 1; \ + fi + +build: depend prepare + @echo "Build ..."; \ + make --directory=${CMAKE_BUILD_DIR}; \ + echo "Build: OK" + +uninstall: + @echo "Uninstall ..." + @for FILE_PO in $(wildcard *.po); do \ + LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \ + FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ + PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + $(RM) "$${PATH_FILE_MO}"; \ + done + @for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \ + done + @for FILE_SVG in $(wildcard *.svg); do \ + for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \ + done; \ + done + @$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}" + @$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop" + @$(RM) "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/logo-background.png" + @$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.pkexec.${PKGNAME}.exec.policy" + @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg" + @$(RM) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}" + @if [ -z ${DESTDIR} ]; then \ + [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ + update-desktop-database --quiet &>/dev/null || true; \ + [ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \ + fi + @echo "Uninstall: OK" + +install: check uninstall + @echo "Install ..." + @for FILE_PO in $(wildcard *.po); do \ + LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \ + install -dm755 "${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES"; \ + FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ + PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + echo "$${FILE_PO}"; \ + msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \ + done + @for SIZE in 16 32 48; do \ + install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \ + rsvg-convert -w $${SIZE} -h $${SIZE} -f png --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \ + done + @install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg" + @install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}" + @install -dm755 "${DESTDIR}${PREFIX}/share/applications" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop" + @install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.pkexec.${PKGNAME}.exec.policy" + @install -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images} + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}.glade" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "logo-background.png" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg" + @install -Dm644 -t /usr/share/${PKGNAME}/ cmdline-linux.csv + @install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-input.csv + @install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-output.csv + @if [ -z ${DESTDIR} ]; then \ + [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ + update-desktop-database --quiet &>/dev/null || true; \ + [ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \ + fi + @echo "Install: OK" + +clean: + @echo "Clean ..." + @$(RM) -rd ${CMAKE_BUILD_DIR} + @if [ -d ${CMAKE_BUILD_DIR} ]; then \ + echo "Clean: error, compile directory exist ${CMAKE_BUILD_DIR}"; \ + else \ + echo "Clean: OK"; \ + fi + +up_ver: + @CURRENT=$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2); \ + MAJOR=$$(cut -d. -f1 <<< $${CURRENT}); \ + MINOR=$$(cut -d. -f2 <<< $${CURRENT}); \ + VER="$${MAJOR}.$$(($${MINOR}+1))"; \ + sed "s/VERSION *[[:digit:]]*.*/VERSION $${VER}/" -i ${FILE_VERSION}; \ + echo "Updated version to VERSION.md: $${CURRENT} to $${VER}" + +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... init" + @echo "... debug" + @echo "... prepare" + @echo "... compile" + @echo "... install" + @echo "... uninstall" + @echo "... clean" diff --git a/README.md b/README.md index f8c2bcf..85c8e4b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ # ubl-settings-bootloader +# Настройка загрузчика +[RU] Утилита для настройки загрузчика +Utility for setting the bootloader + +![alt text](screenshot/screenshot.png) + +# Build +In order to build ubl-settings-bootloader you will need: + +- CMake +- C compiler +- GTK+ 3 & dependencies + +Once you have all the necessary dependencies, you can use: +```sh +$ make +``` + +# Installation +After a successful build, just use: +```sh +$ sudo make install clean +``` + +# Uninstallation +After a successful build, just use: +```sh +$ sudo make uninstall +``` +# Usage +```sh +$ ubl-settings-bootloader --help +GTK settings bootloader for UBLinux + +Usage: ubl-settings-bootloader [OPTIONS...] +Options: + -h, --help Show this help + -V, --version Show package version + +$ ubl-settings-bootloader --version +ubl-settings-bootloader version: x.xx +``` \ No newline at end of file diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..12ebd01 --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +VERSION 1.0 diff --git a/cmdline-linux.csv b/cmdline-linux.csv new file mode 100644 index 0000000..1aba2df --- /dev/null +++ b/cmdline-linux.csv @@ -0,0 +1,14 @@ +Option,Description +quiet,Downloading without text messages +splash,Show welcome window +noplymouth,Disable Plymouth +acpi=off,Disable ACPI +noapic,Disable APIC +nolapic,Disable local APIC +single,Single User Mode +nomodeset,Disable kernel selection and loading of video drivers +915.enable_dc=0,Disable GPU power management +ahci.mobile_lpm_policy=1,"Maximum performance, power management" +snd-intel-dspcfg.dsp_driver=1,Forced selection of an Intel sound device driver +intel_idle.max_cstate=1,Prevents the processor from going into a deep sleep state +intel_idle.max_cstate=4,Eliminates flickering laptop display on Ultra Voltage processors diff --git a/com.ublinux.pkexec.ubl-settings-bootloader.exec.policy b/com.ublinux.pkexec.ubl-settings-bootloader.exec.policy new file mode 100644 index 0000000..50b1000 --- /dev/null +++ b/com.ublinux.pkexec.ubl-settings-bootloader.exec.policy @@ -0,0 +1,24 @@ + + + + + UBLinux + https://ublinux.ru + + + Run "ubl-settings-bootloader" as root + Запуск утилиты "ubl-settings-bootloader" с правами root + Authentication is required to run "ubl-settings-bootloader" + Требуется авторизация для запуска утилиты "ubl-settings-bootloader" с правами root + + auth_admin + auth_admin + auth_admin + + /usr/bin/ubl-settings-bootloader + true + + + diff --git a/com.ublinux.ubl-settings-bootloader.checked.svg b/com.ublinux.ubl-settings-bootloader.checked.svg new file mode 100644 index 0000000..e3cab42 --- /dev/null +++ b/com.ublinux.ubl-settings-bootloader.checked.svg @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + diff --git a/com.ublinux.ubl-settings-bootloader.svg b/com.ublinux.ubl-settings-bootloader.svg new file mode 100644 index 0000000..ceee7ff --- /dev/null +++ b/com.ublinux.ubl-settings-bootloader.svg @@ -0,0 +1,3363 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.ublinux.ubl-settings-bootloader.warning.svg b/com.ublinux.ubl-settings-bootloader.warning.svg new file mode 100644 index 0000000..9a90dba --- /dev/null +++ b/com.ublinux.ubl-settings-bootloader.warning.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/grub-terminal-input.csv b/grub-terminal-input.csv new file mode 100644 index 0000000..4bd7f47 --- /dev/null +++ b/grub-terminal-input.csv @@ -0,0 +1,6 @@ +Option,Description +console,PC BIOS & EFI console +serial,Serial terminal +ofconsole,Open Firmware Console +at_keyboard,PC AT Keyboard (Coreboot) +usb_keyboard,USB Keyboard (HID Boot protocol) diff --git a/grub-terminal-output.csv b/grub-terminal-output.csv new file mode 100644 index 0000000..30453d6 --- /dev/null +++ b/grub-terminal-output.csv @@ -0,0 +1,6 @@ +Option,Description +console,PC BIOS & EFI console +serial,Serial terminal +ofconsole,Open Firmware Console +gfxterm,Output in graphical mode +vga_text,VGA text output (Coreboot) diff --git a/logo-background.png b/logo-background.png new file mode 100644 index 0000000..8eb67cb Binary files /dev/null and b/logo-background.png differ diff --git a/screenshot/screenshot.png b/screenshot/screenshot.png new file mode 100644 index 0000000..9f7ddbf Binary files /dev/null and b/screenshot/screenshot.png differ diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000..39fe799 --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 3.7) +project(ubl-settings-bootloader) + +find_package(PkgConfig REQUIRED) + +pkg_check_modules(GTK REQUIRED gtkmm-3.0) +include_directories(${GTK_INCLUDE_DIRS}) +link_directories(${GTK_LIBRARY_DIRS}) +add_definitions(${GTK_CFLAGS_OTHER}) + +find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) + +option(WEBKIT_FOUND "No" OFF) + +find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) +if(WEBKIT_LIBRARIES_FOUND) + option(WEBKIT_FOUND "Yes" ON) + PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0) + include_directories(${WEBKIT_INCLUDE_DIRS}) + link_directories(${WEBKIT_LIBRARY_DIRS}) + add_definitions(${WEBKIT_CFLAGS_OTHER}) +endif() +configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h) + + + +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ + -O2 -pipe -fno-plt -fexceptions \ + -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ + -fstack-clash-protection -fcf-protection") + +set(SOURCE_FILES + ubl-settings-bootloader-cm.h + ubl-settings-bootloader.h + ubl-settings-bootloader.cc + save.h + save.cc + load.h + load.cc + my_process.h + my_process.cc + util.h + util.cc + ubl-util-standard.h + ubl-util-standard.c + main.cc) + +set(LIBRARIES + ${GTK_LIBRARIES} + pthread) + +add_executable(ubl-settings-bootloader ${SOURCE_FILES}) +target_link_libraries(ubl-settings-bootloader PUBLIC ${WEBKIT_LIBRARIES} ${LIBRARIES}) +target_include_directories(ubl-settings-bootloader PUBLIC + "${PROJECT_BINARY_DIR}" + ${WEBKIT_INCLUDE_DIRS} + ) +install(TARGETS ubl-settings-bootloader DESTINATION bin) \ No newline at end of file diff --git a/source/load.cc b/source/load.cc new file mode 100644 index 0000000..77873dc --- /dev/null +++ b/source/load.cc @@ -0,0 +1,34 @@ +#include "load.h" + +namespace Lib_Load{ + void Load::set_count_error(int count_error) { + process.set_count_error(count_error); + } + string Load::get_cmd_error() { + return process.get_cmd_error(); + } + map& Load::get_load_data(std::map &map_temp, string cmd) { + string response = ""; + string key = ""; + string value = ""; + response = process.call_all_sections(cmd); + vector vec_str_key_value = Utils::split(response, '\n'); + for (const string ¶m: vec_str_key_value) { + if ((param.find("(null)") == std::string::npos) && (param.length() != 0 )) { + if (param.find("=") != std::string::npos) { + size_t index = param.find("="); + key = param.substr(0, index); + value = param.substr(index + 1, param.length()); + Utils::str_replace_all(value, " \"",""); + Utils::str_replace_all(value, "\"",""); + map_temp[key] = value; + } + } + } + return map_temp; + } + int Load::get_count_error() { + return process.get_count_error(); + } + +} \ No newline at end of file diff --git a/source/load.h b/source/load.h new file mode 100644 index 0000000..b4d4a38 --- /dev/null +++ b/source/load.h @@ -0,0 +1,20 @@ +#ifndef LOAD_H +#define LOAD_H + +#include "my_process.h" +namespace Lib_Load{ + class Load { + + private: + string sections; + My_Process::My_Process_call process = My_Process::My_Process_call(); + public: + int get_count_error(); + void set_count_error(int count_error); + string get_cmd_error(); + map& get_load_data(std::map &map_temp, string str_flag_load); + }; + + +} +#endif \ No newline at end of file diff --git a/source/main.cc b/source/main.cc new file mode 100644 index 0000000..edab5c2 --- /dev/null +++ b/source/main.cc @@ -0,0 +1,94 @@ +#include "ubl-settings-bootloader.h" + + +void pars_flag(int index_start, int argc, char* argv[]); + +int main(int argc, char** argv) { + string str_argv= ""; + string str_cmd_argv = ""; + for (int i=1; i 1){ + str_argv = argv[1]; + } + bindtextdomain("ubl-settings-bootloader", "/usr/share/locale/"); + bind_textdomain_codeset("ubl-settings-bootloader", "UTF-8"); + textdomain("ubl-settings-bootloader"); + if (str_argv.find("--socket-id") != std::string::npos) { + auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); + auto builder = Gtk::Builder::create_from_file(path_glade); + Glib::init(); + setlocale(LC_ALL, ""); + Glib::OptionContext context; + + CmdArgParser parser{ + "Socket ID", + "Command line argument for socket ID communication.", + "No help available, sorry" + }; + + context.set_main_group(parser); + context.parse(argc, argv); + + ::Window socketID = parser.GetSocketID(); + + // Handle plug: + SettingsPlug plug{socketID, builder}; + plug.show(); + + app->run(plug); + return 0; + } + else if (str_argv.find("-") != std::string::npos || argc == 1) { + int len_argv = 1; + auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug"); + auto builder = Gtk::Builder::create_from_file(path_glade); + pars_flag(1, argc, argv); + MainWindow* wnd = nullptr; + builder->get_widget_derived("window", wnd); + auto r = app->run(*wnd); + delete wnd; + return r; + } + +} +void pars_flag(int index_start, int argc, char* argv[]) { + string str_argv = ""; + for (int i = index_start; i My_Process_call::call(string cmd) { + this->i_error_old = this->i_error; + struct Utils::Result obj_result; + string response = Utils::call(cmd); + obj_result.response = response; + if ((response.find("(null)") == std::string::npos) && (response.length() != 0 )) { + if (response.find("=") != std::string::npos) { + if (response.find("\n") != std::string::npos) { + response = response.substr(response.find("=")+1,response.length()); + response = response.substr(0,response.find("\n")); + obj_result.response = response; + obj_result.error = 0; + } + else { + obj_result.error = 1; + this->i_error += 1; + this->log_mess_error(cmd); + } + } + else { + obj_result.error = 2; + this->i_error += 1; + str_cmd_error = cmd; + this->log_mess_error(cmd); + } + } + else { + obj_result.error = 3; + this->i_error += 1; + str_cmd_error = cmd; + this->log_mess_error(cmd); + } + return obj_result; +} + +int My_Process::get_count_error() { + return this->i_error; +} + +void My_Process::set_back_count_error() { + this->i_error = this->i_error_old; +} + +void My_Process_system::call(string cmd, string thread_str = "") { + string cmd_new = cmd + " " + thread_str; + int response_cmd = system(cmd_new.c_str()); + if (response_cmd != 0) { + this->i_error += 1; + } +} + +void My_Process::set_count_error(int count_error) { + this->i_error = count_error; + this->str_cmd_error = ""; +} + +void My_Process::log_mess_error(string) { +} + +string My_Process::get_cmd_error() { + return this->str_cmd_error; +} +string My_Process_call::call_all_sections(string cmd) { + char buffer[PATH_MAX] = {0}; + std::string result = ""; + FILE* pipe = popen(cmd.c_str(), "r"); + if (!pipe) throw std::runtime_error("popen() failed!"); + try { + while (fgets(buffer, sizeof buffer, pipe) != NULL) { + result += buffer; + } + } catch (...) { + pclose(pipe); + throw; + } + pclose(pipe); + return result; +} +} \ No newline at end of file diff --git a/source/my_process.h b/source/my_process.h new file mode 100644 index 0000000..f780860 --- /dev/null +++ b/source/my_process.h @@ -0,0 +1,32 @@ +#ifndef SAVE_H +#define SAVE_H + +#include "util.h" +namespace My_Process{ +class My_Process { + public: + int i_error = 0; + int i_error_old = 0; + string str_cmd_error = ""; + int get_count_error(); + void set_count_error(int count_error); + void set_back_count_error(); + void log_mess_error(string); + string get_cmd_error(); +}; + + +class My_Process_call: public My_Process { + public: + struct Utils::Result call(string cmd); + string call_all_sections(string cmd); + +}; + +class My_Process_system: public My_Process { + public: + void call(string cmd, string thread_str); + +}; +} +#endif \ No newline at end of file diff --git a/source/save.cc b/source/save.cc new file mode 100644 index 0000000..c824093 --- /dev/null +++ b/source/save.cc @@ -0,0 +1,151 @@ +#include "save.h" + +namespace Lib_save { + +vector Save::get_error() { + return this->vec_errors; +} + +bool Save::get_state_save() { + return this->flag_no_save; +} + +void Save::set_data_global(std::map &map_global) { + this->map_global = &map_global; +} + +void Save::set_data_local(std::map &map_local) { + this->map_local = &map_local; +} + +void Save::set_data_gui(std::map &map_gui) { + this->map_gui = &map_gui; +} + +bool Save::check_save(string flag_save, string key_name) { + std::map :: iterator iter_map_data; + std::map :: iterator iter_map_data_old; + std::map *map_data_old; + if (flag_save == "system") { + map_data_old = map_local; + } + else if (flag_save == "global") { + map_data_old = map_global; + } + iter_map_data = (*map_gui).find(key_name); + iter_map_data_old = (*map_data_old).find(key_name); + if ((*map_local).find(key_name) != (*map_local).end() && (*map_global).find(key_name) != (*map_global).end()) { + if ((*map_local)[key_name] != (*map_global)[key_name]) { + return true; + } + } + if (iter_map_data_old == (*map_data_old).end() && iter_map_data != (*map_gui).end()) { + return true; + } + else if (iter_map_data->second != iter_map_data_old->second) { + return true; + } + else if (iter_map_data->second.length() == 0 && iter_map_data_old->second.length() == 0) { + return false; + } + else if (iter_map_data->second == iter_map_data_old->second) { + return false; + } + else { + return true; + } + return true; +} + +int Save::get_count_error() { + return process.get_count_error(); +} + +string Save::get_cmd_error() { + return process.get_cmd_error(); +} + +void Save::set_count_error(int count_error) { + process.set_count_error(count_error); +} + +void Save::set_vec_params(vector& vec_param_names) { + this->vec_param_names = &vec_param_names; +} + +void Save::save(string sections, string str_flag_save) { + string key = ""; + string value = ""; + string cmd = ""; + string str_error = ""; + this->flag_no_save = true; + for (const auto &key: *vec_param_names) { + if (map_gui->find(key) != map_gui->end()) { + value = (*map_gui)[key]; + if (this->check_save(str_flag_save, key)) { + if (value.length() != 0) { + cmd = "ubconfig --target " + str_flag_save + " set " + sections + " " + + key + "=\"" + value + "\""; + } + else if (value.length() == 0) { + cmd = "ubconfig --target " + str_flag_save + " remove " + sections + " " + key; + } + else { + cmd = ""; + } + if (cmd.length() != 0) { + process.call(cmd, ""); + this->flag_no_save = false; + str_error = process.get_cmd_error(); + if (str_error.length() != 0) { + this->vec_errors.push_back(str_error); + str_error = ""; + } + } + } + } + + } +} +void Save::save_one_cmd(string cmd1, string cmd_remove, string str_flag_save) { + string key = ""; + string value = ""; + string cmd = ""; + this->flag_no_save = true; + cmd = cmd1; + string remove = cmd_remove; + for (const auto &key: *vec_param_names) { + if (map_gui->find(key) != map_gui->end()) { + value = (*map_gui)[key]; + if (this->check_save(str_flag_save, key)) { + if (value.length() != 0) { + cmd = cmd + key + "=\"" + value + "\" "; + } + else if (value.length() == 0) { + remove = remove + key + " "; + } + + } + } + } + if (cmd.length() != cmd1.length()) { + this->template_save(cmd); + } + if (cmd_remove.length() != remove.length()) { + this->template_save(remove); + } +} + +void Save::template_save(string cmd) { + string str_error = ""; + process.call(cmd, ""); + this->flag_no_save = false; + str_error = process.get_cmd_error(); + if (str_error.length() != 0) { + this->vec_errors.push_back(str_error); + str_error = ""; + } + +} + +} diff --git a/source/save.h b/source/save.h new file mode 100644 index 0000000..40b13a1 --- /dev/null +++ b/source/save.h @@ -0,0 +1,33 @@ +#ifndef MY_PROCESS_H +#define MY_PROCESS_H + +#include "my_process.h" +namespace Lib_save { + +class Save { +private: + std::map *map_global; + std::map *map_local; + std::map *map_gui; + vector vec_errors; + vector* vec_param_names; + My_Process::My_Process_system process = My_Process::My_Process_system(); + bool flag_no_save; + void template_save(string cmd); +public: + void set_data_global(std::map &map_global); + void set_data_local(std::map &map_local); + void set_data_gui(std::map &map_gui); + bool check_save(string flag_save, string key_name); + bool get_state_save(); + + void save_one_cmd(string cmd1, string cmd_remove, string str_flag_save); + int get_count_error(); + string get_cmd_error(); + void set_count_error(int count_error); + void set_vec_params(vector& vec_param_names); + void save(string sections, string str_flag_save) ; + vector get_error(); +}; +} +#endif \ No newline at end of file diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc new file mode 100755 index 0000000..66ee893 --- /dev/null +++ b/source/ubl-settings-bootloader.cc @@ -0,0 +1,1058 @@ + +#include "ubl-settings-bootloader.h" +using namespace std; + +int socket_ext_id_I = 0; +int socket_trd_id_I = 0; +bool flag_save = false; +bool flag_save_local = false; +bool flag_save_global = false; +bool flag_load_global = false; +bool flag_lock_help = false; +string version_application = "1.0"; + +CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help) +: Glib::OptionGroup{p_name, p_description, p_help} { + Glib::OptionEntry socketIDArg; + socketIDArg.set_long_name("socket-id"); + socketIDArg.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketIDArg.set_description("Settings manager socket"); + + Glib::OptionEntry socketExtId; + socketExtId.set_long_name("socket-ext-id"); + socketExtId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketExtId.set_description("Settings manager secondary socket"); + + Glib::OptionEntry socketTrdId; + socketTrdId.set_long_name("socket-trd-id"); + socketTrdId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketTrdId.set_description("Settings manager secondary socket"); + + add_entry(socketIDArg, m_socketID); + add_entry(socketExtId, socket_ext_id_I); + add_entry(socketTrdId, socket_trd_id_I); +} +::Window CmdArgParser::GetSocketID() const{ + return m_socketID; +} + +SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr builder) + : Gtk::Plug{p_socketID} { + MainWindow* wnd = nullptr; + builder->get_widget_derived("window", wnd); + builder->get_widget("plugBox", plugBox); + plugBox->get_parent()->remove(*plugBox); + add(*plugBox); + show_all_children(); +} + +int MainWindow::check_root() { + if (geteuid() != 0) { + return 1; + } + return 0; +} + +MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) + : Gtk::ApplicationWindow(obj), builder{builder} { + this->builder = builder; + this->settings(); +} + +MainWindow::MainWindow(Glib::RefPtr const& builder) { + this->builder = builder; + this->settings(); +} + +void MainWindow::settings(){ + map_cmd_error[""] = ""; + vec_param_names.push_back("GRUB_TIMEOUT"); + vec_param_names.push_back("GRUB_CMDLINE_LINUX"); + vec_param_names.push_back("GRUB_TERMINAL_INPUT"); + vec_param_names.push_back("GRUB_TERMINAL_OUTPUT"); + vec_param_names.push_back("GRUB_BOOT_SILENT"); + vec_param_names.push_back("GRUB_USER"); + vec_param_names.push_back("GRUB_PASSWORD"); + vec_param_names.push_back("GRUB_DEFAULT"); + this->get_builder(); + this->localization(); + this->add_CSS(); + Gtk::Widget *boxWidget; + builder->get_widget("boxColor", boxWidget); + overHead->add_overlay(*boxWidget); + btnBoxAboutDialog->set_visible(false); + ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); + #ifdef WEBKIT_FOUND + one = WEBKIT_WEB_VIEW( webkit_web_view_new() ); + three = Glib::wrap(GTK_WIDGET(one)); + wndWeb->add(*three); + #endif + this->flag_block_gui(); + if (this->check_root() == 0) { + spbSecond->set_range(1, 60); + spbSecond->set_increments(1.0, 1.0); + spbSecond->set_value(1); + this->fill_in_view(); + this->change_password_protecc(); + this->change_security_login(); + this->set_active_boot_second(); + this->str_last_launched_os = this->pars_last_launched_os(); + vector os_control_list; + this->pars_os(os_control_list); + this->write_list_entry_os(os_control_list); + this->download_local_cfg(); + this->download_globl_cfg(); + } + else{ + boxWidgetAll->set_sensitive(false); + btnLoad->set_sensitive(false); + btnSave->set_sensitive(false); + imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); + info_status_app(info_box_error_css); + lblWarning->set_text(program_as_root); + this->set_active_boot_second(); + this->fill_in_view(); + } + this->event(); +} + +vector MainWindow::pars_os(vector &os_control_list) { + string str_list_os = obj_process_call.call_all_sections(cmd_pars_list_os); + os_control_list = Utils::split(str_list_os, '\n'); + return os_control_list; +} +string MainWindow::pars_last_launched_os() { + string str_list_os = obj_process_call.call_all_sections(cmd_last_launched_os); + Utils::str_replace_all(str_list_os, "\n" , ""); + return str_list_os; +} + +void MainWindow::write_list_entry_os(vector &os_control_list) { + for (string &name_os: os_control_list) { + cmbDefaultDonw->append(name_os); + } +} + +void MainWindow::flag_block_gui() { + if (flag_load_global == true) { + btnLoadGlob->set_sensitive(false); + } + if (flag_save_local == true && flag_save_global == true) { + btnSave->set_sensitive(false); + } + if (flag_save == true) { + btnSave->set_sensitive(false); + } + if (flag_save_local == true) { + btnSaveLocal->set_sensitive(false); + btnSaveLocalGlob->set_sensitive(false); + } + if (flag_save_global == true) { + btnSaveGlob->set_sensitive(false); + btnSaveLocalGlob->set_sensitive(false); + } + if (flag_lock_help == true) { + btnSynopsis->set_sensitive(false); + } +} + +void MainWindow::fill_in_view() { + list_store_kernel = Gtk::ListStore::create(m_columns); + list_store_IPT = Gtk::ListStore::create(m_columns); + list_store_OTT = Gtk::ListStore::create(m_columns); + treeViewKernel->set_model(list_store_kernel); + treeViewIPT->set_model(list_store_IPT); + treeViewOTT->set_model(list_store_OTT); + + vec_Option_kernel = this->read_file_and_view(kernel_csv, row_kernel, list_store_kernel); + vec_Option_IPT = this->read_file_and_view(IPT_csv, row_IPT, list_store_IPT); + vec_Option_OTT = this->read_file_and_view(OTT_csv, row_OTT, list_store_OTT); + size_kernel = vec_Option_kernel.size(); + size_IPT = vec_Option_IPT.size(); + size_OTT = vec_Option_OTT.size(); + this->view_add_colums(*treeViewKernel); + this->view_add_colums(*treeViewIPT); + this->view_add_colums(*treeViewOTT); +} + +void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { + auto selection_IPT = treeViewIPT->get_selection(); + auto selection_OTT = treeViewOTT->get_selection(); + selection_IPT->unselect_all(); + selection_OTT->unselect_all(); + if (flag_blocked_tree_view == false) { + string str_flags = template_item_selected(size_kernel, list_store_kernel); + Utils::str_replace_all(str_flags, " \"", "\""); + Utils::str_replace_all(str_flags, "\"", ""); + map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; + Utils::str_replace_all(str_flags, " ", ", "); + entryKernel->set_text(str_flags); + } +} + +void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { + auto selection_kernel = treeViewKernel->get_selection(); + auto selection_IPT = treeViewIPT->get_selection(); + selection_kernel->unselect_all(); + selection_IPT->unselect_all(); + if (flag_blocked_tree_view == false) { + string str_flags = template_item_selected(size_OTT, list_store_OTT); + Utils::str_replace_all(str_flags, " \"", "\""); + Utils::str_replace_all(str_flags, "\"", ""); + map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; + Utils::str_replace_all(str_flags, " ", ", "); + entryOTT->set_text(str_flags); + } +} +void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { + auto selection_kernel = treeViewKernel->get_selection(); + auto selection_OTT = treeViewOTT->get_selection(); + selection_kernel->unselect_all(); + selection_OTT->unselect_all(); + if (flag_blocked_tree_view == false) { + string str_flags = template_item_selected(size_IPT, list_store_IPT); + Utils::str_replace_all(str_flags, " \"", "\""); + Utils::str_replace_all(str_flags, "\"", ""); + map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; + Utils::str_replace_all(str_flags, " ", ", "); + entryIPT->set_text(str_flags); + } +} + +void MainWindow::get_download_mode(std::map &map_temp) { + std::map :: iterator iter_map_data; + iter_map_data = map_temp.find("GRUB_BOOT_SILENT"); + if (iter_map_data != map_temp.end()) { + string value = iter_map_data->second; + if (value.length() != 0) { + Utils::str_replace_all(value, "\"",""); + if (value == "splash") { + cmbDownloadMode->set_active(0); + } + else if (value == "splash quiet ub.silent") { + cmbDownloadMode->set_active(1); + } + else if (value == "quiet ub.silent") { + cmbDownloadMode->set_active(2); + } + else if (value == "plymouth.enable=0") { + cmbDownloadMode->set_active(3); + } + else{ + cmbDownloadMode->set_active(-1); + } + } + else { + cmbDownloadMode->set_active(-1); + } + } + else { + cmbDownloadMode->set_active(-1); + } +} + +void MainWindow::set_download_mode() { + int index = cmbDownloadMode->get_active_row_number(); + string key = ""; + if (index == 0) { + key = "splash"; + } + else if (index == 1) { + key = "splash quiet ub.silent"; + } + else if (index == 2) { + key = "quiet ub.silent"; + } + else if (index == 3) { + key = "plymouth.enable=0"; + } + else{ + return; + } + map_cmd_selection["GRUB_BOOT_SILENT"] = key; +} + +void MainWindow::set_security_login() { + bool index = chbSecurityLogin->get_active(); + string key = ""; + if (index == false) { + key = ""; + } + else if (index == true) { + key = entrySecurityLogin->get_text(); + } + map_cmd_selection["GRUB_USER"] = key; +} + +void MainWindow::get_security_login(std::map &map_temp) { + // Todo; + std::map :: iterator iter_map_data; + iter_map_data = map_temp.find("GRUB_USER"); + if (iter_map_data != map_temp.end()) { + string value = iter_map_data->second; + if (value.length() != 0) { + Utils::str_replace_all(value, " ",""); + Utils::str_replace_all(value, "\"",""); + chbSecurityLogin->set_active(1); + entrySecurityLogin->set_sensitive(true); + entrySecurityLogin->set_text(value); + } + else { + chbSecurityLogin->set_active(0); + entrySecurityLogin->set_text(""); + entrySecurityLogin->set_sensitive(false); + } + } + else { + chbSecurityLogin->set_active(0); + entrySecurityLogin->set_text(""); + entrySecurityLogin->set_sensitive(false); + } +} + +void MainWindow::set_password_protec() { + bool index = chbPasswordProtecc->get_active(); + string key = ""; + if (index == false){ + key = ""; + } + else if (index == true) { + key = entryPasswordProtecc->get_text(); + } + if (key != "************") { + map_cmd_selection["GRUB_PASSWORD"] = key; + } +} + +void MainWindow::get_password_protec(std::map &map_temp) { + std::map :: iterator iter_map_data; + iter_map_data = map_temp.find("GRUB_PASSWORD"); + if (iter_map_data != map_temp.end()) { + string value = iter_map_data->second; + if (value.length() != 0) { + Utils::str_replace_all(value, "\"",""); + chbPasswordProtecc->set_active(1); + entryPasswordProtecc->set_text("************"); + entryPasswordProtecc->set_sensitive(true); + } + else{ + chbPasswordProtecc->set_active(0); + entryPasswordProtecc->set_text(""); + } + } + else { + chbPasswordProtecc->set_active(-1); + } +} + +string MainWindow::template_item_selected(int size, Glib::RefPtr &list_store) { + string cmds = ""; + for (int index = 0; index < size; index++) { + Gtk::TreeModel::Row row = list_store->children()[index]; + if(row) { + if (row[m_columns.check_button] == true) { + cmds += row[m_columns.name] + " "; + } + } + } + cmds = "\"" + cmds + "\""; + return cmds; +} + + +vector MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m) { + std::array, 5> arr_view = Utils::read_csv(string(path_resources) + "/" + file_name); + std::vector vec_Option = arr_view[0]; + for (size_t index = 0; index < vec_Option.size(); index++) { + + this->view_add_cell(row, list_store_m , arr_view, index); + } + return vec_Option; +} + +void MainWindow::view_add_colums(Gtk::TreeView &treeView) { + treeView.append_column_editable(str_active, m_columns.check_button); + treeView.append_column(str_option, m_columns.name); + treeView.append_column(str_description, m_columns.description); +} + +void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m , std::array, 5> &arr_view , size_t index) { + row = *(list_store_m->append()); + bool flag_chb = false; + string name = arr_view[0][index]; + row[m_columns.check_button] = flag_chb; + row[m_columns.name] = _(name.c_str()); + row[m_columns.description] = _(arr_view[1][index].c_str()); +} + +void MainWindow::get_builder() { + builder->get_widget("lblHeaderAboutTopic", lblHeaderAboutTopic); + builder->get_widget("chbLoadVariantSelectionTimer", chbLoadVariantSelectionTimer); + builder->get_widget("lblInfoCommand", lblInfoCommand); + builder->get_widget("lblInfoCommand1", lblInfoCommand1); + builder->get_widget("lblInfoCommand2", lblInfoCommand2); + builder->get_widget("lblInfoDefaultDonw", lblInfoDefaultDonw); + builder->get_widget("lblInfoSeconds", lblInfoSeconds); + builder->get_widget("lblLoadMenu", lblLoadMenu); + builder->get_widget("lblInfoInputTerminal", lblInfoInputTerminal); + builder->get_widget("lblInfoOutputTerminal", lblInfoOutputTerminal); + builder->get_widget("lblInfoSeconds", lblInfoSeconds); + builder->get_widget("lblHeaderName", lblHeaderName); + builder->get_widget("lblInfoHead", lblInfoHead); + + builder->get_widget("spbSecond", spbSecond); + builder->get_widget("entryKernel", entryKernel); + builder->get_widget("entryIPT", entryIPT); + builder->get_widget("entryOTT", entryOTT); + + builder->get_widget("boxColor", boxColor); + builder->get_widget("boxWidgetAll", boxWidgetAll); + + builder->get_widget("aboutWindows", aboutWindows); + builder->get_widget("btnSynopsis", btnSynopsis); + builder->get_widget("btnAbout", btnAbout); + builder->get_widget("btnLoadLocal", btnLoadLocal); + builder->get_widget("btnLoadGlob", btnLoadGlob); + builder->get_widget("btnSaveLocalGlob", btnSaveLocalGlob); + builder->get_widget("btnSaveLocal", btnSaveLocal); + builder->get_widget("btnSaveGlob", btnSaveGlob); + builder->get_widget("btnSettings", btnSettings); + builder->get_widget("btnLoad", btnLoad); + builder->get_widget("btnSave", btnSave); + builder->get_widget("boxButton", boxButton); + builder->get_widget("boxSave", boxSave); + builder->get_widget("boxInfoError", boxInfoError); + builder->get_widget("lblWarning", lblWarning); + builder->get_widget("imgInfo", imgInfo); + builder->get_widget("btnBoxAboutDialog", btnBoxAboutDialog); + builder->get_widget("treeViewKernel", treeViewKernel); + builder->get_widget("treeViewOTT", treeViewOTT); + builder->get_widget("treeViewIPT", treeViewIPT); + builder->get_widget("imgBG", imgBG); + builder->get_widget("overHead", overHead); + builder->get_widget("lblDownloadMode", lblDownloadMode); + builder->get_widget("cmbDownloadMode", cmbDownloadMode); + builder->get_widget("chbSecurityLogin", chbSecurityLogin); + builder->get_widget("chbPasswordProtecc", chbPasswordProtecc); + builder->get_widget("entryPasswordProtecc", entryPasswordProtecc); + builder->get_widget("entrySecurityLogin", entrySecurityLogin); + builder->get_widget("cmbDefaultDonw", cmbDefaultDonw); + #ifdef WEBKIT_FOUND + builder->get_widget("wndWeb", wndWeb); + #endif + builder->get_widget("lblHeadeWndWeb", lblHeadeWndWeb); + + builder->get_widget("lblwebHeaderName", lblwebHeaderName); + builder->get_widget("lblhelpText", lblhelpText); + builder->get_widget("lblhelpHeader", lblhelpHeader); + builder->get_widget("chkAlwaysOpenHelp", chkAlwaysOpenHelp); + builder->get_widget("btnReadHelp", btnReadHelp); + builder->get_widget("btnCancelHelp", btnCancelHelp); + builder->get_widget("wndShowWeb", wndShowWeb); + +} + +void MainWindow::localization(){ + time_t now = time(0); + tm *ltm = localtime(&now); + unsigned int year = 1900+ ltm->tm_year; + string str_authors = string(copyright) + to_string(year); + aboutWindows->set_program_name(name_app); + aboutWindows->set_copyright(str_authors); + aboutWindows->set_comments(name_app); + aboutWindows->set_website(web_url); + aboutWindows->set_version(_(version_application.c_str())); + aboutWindows->set_website_label(project_Home_page); + lblInfoHead->set_text(configuring_system_boot); + lblHeaderName->set_text(name_app); + aboutWindows->set_comments(system_boot); + lblHeaderAboutTopic->set_label(str_about); + aboutWindows->set_website_label(project_Home_page); + lblInfoCommand->set_text(command_line_parameters); + lblInfoCommand1->set_text(command_line_parameters); + lblInfoCommand2->set_text(command_line_parameters); + lblInfoDefaultDonw->set_text(load_default); + lblInfoSeconds->set_text(seconds); + lblLoadMenu->set_text(download_menu); + lblInfoInputTerminal->set_text(terminal_for_input); + lblInfoOutputTerminal->set_text(terminal_for_output); + chbLoadVariantSelectionTimer->set_label(boot_selection_menu_timer); + btnSynopsis->set_label(str_help); + btnAbout->set_label(str_about_1); + lblHeadeWndWeb->set_text(name_app); + btnSaveLocalGlob->set_label(save_all); + btnSaveLocal->set_label(save_local); + btnSaveGlob->set_label(save_global); + btnLoadGlob->set_label(load_global); + btnLoadLocal->set_label(load_local); + btnSave->set_label(str_save); + btnLoad->set_label(str_load); + this->set_title(name_app); + // Todo: check + entrySecurityLogin->set_tooltip_text(loading_animation_without); + entryPasswordProtecc->set_tooltip_text(user_password_configuration_edit_mode); + chbSecurityLogin->set_tooltip_text(loading_animation_without); + chbPasswordProtecc->set_tooltip_text(user_password_configuration_edit_mode); + lblDownloadMode->set_text(boot_screen_display_mode); + chbSecurityLogin->set_label(boot_menu_user_name); + chbPasswordProtecc->set_label(boot_menu_user_password); + cmbDownloadMode->append(loading_animation_with); + cmbDownloadMode->append(loading_animation_without); + cmbDownloadMode->append(no_loading_animation); + cmbDownloadMode->append(lack_loading_animation); + cmbDefaultDonw->append(last_successful_upload); + + lblhelpHeader->set_text(read_documentation_web); + lblhelpText->set_text(_(redirected_documentation)); + btnReadHelp->set_label(read_online); + btnCancelHelp->set_label(cancel); + chkAlwaysOpenHelp->set_label(always_redirect); + lblwebHeaderName->set_label(name_app); +} + +vector MainWindow::get_setting_entry_all(string key, std::map * map_temp) { + vector vec_params; + std::map :: iterator iter_map_data; + iter_map_data = (*map_temp).find(key); + if (iter_map_data != (*map_temp).end()) { + string value = iter_map_data->second; + if (value.length() != 0) { + Utils::str_replace_all(value, "\"", ""); + vec_params = Utils::split(value, ' '); + Utils::str_replace_all(value, " ", ", "); + Utils::str_remove(value, ","); + (*map_temp)[key] = value; + } + } + return vec_params; +} + +bool MainWindow::focus_out_txt_password(GdkEventFocus*) { + if (entryPasswordProtecc->get_text().length() == 0) { + info_status_app(info_box_error_css); + imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(enter_password); + boxSave->set_sensitive(false); + } + else { + info_status_app(info_box_ok_css); + imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(""); + boxSave->set_sensitive(true); + string key = entryPasswordProtecc->get_text(); + if (key != "************") { + map_cmd_selection["GRUB_PASSWORD"] = key; + } + + } + return true; +} +bool MainWindow::focus_out_txt_login(GdkEventFocus*) { + if (entrySecurityLogin->get_text().length() == 0) { + info_status_app(info_box_error_css); + imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(enter_login); + boxSave->set_sensitive(false); + } + else { + info_status_app(info_box_ok_css); + imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(""); + map_cmd_selection["GRUB_USER"] = entrySecurityLogin->get_text(); + boxSave->set_sensitive(true); + } + return true; +} + +bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) { + this->set_entry_to_tree_view(list_store_kernel, *entryKernel, vec_Option_kernel, size_kernel); + return true; +} + +bool MainWindow::focus_out_txt_IPT(GdkEventFocus*) { + this->set_entry_to_tree_view(list_store_IPT, *entryIPT, vec_Option_IPT, size_IPT); + return true; +} +bool MainWindow::focus_out_txt_OTT(GdkEventFocus*) { + this->set_entry_to_tree_view(list_store_OTT, *entryOTT, vec_Option_OTT, size_OTT); + return true; +} + +void MainWindow::set_entry_to_tree_view(Glib::RefPtr &list_store, Gtk::Entry &entry, std::vector &vec_Option, int size) { + flag_blocked_tree_view = true; + vector vec_params; + std::string text = entry.get_text(); + Utils::str_replace_all(text, " ", ""); + vec_params = Utils::split(text, ','); + for (auto &name: vec_Option) { + this->set_row(list_store, size, name, false); + } + for (auto &name: vec_params) { + this->set_row(list_store, size, name, true); + } + flag_blocked_tree_view = false; +} + +void MainWindow::get_menu_boot(std::map &map_temp) { + std::map :: iterator iter_map_data; + iter_map_data = map_temp.find("GRUB_TIMEOUT"); + if (iter_map_data != map_temp.end()) { + if (iter_map_data->second.length() > 0) { + spbSecond->set_value(atoi(iter_map_data->second.c_str())); + chbLoadVariantSelectionTimer->set_active(true); + spbSecond->set_sensitive(true); + lblInfoSeconds->set_sensitive(true); + } + else { + spbSecond->set_value(1); + chbLoadVariantSelectionTimer->set_active(false); + spbSecond->set_sensitive(false); + lblInfoSeconds->set_sensitive(true); + } + } + else { + spbSecond->set_value(1); + chbLoadVariantSelectionTimer->set_active(false); + spbSecond->set_sensitive(false); + lblInfoSeconds->set_sensitive(true); + } +} + +void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove) { + string cmds = entry.get_text(); + Utils::str_remove(cmds, ","); + if (cmds.length() != 0) { + cmd_settings += "\"" + cmds + "\""; + Utils::str_replace_all(cmd_settings, " \"", "\""); + obj_process_system.call(cmd_settings, ""); + } + else { + obj_process_system.call(cmd_remove, ""); + } + +} + +void MainWindow::event(){ + btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();}); + chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;}); + btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser)); + btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show)); + btnAbout->signal_activate().connect([&]() {aboutWindows->show();}); + btnLoadLocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_local_cfg)); + btnLoadGlob->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_globl_cfg)); + btnSaveLocalGlob->signal_activate().connect([&]() {wrapper_save_all_cfg();}); + btnSaveLocal->signal_activate().connect([&]() {wrapper_save_local_cfg();}); + btnSaveGlob->signal_activate().connect([&]() {wrapper_save_global_cfg();}); + entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel)); + entryIPT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT)); + entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT)); + entrySecurityLogin->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_login)); + entryPasswordProtecc->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_password)); + chbPasswordProtecc->signal_toggled().connect([&]() {change_password_protecc();}); + chbSecurityLogin->signal_toggled().connect([&]() {change_security_login();}); + if (this->check_root() == 0) { + Glib::RefPtr treeViewKernelModel = treeViewKernel->get_model(); + treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel)); + Glib::RefPtr treeViewIPTModel = treeViewIPT->get_model(); + treeViewIPTModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_IPT)); + Glib::RefPtr treeViewOTTModel = treeViewOTT->get_model(); + treeViewOTTModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_OTT)); + entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel)); + entryIPT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT)); + entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT)); + } + this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit)); + chbLoadVariantSelectionTimer->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_active_boot_second)); +} + +bool MainWindow::gui_exit(GdkEventAny*) { + exit(1); + return true; +} + +void MainWindow::change_security_login() { + bool index = chbSecurityLogin->get_active(); + if (index == false) { + entrySecurityLogin->set_sensitive(false); + entrySecurityLogin->set_text(""); + boxSave->set_sensitive(true); + info_status_app(info_box_ok_css); + imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(""); + } + else if (index == true) { + entrySecurityLogin->set_sensitive(true); + entrySecurityLogin->set_text(""); + boxSave->set_sensitive(true); + } +} + +void MainWindow::get_default_load(std::map &map_temp) { + std::map :: iterator iter_map_data; + iter_map_data = map_temp.find("GRUB_DEFAULT"); + if (iter_map_data != map_temp.end()) { + string value = iter_map_data->second; + if (value.length() != 0) { + cmbDefaultDonw->set_active_text(value); + } + else { + cmbDefaultDonw->set_active(0); + } + } + else { + cmbDefaultDonw->set_active(-1); + } +} + +void MainWindow::change_password_protecc() { + // Todo; + bool index = chbPasswordProtecc->get_active(); + if (index == false) { + entryPasswordProtecc->set_sensitive(false); + entryPasswordProtecc->set_text(""); + boxSave->set_sensitive(true); + info_status_app(info_box_ok_css); + imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); + lblWarning->set_text(""); + } + else if (index == true) { + entryPasswordProtecc->set_sensitive(true); + entryPasswordProtecc->set_text(""); + boxSave->set_sensitive(true); + } + else { + boxSave->set_sensitive(true); + } +} + +void MainWindow::set_active_boot_second() { + spbSecond->set_sensitive(chbLoadVariantSelectionTimer->get_active()); + lblInfoSeconds->set_sensitive(chbLoadVariantSelectionTimer->get_active()); + if (chbLoadVariantSelectionTimer->get_active()) { + int second = spbSecond->get_value(); + map_cmd_selection["GRUB_TIMEOUT"] = to_string(second); + } + else { + spbSecond->set_value(1); + map_cmd_selection["GRUB_TIMEOUT"] = ""; + } +} + +void MainWindow::wrapper_save_all_cfg() { + this->set_data_cfg(); + bool _flag_save_global1 = true; + bool _flag_save_local1 = true; + if (flag_save_global == false) { + _flag_save_global1 = this->save_template(global_save, global_remove , "global"); + } + if (flag_save_local == false) { + _flag_save_local1 = this->save_template(system_save, system_remove , "system"); + } + if (_flag_save_global1 && _flag_save_local1) { + this->info_warning_error(5); + } + else { + info_warning_error(4); + } + map_global_cmd_selection = map_cmd_selection; + map_local_cmd_selection = map_cmd_selection; + +} + +void MainWindow::wrapper_save_global_cfg() { + this->set_data_cfg(); + if (this->save_template(global_save, global_remove , "global")) { + this->info_warning_error(5); + } + else { + info_warning_error(3); + } + map_global_cmd_selection = map_cmd_selection; + +} + +bool MainWindow::save_template(string cmd, string cmd_remove, string flag_save) { + bool flag_no_save = true; + obj_save.set_data_local(map_local_cmd_selection); + obj_save.set_data_global(map_global_cmd_selection); + obj_save.set_data_gui(map_cmd_selection); + obj_save.set_vec_params(vec_param_names); + obj_save.save_one_cmd(cmd, cmd_remove ,flag_save); + vector obj_vec_error = obj_save.get_error(); + flag_no_save = obj_save.get_state_save(); + return flag_no_save; +} + +void MainWindow::wrapper_save_local_cfg() { + this->set_data_cfg(); + if (this->save_template(system_save, system_remove , "system")) { + this->info_warning_error(5); + } + else { + info_warning_error(2); + } + map_local_cmd_selection = map_cmd_selection; +} + + +void MainWindow::set_data_cfg() { + string str_flags = entryKernel->get_text(); + Utils::str_remove(str_flags, ","); + Utils::str_replace_all(str_flags, " \"", "\""); + map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; + str_flags = entryIPT->get_text(); + Utils::str_remove(str_flags, ","); + Utils::str_replace_all(str_flags, " \"", "\""); + map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; + str_flags = entryOTT->get_text(); + Utils::str_remove(str_flags, ","); + Utils::str_replace_all(str_flags, " \"", "\""); + map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; + if (chbLoadVariantSelectionTimer->get_active()) { + int second = spbSecond->get_value(); + map_cmd_selection["GRUB_TIMEOUT"] = to_string(second); + } + else { + map_cmd_selection["GRUB_TIMEOUT"] = ""; + } + int index = cmbDefaultDonw->get_active_row_number(); + if (index != 0 && index != -1) { + map_cmd_selection["GRUB_DEFAULT"] = cmbDefaultDonw->get_active_text(); + } + else { + map_cmd_selection["GRUB_DEFAULT"] = ""; + } + this->set_download_mode(); + this->set_security_login(); + this->set_password_protec(); +} + +void MainWindow::download_globl_cfg() { + this->load_template(&map_global_cmd_selection, global_load); + info_warning_error(1); + map_cmd_selection = map_global_cmd_selection; +} + +void MainWindow::download_local_cfg() { + this->load_template(&map_local_cmd_selection, system_load); + info_warning_error(0); + map_cmd_selection = map_local_cmd_selection; +} + +void MainWindow::load_template(std::map* map_temp, string cmd) { + if (cmd.find("system") != string::npos) { + this->init_dict("system"); + } + else { + this->init_dict("global"); + } + entryKernel->set_text(""); + entryOTT->set_text(""); + entryIPT->set_text(""); + *map_temp = obj_load.get_load_data(*map_temp, cmd); + this->get_menu_boot(*map_temp); + this->get_setting_entry_all("GRUB_CMDLINE_LINUX", map_temp); + this->get_setting_entry_all("GRUB_TERMINAL_INPUT", map_temp); + this->get_setting_entry_all("GRUB_TERMINAL_OUTPUT", map_temp); + this->set_row_all(*map_temp, list_store_kernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX"); + this->set_row_all(*map_temp, list_store_IPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT"); + this->set_row_all(*map_temp, list_store_OTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT"); + this->get_download_mode(*map_temp); + this->get_security_login(*map_temp); + this->get_password_protec(*map_temp); + this->get_default_load(*map_temp); + this->set_entry(entryKernel, *map_temp, "GRUB_CMDLINE_LINUX"); + this->set_entry(entryIPT, *map_temp, "GRUB_TERMINAL_INPUT"); + this->set_entry(entryOTT, *map_temp, "GRUB_TERMINAL_OUTPUT"); + string str_last_launched_os_ubconfig = (*map_temp)["GRUB_DEFAULT"]; + if (str_last_launched_os_ubconfig.length() != 0) { + cmbDefaultDonw->set_active_text(str_last_launched_os_ubconfig); + } + else { + cmbDefaultDonw->set_active_text(str_last_launched_os); + } + +} + +void MainWindow::set_entry(Gtk::Entry* entry , std::map &map_temp, string key) { + if (map_temp.find(key) != map_temp.end()) { + string value = map_temp[key]; + Utils::str_replace_all(value, "\"", ""); + Utils::str_replace_all(value, " ", ", "); + entry->set_text(value); + } + else { + entry->set_text(""); + } + +} + +void MainWindow::init_dict(string flag_load) { + std::map map_cmd_selection_n; + map_cmd_selection_n["GRUB_TIMEOUT"] = ""; + map_cmd_selection_n["GRUB_CMDLINE_LINUX"] = ""; + map_cmd_selection_n["GRUB_TERMINAL_INPUT"] = ""; + map_cmd_selection_n["GRUB_TERMINAL_OUTPUT"] = ""; + map_cmd_selection_n["GRUB_BOOT_SILENT"] = ""; + map_cmd_selection_n["GRUB_USER"] = ""; + map_cmd_selection_n["GRUB_PASSWORD"] = ""; + map_cmd_selection_n["GRUB_DEFAULT"] = ""; + map_cmd_selection = map_cmd_selection_n; + if (flag_load == "global") { + map_global_cmd_selection = map_cmd_selection_n; + } + else if (flag_load == "system") { + map_local_cmd_selection = map_cmd_selection_n; + } +} + +void MainWindow::set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size,string key) { + for (auto &name: list_params) { + this->set_row(list_store, size, name, false); + } + string value = map_cmd[key]; + Utils::str_replace_all(value, "\"", ""); + vector vec_params = Utils::split(value, ' '); + for (auto &name: vec_params) { + this->set_row(list_store, size, name, true); + } +} + +void MainWindow::set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox) { + for (int index = 0; index < size; index++) { + Gtk::TreeModel::Row row = list_store->children()[index]; + if(row) { + if (row[m_columns.name] == name) { + row[m_columns.check_button] = flag_chbox; + } + } + } +} + +void MainWindow::synopsis_show() { + if (flag_open_browser == true) { + this->open_browser(); + } + else { + wndShowWeb->show_all(); + } + +} + +void MainWindow::open_browser() { + #ifdef WEBKIT_FOUND + webkit_web_view_load_uri(one, link_doc); + wndWeb->show_all(); + #else + this->template_open_browser(); + #endif +} + +void MainWindow::template_open_browser() { + string cmd = cmd_xdg + string(_(link_doc)) + " &"; + string buf = ""; + if (geteuid() == 0) { + string response_user = getlogin(); + int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1; + auto size = static_cast(size_s); + std::unique_ptr buf(new char[ size ]); + std::snprintf( buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str() ); + cmd = std::string( buf.get(), buf.get() + size - 1 ); + } + index_error = system(cmd.c_str()); +} +void MainWindow::info_status_app(string stule) { + boxInfo->remove_class(info_box_ok_css); + boxInfo->remove_class(info_box_error_css); + boxInfo->add_class(stule); +} + +void MainWindow::info_warning_error(int mess) { + if (obj_load.get_count_error() > 0 || obj_save.get_count_error() > 0) { + info_status_app(info_box_error_css); + imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); + string mess_error = ""; + if (mess == 0) { + mess_error = string(local_read_error) + str_cmd_error; + lblWarning->set_text(mess_error); + } + else if (mess == 1) { + mess_error = string(global_read_error) + str_cmd_error; + lblWarning->set_text(mess_error); + } + else if (mess == 2) { + mess_error = string(local_write_error) + str_cmd_error; + lblWarning->set_text(mess_error); + } + else if (mess == 3) { + mess_error = string(global_write_error) + str_cmd_error; + lblWarning->set_text(mess_error); + } + else if (mess == 4) { + mess_error = string(error_save_all) + str_cmd_error; + lblWarning->set_text(mess_error); + } + str_cmd_error = ""; + obj_load.set_count_error(0); + obj_save.set_count_error(0); + } + else { + info_status_app(info_box_ok_css); + imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); + if (mess == 0) { + lblWarning->set_text(local_load_ok); + } + else if (mess == 1) { + lblWarning->set_text(global_load_ok); + } + else if (mess == 2) { + lblWarning->set_text(local_ok_written); + } + else if (mess == 3) { + lblWarning->set_text(global_ok_written); + } + else if (mess == 4) { + lblWarning->set_text(successfully_save_all); + } + else if (mess == 5) { + lblWarning->set_text(nothing_save); + } + } +} +MainWindow::~MainWindow() { + #ifdef WEBKIT_FOUND + free(one); + #endif +} + +void MainWindow::add_CSS(){ + Glib::RefPtr cssProvider = Gtk::CssProvider::create(); + cssProvider->load_from_path(path_css); + Glib::RefPtr styleContext = Gtk::StyleContext::create(); + Glib::RefPtr screen = Gdk::Screen::get_default();//get default screen + styleContext->add_provider_for_screen(screen, cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);//add provider for screen in all application + Glib::RefPtr lblInfoHead_css = lblInfoHead->get_style_context(); + Glib::RefPtr boxButton_css = boxButton->get_style_context(); + Glib::RefPtr boxSave_css = boxSave->get_style_context(); + boxInfo = boxInfoError->get_style_context(); + imgBG->set(path_img_head_background); + if (socket_trd_id_I == 0 && socket_ext_id_I == 0){ + boxButton_css->add_class("bkim_no_plug"); + boxSave_css->add_class("bkim_no_plug"); + } + lblInfoHead_css->add_class("textHead"); +} + +void help() { + string version = string(str_version) + version_application + "\n"; + cout << version; + string help; + cout << str_help_h; + +} + + + + + + diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h new file mode 100644 index 0000000..1d2871a --- /dev/null +++ b/source/ubl-settings-bootloader.h @@ -0,0 +1,329 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ubl-util-standard.c" +#include "util.h" +#include "save.h" +#include "load.h" +#include +#include "ubl-settings-bootloader-cm.h" +#ifdef WEBKIT_FOUND +#include +#endif + +#include "my_process.h" +using namespace std; + +extern int socket_ext_id_I; +extern int socket_trd_id_I; +extern string version_application; +extern bool flag_save; +extern bool flag_save_local; +extern bool flag_save_global; +extern bool flag_load_global; +extern bool flag_lock_help; +void me_thread(string cmd); + +#define copyright _("Copyright © UBSoft LLC, 2022 - ") +#define name_app _("ubl-settings-bootloader") +#define website _("https://wiki.ublinux.com") +#define project_Home_page _("Project Home Page") +#define configuring_system_boot _("Configuring system boot parameters") +#define system_boot _("System boot") +#define str_about _("About ubl-settings-bootloader") +#define command_line_parameters _("Command line parameters:") +#define load_default _("Load default:") +#define seconds _("seconds") +#define download_menu _("Download menu") +#define terminal_for_input _("Terminal for input") +#define terminal_for_output _("Terminal for output") +#define boot_selection_menu_timer _("Boot selection menu timer") +#define str_help _("Help") +#define str_about_1 _("About") +#define str_save _("Save") +#define str_load _("Load") +#define save_all _("Save in global and local configuration") +#define save_local _("Save in local configuration") +#define save_global _("Save in global configuration") +#define load_global _("Load global configuration") +#define load_local _("Load local configuration") +#define read_online _("Read online") +#define cancel _("Cancel") +#define always_redirect _("Always redirect") +#define boot_screen_display_mode _("Boot screen display mode:") +#define no_loading_animation _("No loading animation, full log") +#define boot_menu_user_name _("Boot menu user name:") +#define boot_menu_user_password _("Boot menu user password:") +#define last_successful_upload _("Last successful upload") +#define read_documentation_web _("Would you like to read documentation in the Web?") +#define redirected_documentation _("You will be redirected to documentation site, where user help pages are ""translated and supported by community.") +#define user_name_configuration_editing_code _("User name to enter boot configuration editing mode") +#define user_password_configuration_edit_mode _("User password to enter boot configuration edit mode") +#define loading_animation_with _("Loading animation with the magazine") +#define loading_animation_without _("Loading animation without a magazine") +#define lack_loading_animation _("Lack of loading animation with the output of the abbreviated log") +#define web_url _("https://wiki.ublinux.com") +#define enter_password _("Enter your password") +#define enter_login _("Enter login") +#define str_version _("ubl-settings-bootloader version: ") +#define local_read_error _("Local configuration reading error") +#define global_read_error _("Global configuration read error") +#define local_write_error _("Local configuration write error") +#define global_write_error _("Global configuration write error") +#define error_save_all _("Error saved local and global configuration") +#define local_load_ok _("Local configuration downloaded successfully") +#define global_load_ok _("Global configuration downloaded successfully") +#define local_ok_written _("Local configuration successfully written") +#define global_ok_written _("Global configuration successfully written") +#define successfully_save_all _("Successfully saved local and global configuration") +#define nothing_save _("Nothing to save!") +#define program_as_root _("The program must be run as root") +#define str_active _("Active") +#define str_option _("Option") +#define str_description _("Description") +#define str_help_h _("GTK settings bootloader for UBLinux\n""\n""Usage: ubl-settings-bootloader [OPTIONS...]\n""Options:\n"" -h, --help\t Show this help\n"" -V, --version\t Show package version\n"" --lock-help Lock utility help\n"" --lock-save Lock saving local and global configuration\n"" --lock-save-local Lock save global configuration\n"" --lock-save-global Lock load global configuration\n"" --lock-load-global Lock load global configuration\n") +#define no_recognized _("Argument not recognized\n") + + +#define global_load "ubconfig --default --source global get boot" +#define system_load "ubconfig --default --source system get boot" +#define global_save "ubconfig --target global set boot " +#define system_save "ubconfig --target system set boot " +#define global_remove "ubconfig --target global remove boot " +#define system_remove "ubconfig --target system remove boot " +#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-bootloader" +#define cmd_xdg "xdg-open " +#define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \"" +#define icon_checked "com.ublinux.ubl-settings-bootloader.checked" +#define icon_warning "com.ublinux.ubl-settings-bootloader.warning" +#define kernel_csv "cmdline-linux.csv" +#define IPT_csv "grub-terminal-input.csv" +#define OTT_csv "grub-terminal-output.csv" +#define path_app "/usr/bin/" +#define path_glade "/usr/share/ubl-settings-bootloader/ui/ubl-settings-bootloader.glade" +#define path_css "/usr/share/ubl-settings-bootloader/css/ubl-settings-bootloader.css" +#define app_name "ubl-settings-bootloader" +#define path_resources "/usr/share/ubl-settings-bootloader" +#define path_img_head_background "/usr/share/ubl-settings-bootloader/images/logo-background.png" +#define cmd_pars_list_os "/usr/lib/ublinux/scripts/grub-functions exec_get_all_menuentry" +#define cmd_last_launched_os "/usr/lib/ublinux/scripts/grub-functions exec_get_last_menuentry" +#define info_box_ok_css "boxInfoMessOK" +#define info_box_error_css "boxInfoMessError" + +class CmdArgParser : public Glib::OptionGroup +{ +public: + CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help); + ::Window GetSocketID() const; + +private: + int m_socketID = 0; + +}; + +class MainWindow : public Gtk::ApplicationWindow { + public: + class ModelColumns : public Gtk::TreeModel::ColumnRecord { + public: + ModelColumns() {add(check_button), add(name); add(description); } + //Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn check_button; + Gtk::TreeModelColumn name; + Gtk::TreeModelColumn description; + }; + ModelColumns m_columns; + Glib::RefPtr builder; + Gtk::SpinButton *spbSecond; + Gtk::Label *lblInfoSeconds; + Gtk::Label *lblInfoDefaultDonw; + Gtk::Label *lblInfoCommand; + Gtk::Label *lblInfoCommand1; + Gtk::Label *lblHeaderAboutTopic; + Gtk::Label *lblInfoCommand2; + Gtk::Label *lblLoadMenu; + Gtk::Label *lblInfoInputTerminal; + Gtk::Label *lblInfoOutputTerminal; + Gtk::Label *lblHeaderName; + Gtk::Label *lblInfoHead; + Gtk::CheckButton *chbVgaText; + Gtk::CheckButton *chbLoadVariantSelectionTimer; + Gtk::Entry *entryKernel; + Gtk::Entry *entryIPT; + Gtk::Entry *entryOTT; + Gtk::Box *boxColor; + Gtk::AboutDialog *aboutWindows; + Gtk::MenuItem *btnAbout; + Gtk::MenuItem *btnSynopsis; + Gtk::MenuItem *btnSaveLocalGlob; + Gtk::MenuItem *btnSaveLocal; + Gtk::MenuItem *btnSaveGlob; + Gtk::MenuItem *btnLoadGlob; + Gtk::MenuItem *btnLoadLocal; + Gtk::Button *btnLoad; + Gtk::Button *btnSave; + Gtk::Button *btnSettings; + Gtk::Widget *boxButton; + Gtk::Widget *boxSave; + Gtk::Box *boxInfoError; + Gtk::Box *boxWidgetAll; + Gtk::Label *lblWarning; + Gtk::Image *imgInfo; + Gtk::ButtonBox *btnBoxAboutDialog; + Gtk::TreeView *treeViewKernel; + Gtk::TreeView *treeViewIPT; + Gtk::TreeView *treeViewOTT; + Gtk::Image *imgBG; + Gtk::Overlay *overHead; + Gtk::ComboBoxText *cmbDefaultDonw; + Gtk::ComboBoxText *cmbDownloadMode; + Gtk::CheckButton *chbSecurityLogin; + Gtk::CheckButton *chbPasswordProtecc; + Gtk::Entry *entrySecurityLogin; + Gtk::Entry *entryPasswordProtecc; + Gtk::Label *lblHeadeWndWeb; + + Gtk::Label *lblwebHeaderName; + Gtk::Label *lblhelpText; + Gtk::Label *lblhelpHeader; + Gtk::CheckButton *chkAlwaysOpenHelp; + Gtk::Button *btnReadHelp; + Gtk::Button *btnCancelHelp; + Gtk::Window *wndShowWeb; + + std::vector vec_Option_kernel; + std::vector vec_Option_IPT; + std::vector vec_Option_OTT; + + Glib::RefPtr list_store_kernel; + Glib::RefPtr list_store_IPT; + Glib::RefPtr list_store_OTT; + #ifdef WEBKIT_FOUND + Gtk::Window *wndWeb; + Gtk::Widget *three; + WebKitWebView *one; + #endif + + void set_entry_to_tree_view(Glib::RefPtr &list_store, Gtk::Entry &entry, std::vector &vec_Option, int size); + Gtk::TreeModel::Row row_kernel; + Gtk::TreeModel::Row row_IPT; + Gtk::TreeModel::Row row_OTT; + std::map map_cmd_selection; + std::map map_global_cmd_selection; + std::map map_local_cmd_selection; + + Gtk::Label *lblDownloadMode; + Lib_save::Save obj_save = Lib_save::Save(); + Lib_Load::Load obj_load = Lib_Load::Load(); + vector vec_param_names; + My_Process::My_Process_system obj_process_system = My_Process::My_Process_system(); + My_Process::My_Process_call obj_process_call = My_Process::My_Process_call(); + bool flag_load = false; + bool flag_save_all = false; + bool flag_blocked_tree_view = false; + bool flag_save_block = false; + bool flag_open_browser = false; + string str_last_launched_os = ""; + int index_error = 0; + size_t size_kernel = 0; + size_t size_IPT = 0; + size_t size_OTT = 0; + Glib::RefPtr boxInfo; + string str_cmd_error = ""; + template + struct Result{ + Type response; + int error; + }; + std::map map_cmd_error; + + MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); + MainWindow(Glib::RefPtr const& builder); + ~MainWindow(); + void open_browser(); + void get_menu_boot(std::map &map_temp); + void set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size,string key); + void set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox); + void get_builder(); + bool gui_exit(GdkEventAny*); + void init_dict(string flag_load); + void add_CSS(); + void show_pass(); + void localization(); + void event(); + void settings(); + string pars_last_launched_os(); + vector pars_os(vector &os_control_list); + void fn_event_intelMax1(); + void write_list_entry_os(vector &os_control_list); + void fn_event_intelMax4(); + void synopsis_show(); + void set_data_cfg(); + void set_active_boot_second(); + void get_download_mode(std::map &map_temp); + void view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m , std::array, 5> &arr_view, size_t index); + void wrapper_system(string cmd, string thread_str); + struct Result wrapper_call(string cmd); + void log_mess_error(string &cmd); + void wrapper_save_all_cfg(); + void wrapper_save_local_cfg(); + void wrapper_save_global_cfg(); + bool save_template(string cmd, string cmd_remove, string flag_save); + void view_add_colums(Gtk::TreeView &treeView); + vector read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m); + void download_local_cfg(); + void template_open_browser(); + void download_globl_cfg(); + void flag_block_gui(); + void info_status_app(string stule); + bool check_save(string flag_save, string key_name); + void info_warning_error(int mess); + int check_root(); + bool focus_out_txt_kernel(GdkEventFocus*); + bool focus_out_txt_IPT(GdkEventFocus*); + bool focus_out_txt_OTT(GdkEventFocus*); + void fill_in_view(); + void set_security_login(); + void get_security_login(std::map &map_temp); + bool check_flag_save(string flag_save); + void set_download_mode(); + void change_password_protecc(); + bool focus_out_txt_login(GdkEventFocus*); + void change_security_login(); + void get_default_load(std::map &map_temp); + bool focus_out_txt_password(GdkEventFocus*); + void get_password_protec(std::map &map_temp); + void set_password_protec(); + void set_entry(Gtk::Entry* entry , std::map &map_temp, string key); + void load_template(std::map* map_temp, string cmd); + vector get_setting_entry_all(string key, std::map * map_temp); + void cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove); + void item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&); + void item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&); + void item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&); + string template_item_selected(int size, Glib::RefPtr &list_store); +}; + +class SettingsPlug : public Gtk::Plug{ +public: + Gtk::Window *window; + SettingsPlug(::Window p_socketID, Glib::RefPtr builder); + +private: + Gtk::Widget *plugBox; + Gtk::Widget *parent; +}; + +void help(); + + diff --git a/source/ubl-settings-bootloader.h.in b/source/ubl-settings-bootloader.h.in new file mode 100644 index 0000000..17ba454 --- /dev/null +++ b/source/ubl-settings-bootloader.h.in @@ -0,0 +1 @@ +#cmakedefine WEBKIT_FOUND \ No newline at end of file diff --git a/source/ubl-util-standard.c b/source/ubl-util-standard.c new file mode 100644 index 0000000..3b753b1 --- /dev/null +++ b/source/ubl-util-standard.c @@ -0,0 +1,91 @@ +#include "ubl-util-standard.h" +#ifndef __cplusplus +#ifndef UBL_GET_STANDARD_UI +#define UBL_GET_STANDARD_UI + + +inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){ + returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*)); + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=LeftWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugLeft=plug; + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=RightWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugRight=plug; + } + return ret; +} + +#endif + +#else + + +inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){ + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj()); + {GdkScreen *screen = gtk_widget_get_screen(plug); + gtk_widget_set_app_paintable(plug,TRUE); + GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); + gtk_widget_set_visual(plug, colormap);} + {GdkScreen *screen = gtk_widget_get_screen(toplug); + gtk_widget_set_app_paintable(toplug,TRUE); + GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); + gtk_widget_set_visual(toplug, colormap);} + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim"); + gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim"); + gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar"); + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj()); + {GdkScreen *screen = gtk_widget_get_screen(plug); + gtk_widget_set_app_paintable(plug,TRUE); + GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); + gtk_widget_set_visual(plug, colormap);} + {GdkScreen *screen = gtk_widget_get_screen(toplug); + gtk_widget_set_app_paintable(toplug,TRUE); + GdkVisual *colormap = gdk_screen_get_rgba_visual(screen); + gtk_widget_set_visual(toplug, colormap);} + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim"); + gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim"); + gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar"); + } +} +#endif \ No newline at end of file diff --git a/source/ubl-util-standard.h b/source/ubl-util-standard.h new file mode 100644 index 0000000..3209625 --- /dev/null +++ b/source/ubl-util-standard.h @@ -0,0 +1,20 @@ +#ifndef __cplusplus +#include +#include + +typedef struct { + GtkWidget *plugLeft; + GtkWidget *plugRight; + + +} returnstruct; +static returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id); +#else +#include +#include +#include +#include + + +static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id); +#endif \ No newline at end of file diff --git a/source/util.cc b/source/util.cc new file mode 100644 index 0000000..3236cc1 --- /dev/null +++ b/source/util.cc @@ -0,0 +1,169 @@ +#include "util.h" + +namespace Utils { + +array, 5> read_csv(const string& filename) { + array, 5> array_vectors; + vector vec_option; + vector vec_opcision; + ifstream file(filename); + string line; + char delimiter = ','; + getline(file, line); + while (getline(file, line)) { + stringstream stream(line); + string option; + string opcision; + getline(stream, option, delimiter); + string line_local = stream.str(); + if (line_local.find("\"") != string::npos) { + string str_delimiter = "\""; + vector point = find_all(line_local, str_delimiter); + size_t len = point.size(); + if (len >= 2) { + int index_start = point[len-2]; + int index_end = point[len-1]; + opcision = line_local.substr(index_start, index_end); + index_end = opcision.find("\""); + if (opcision.find("\"") != string::npos) { + opcision.replace(index_end, opcision.length(), ""); + } + + } + else { + opcision = "error"; + } + + + } + else{ + getline(stream, opcision, delimiter); + } + + + vec_option.push_back(option); + vec_opcision.push_back(opcision); + } + + array_vectors[0] = vec_option; + array_vectors[1] = vec_opcision; + return array_vectors; +} + +string call(string cmd) { + FILE *fp; + int status; + char path[PATH_MAX] = {0}; + fp = popen(cmd.c_str(), "r"); + if (fp == NULL) { + exit(1); + } + while (fgets(path, PATH_MAX, fp) != NULL) { + break; + } + status = pclose(fp); + if (status == -1) { + exit(1); + } + return path; +} + +vector find_all(string &str_ntp, string substr) { + size_t index = 0; + vector sub_index; + while ((index = str_ntp.find(substr, index)) != std::string::npos) { + index += substr.length(); + sub_index.push_back(index); + } + return sub_index; +} + +void str_remove(std::string& source, std::string to_remove) { + string::size_type n = to_remove.length(); + for (string::size_type i = source.find(to_remove); + i != string::npos; + i = source.find(to_remove)) + source.erase(i, n); +} + +void str_replace_all(std::string& str_base, string str_find, string sReplacement) +{ + size_t pos = 0, fpos; + while ((fpos = str_base.find(str_find, pos)) != std::string::npos) + { + str_base.replace(fpos, str_find.size(), sReplacement); + pos = fpos + sReplacement.size(); + } +} +std::vector split(std::string text, char delim) { + std::string line; + std::vector vec; + std::stringstream ss(text); + while(std::getline(ss, line, delim)) { + vec.push_back(line); + } + return vec; +} +unsigned short read_uid_min_max(string filename, string search) { + std::string line; + int uid = 0; + string remove_tab = "\t"; + string remove_space = " "; + std::ifstream in(filename); // окрываем файл для чтения + if (in.is_open()){ + while (getline(in, line)){ + try{ + if (line.find(search) != string::npos && (line.find("SYS_"+search) == string::npos)) { + str_remove(line, search); + str_remove(line, remove_space); + str_remove(line, remove_tab); + uid = atoi(line.c_str()); + } + } + catch (int x) { + if (search == "UID_MIN"){ + uid = 1000; + } + else{ + uid = 65534; + } + + } + + } + } + else{ + if (search == "UID_MIN") { + uid = 1000; + } + else{ + uid = 65534; + } + } + in.close(); + return uid; + +} + +vector pars_users() { + vector vec_users; + unsigned short uid_min = read_uid_min_max("/etc/login.defs", "UID_MIN"); + unsigned short uid_max =read_uid_min_max("/etc/login.defs", "UID_MAX"); + while (true) { + errno = 0; + passwd* entry = getpwent(); + if (!entry) { + if (errno) { + break; + } + break; + } + if ((entry->pw_uid >= uid_min && entry->pw_uid < uid_max) || entry->pw_uid == 0) { + vec_users.push_back(string(entry->pw_name)); + } + } + endpwent(); + return vec_users; +} + +} \ No newline at end of file diff --git a/source/util.h b/source/util.h new file mode 100644 index 0000000..9044b95 --- /dev/null +++ b/source/util.h @@ -0,0 +1,51 @@ +#ifndef UTIL_H +#define UTIL_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +namespace Utils { +template +struct Result{ + Type response; + int error; +}; + +struct Passwd { + string user; + int uid; +}; + +std::array, 5> read_csv(const std::string& filename); +std::string call(std::string cmd); +vector find_all(string &str_ntp, string substr); +void str_remove(std::string& source, std::string to_remove); +void str_replace_all(string &str_base, string str_find, string str_replace); +std::vector split(std::string text, char delim); +unsigned short read_uid_min_max(string filename, string search); +vector pars_users(); +string read_passwd(string username); +int synopsis_show(string str_link); +} +#endif \ No newline at end of file diff --git a/ubl-settings-bootloader.css b/ubl-settings-bootloader.css new file mode 100644 index 0000000..ee3ba98 --- /dev/null +++ b/ubl-settings-bootloader.css @@ -0,0 +1,149 @@ +.textHead{ + text-shadow: 2px 2px @theme_bg_color; + color: @theme_text_color; +} +.boxInfoMessError{ + background-color: #ea9999; +} +.boxInfoMessOK{ + background-color: #f3f0ac; +} +.bannerbackground { + background-color: #404040; +} +.textHead{ + text-shadow: 1px 1px #ffffff; +} +.view_app { + background-color: @theme_bg_color; +} +.view_app.view.cell:selected { + background-color:@theme_selected_bg_color; + color:@theme_selected_text_color; + transition: 10ms ease-out; + border-radius: 3px; +} +#GnomeIcon{ + border-style:solid; + border-bottom-width: 1px; + border-image: linear-gradient(90deg, alpha(@theme_text_color,0.4) 55%, alpha(@theme_bg_color, 0) 100%); + border-image-slice: 1; +} + +#SepIcon{ + background-color: alpha(@theme_text_color, 0.6); +} + +#iconlabel { + font-size:14px; + font-weight: bold; + +} +.roundborder * { + border-width:0px; + border-radius:5px; +} +.noborder { + border: none; +} +.menu:hover { + border-color:alpha(@theme_text_color, 0.01); +} +.menu { + border-color:alpha(@theme_text_color, 0.01); +} +.menu:hover >* { + border-color:alpha(@theme_text_color, 0.01); +} +.menuitembottom{ + margin-top:0px; + margin-bottom:3px; +} +.menuitemmiddle{ + margin-top:0px; + margin-bottom:0px; +} + +.menuitemtop{ + margin-bottom:0px; +} +.menuitemtop *{ + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; +} +.menuitemmiddle *{ + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; +} +.menuitembottom *{ + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; +} +.menuitemtop:hover { + background:@theme_bg_color; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; +} +.menuitemmiddle:hover { + background:@theme_bg_color; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; +} +.menuitembottom:hover { + background:@theme_bg_color; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; + +} +.menuitemtop:hover* { + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; + background:@theme_selected_bg_color; + border-radius:2px; +} +.menuitemmiddle:hover* { + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; + background:@theme_selected_bg_color; + border-radius:2px; +} +.menuitembottom:hover* { + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; + background:@theme_selected_bg_color; + border-radius:2px; +} + +.workingbg, #workingbg { + background-color:@theme_base_color; +} +.workingbg.view.cell:selected { + background-color:@theme_selected_bg_color; +} +.workingbg.view.cell:hover { + background-color:darker(@theme_selected_bg_color); + color:@theme_selected_text_color; + border-radius:3px; +} +.bkim { + transition: 200ms ease-out; + background-image: none; +} +.noborder{ +border:none; +} + +.bkim{ +opacity:0.99; +border:none; +} + +.bkim_no_plug{ +background-color: transparent; +opacity:0.99; +} + + diff --git a/ubl-settings-bootloader.desktop b/ubl-settings-bootloader.desktop new file mode 100644 index 0000000..6e5f0d7 --- /dev/null +++ b/ubl-settings-bootloader.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=ubl-settings-bootloader +Name[ru]=Настройка загрузчика +GenericName=Настройка загрузчика +GenericName[ru]=Настройка загрузчика +Comment=Bootloader setup application +Comment[ru]=Приложение для настройки загрузчика +Type=Application +Exec=pkexec ubl-settings-bootloader +Icon=com.ublinux.ubl-settings-bootloader +Terminal=false +X-XfcePluggable=true +X-UBLPluggable=true +Categories=XFCE;GTK;Settings;DesktopSettings;X-UBL-SettingsManager;X-UBL-SystemSettings; \ No newline at end of file diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade new file mode 100644 index 0000000..c7a83df --- /dev/null +++ b/ubl-settings-bootloader.glade @@ -0,0 +1,1570 @@ + + + + + + both + True + + + + + True + True + True + + + True + False + + + True + False + label + + + False + True + 0 + + + + + True + True + False + True + right + + + + + + False + True + 1 + + + + + + + False + False + True + center + com.ublinux.ubl-settings-diskquota + dialog + True + True + ubl-settings-bootloader + 1.0 + Copyright © 2022 - 2023, UBSoft LLC + ubl-settings-bootloader + https://ublinux.ru/ + Project Home Page + Это приложение распространяется без каких-либо гарантий. +Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. + UBGroup + UBGroup + UBGroup + UBGroup + com.ublinux.ubl-settings-bootloader + True + gpl-2-0 + + + True + False + vertical + 2 + + + False + end + + + False + False + 1 + + + + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + ubl-settings-bootloader + + + + + + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + com.ublinux.ubl-settings-bootloader + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Running applications as a user with a +specified priority + + + + + + + + True + True + 1 + + + + + True + False + + + True + False + False + False + 4 + + + True + False + Load global configuration + + + + + + True + False + Load local configuration + + + + + + True + False + False + False + 4 + + + True + False + Help + + + + + + True + False + About + + + + + + True + False + False + False + 4 + + + True + False + Save to global and local configuration + + + + + + True + False + Save global configuration + + + + + + True + False + Save local configuration + + + + + + 750 + 550 + False + com.ublinux.ubl-settings-bootloader + + + True + False + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 25 + 1 + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + 81 + True + False + start + + + -1 + + + + + False + True + 1 + + + + + True + True + in + + + True + False + + + True + False + vertical + + + True + False + vertical + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + True + False + + + Boot selection menu timer + True + True + False + 3 + 5 + 3 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Seconds + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Default load + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Load screen display mode: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 3 + + + + + True + False + + + Boot menu user name: + True + True + False + 2 + 5 + 2 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + + + + False + True + 4 + + + + + True + False + + + Boot menu user password: + True + True + False + 2 + 5 + 2 + 5 + 6 + 6 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + + + + False + True + 5 + + + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Download menu + + + + + False + True + 0 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + -1 + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 10 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Parameters passed to the kernel + start + + + + + False + True + 1 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 1 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for input + start + + + + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + vertical + + + 140 + True + True + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for output + start + + + + + False + True + 3 + + + + + False + True + 5 + + + + + + + + + True + True + 2 + + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + + + + + True + False + + + True + False + + + True + True + False + True + True + menu2 + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Save + + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + False + True + True + menu1 + none + + + True + False + open-menu-symbolic + + + + + False + True + 1 + + + + + + False + True + 0 + + + + + end + 1 + + + + + True + False + + + True + True + False + True + True + menu + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Load + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + + 2 + + + + + + + both + True + + + + + + + + both + True + + + + + + + + + + False + Внимание! + center + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Warning! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + False + start + start + False + 450 + 250 + dialog-question-symbolic + + + True + False + vertical + + + True + False + + + True + False + start + 20 + 20 + dialog-question-symbolic + 6 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + start + 10 + 5 + Would you like to read documentation in the Web? + True + 0 + + + + + + + False + True + 0 + + + + + True + False + start + start + 10 + 10 + You will be redirected to documentation website where documentation is translated and supported by community. + True + 0 + + + + True + True + 1 + + + + + Always redirect to online documentation + True + True + False + end + 10 + True + + + + False + True + 2 + + + + + + True + True + 1 + + + + + + True + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 30 + True + + + Cancel + True + True + True + + + + True + True + 0 + + + + + Read Online + True + True + True + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + + + + True + False + 32 + dialog-question-symbolic + + + + + + + 800 + 600 + False + True + True + com.ublinux.ubl-settings-datetime + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + + diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot new file mode 100644 index 0000000..88dec94 --- /dev/null +++ b/ubl-settings-bootloader.pot @@ -0,0 +1,518 @@ +# Language translations for ubl-settings-bootloader package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-bootloader package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubl-settings-bootloader 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-01-01 00:00+0600\n" +"PO-Revision-Date: 2023-01-01 00:00+0600\n" +"Last-Translator: UBLinux Team \n" +"Language-Team: UBLinux Team \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: source/ubl-settings-bootloader.h:53 source/ubl-settings-bootloader.h:52 +#: source/ubl-settings-bootloader.cc:431 source/ubl-settings-bootloader.cc:301 +msgid "About" +msgstr "" + +#: source/ubl-settings-bootloader.h:44 source/ubl-settings-bootloader.h:43 +msgid "About ubl-settings-bootloader" +msgstr "" + +#: source/ubl-settings-bootloader.h:92 source/ubl-settings-bootloader.h:91 +#: source/ubl-settings-bootloader.cc:337 source/ubl-settings-bootloader.cc:199 +msgid "Active" +msgstr "" + +#: source/ubl-settings-bootloader.h:63 source/ubl-settings-bootloader.h:62 +msgid "Always redirect" +msgstr "" + +#: source/ubl-settings-bootloader.h:96 source/ubl-settings-bootloader.h:95 +msgid "Argument not recognized\n" +msgstr "" + +#: source/ubl-settings-bootloader.h:66 source/ubl-settings-bootloader.h:65 +msgid "Boot menu user name:" +msgstr "" + +#: source/ubl-settings-bootloader.h:67 source/ubl-settings-bootloader.h:66 +msgid "Boot menu user password:" +msgstr "" + +#: source/ubl-settings-bootloader.h:64 source/ubl-settings-bootloader.h:63 +msgid "Boot screen display mode:" +msgstr "" + +#: source/ubl-settings-bootloader.h:51 source/ubl-settings-bootloader.h:50 +msgid "Boot selection menu timer" +msgstr "" + +#: source/ubl-settings-bootloader.h:62 source/ubl-settings-bootloader.h:61 +msgid "Cancel" +msgstr "" + +#: source/ubl-settings-bootloader.h:45 source/ubl-settings-bootloader.h:44 +#: source/ubl-settings-bootloader.cc:421 source/ubl-settings-bootloader.cc:422 +#: source/ubl-settings-bootloader.cc:423 source/ubl-settings-bootloader.cc:289 +#: source/ubl-settings-bootloader.cc:290 source/ubl-settings-bootloader.cc:291 +msgid "Command line parameters:" +msgstr "" + +#: source/ubl-settings-bootloader.h:42 source/ubl-settings-bootloader.h:41 +#: source/ubl-settings-bootloader.cc:417 source/ubl-settings-bootloader.cc:285 +msgid "Configuring system boot parameters" +msgstr "" + +msgid "Configuring the boot loader settings" +msgstr "" + +#: source/ubl-settings-bootloader.h:38 source/ubl-settings-bootloader.h:37 +#: source/ubl-settings-bootloader.cc:411 source/ubl-settings-bootloader.cc:279 +msgid "Copyright © UBSoft LLC, 2022 - " +msgstr "" + +#: source/ubl-settings-bootloader.cc:292 +msgid "Default download" +msgstr "" + +#: source/ubl-settings-bootloader.h:94 source/ubl-settings-bootloader.h:93 +#: source/ubl-settings-bootloader.cc:339 source/ubl-settings-bootloader.cc:201 +msgid "Description" +msgstr "" + +msgid "Disable ACPI" +msgstr "" + +msgid "Disable APIC" +msgstr "" + +msgid "Disable GPU power management" +msgstr "" + +msgid "Disable Plymouth" +msgstr "" + +msgid "Disable kernel selection and loading of video drivers" +msgstr "" + +msgid "Disable local APIC" +msgstr "" + +#: source/ubl-settings-bootloader.h:48 source/ubl-settings-bootloader.h:47 +#: source/ubl-settings-bootloader.cc:426 source/ubl-settings-bootloader.cc:294 +msgid "Download menu" +msgstr "" + +msgid "Downloading without text messages" +msgstr "" + +msgid "Eliminates flickering laptop display on Ultra Voltage processors" +msgstr "" + +#: source/ubl-settings-bootloader.h:78 source/ubl-settings-bootloader.h:77 +#: source/ubl-settings-bootloader.cc:496 +msgid "Enter login" +msgstr "" + +#: source/ubl-settings-bootloader.h:77 source/ubl-settings-bootloader.h:76 +#: source/ubl-settings-bootloader.cc:476 +msgid "Enter your password" +msgstr "" + +#: source/ubl-settings-bootloader.h:84 source/ubl-settings-bootloader.h:83 +#: source/ubl-settings-bootloader.cc:897 source/ubl-settings-bootloader.cc:443 +msgid "Error saved local and global configuration" +msgstr "" + +msgid "Forced selection of an Intel sound device driver" +msgstr "" + +msgid "" +"GTK settings bootloader for UBLinux\n" +"\n" +"Usage: ubl-settings-bootloader [OPTIONS...]\n" +"Options:\n" +" -h, --help\t Show this help\n" +" -V, --version\t Show package version\n" +msgstr "" + +#: source/ubl-settings-bootloader.h:95 source/ubl-settings-bootloader.h:94 +msgid "" +"GTK settings bootloader for UBLinux\n" +"\n" +"Usage: ubl-settings-bootloader [OPTIONS...]\n" +"Options:\n" +" -h, --help\t Show this help\n" +" -V, --version\t Show package version\n" +" --lock-help Lock utility help\n" +" --lock-save Lock saving local and global configuration\n" +" --lock-save-local Lock save global configuration\n" +" --lock-save-global Lock load global configuration\n" +" --lock-load-global Lock load global configuration\n" +msgstr "" + +#: source/ubl-settings-bootloader.h:86 source/ubl-settings-bootloader.h:85 +#: source/ubl-settings-bootloader.cc:911 source/ubl-settings-bootloader.cc:455 +msgid "Global configuration downloaded successfully" +msgstr "" + +#: source/ubl-settings-bootloader.h:81 source/ubl-settings-bootloader.h:80 +#: source/ubl-settings-bootloader.cc:885 source/ubl-settings-bootloader.cc:431 +msgid "Global configuration read error" +msgstr "" + +#: source/ubl-settings-bootloader.h:88 source/ubl-settings-bootloader.h:87 +#: source/ubl-settings-bootloader.cc:917 source/ubl-settings-bootloader.cc:461 +msgid "Global configuration successfully written" +msgstr "" + +#: source/ubl-settings-bootloader.h:83 source/ubl-settings-bootloader.h:82 +#: source/ubl-settings-bootloader.cc:893 source/ubl-settings-bootloader.cc:439 +msgid "Global configuration write error" +msgstr "" + +#: source/ubl-settings-bootloader.h:52 source/ubl-settings-bootloader.h:51 +#: source/ubl-settings-bootloader.cc:430 source/ubl-settings-bootloader.cc:300 +msgid "Help" +msgstr "" + +#: source/ubl-settings-bootloader.cc:295 +msgid "Input terminal" +msgstr "" + +#: source/ubl-settings-bootloader.h:75 source/ubl-settings-bootloader.h:74 +#: source/ubl-settings-bootloader.cc:451 +msgid "Lack of loading animation with the output of the abbreviated log" +msgstr "" + +msgid "Last Successful Download" +msgstr "" + +#: source/ubl-settings-bootloader.h:68 source/ubl-settings-bootloader.h:67 +#: source/ubl-settings-bootloader.cc:452 +msgid "Last successful upload" +msgstr "" + +#: source/ubl-settings-bootloader.h:55 source/ubl-settings-bootloader.h:54 +#: source/ubl-settings-bootloader.cc:438 source/ubl-settings-bootloader.cc:308 +msgid "Load" +msgstr "" + +#: source/ubl-settings-bootloader.h:46 source/ubl-settings-bootloader.h:45 +#: source/ubl-settings-bootloader.cc:424 +msgid "Load default:" +msgstr "" + +#: source/ubl-settings-bootloader.h:59 source/ubl-settings-bootloader.h:58 +#: source/ubl-settings-bootloader.cc:435 source/ubl-settings-bootloader.cc:305 +msgid "Load global configuration" +msgstr "" + +#: source/ubl-settings-bootloader.h:60 source/ubl-settings-bootloader.h:59 +#: source/ubl-settings-bootloader.cc:436 source/ubl-settings-bootloader.cc:306 +msgid "Load local configuration" +msgstr "" + +#: source/ubl-settings-bootloader.cc:442 +msgid "Load menu user name:" +msgstr "" + +#: source/ubl-settings-bootloader.cc:443 +msgid "Load menu user password:" +msgstr "" + +#: source/ubl-settings-bootloader.cc:429 source/ubl-settings-bootloader.cc:298 +msgid "Load option timer" +msgstr "" + +#: source/ubl-settings-bootloader.cc:441 +msgid "Load screen display mode:" +msgstr "" + +#: source/ubl-settings-bootloader.h:73 source/ubl-settings-bootloader.h:72 +#: source/ubl-settings-bootloader.cc:448 +msgid "Loading animation with the magazine" +msgstr "" + +#: source/ubl-settings-bootloader.h:74 source/ubl-settings-bootloader.h:73 +#: source/ubl-settings-bootloader.cc:449 +msgid "Loading animation without a magazine" +msgstr "" + +#: source/ubl-settings-bootloader.h:85 source/ubl-settings-bootloader.h:84 +#: source/ubl-settings-bootloader.cc:908 source/ubl-settings-bootloader.cc:452 +msgid "Local configuration downloaded successfully" +msgstr "" + +#: source/ubl-settings-bootloader.h:80 source/ubl-settings-bootloader.h:79 +#: source/ubl-settings-bootloader.cc:881 source/ubl-settings-bootloader.cc:427 +msgid "Local configuration reading error" +msgstr "" + +#: source/ubl-settings-bootloader.h:87 source/ubl-settings-bootloader.h:86 +#: source/ubl-settings-bootloader.cc:914 source/ubl-settings-bootloader.cc:458 +msgid "Local configuration successfully written" +msgstr "" + +#: source/ubl-settings-bootloader.h:82 source/ubl-settings-bootloader.h:81 +#: source/ubl-settings-bootloader.cc:889 source/ubl-settings-bootloader.cc:435 +msgid "Local configuration write error" +msgstr "" + +#: source/ubl-settings-bootloader.cc:445 source/ubl-settings-bootloader.cc:447 +msgid "Manually" +msgstr "" + +msgid "Maximum performance, power management" +msgstr "" + +#: source/ubl-settings-bootloader.h:65 source/ubl-settings-bootloader.h:64 +msgid "No loading animation, full log" +msgstr "" + +#: source/ubl-settings-bootloader.cc:444 source/ubl-settings-bootloader.cc:446 +msgid "Not available" +msgstr "" + +#: source/ubl-settings-bootloader.h:90 source/ubl-settings-bootloader.h:89 +#: source/ubl-settings-bootloader.cc:923 source/ubl-settings-bootloader.cc:341 +#: source/ubl-settings-bootloader.cc:354 source/ubl-settings-bootloader.cc:367 +msgid "Nothing to save!" +msgstr "" + +msgid "Open Firmware Console" +msgstr "" + +#: source/ubl-settings-bootloader.h:93 source/ubl-settings-bootloader.h:92 +#: source/ubl-settings-bootloader.cc:338 source/ubl-settings-bootloader.cc:200 +msgid "Option" +msgstr "" + +msgid "Output in graphical mode" +msgstr "" + +#: source/ubl-settings-bootloader.cc:296 +msgid "Output terminal" +msgstr "" + +msgid "PC AT Keyboard (Coreboot)" +msgstr "" + +msgid "PC BIOS & EFI console" +msgstr "" + +msgid "Parameters passed to the kernel" +msgstr "" + +msgid "Prevents the processor from going into a deep sleep state" +msgstr "" + +#: source/ubl-settings-bootloader.h:41 source/ubl-settings-bootloader.h:40 +#: source/ubl-settings-bootloader.cc:416 source/ubl-settings-bootloader.cc:420 +#: source/ubl-settings-bootloader.cc:284 source/ubl-settings-bootloader.cc:288 +msgid "Project Home Page" +msgstr "" + +#: source/ubl-settings-bootloader.h:61 source/ubl-settings-bootloader.h:60 +msgid "Read online" +msgstr "" + +#: source/ubl-settings-bootloader.h:54 source/ubl-settings-bootloader.h:53 +#: source/ubl-settings-bootloader.cc:437 source/ubl-settings-bootloader.cc:307 +msgid "Save" +msgstr "" + +#: source/ubl-settings-bootloader.h:58 source/ubl-settings-bootloader.h:57 +#: source/ubl-settings-bootloader.cc:434 source/ubl-settings-bootloader.cc:304 +msgid "Save in global configuration" +msgstr "" + +#: source/ubl-settings-bootloader.h:57 source/ubl-settings-bootloader.h:56 +#: source/ubl-settings-bootloader.cc:433 source/ubl-settings-bootloader.cc:303 +msgid "Save in local configuration" +msgstr "" + +#: source/ubl-settings-bootloader.h:56 source/ubl-settings-bootloader.h:55 +#: source/ubl-settings-bootloader.cc:432 source/ubl-settings-bootloader.cc:302 +msgid "Save in global and local configuration" +msgstr "" + +#: source/ubl-settings-bootloader.cc:293 +msgid "Seconds" +msgstr "" + +msgid "Serial terminal" +msgstr "" + +#: source/ubl-settings-bootloader.cc:287 +msgid "Setting bootloader" +msgstr "" + +msgid "Show welcome window" +msgstr "" + +msgid "Single User Mode" +msgstr "" + +#: source/ubl-settings-bootloader.h:89 source/ubl-settings-bootloader.h:88 +#: source/ubl-settings-bootloader.cc:920 source/ubl-settings-bootloader.cc:464 +msgid "Successfully saved local and global configuration" +msgstr "" + +#: source/ubl-settings-bootloader.h:43 source/ubl-settings-bootloader.h:42 +#: source/ubl-settings-bootloader.cc:419 +msgid "System boot" +msgstr "" + +#: source/ubl-settings-bootloader.h:49 source/ubl-settings-bootloader.h:48 +#: source/ubl-settings-bootloader.cc:427 +msgid "Terminal for input" +msgstr "" + +#: source/ubl-settings-bootloader.h:50 source/ubl-settings-bootloader.h:49 +#: source/ubl-settings-bootloader.cc:428 +msgid "Terminal for output" +msgstr "" + +#: source/ubl-settings-bootloader.cc:299 +msgid "The last selection will become the default boot choice" +msgstr "" + +#: source/ubl-settings-bootloader.h:91 source/ubl-settings-bootloader.h:90 +#: source/ubl-settings-bootloader.cc:107 source/ubl-settings-bootloader.cc:94 +msgid "The program must be run as root" +msgstr "" + +msgid "UBConfig - Loading" +msgstr "" + +msgid "USB Keyboard (HID Boot protocol)" +msgstr "" + +#: source/ubl-settings-bootloader.h:71 source/ubl-settings-bootloader.h:70 +#: source/ubl-settings-bootloader.cc:440 +msgid "User name to enter boot configuration editing mode" +msgstr "" + +#: source/ubl-settings-bootloader.h:72 source/ubl-settings-bootloader.h:71 +msgid "User password to enter boot configuration edit mode" +msgstr "" + +msgid "VGA text output (Coreboot)" +msgstr "" + +#: source/ubl-settings-bootloader.h:69 source/ubl-settings-bootloader.h:68 +msgid "Would you like to read documentation in the Web?" +msgstr "" + +#: source/ubl-settings-bootloader.h:70 source/ubl-settings-bootloader.h:69 +msgid "" +"You will be redirected to documentation site, where user help pages are " +"translated and supported by community." +msgstr "" + +msgid "acpi=off (Disable ACPI)" +msgstr "" + +msgid "ahci.mobile_jpm_policy=1 (Maximum performance, power management)" +msgstr "" + +msgid "apic (Disable APIC)" +msgstr "" + +msgid "at_keyboard (Keyboard PC AT (Coreboot))" +msgstr "" + +msgid "console (PC BIOS & console EFI)" +msgstr "" + +msgid "gfxterm (Output in graphical mode)" +msgstr "" + +#: source/ubl-settings-bootloader.h:40 source/ubl-settings-bootloader.h:76 +#: source/ubl-settings-bootloader.h:39 source/ubl-settings-bootloader.h:75 +#: source/ubl-settings-bootloader.cc:414 source/ubl-settings-bootloader.cc:282 +msgid "https://wiki.ublinux.com" +msgstr "" + +#: source/ubl-settings-bootloader.cc:860 source/ubl-settings-bootloader.cc:400 +msgid "" +"https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/" +msgstr "" + +msgid "i915.enable_dc=0 (Disable GPU power management)" +msgstr "" + +msgid "" +"intel_idle max_cstate=1 (Prevents the processor from going into a deep sleep " +"state)" +msgstr "" + +msgid "" +"intel_idle.max_cstate=4 (Eliminates flickering laptop display on processors " +"Ultra Voltage)" +msgstr "" + +msgid "no plymouth (Disable Plymouth)" +msgstr "" + +msgid "nolapic (Disable local APIC)" +msgstr "" + +msgid "nomodeset (Disable kernel selection and loading of video drivers)" +msgstr "" + +msgid "ofconsole (Console Open Firmware)" +msgstr "" + +msgid "quiet (Downloading without text messages)" +msgstr "" + +#: source/ubl-settings-bootloader.h:47 source/ubl-settings-bootloader.h:46 +#: source/ubl-settings-bootloader.cc:425 +msgid "seconds" +msgstr "" + +msgid "serial (Serial terminal)" +msgstr "" + +msgid "single (Single User Mode)" +msgstr "" + +msgid "" +"snd-intel-dspcfg.dsp_driver=1 (Forced selection of a sound device driver " +"from Intel)" +msgstr "" + +msgid "splash (Show welcome window)" +msgstr "" + +#: source/ubl-settings-bootloader.h:39 source/ubl-settings-bootloader.h:38 +#: source/ubl-settings-bootloader.cc:413 source/ubl-settings-bootloader.cc:418 +#: source/ubl-settings-bootloader.cc:439 source/ubl-settings-bootloader.cc:281 +#: source/ubl-settings-bootloader.cc:286 source/ubl-settings-bootloader.cc:309 +msgid "ubl-settings-bootloader" +msgstr "" + +#: source/ubl-settings-bootloader.h:79 source/ubl-settings-bootloader.h:78 +#: source/ubl-settings-bootloader.cc:947 source/ubl-settings-bootloader.cc:547 +msgid "ubl-settings-bootloader version: " +msgstr "" + +msgid "usb_keyboard (Keyboard USB Keyboard (protocol HID Boot))" +msgstr "" + +msgid "vga_text (Text output VGA (Coreboot))" +msgstr "" + +#: source/ubl-settings-bootloader.cc:450 +msgid "Нет анимации загрузки, полный журнал" +msgstr "" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po new file mode 100644 index 0000000..73ae7f5 --- /dev/null +++ b/ubl-settings-bootloader_ru.po @@ -0,0 +1,561 @@ +# Russian translations for ubl-settings-bootloader package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-bootloader package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubl-settings-bootloader 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-04-25 15:27+0600\n" +"PO-Revision-Date: 2020-02-22 23:28+0600\n" +"Last-Translator: ublinux \n" +"Language-Team: Russian - UBLinux Team \n" +"Language: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: source/ubl-settings-bootloader.h:53 source/ubl-settings-bootloader.h:52 +#: source/ubl-settings-bootloader.cc:431 source/ubl-settings-bootloader.cc:301 +msgid "About" +msgstr "О программе" + +#: source/ubl-settings-bootloader.h:44 source/ubl-settings-bootloader.h:43 +msgid "About ubl-settings-bootloader" +msgstr "О программе Загрузка системы" + +#: source/ubl-settings-bootloader.h:92 source/ubl-settings-bootloader.h:91 +#: source/ubl-settings-bootloader.cc:337 source/ubl-settings-bootloader.cc:199 +msgid "Active" +msgstr "Активно" + +#: source/ubl-settings-bootloader.h:63 source/ubl-settings-bootloader.h:62 +msgid "Always redirect" +msgstr "Всегда перенаправлять" + +#: source/ubl-settings-bootloader.h:96 source/ubl-settings-bootloader.h:95 +msgid "Argument not recognized\n" +msgstr "" + +#: source/ubl-settings-bootloader.h:66 source/ubl-settings-bootloader.h:65 +msgid "Boot menu user name:" +msgstr "Имя пользователя меню загрузки:" + +#: source/ubl-settings-bootloader.h:67 source/ubl-settings-bootloader.h:66 +msgid "Boot menu user password:" +msgstr "Пароль пользователя меню загрузки:" + +#: source/ubl-settings-bootloader.h:64 source/ubl-settings-bootloader.h:63 +msgid "Boot screen display mode:" +msgstr "Режим отображения экрана загрузки:" + +#: source/ubl-settings-bootloader.h:51 source/ubl-settings-bootloader.h:50 +msgid "Boot selection menu timer" +msgstr "Таймер меню выбора варианта загрузки" + +#: source/ubl-settings-bootloader.h:62 source/ubl-settings-bootloader.h:61 +msgid "Cancel" +msgstr "Отменить" + +#: source/ubl-settings-bootloader.h:45 source/ubl-settings-bootloader.h:44 +#: source/ubl-settings-bootloader.cc:421 source/ubl-settings-bootloader.cc:422 +#: source/ubl-settings-bootloader.cc:423 source/ubl-settings-bootloader.cc:289 +#: source/ubl-settings-bootloader.cc:290 source/ubl-settings-bootloader.cc:291 +msgid "Command line parameters:" +msgstr "Параметры командной строки:" + +#: source/ubl-settings-bootloader.h:42 source/ubl-settings-bootloader.h:41 +#: source/ubl-settings-bootloader.cc:417 source/ubl-settings-bootloader.cc:285 +msgid "Configuring system boot parameters" +msgstr "Настройка параметров загрузки системы" + +msgid "Configuring the boot loader settings" +msgstr "Настройка параметров загрузчика системы" + +#: source/ubl-settings-bootloader.h:38 source/ubl-settings-bootloader.h:37 +#: source/ubl-settings-bootloader.cc:411 source/ubl-settings-bootloader.cc:279 +msgid "Copyright © UBSoft LLC, 2022 - " +msgstr "" + +#: source/ubl-settings-bootloader.cc:292 +#, fuzzy +msgid "Default download" +msgstr "По умолчанию" + +#: source/ubl-settings-bootloader.h:94 source/ubl-settings-bootloader.h:93 +#: source/ubl-settings-bootloader.cc:339 source/ubl-settings-bootloader.cc:201 +msgid "Description" +msgstr "Описание" + +msgid "Disable ACPI" +msgstr "Отключить ACPI" + +msgid "Disable APIC" +msgstr "Отключить APIC" + +msgid "Disable GPU power management" +msgstr "Отключить управление питанием графического процессора" + +msgid "Disable Plymouth" +msgstr "Отключить Plymouth" + +msgid "Disable kernel selection and loading of video drivers" +msgstr "Отключить выбор и загрузку ядром драйверов видео" + +msgid "Disable local APIC" +msgstr "Отключить локальный APIC" + +#: source/ubl-settings-bootloader.h:48 source/ubl-settings-bootloader.h:47 +#: source/ubl-settings-bootloader.cc:426 source/ubl-settings-bootloader.cc:294 +msgid "Download menu" +msgstr "Меню загрузки" + +msgid "Downloading without text messages" +msgstr "Загрузка без текстовых сообщений" + +msgid "Eliminates flickering laptop display on Ultra Voltage processors" +msgstr "Устраняет мерцание дисплея ноутбука на процессорах Ultra Voltage" + +#: source/ubl-settings-bootloader.h:78 source/ubl-settings-bootloader.h:77 +#: source/ubl-settings-bootloader.cc:496 +msgid "Enter login" +msgstr "Введите логин" + +#: source/ubl-settings-bootloader.h:77 source/ubl-settings-bootloader.h:76 +#: source/ubl-settings-bootloader.cc:476 +msgid "Enter your password" +msgstr "Введите пароль" + +#: source/ubl-settings-bootloader.h:84 source/ubl-settings-bootloader.h:83 +#: source/ubl-settings-bootloader.cc:897 source/ubl-settings-bootloader.cc:443 +#, fuzzy +msgid "Error saved local and global configuration" +msgstr "Успешно записаны локальная и глобальная конфигурация" + +msgid "Forced selection of an Intel sound device driver" +msgstr "Принудительный выбор драйвера звукового устройства от Intel" + +msgid "" +"GTK settings bootloader for UBLinux\n" +"\n" +"Usage: ubl-settings-bootloader [OPTIONS...]\n" +"Options:\n" +" -h, --help\t Show this help\n" +" -V, --version\t Show package version\n" +msgstr "" + +#: source/ubl-settings-bootloader.h:95 source/ubl-settings-bootloader.h:94 +msgid "" +"GTK settings bootloader for UBLinux\n" +"\n" +"Usage: ubl-settings-bootloader [OPTIONS...]\n" +"Options:\n" +" -h, --help\t Show this help\n" +" -V, --version\t Show package version\n" +" --lock-help Lock utility help\n" +" --lock-save Lock saving local and global configuration\n" +" --lock-save-local Lock save global configuration\n" +" --lock-save-global Lock load global configuration\n" +" --lock-load-global Lock load global configuration\n" +msgstr "" +"GTK-утилита настройки загрузчика для UBLinux\n" +"\n" +"Использование: ubl-settings-bootloader [Параметры приложения...]\n" +"Параметры приложения:\n" +" -h, --help\t Показать параметры справки\n" +" -V, --version\t Показать версию пакета\n" +" --lock-help Блокировка вызова справки\n" +" --lock-save Блокировка сохранения локальной и глобальной " +"конфигурации\n" +" --lock-save-local Блокировка сохранения локальной конфигурации\n" +" --lock-save-global Блокировка сохранения глобальной конфигурации\n" +" --lock-load-global Блокировка загрузки глобальной конфигурации\n" + +#: source/ubl-settings-bootloader.h:86 source/ubl-settings-bootloader.h:85 +#: source/ubl-settings-bootloader.cc:911 source/ubl-settings-bootloader.cc:455 +msgid "Global configuration downloaded successfully" +msgstr "Успешно загружена глобальная конфигурация" + +#: source/ubl-settings-bootloader.h:81 source/ubl-settings-bootloader.h:80 +#: source/ubl-settings-bootloader.cc:885 source/ubl-settings-bootloader.cc:431 +msgid "Global configuration read error" +msgstr "Ошибка чтения глобальной конфигурации" + +#: source/ubl-settings-bootloader.h:88 source/ubl-settings-bootloader.h:87 +#: source/ubl-settings-bootloader.cc:917 source/ubl-settings-bootloader.cc:461 +msgid "Global configuration successfully written" +msgstr "Успешно записана глобальная конфигурация" + +#: source/ubl-settings-bootloader.h:83 source/ubl-settings-bootloader.h:82 +#: source/ubl-settings-bootloader.cc:893 source/ubl-settings-bootloader.cc:439 +msgid "Global configuration write error" +msgstr "Ошибка записи глобальной конфигурации" + +#: source/ubl-settings-bootloader.h:52 source/ubl-settings-bootloader.h:51 +#: source/ubl-settings-bootloader.cc:430 source/ubl-settings-bootloader.cc:300 +msgid "Help" +msgstr "Справка" + +#: source/ubl-settings-bootloader.cc:295 +#, fuzzy +msgid "Input terminal" +msgstr "Терминал для вывода" + +#: source/ubl-settings-bootloader.h:75 source/ubl-settings-bootloader.h:74 +#: source/ubl-settings-bootloader.cc:451 +msgid "Lack of loading animation with the output of the abbreviated log" +msgstr "Отсутствие анимации загрузки с выводом сокращенного журнала" + +#, fuzzy +msgid "Last Successful Download" +msgstr "Последняя удачная загрузка" + +#: source/ubl-settings-bootloader.h:68 source/ubl-settings-bootloader.h:67 +#: source/ubl-settings-bootloader.cc:452 +msgid "Last successful upload" +msgstr "Последняя удачная загрузка" + +#: source/ubl-settings-bootloader.h:55 source/ubl-settings-bootloader.h:54 +#: source/ubl-settings-bootloader.cc:438 source/ubl-settings-bootloader.cc:308 +msgid "Load" +msgstr "Загрузить" + +#: source/ubl-settings-bootloader.h:46 source/ubl-settings-bootloader.h:45 +#: source/ubl-settings-bootloader.cc:424 +msgid "Load default:" +msgstr "Загрузка по умолчанию:" + +#: source/ubl-settings-bootloader.h:59 source/ubl-settings-bootloader.h:58 +#: source/ubl-settings-bootloader.cc:435 source/ubl-settings-bootloader.cc:305 +msgid "Load global configuration" +msgstr "Загрузить глобальную конфигурацию" + +#: source/ubl-settings-bootloader.h:60 source/ubl-settings-bootloader.h:59 +#: source/ubl-settings-bootloader.cc:436 source/ubl-settings-bootloader.cc:306 +msgid "Load local configuration" +msgstr "Загрузить локальную конфигурацию" + +#: source/ubl-settings-bootloader.cc:442 +#, fuzzy +msgid "Load menu user name:" +msgstr "Имя пользователя меню загрузки:" + +#: source/ubl-settings-bootloader.cc:443 +#, fuzzy +msgid "Load menu user password:" +msgstr "Пароль пользователя меню загрузки:" + +#: source/ubl-settings-bootloader.cc:429 source/ubl-settings-bootloader.cc:298 +msgid "Load option timer" +msgstr "" + +#: source/ubl-settings-bootloader.cc:441 +#, fuzzy +msgid "Load screen display mode:" +msgstr "Режим отображения экрана загрузки:" + +#: source/ubl-settings-bootloader.h:73 source/ubl-settings-bootloader.h:72 +#: source/ubl-settings-bootloader.cc:448 +msgid "Loading animation with the magazine" +msgstr "Анимация загрузки с журналом" + +#: source/ubl-settings-bootloader.h:74 source/ubl-settings-bootloader.h:73 +#: source/ubl-settings-bootloader.cc:449 +msgid "Loading animation without a magazine" +msgstr "Анимация загрузки без журнала" + +#: source/ubl-settings-bootloader.h:85 source/ubl-settings-bootloader.h:84 +#: source/ubl-settings-bootloader.cc:908 source/ubl-settings-bootloader.cc:452 +msgid "Local configuration downloaded successfully" +msgstr "Успешно загружена локальная конфигурация" + +#: source/ubl-settings-bootloader.h:80 source/ubl-settings-bootloader.h:79 +#: source/ubl-settings-bootloader.cc:881 source/ubl-settings-bootloader.cc:427 +msgid "Local configuration reading error" +msgstr "Ошибка чтения локальной конфигурации" + +#: source/ubl-settings-bootloader.h:87 source/ubl-settings-bootloader.h:86 +#: source/ubl-settings-bootloader.cc:914 source/ubl-settings-bootloader.cc:458 +msgid "Local configuration successfully written" +msgstr "Успешно записана локальная конфигурация" + +#: source/ubl-settings-bootloader.h:82 source/ubl-settings-bootloader.h:81 +#: source/ubl-settings-bootloader.cc:889 source/ubl-settings-bootloader.cc:435 +msgid "Local configuration write error" +msgstr "Ошибка записи локальной конфигурации" + +#: source/ubl-settings-bootloader.cc:445 source/ubl-settings-bootloader.cc:447 +msgid "Manually" +msgstr "Вручную" + +msgid "Maximum performance, power management" +msgstr "Максимальная производительность, управление питанием" + +#: source/ubl-settings-bootloader.h:65 source/ubl-settings-bootloader.h:64 +msgid "No loading animation, full log" +msgstr "Отсутствие анимации загрузки с выводом журнала" + +#: source/ubl-settings-bootloader.cc:444 source/ubl-settings-bootloader.cc:446 +msgid "Not available" +msgstr "Отсутствует" + +#: source/ubl-settings-bootloader.h:90 source/ubl-settings-bootloader.h:89 +#: source/ubl-settings-bootloader.cc:923 source/ubl-settings-bootloader.cc:341 +#: source/ubl-settings-bootloader.cc:354 source/ubl-settings-bootloader.cc:367 +msgid "Nothing to save!" +msgstr "Нечего сохранять!" + +msgid "Open Firmware Console" +msgstr "Консоль Open Firmware" + +#: source/ubl-settings-bootloader.h:93 source/ubl-settings-bootloader.h:92 +#: source/ubl-settings-bootloader.cc:338 source/ubl-settings-bootloader.cc:200 +msgid "Option" +msgstr "Опция" + +msgid "Output in graphical mode" +msgstr "Вывод в графическом режиме" + +#: source/ubl-settings-bootloader.cc:296 +msgid "Output terminal" +msgstr "Терминал для вывода" + +msgid "PC AT Keyboard (Coreboot)" +msgstr "Клавиатура PC AT (Coreboot)" + +msgid "PC BIOS & EFI console" +msgstr "PC BIOS & консоль EFI" + +msgid "Parameters passed to the kernel" +msgstr "Параметры, передаваемые ядру" + +msgid "Prevents the processor from going into a deep sleep state" +msgstr "Предотвращает переход процессора в состояние глубокого сна" + +#: source/ubl-settings-bootloader.h:41 source/ubl-settings-bootloader.h:40 +#: source/ubl-settings-bootloader.cc:416 source/ubl-settings-bootloader.cc:420 +#: source/ubl-settings-bootloader.cc:284 source/ubl-settings-bootloader.cc:288 +msgid "Project Home Page" +msgstr "Домашняя страница проекта" + +#: source/ubl-settings-bootloader.h:61 source/ubl-settings-bootloader.h:60 +msgid "Read online" +msgstr "Прочитать онлайн" + +#: source/ubl-settings-bootloader.h:54 source/ubl-settings-bootloader.h:53 +#: source/ubl-settings-bootloader.cc:437 source/ubl-settings-bootloader.cc:307 +msgid "Save" +msgstr "Сохранить" + +#: source/ubl-settings-bootloader.h:58 source/ubl-settings-bootloader.h:57 +#: source/ubl-settings-bootloader.cc:434 source/ubl-settings-bootloader.cc:304 +msgid "Save in global configuration" +msgstr "Сохранить в глобальную конфигурацию" + +#: source/ubl-settings-bootloader.h:57 source/ubl-settings-bootloader.h:56 +#: source/ubl-settings-bootloader.cc:433 source/ubl-settings-bootloader.cc:303 +msgid "Save in local configuration" +msgstr "Сохранить в локальную конфигурацию" + +#: source/ubl-settings-bootloader.h:56 source/ubl-settings-bootloader.h:55 +#: source/ubl-settings-bootloader.cc:432 source/ubl-settings-bootloader.cc:302 +msgid "Save in global and local configuration" +msgstr "Сохранить в глобальную и локальную конфигурацию" + +#: source/ubl-settings-bootloader.cc:293 +#, fuzzy +msgid "Seconds" +msgstr "секунд" + +msgid "Serial terminal" +msgstr "Последовательный терминал" + +#: source/ubl-settings-bootloader.cc:287 +msgid "Setting bootloader" +msgstr "Настройка загрузчика" + +msgid "Show welcome window" +msgstr "Показывать окно приветствия" + +msgid "Single User Mode" +msgstr "Режим одного пользователя" + +#: source/ubl-settings-bootloader.h:89 source/ubl-settings-bootloader.h:88 +#: source/ubl-settings-bootloader.cc:920 source/ubl-settings-bootloader.cc:464 +msgid "Successfully saved local and global configuration" +msgstr "Успешно записаны локальная и глобальная конфигурация" + +#: source/ubl-settings-bootloader.h:43 source/ubl-settings-bootloader.h:42 +#: source/ubl-settings-bootloader.cc:419 +msgid "System boot" +msgstr "Загрузка системы" + +#: source/ubl-settings-bootloader.h:49 source/ubl-settings-bootloader.h:48 +#: source/ubl-settings-bootloader.cc:427 +#, fuzzy +msgid "Terminal for input" +msgstr "Терминал для ввода" + +#: source/ubl-settings-bootloader.h:50 source/ubl-settings-bootloader.h:49 +#: source/ubl-settings-bootloader.cc:428 +#, fuzzy +msgid "Terminal for output" +msgstr "Терминал для вывода" + +#: source/ubl-settings-bootloader.cc:299 +msgid "The last selection will become the default boot choice" +msgstr "Последний выбор станет выбором загрузки по умолчанию" + +#: source/ubl-settings-bootloader.h:91 source/ubl-settings-bootloader.h:90 +#: source/ubl-settings-bootloader.cc:107 source/ubl-settings-bootloader.cc:94 +msgid "The program must be run as root" +msgstr "Программа должна быть запущена с правами суперпользователя!" + +msgid "UBConfig - Loading" +msgstr "UBConfig - Загрузка" + +msgid "USB Keyboard (HID Boot protocol)" +msgstr "Клавиатура USB Keyboard (протокол HID Boot)" + +#: source/ubl-settings-bootloader.h:71 source/ubl-settings-bootloader.h:70 +#: source/ubl-settings-bootloader.cc:440 +msgid "User name to enter boot configuration editing mode" +msgstr "" +"Имя пользователя для входа в режим редактирования конфигурации загрузки" + +#: source/ubl-settings-bootloader.h:72 source/ubl-settings-bootloader.h:71 +msgid "User password to enter boot configuration edit mode" +msgstr "" +"Пароль пользователя для входа в режим редактирования конфигурации загрузки" + +msgid "VGA text output (Coreboot)" +msgstr "Текстовый вывод VGA (Coreboot)" + +#: source/ubl-settings-bootloader.h:69 source/ubl-settings-bootloader.h:68 +msgid "Would you like to read documentation in the Web?" +msgstr "Вы хотите прочитать справку в Сети?" + +#: source/ubl-settings-bootloader.h:70 source/ubl-settings-bootloader.h:69 +msgid "" +"You will be redirected to documentation site, where user help pages are " +"translated and supported by community." +msgstr "" +"Вы будете перенаправлены на сайт с документацией где страницы помощи " +"переводятся и поддерживаются сообществом." + +msgid "acpi=off (Disable ACPI)" +msgstr "acpi=off (Отключить ACPI)" + +msgid "ahci.mobile_jpm_policy=1 (Maximum performance, power management)" +msgstr "" +"ahci.mobile_jpm_policy=1 (Максимальная производительность, управление " +"питанием)" + +msgid "apic (Disable APIC)" +msgstr "apic (Отключить APIC)" + +msgid "at_keyboard (Keyboard PC AT (Coreboot))" +msgstr "at_keyboard (Клавиатура PC AT (Coreboot))" + +msgid "console (PC BIOS & console EFI)" +msgstr "Консоль (PC BIOS & console EFI)" + +msgid "gfxterm (Output in graphical mode)" +msgstr "gfxterm (Вывод в графическом режиме)" + +#: source/ubl-settings-bootloader.h:40 source/ubl-settings-bootloader.h:76 +#: source/ubl-settings-bootloader.h:39 source/ubl-settings-bootloader.h:75 +#: source/ubl-settings-bootloader.cc:414 source/ubl-settings-bootloader.cc:282 +msgid "https://wiki.ublinux.com" +msgstr "" + +#: source/ubl-settings-bootloader.cc:860 source/ubl-settings-bootloader.cc:400 +#, fuzzy +msgid "" +"https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/" +msgstr "" +"https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/" +"ubl-settings-bootloader" + +msgid "i915.enable_dc=0 (Disable GPU power management)" +msgstr "i915.enable_dc=0 (Отключите управление питанием GPU)" + +msgid "" +"intel_idle max_cstate=1 (Prevents the processor from going into a deep sleep " +"state)" +msgstr "" +"intel_idle max_cstate=1 (Предотвращает переход процессора в состояние " +"глубокого сна)" + +msgid "" +"intel_idle.max_cstate=4 (Eliminates flickering laptop display on processors " +"Ultra Voltage)" +msgstr "" +"intel_idle.max_cstate=4 (Устраняет мерцание дисплея ноутбука на процессорах " +"Ultra Voltage)" + +msgid "no plymouth (Disable Plymouth)" +msgstr "no plymouth (Отключить Plymouth" + +msgid "nolapic (Disable local APIC)" +msgstr "nolapic (Отключить локальный APIC)" + +msgid "nomodeset (Disable kernel selection and loading of video drivers)" +msgstr "nomodeset (Отключите выбор ядра и загрузку видеодрайверов)" + +msgid "ofconsole (Console Open Firmware)" +msgstr "ofconsole (Консоль Open Firmware)" + +msgid "quiet (Downloading without text messages)" +msgstr "quiet (Загрузка без текстовых сообщений)" + +#: source/ubl-settings-bootloader.h:47 source/ubl-settings-bootloader.h:46 +#: source/ubl-settings-bootloader.cc:425 +msgid "seconds" +msgstr "секунд" + +msgid "serial (Serial terminal)" +msgstr "serial (Последовательный терминал)" + +msgid "single (Single User Mode)" +msgstr "single (Однопользовательский режим)" + +msgid "" +"snd-intel-dspcfg.dsp_driver=1 (Forced selection of a sound device driver " +"from Intel)" +msgstr "" +"snd-intel-dspcfg.dsp_driver=1 (Принудительный выбор драйвера звукового " +"устройства от Intel)" + +msgid "splash (Show welcome window)" +msgstr "splash (Показать окно приветствия)" + +#: source/ubl-settings-bootloader.h:39 source/ubl-settings-bootloader.h:38 +#: source/ubl-settings-bootloader.cc:413 source/ubl-settings-bootloader.cc:418 +#: source/ubl-settings-bootloader.cc:439 source/ubl-settings-bootloader.cc:281 +#: source/ubl-settings-bootloader.cc:286 source/ubl-settings-bootloader.cc:309 +msgid "ubl-settings-bootloader" +msgstr "Загрузка системы" + +#: source/ubl-settings-bootloader.h:79 source/ubl-settings-bootloader.h:78 +#: source/ubl-settings-bootloader.cc:947 source/ubl-settings-bootloader.cc:547 +msgid "ubl-settings-bootloader version: " +msgstr "ubl-settings-bootloader версия: " + +msgid "usb_keyboard (Keyboard USB Keyboard (protocol HID Boot))" +msgstr "usb_keyboard (Клавиатура USB Keyboard (protocol HID Boot))" + +msgid "vga_text (Text output VGA (Coreboot))" +msgstr "vga_text (Текстовый вывод VGA (Coreboot))" + +#: source/ubl-settings-bootloader.cc:450 +msgid "Нет анимации загрузки, полный журнал" +msgstr "" + +#~ msgid "Mine" +#~ msgstr "Свой" + +#~ msgid "Disabled" +#~ msgstr "Отключён"