@ -37,9 +37,9 @@ extern bool flag_lock_help;
void me_thread ( string cmd ) ;
void me_thread ( string cmd ) ;
# define copyright _("Copyright © UBSoft LLC, 2022 - ")
# define copyright _("Copyright © UBSoft LLC, 2022 - ")
# define name_app _("ubl-settings-bootloader")
# define name_app _("ubl-settings-bootloader")
# define website _("https: //wiki.ublinux.com")
# define website _("https: //wiki.ublinux.com")
# define project_Home_page _("Project Home Page")
# define project_Home_page _("Project Home Page")
# define configuring_system_boot _("Configuring system boot parameters")
# define configuring_system_boot _("Configuring system boot parameters")
# define system_boot _("System boot setup")
# define system_boot _("System boot setup")
# define str_about _("About ubl-settings-bootloader")
# define str_about _("About ubl-settings-bootloader")
@ -68,7 +68,8 @@ void me_thread(string cmd);
# define boot_menu_user_password _("Boot menu user password:")
# define boot_menu_user_password _("Boot menu user password:")
# define last_successful_upload _("Last successful upload")
# define last_successful_upload _("Last successful upload")
# define read_documentation_web _("Would you like to read documentation in the Web?")
# 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 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_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 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_with _("Loading animation with the magazine")
@ -93,10 +94,19 @@ void me_thread(string cmd);
# define str_active _("Active")
# define str_active _("Active")
# define str_option _("Option")
# define str_option _("Option")
# define str_description _("Description")
# 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 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 no_recognized _("Argument not recognized\n")
# define global_load "ubconfig --default --source global get boot"
# define global_load "ubconfig --default --source global get boot"
# define system_load "ubconfig --default --source system get boot"
# define system_load "ubconfig --default --source system get boot"
# define global_save "ubconfig --target global set boot "
# define global_save "ubconfig --target global set boot "
@ -125,201 +135,210 @@ void me_thread(string cmd);
class CmdArgParser : public Glib : : OptionGroup
class CmdArgParser : public Glib : : OptionGroup
{
{
public :
public :
CmdArgParser ( const std : : string & p_name , const std : : string & p_description , const std : : string & p_help ) ;
CmdArgParser ( const std : : string & p_name , const std : : string & p_description , const std : : string & p_help ) ;
: : Window GetSocketID ( ) const ;
: : Window GetSocketID ( ) const ;
private :
private :
int m_socketID = 0 ;
int m_socketID = 0 ;
} ;
} ;
class MainWindow : public Gtk : : ApplicationWindow {
class MainWindow : public Gtk : : ApplicationWindow
{
public :
class ModelColumns : public Gtk : : TreeModel : : ColumnRecord
{
public :
public :
class ModelColumns : public Gtk : : TreeModel : : ColumnRecord {
ModelColumns ( )
public :
{
ModelColumns ( ) { add ( check_button ) , add ( name ) ; add ( description ) ; }
add ( check_button ) , add ( name ) ;
//Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
add ( description ) ;
Gtk : : TreeModelColumn < bool > check_button ;
}
Gtk : : TreeModelColumn < Glib : : ustring > name ;
// Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk : : TreeModelColumn < Glib : : ustring > description ;
Gtk : : TreeModelColumn < bool > check_button ;
} ;
Gtk : : TreeModelColumn < Glib : : ustring > name ;
ModelColumns m_columns ;
Gtk : : TreeModelColumn < Glib : : ustring > description ;
Glib : : RefPtr < Gtk : : Builder > builder ;
} ;
Gtk : : SpinButton * spbSecond ;
ModelColumns m_columns ;
Gtk : : Label * lblInfoSeconds ;
Glib : : RefPtr < Gtk : : Builder > builder ;
Gtk : : Label * lblInfoDefaultDonw ;
Gtk : : SpinButton * spbSecond ;
Gtk : : Label * lblInfoCommand ;
Gtk : : Label * lblInfoSeconds ;
Gtk : : Label * lblInfoCommand1 ;
Gtk : : Label * lblInfoDefaultDonw ;
Gtk : : Label * lblHeaderAboutTopic ;
Gtk : : Label * lblInfoCommand ;
Gtk : : Label * lblInfoCommand2 ;
Gtk : : Label * lblInfoCommand1 ;
Gtk : : Label * lblLoadMenu ;
Gtk : : Label * lblHeaderAboutTopic ;
Gtk : : Label * lblInfoInputTerminal ;
Gtk : : Label * lblInfoCommand2 ;
Gtk : : Label * lblInfoOutputTerminal ;
Gtk : : Label * lblLoadMenu ;
Gtk : : Label * lblHeaderName ;
Gtk : : Label * lblInfoInputTerminal ;
Gtk : : Label * lblInfoHead ;
Gtk : : Label * lblInfoOutputTerminal ;
Gtk : : CheckButton * chbVgaText ;
Gtk : : Label * lblHeaderName ;
Gtk : : CheckButton * chbLoadVariantSelectionTimer ;
Gtk : : Label * lblInfoHead ;
Gtk : : Entry * entryKernel ;
Gtk : : CheckButton * chbVgaText ;
Gtk : : Entry * entryIPT ;
Gtk : : CheckButton * chbLoadVariantSelectionTimer ;
Gtk : : Entry * entryOTT ;
Gtk : : Entry * entryKernel ;
Gtk : : Box * boxColor ;
Gtk : : Entry * entryIPT ;
Gtk : : AboutDialog * aboutWindows ;
Gtk : : Entry * entryOTT ;
Gtk : : MenuItem * btnAbout ;
Gtk : : Box * boxColor ;
Gtk : : MenuItem * btnSynopsis ;
Gtk : : AboutDialog * aboutWindows ;
Gtk : : MenuItem * btnSaveLocalGlob ;
Gtk : : MenuItem * btnAbout ;
Gtk : : MenuItem * btnSaveLocal ;
Gtk : : MenuItem * btnSynopsis ;
Gtk : : MenuItem * btnSaveGlob ;
Gtk : : MenuItem * btnSaveLocalGlob ;
Gtk : : MenuItem * btnLoadGlob ;
Gtk : : MenuItem * btnSaveLocal ;
Gtk : : MenuItem * btnLoadLocal ;
Gtk : : MenuItem * btnSaveGlob ;
Gtk : : Button * btnLoad ;
Gtk : : MenuItem * btnLoadGlob ;
Gtk : : Button * btnSave ;
Gtk : : MenuItem * btnLoadLocal ;
Gtk : : Button * btnSettings ;
Gtk : : Button * btnLoad ;
Gtk : : Widget * boxButton ;
Gtk : : Button * btnSave ;
Gtk : : Widget * boxSave ;
Gtk : : Button * btnSettings ;
Gtk : : Box * boxInfoError ;
Gtk : : Widget * boxButton ;
Gtk : : Box * boxWidgetAll ;
Gtk : : Widget * boxSave ;
Gtk : : Label * lblWarning ;
Gtk : : Box * boxInfoError ;
Gtk : : Image * imgInfo ;
Gtk : : Box * boxWidgetAll ;
Gtk : : ButtonBox * btnBoxAboutDialog ;
Gtk : : Label * lblWarning ;
Gtk : : TreeView * treeViewKernel ;
Gtk : : Image * imgInfo ;
Gtk : : TreeView * treeViewIPT ;
Gtk : : ButtonBox * btnBoxAboutDialog ;
Gtk : : TreeView * treeViewOTT ;
Gtk : : TreeView * treeViewKernel ;
Gtk : : Image * imgBG ;
Gtk : : TreeView * treeViewIPT ;
Gtk : : Overlay * overHead ;
Gtk : : TreeView * treeViewOTT ;
Gtk : : ComboBoxText * cmbDefaultDonw ;
Gtk : : Image * imgBG ;
Gtk : : ComboBoxText * cmbDownloadMode ;
Gtk : : Overlay * overHead ;
Gtk : : CheckButton * chbSecurityLogin ;
Gtk : : ComboBoxText * cmbDefaultDonw ;
Gtk : : CheckButton * chbPasswordProtecc ;
Gtk : : ComboBoxText * cmbDownloadMode ;
Gtk : : Entry * entrySecurityLogin ;
Gtk : : CheckButton * chbSecurityLogin ;
Gtk : : Entry * entryPasswordProtecc ;
Gtk : : CheckButton * chbPasswordProtecc ;
Gtk : : Label * lblHeadeWndWeb ;
Gtk : : Entry * entrySecurityLogin ;
Gtk : : Entry * entryPasswordProtecc ;
Gtk : : Label * lblHeadeWndWeb ;
Gtk : : Label * lblwebHeaderName ;
Gtk : : Label * lblwebHeaderName ;
Gtk : : Label * lblhelpText ;
Gtk : : Label * lblhelpText ;
Gtk : : Label * lblhelpHeader ;
Gtk : : Label * lblhelpHeader ;
Gtk : : CheckButton * chkAlwaysOpenHelp ;
Gtk : : CheckButton * chkAlwaysOpenHelp ;
Gtk : : Button * btnReadHelp ;
Gtk : : Button * btnReadHelp ;
Gtk : : Button * btnCancelHelp ;
Gtk : : Button * btnCancelHelp ;
Gtk : : Window * wndShowWeb ;
Gtk : : Window * wndShowWeb ;
Gtk : : Button * btnOpenMenuOS ;
Gtk : : Entry * entrListOS ;
std : : vector < std : : string > vec_Option_kernel ;
std : : vector < std : : string > vec_Option_kernel ;
std : : vector < std : : string > vec_Option_IPT ;
std : : vector < std : : string > vec_Option_IPT ;
std : : vector < std : : string > vec_Option_OTT ;
std : : vector < std : : string > vec_Option_OTT ;
Glib : : RefPtr < Gtk : : ListStore > list_store_kernel ;
Glib : : RefPtr < Gtk : : ListStore > list_store_kernel ;
Glib : : RefPtr < Gtk : : ListStore > list_store_IPT ;
Glib : : RefPtr < Gtk : : ListStore > list_store_IPT ;
Glib : : RefPtr < Gtk : : ListStore > list_store_OTT ;
Glib : : RefPtr < Gtk : : ListStore > list_store_OTT ;
# ifdef WEBKIT_FOUND
# ifdef WEBKIT_FOUND
Gtk : : Window * wndWeb ;
Gtk : : Window * wndWeb ;
Gtk : : Widget * three ;
Gtk : : Widget * three ;
WebKitWebView * one ;
WebKitWebView * one ;
# endif
# endif
void set_entry_to_tree_view ( Glib : : RefPtr < Gtk : : ListStore > & list_store , Gtk : : Entry & entry , std : : vector < std : : string > & vec_Option , int size , string key ) ;
Gtk : : TreeModel : : Row row_kernel ;
Gtk : : TreeModel : : Row row_IPT ;
Gtk : : TreeModel : : Row row_OTT ;
std : : map < string , string > map_cmd_selection ;
std : : map < string , string > map_global_cmd_selection ;
std : : map < string , string > map_local_cmd_selection ;
Gtk : : Label * lblDownloadMode ;
void set_entry_to_tree_view ( Glib : : RefPtr < Gtk : : ListStore > & list_store , Gtk : : Entry & entry , std : : vector < std : : string > & vec_Option , int size , string key ) ;
Lib_save : : Save obj_save = Lib_save : : Save ( ) ;
Gtk : : TreeModel : : Row row_kernel ;
Lib_Load : : Load obj_load = Lib_Load : : Load ( ) ;
Gtk : : TreeModel : : Row row_IPT ;
Menu_os obj_menu_os = Menu_os ( ) ;
Gtk : : TreeModel : : Row row_OTT ;
vector < string > vec_param_names ;
std : : map < string , string > map_cmd_selection ;
My_Process : : My_Process_system obj_process_system = My_Process : : My_Process_system ( ) ;
std : : map < string , string > map_global_cmd_selection ;
My_Process : : My_Process_call obj_process_call = My_Process : : My_Process_call ( ) ;
std : : map < string , string > map_local_cmd_selection ;
bool flag_load = false ;
bool flag_save_all = false ;
Gtk : : Label * lblDownloadMode ;
bool flag_blocked_tree_view = false ;
Lib_save : : Save obj_save = Lib_save : : Save ( ) ;
bool flag_save_block = false ;
Lib_Load : : Load obj_load = Lib_Load : : Load ( ) ;
bool flag_open_browser = false ;
Menu_os obj_menu_os = Menu_os ( ) ;
string str_last_launched_os = " " ;
vector < string > vec_param_names ;
int index_error = 0 ;
My_Process : : My_Process_system obj_process_system = My_Process : : My_Process_system ( ) ;
string str_flag_load = " " ;
My_Process : : My_Process_call obj_process_call = My_Process : : My_Process_call ( ) ;
size_t size_kernel = 0 ;
bool flag_load = false ;
size_t size_IPT = 0 ;
bool flag_save_all = false ;
size_t size_OTT = 0 ;
bool flag_blocked_tree_view = false ;
Glib : : RefPtr < Gtk : : StyleContext > boxInfo ;
bool flag_save_block = false ;
string str_cmd_error = " " ;
bool flag_open_browser = false ;
template < typename Type >
string str_last_launched_os = " " ;
struct Result {
int index_error = 0 ;
Type response ;
string str_flag_load = " " ;
int error ;
size_t size_kernel = 0 ;
} ;
size_t size_IPT = 0 ;
std : : map < string , string > map_cmd_error ;
size_t size_OTT = 0 ;
Glib : : RefPtr < Gtk : : StyleContext > boxInfo ;
MainWindow ( BaseObjectType * obj , Glib : : RefPtr < Gtk : : Builder > const & builder ) ;
string str_cmd_error = " " ;
MainWindow ( Glib : : RefPtr < Gtk : : Builder > const & builder ) ;
template < typename Type >
~ MainWindow ( ) ;
struct Result
void open_browser ( ) ;
{
void get_menu_boot ( std : : map < string , string > & map_temp ) ;
Type response ;
void set_row_all ( std : : map < string , string > & map_cmd , Glib : : RefPtr < Gtk : : ListStore > & list_store , vector < string > & list_params , size_t size , string key ) ;
int error ;
void set_row ( Glib : : RefPtr < Gtk : : ListStore > & list_store , int size , std : : string name , bool flag_chbox ) ;
} ;
void get_builder ( ) ;
std : : map < string , string > map_cmd_error ;
bool gui_exit ( GdkEventAny * ) ;
void init_dict ( string flag_load ) ;
MainWindow ( BaseObjectType * obj , Glib : : RefPtr < Gtk : : Builder > const & builder ) ;
void add_CSS ( ) ;
MainWindow ( Glib : : RefPtr < Gtk : : Builder > const & builder ) ;
void show_pass ( ) ;
~ MainWindow ( ) ;
void localization ( ) ;
void open_browser ( ) ;
void event ( ) ;
void get_menu_boot ( std : : map < string , string > & map_temp ) ;
void settings ( ) ;
void set_row_all ( std : : map < string , string > & map_cmd , Glib : : RefPtr < Gtk : : ListStore > & list_store , vector < string > & list_params , size_t size , string key ) ;
string pars_last_launched_os ( ) ;
void set_row ( Glib : : RefPtr < Gtk : : ListStore > & list_store , int size , std : : string name , bool flag_chbox ) ;
vector < string > pars_os ( vector < string > & os_control_list ) ;
void get_builder ( ) ;
void fn_event_intelMax1 ( ) ;
bool gui_exit ( GdkEventAny * ) ;
void write_list_entry_os ( vector < string > & os_control_list ) ;
void init_dict ( string flag_load ) ;
void fn_event_intelMax4 ( ) ;
void add_CSS ( ) ;
void synopsis_show ( ) ;
void show_pass ( ) ;
void set_data_cfg ( ) ;
void localization ( ) ;
std : : map < string , vector < string > > format_os_list ( vector < string > & os_control_list ) ;
void event ( ) ;
void set_active_boot_second ( ) ;
void settings ( ) ;
void get_download_mode ( std : : map < string , string > & map_temp ) ;
string pars_last_launched_os ( ) ;
void view_add_cell ( Gtk : : TreeModel : : Row & row , Glib : : RefPtr < Gtk : : ListStore > list_store_m , std : : array < std : : vector < std : : string > , 5 > & arr_view , size_t index ) ;
vector < string > pars_os ( vector < string > & os_control_list ) ;
void wrapper_system ( string cmd , string thread_str ) ;
void fn_event_intelMax1 ( ) ;
struct Result < string > wrapper_call ( string cmd ) ;
void write_list_entry_os ( vector < string > & os_control_list ) ;
void log_mess_error ( string & cmd ) ;
void fn_event_intelMax4 ( ) ;
void wrapper_save_all_cfg ( ) ;
void synopsis_show ( ) ;
void wrapper_save_local_cfg ( ) ;
void set_data_cfg ( ) ;
void wrapper_save_global_cfg ( ) ;
std : : map < string , vector < string > > format_os_list ( vector < string > & os_control_list ) ;
bool save_template ( string cmd , string cmd_remove , string flag_save ) ;
void set_active_boot_second ( ) ;
void view_add_colums ( Gtk : : TreeView & treeView ) ;
void get_download_mode ( std : : map < string , string > & map_temp ) ;
vector < string > read_file_and_view ( string file_name , Gtk : : TreeModel : : Row & row , Glib : : RefPtr < Gtk : : ListStore > list_store_m ) ;
void view_add_cell ( Gtk : : TreeModel : : Row & row , Glib : : RefPtr < Gtk : : ListStore > list_store_m , std : : array < std : : vector < std : : string > , 5 > & arr_view , size_t index ) ;
void download_local_cfg ( ) ;
void wrapper_system ( string cmd , string thread_str ) ;
void template_open_browser ( ) ;
struct Result < string > wrapper_call ( string cmd ) ;
void download_globl_cfg ( ) ;
void log_mess_error ( string & cmd ) ;
void flag_block_gui ( ) ;
void wrapper_save_all_cfg ( ) ;
void info_status_app ( string stule ) ;
void wrapper_save_local_cfg ( ) ;
bool check_save ( string flag_save , string key_name ) ;
void wrapper_save_global_cfg ( ) ;
void info_warning_error ( int mess ) ;
bool save_template ( string cmd , string cmd_remove , string flag_save ) ;
int check_root ( ) ;
void view_add_colums ( Gtk : : TreeView & treeView ) ;
bool focus_out_txt_kernel ( GdkEventFocus * ) ;
vector < string > read_file_and_view ( string file_name , Gtk : : TreeModel : : Row & row , Glib : : RefPtr < Gtk : : ListStore > list_store_m ) ;
bool focus_out_txt_IPT ( GdkEventFocus * ) ;
void download_local_cfg ( ) ;
bool focus_out_txt_OTT ( GdkEventFocus * ) ;
void template_open_browser ( ) ;
void fill_in_view ( ) ;
void download_globl_cfg ( ) ;
bool focus_tree_view ( GdkEventFocus * ) ;
void flag_block_gui ( ) ;
void set_security_login ( ) ;
void info_status_app ( string stule ) ;
void get_security_login ( std : : map < string , string > & map_temp ) ;
bool check_save ( string flag_save , string key_name ) ;
bool check_flag_save ( string flag_save ) ;
void info_warning_error ( int mess ) ;
void set_download_mode ( ) ;
int check_root ( ) ;
void change_password_protecc ( ) ;
bool focus_out_txt_kernel ( GdkEventFocus * ) ;
bool focus_out_txt_login ( GdkEventFocus * ) ;
bool focus_out_txt_IPT ( GdkEventFocus * ) ;
void change_security_login ( ) ;
bool focus_out_txt_OTT ( GdkEventFocus * ) ;
void get_default_load ( std : : map < string , string > & map_temp ) ;
void fill_in_view ( ) ;
bool focus_out_txt_password ( GdkEventFocus * ) ;
bool focus_tree_view ( GdkEventFocus * ) ;
void get_password_protec ( std : : map < string , string > & map_temp ) ;
void set_security_login ( ) ;
void set_password_protec ( ) ;
void get_security_login ( std : : map < string , string > & map_temp ) ;
void set_entry ( Gtk : : Entry * entry , std : : map < string , string > & map_temp , string key ) ;
bool check_flag_save ( string flag_save ) ;
void load_template ( std : : map < string , string > * map_temp , string cmd ) ;
void set_download_mode ( ) ;
vector < string > get_setting_entry_all ( string key , std : : map < string , string > * map_temp ) ;
void change_password_protecc ( ) ;
void cmd_entry_all ( Gtk : : Entry & entry , string cmd_settings , string cmd_remove ) ;
bool focus_out_txt_login ( GdkEventFocus * ) ;
void item_selected_kernel ( const Gtk : : TreeModel : : Path & , const Gtk : : TreeModel : : iterator & ) ;
void change_security_login ( ) ;
void item_selected_OTT ( const Gtk : : TreeModel : : Path & , const Gtk : : TreeModel : : iterator & ) ;
void get_default_load ( std : : map < string , string > & map_temp ) ;
void item_selected_IPT ( const Gtk : : TreeModel : : Path & , const Gtk : : TreeModel : : iterator & ) ;
bool focus_out_txt_password ( GdkEventFocus * ) ;
string template_item_selected ( int size , Glib : : RefPtr < Gtk : : ListStore > & list_store , string key ) ;
void get_password_protec ( std : : map < string , string > & map_temp ) ;
void set_password_protec ( ) ;
void set_entry ( Gtk : : Entry * entry , std : : map < string , string > & map_temp , string key ) ;
void load_template ( std : : map < string , string > * map_temp , string cmd ) ;
vector < string > get_setting_entry_all ( string key , std : : map < string , string > * 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 < Gtk : : ListStore > & list_store , string key ) ;
} ;
} ;
class SettingsPlug : public Gtk : : Plug {
class SettingsPlug : public Gtk : : Plug
{
public :
public :
Gtk : : Window * window ;
Gtk : : Window * window ;
SettingsPlug ( : : Window p_socketID , Glib : : RefPtr < Gtk : : Builder > builder ) ;
SettingsPlug ( : : Window p_socketID , Glib : : RefPtr < Gtk : : Builder > builder ) ;
@ -330,5 +349,3 @@ private:
} ;
} ;
void help ( ) ;
void help ( ) ;