define перенесены в о общий файл

pull/11/head
Igor Belitskiy 3 years ago
parent 33bd148f2c
commit e4e499fe61

@ -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

@ -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

@ -1,65 +0,0 @@
#ifndef MY_LOCALIZATION
#define MY_LOCALIZATION
#include <gtkmm/plug.h>
#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

@ -12,7 +12,6 @@
#include <libintl.h>
#include <glibmm/i18n.h>
#include <map>
#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 <webkit2/webkit2.h>
#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:

Loading…
Cancel
Save