From e4e499fe6154029757251a9a82fc96bee3b2988b Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 25 Apr 2023 11:06:03 +0600 Subject: [PATCH] =?UTF-8?q?define=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BE=20=D0=BE=D0=B1=D1=89?= =?UTF-8?q?=D0=B8=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 2 - source/my_cmd_and_path.h | 30 --------- source/my_localization.h | 65 ------------------- source/ubl-settings-bootloader.h | 103 ++++++++++++++++++++++++++++++- 4 files changed, 101 insertions(+), 99 deletions(-) delete mode 100644 source/my_cmd_and_path.h delete mode 100644 source/my_localization.h diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ccbf2ca..5800f09 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -26,10 +26,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin -fstack-clash-protection -fcf-protection") set(SOURCE_FILES - my_localization.h ubl-settings-bootloader.h ubl-settings-bootloader.cc - my_cmd_and_path.h save.h save.cc load.h diff --git a/source/my_cmd_and_path.h b/source/my_cmd_and_path.h deleted file mode 100644 index 116fca4..0000000 --- a/source/my_cmd_and_path.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef MY_CMD_H -#define MY_CMD_H - -#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" -#endif \ No newline at end of file diff --git a/source/my_localization.h b/source/my_localization.h deleted file mode 100644 index 88f8d03..0000000 --- a/source/my_localization.h +++ /dev/null @@ -1,65 +0,0 @@ - -#ifndef MY_LOCALIZATION -#define MY_LOCALIZATION -#include -#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 to global and local configuration") -#define save_local _("Save local configuration") -#define save_global _("Save 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") - -#endif \ No newline at end of file diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 54c1da5..2a7f5af 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -12,7 +12,6 @@ #include #include #include -#include "my_cmd_and_path.h" #include "ubl-util-standard.c" #include "util.h" #include "save.h" @@ -21,7 +20,6 @@ #ifdef WEBKIT_FOUND #include #endif -#include "my_localization.h" #include "my_process.h" using namespace std; @@ -35,6 +33,107 @@ 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 to global and local configuration") +#define save_local _("Save local configuration") +#define save_global _("Save 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" + + + + + + + + + + + + + + + + + class CmdArgParser : public Glib::OptionGroup { public: