Merge pull request 'master' (#18) from Igor1/ubl-settings-bootloader:master into develop

Reviewed-on: #18
pull/19/head
Dmitry Razumov 3 years ago
commit a1054e27e2

@ -126,6 +126,7 @@ install: check uninstall
@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
@install -Dm644 -t /usr/share/${PKGNAME}/ grub-melodylist.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; \

@ -0,0 +1 @@
ubbeep,1 22 333 4444 5555
1 ubbeep 1 22 333 4444 5555

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 135 KiB

@ -31,6 +31,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
-fstack-clash-protection -fcf-protection")
set(SOURCE_FILES
menu_os.h
menu_os.cc
ubl-settings-bootloader-cm.h
ubl-settings-bootloader.h
ubl-settings-bootloader.cc

@ -85,7 +85,7 @@ void pars_flag(int index_start, int argc, char* argv[]) {
}
else{
if (index_start == 1){
g_print(_(no_recognized));
g_print(no_recognized);
}
}

@ -0,0 +1,173 @@
#include "menu_os.h"
Menu_os::Menu_os(/* args */)
{
}
Menu_os::~Menu_os()
{
}
void Menu_os::set_last_launched_os(string str_last_launched_os) {
this->str_last_launched_os = str_last_launched_os;
}
void Menu_os::set_builder(Glib::RefPtr<Gtk::Builder>& builder, string path_glade) {
this->builder = builder;
this->path_glade = path_glade;
builder->get_widget("popoverMenuOS", popoverMenuOS);
builder->get_widget("revealerL1", revealerL1);
builder->get_widget("revealerL2", revealerL2);
builder->get_widget("boxALLL3", boxALLL3);
builder->get_widget("boxLevel1", boxLevel1);
builder->get_widget("btnToLev1", btnToLev1);
revealerL1->set_reveal_child(true);
}
void Menu_os::set_map(vector<tuple<string, vector<string>>> &vec_list_os) {
this->vec_list_os = vec_list_os;
}
void Menu_os::init() {
revealerL1->set_reveal_child(true);
revealerL2->set_reveal_child(true);
size_t index_l1 = 0;
string key = "";
for (tuple<string, vector<string>> tuple_os: vec_list_os) {
key = get<0>(tuple_os);
vector<string> vec_value = get<1>(tuple_os);
map_menu_level_1[key] = new struct_menu_level1;
Glib::RefPtr<Gtk::Builder> builder_level_1 = Gtk::Builder::create_from_file(path_glade);
builder_level_1->get_widget("lblRevL1", map_menu_level_1[key]->lblRevL1);
builder_level_1->get_widget("btnToL2AndLv3", map_menu_level_1[key]->btnToL2AndLv3);
builder_level_1->get_widget("boxMenuLevel1", map_menu_level_1[key]->boxMenuLevel1);
map_menu_level_1[key]->btnToL2AndLv3_css = map_menu_level_1[key]->btnToL2AndLv3->get_style_context();
map_menu_level_1[key]->btnToL2AndLv3_css->add_class("noborder");
map_menu_level_1[key]->builder = builder_level_1;
boxLevel1->pack_start(*(map_menu_level_1[key]->boxMenuLevel1));
map_menu_level_1[key]->name = key;
this->html_last_launched_os(key, map_menu_level_1[key]->lblRevL1);
map_menu_level_1[key]->btnToL2AndLv3->signal_clicked().connect(
sigc::bind<Gtk::Label*, string&, string&> (sigc::mem_fun( *this,
&Menu_os::event_template), map_menu_level_1[key]->lblRevL1,
name_level_1, map_menu_level_1[key]->name));
if (vec_value.size()!= 0) {
builder_level_1->get_widget("revealerL3", map_menu_level_1[key]->revealer);
builder_level_1->get_widget("boxLevel3", map_menu_level_1[key]->boxLevel3);
boxALLL3->pack_start(*(map_menu_level_1[key]->revealer));
}
else {
map_menu_level_1[key]->revealer = NULL;
map_menu_level_1[key]->boxLevel3 = NULL;
}
size_t index_l3 = 0;
for (string& str_level_3: vec_value) {
auto builder_level_3 = Gtk::Builder::create_from_file(path_glade);
map_menu_level_1[key]->vec_menu_level_3.push_back(new struct_menu_level_3);
builder_level_3->get_widget("btnToL3",
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3);
builder_level_3->get_widget("lblToL3",
map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3);
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3_css =
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3->get_style_context();
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3_css->add_class("noborder");
this->html_last_launched_os(str_level_3, map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3);
map_menu_level_1[key]->boxLevel3->pack_start(
*(map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3));
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3->signal_clicked().connect(
sigc::bind<Gtk::Label*, string&, string&> (sigc::mem_fun(*this,
&Menu_os::event_template), map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3,
name_level_3, map_menu_level_1[key]->name));
map_menu_level_1[key]->vec_menu_level_3[index_l3]->builder_level_3 = builder_level_3;
index_l3 += 1;
}
index_l1 += 1;
}
}
void Menu_os::close_revealer() {
for (auto& [key, values]: map_menu_level_1) {
if (values->revealer != NULL) {
values->revealer->set_reveal_child(false);
}
}
}
void Menu_os::show() {
revealerL1->set_reveal_child(true);
revealerL2->set_reveal_child(false);
this->close_revealer();
popoverMenuOS->show_all();
}
void Menu_os::event() {
btnToLev1->signal_clicked().connect(sigc::mem_fun(*this, &Menu_os::to_l1));
}
void Menu_os::set_entry(Gtk::Entry *entry) {
this->entry = entry;
}
void Menu_os::event_template(Gtk::Label* label, string& name_level, string& key) {
name_level = label->get_label();
key_global = key;
Utils::str_remove(name_level_1, "<b>");
Utils::str_remove(name_level_1, "</b>");
Utils::str_remove(name_level_3, "<b>");
Utils::str_remove(name_level_3, "</b>");
Gtk::Revealer *revealer = map_menu_level_1[key]->revealer;
if (&name_level == &name_level_1 && map_menu_level_1[key]->vec_menu_level_3.size() != 0) {
revealerL1->set_reveal_child(false);
revealerL2->set_reveal_child(true);
this->close_revealer();
revealer->set_reveal_child(true);
name_level_3 = "";
//entry->set_text(name_level_1);
}
else if (map_menu_level_1[key]->vec_menu_level_3.size() == 0) {
entry->set_text(name_level_1);
name_level_3 = "";
popoverMenuOS->hide();
}
else {
popoverMenuOS->hide();
entry->set_text(name_level_1 + name_level_3);
}
}
void Menu_os::to_l1() {
revealerL1->set_reveal_child(true);
revealerL2->set_reveal_child(false);
map_menu_level_1[key_global]->revealer->set_reveal_child(false);
key_global = "";
}
void Menu_os::html_last_launched_os(string name_os, Gtk::Label *label) {
string margin_name_os = "";
size_t index_find = this->str_last_launched_os.find(">");
size_t len_last_launched_os = this->str_last_launched_os.length();
if (index_find != string::npos) {
string level_1 = this->str_last_launched_os.substr(0, index_find + 1);
string level_3 = this->str_last_launched_os.substr(index_find + 1, len_last_launched_os - 1);
if (name_os == level_1) {
margin_name_os = "<b>" + name_os + "</b>";
label->set_markup(margin_name_os);
}
else if (name_os == level_3) {
margin_name_os = "<b>" + name_os + "</b>";
label->set_markup(margin_name_os);
}
else {
label->set_text(name_os);
}
}
else {
if (this->str_last_launched_os == name_os) {
margin_name_os = "<b>" + name_os + "</b>";
label->set_markup(margin_name_os);
}
else {
label->set_text(name_os);
}
}
}

@ -0,0 +1,67 @@
#ifndef Menu_os_H
#define Menu_os_H
#include <gtkmm.h>
#include <map>
#include <iostream>
#include <vector>
#include "util.h"
using namespace std;
class Menu_os
{
private:
Glib::RefPtr<Gtk::Builder> builder;
vector<tuple<string, vector<string>>> vec_list_os;
Gtk::Popover *popoverMenuOS;
Gtk::Revealer *revealerL1;
Gtk::Revealer *revealerL2;
Gtk::Button *btnToLev1;
string str_last_launched_os = "";
private:
string name_level_1 = "";
string name_level_3 = "";
string key_global = "";
Gtk::Entry *entry;
string path_glade = "";
Gtk::Box *boxALLL3;
Gtk::Box *boxLevel1;
struct struct_menu_level_3 {
Gtk::Button *btnToL3;
Gtk::Label *lblToL3;
Glib::RefPtr<Gtk::Builder> builder_level_3;
Glib::RefPtr<Gtk::StyleContext> btnToL3_css;
};
struct struct_menu_level1 {
Gtk::Label *lblRevL1;
Gtk::Button *btnToL2AndLv3;
Gtk::Revealer *revealer;
Gtk::Box *boxLevel3;
Gtk::Box *boxMenuLevel1;
string name;
Glib::RefPtr<Gtk::Builder> builder;
vector<struct struct_menu_level_3*> vec_menu_level_3;
Glib::RefPtr<Gtk::StyleContext> btnToL2AndLv3_css;
};
std::map<string, struct struct_menu_level1*> map_menu_level_1;
public:
Menu_os(/* args */);
void set_builder(Glib::RefPtr<Gtk::Builder>& builder, string path_glade);
void set_map(vector<tuple<string, vector<string>>> &vec_list_os);
void init();
void show();
void close_revealer();
void settings();
void html_last_launched_os(string name_os, Gtk::Label *label);
void set_last_launched_os(string str_last_launched_os);
void set_entry(Gtk::Entry *entry);
void event_template(Gtk::Label* label, string& name_level, string& key);
void event();
void to_l1();
~Menu_os();
};
#endif

@ -11,23 +11,20 @@ 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)
CmdArgParser::CmdArgParser(const string& p_name, const string& p_description, const 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);
@ -71,9 +68,10 @@ void MainWindow::settings(){
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");
vec_param_names.push_back("GRUB_PLAY");
vec_param_names.push_back("GRUB_SUPERUSERS");
this->get_builder();
this->localization();
this->add_CSS();
@ -93,15 +91,20 @@ void MainWindow::settings(){
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<string> 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();
vector<tuple<string, vector<string>>> vec_list_os = format_os_list(os_control_list);
obj_menu_os.set_builder(builder, path_glade);
obj_menu_os.set_map(vec_list_os);
obj_menu_os.set_entry(entrListOS);
// obj_menu_os.set_last_launched_os(map_global_cmd_selection["GRUB_DEFAULT"]);
obj_menu_os.set_last_launched_os(this->str_last_launched_os);
obj_menu_os.init();
obj_menu_os.event();
}
else{
boxWidgetAll->set_sensitive(false);
@ -116,6 +119,39 @@ void MainWindow::settings(){
this->event();
}
vector<tuple<string, vector<string>>> MainWindow::format_os_list(vector<string> &os_control_list) {
vector<tuple<string, vector<string>>> vec_list_os;
set<string> set_key;
for (string& name_os : os_control_list) {
if (name_os.find(">") != string::npos) {
set_key.insert(name_os.substr(0,name_os.find(">")+1));
}
else {
vector<string> vec_os;
tuple<string, vector<string>> t1(name_os, vec_os);
vec_list_os.push_back(t1);
}
}
set<string>::iterator it = set_key.begin();
for (int index = 1; it != set_key.end(); index++, it++) {
bool flag = false;
string name_os_buff = "";
vector<string> vec_os_values;
for (string& name_os : os_control_list) {
if (name_os.find(*it) != string::npos) {
flag = true;
vec_os_values.push_back(name_os.substr(name_os.find(">")+1, name_os.length() - 1));
name_os_buff = *it;
}
}
if (flag) {
tuple<string, vector<string>> t1(name_os_buff, vec_os_values);
vec_list_os.push_back(t1);
}
}
return vec_list_os;
}
vector<string> MainWindow::pars_os(vector<string> &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');
@ -127,12 +163,6 @@ string MainWindow::pars_last_launched_os() {
return str_list_os;
}
void MainWindow::write_list_entry_os(vector<string> &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);
@ -163,7 +193,6 @@ void MainWindow::fill_in_view() {
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);
@ -175,13 +204,25 @@ void MainWindow::fill_in_view() {
this->view_add_colums(*treeViewOTT);
}
void MainWindow::view_add_colums_user(Gtk::TreeView &treeView) {
treeView.append_column_editable(str_administrator, m_columns_user.check_button);
treeView.append_column_editable(str_user, m_columns_user.name);
treeView.append_column_editable(str_password, m_columns_user.password);
}
void MainWindow::view_add_colums_melody(Gtk::TreeView &treeView) {
treeView.append_column_editable(str_active, m_columns_melody.check_button);
treeView.append_column_editable(str_option, m_columns_melody.title);
treeView.append_column_editable(str_melody_code, m_columns_melody.melody_code);
}
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();
treeViewIPT->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
if (flag_blocked_tree_view == false) {
string str_flags = template_item_selected(size_kernel, list_store_kernel);
string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX");
Utils::str_replace_all(str_flags, " \"", "\"");
Utils::str_replace_all(str_flags, "\"", "");
map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags;
@ -191,12 +232,12 @@ void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::Tr
}
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();
treeViewIPT->get_selection()->unselect_all();
treeViewKernel->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
if (flag_blocked_tree_view == false) {
string str_flags = template_item_selected(size_OTT, list_store_OTT);
string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT");
Utils::str_replace_all(str_flags, " \"", "\"");
Utils::str_replace_all(str_flags, "\"", "");
map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags;
@ -204,13 +245,14 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM
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();
treeViewKernel->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
if (flag_blocked_tree_view == false) {
string str_flags = template_item_selected(size_IPT, list_store_IPT);
string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT");
Utils::str_replace_all(str_flags, " \"", "\"");
Utils::str_replace_all(str_flags, "\"", "");
map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags;
@ -272,88 +314,26 @@ void MainWindow::set_download_mode() {
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 <string, string> &map_temp) {
// Todo;
std::map <string, string>:: 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 <string, string> &map_temp) {
std::map <string, string>:: 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<Gtk::ListStore> &list_store) {
string cmds = "";
string MainWindow::template_item_selected(int size, Glib::RefPtr<Gtk::ListStore> &list_store, string key) {
string cmds = map_cmd_selection[key];
Utils::str_replace_all(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] + " ";
string param = row[m_columns.name] + "";
if (row[m_columns.check_button] == true && cmds.find(param) == string::npos) {
cmds += " " + param + " ";
}
if (row[m_columns.check_button] == false && cmds.find(param) != string::npos) {
Utils::str_remove(cmds, param);
}
}
}
Utils::str_replace_all(cmds, " ", " ");
if (cmds.length() > 0) {
if (cmds[0] == ' ') {
cmds = cmds.substr(1, cmds.length() - 1);
}
}
cmds = "\"" + cmds + "\"";
return cmds;
@ -361,8 +341,8 @@ string MainWindow::template_item_selected(int size, Glib::RefPtr<Gtk::ListStore>
vector<string> MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m) {
std::array<std::vector<std::string>, 5> arr_view = Utils::read_csv(string(path_resources) + "/" + file_name);
std::vector<std::string> vec_Option = arr_view[0];
std::array<std::vector<string>, 5> arr_view = Utils::read_csv(string(path_resources) + "/" + file_name);
std::vector<string> 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);
@ -376,7 +356,7 @@ void MainWindow::view_add_colums(Gtk::TreeView &treeView) {
treeView.append_column(str_description, m_columns.description);
}
void MainWindow::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 MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m , std::array<std::vector<string>, 5> &arr_view , size_t index) {
row = *(list_store_m->append());
bool flag_chb = false;
string name = arr_view[0][index];
@ -399,15 +379,12 @@ void MainWindow::get_builder() {
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);
@ -432,16 +409,10 @@ void MainWindow::get_builder() {
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);
@ -449,7 +420,16 @@ void MainWindow::get_builder() {
builder->get_widget("btnReadHelp", btnReadHelp);
builder->get_widget("btnCancelHelp", btnCancelHelp);
builder->get_widget("wndShowWeb", wndShowWeb);
builder->get_widget("btnOpenMenuOS", btnOpenMenuOS);
builder->get_widget("entrListOS", entrListOS);
builder->get_widget("treeViewUser", treeViewUser);
builder->get_widget("treeViewMelody", treeViewMelody);
builder->get_widget("lblBootMenuUsers", lblBootMenuUsers);
builder->get_widget("lblRingtoneStartup", lblRingtoneStartup);
builder->get_widget("btnAddUser", btnAddUser);
builder->get_widget("btnRemoveUser", btnRemoveUser);
builder->get_widget("btnAddMusic", btnAddMusic);
builder->get_widget("btnRemoveMusic", btnRemoveMusic);
}
void MainWindow::localization() {
@ -467,6 +447,8 @@ void MainWindow::localization(){
lblHeaderName->set_text(name_app);
aboutWindows->set_comments(system_boot);
lblHeaderAboutTopic->set_label(str_about);
lblBootMenuUsers->set_text(str_title_Boot_Menu_Users);
lblRingtoneStartup->set_text(str_title_Ringtone_Startup);
aboutWindows->set_website_label(project_Home_page);
lblInfoCommand->set_text(command_line_parameters);
lblInfoCommand1->set_text(command_line_parameters);
@ -489,18 +471,11 @@ void MainWindow::localization(){
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));
@ -527,58 +502,34 @@ vector<string> MainWindow::get_setting_entry_all(string key, std::map <string, s
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;
void MainWindow::focus_out_txt_kernel() {
this->set_entry_to_tree_view(list_store_kernel, *entryKernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX");
this->set_row_all(map_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX");
flag_blocked_tree_view = false;
}
}
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;
void MainWindow::focus_out_txt_IPT() {
this->set_entry_to_tree_view(list_store_IPT, *entryIPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT");
this->set_row_all(map_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT");
flag_blocked_tree_view = false;
}
bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) {
this->set_entry_to_tree_view(list_store_kernel, *entryKernel, vec_Option_kernel, size_kernel);
return true;
void MainWindow::focus_out_txt_OTT() {
this->set_entry_to_tree_view(list_store_OTT, *entryOTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT");
this->set_row_all(map_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT");
flag_blocked_tree_view = false;
}
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);
bool MainWindow::focus_in_txt_entry(GdkEventFocus*) {
treeViewKernel->get_selection()->unselect_all();
treeViewIPT->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
return true;
}
void MainWindow::set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size) {
void MainWindow::set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size, string key) {
flag_blocked_tree_view = true;
vector<string> vec_params;
std::string text = entry.get_text();
@ -590,7 +541,16 @@ void MainWindow::set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store
for (auto &name: vec_params) {
this->set_row(list_store, size, name, true);
}
flag_blocked_tree_view = false;
Utils::str_replace_all(text, ",", " ");
if (text.length() > 0) {
if (text[0] == ' ') {
text = text.substr(1, text.length() - 1);
}
}
if (text.find("\"") == string::npos && text.length() != 0) {
text = "\"" + text + "\"";
}
map_cmd_selection[key] = text;
}
void MainWindow::get_menu_boot(std::map <string, string> &map_temp) {
@ -629,10 +589,16 @@ void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cm
else {
obj_process_system.call(cmd_remove, "");
}
}
void MainWindow::event() {
btnRemoveUser->signal_clicked().connect([&]() {remove_user();});
btnRemoveMusic->signal_clicked().connect([&]() {remove_melody();});
btnAddUser->signal_clicked().connect([&]() {string name = "", passwd = "";
set_add_data_user(row_user, false, name, passwd);});
btnAddMusic->signal_clicked().connect([&]() {string code = "", name = "";
set_add_data_melody(row_melody, false,name, code);});
btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();});
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));
@ -643,13 +609,9 @@ void MainWindow::event(){
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();});
entryKernel->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel));
entryIPT->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT));
entryOTT->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
if (this->check_root() == 0) {
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
@ -657,71 +619,324 @@ void MainWindow::event(){
treeViewIPTModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_IPT));
Glib::RefPtr<Gtk::TreeModel> 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));
entryKernel->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
entryIPT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
entryOTT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
}
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::set_tree_view_user() {
string key = "";
string users_root = "";
string password = "";
bool flag_available = false;
Glib::RefPtr<Gtk::TreeModel> treeViewUser_model = treeViewUser->get_model();
Gtk::TreeModel::Children children = treeViewUser_model->children();
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
if(row) {
string superuser_name = row[m_columns_user.name] + "";
if (row[m_columns_user.check_button] && superuser_name.length() != 0) {
key = "GRUB_PASSWORD[" + superuser_name + "]";
password = row[m_columns_user.password] + "";
if (password != "************") {
map_cmd_selection[key] = password;
flag_available = false;
for (size_t index = 0; index < vec_param_names.size(); index++) {
if (vec_param_names[index] == map_cmd_selection[key]) {
flag_available = true;
}
}
if (flag_available == false) {
vec_param_names.push_back(key);
}
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);
else {
// map_cmd_selection[key] = "";
}
if (row[m_columns_user.check_button]) {
if (users_root.length() != 0) {
users_root = users_root + "," + superuser_name;
}
void MainWindow::get_default_load(std::map <string, string> &map_temp) {
std::map <string, string>:: 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;
else {
users_root = users_root + row[m_columns_user.name];
}
}
}
}
}
if (users_root.length() != 0) {
map_cmd_selection["GRUB_SUPERUSERS"] = users_root;
}
else {
map_cmd_selection["GRUB_SUPERUSERS"] = "";
}
}
void MainWindow::set_init_data_user(std::map<string, string> &map_temp) {
treeViewUser->remove_all_columns();
list_store_user = Gtk::ListStore::create(m_columns_user);
treeViewUser->set_model(list_store_user);
vector<string> vec_users;
string buf_key = "";
string password = "";
for (auto& [key, value]: map_temp) {
if (key.find("GRUB_PASSWORD[") != string::npos) {
buf_key = key;
vec_param_names.push_back(buf_key);
Utils::str_remove(buf_key,"GRUB_PASSWORD[");
Utils::str_remove(buf_key,"]");
if (value.length() != 0) {
cmbDefaultDonw->set_active_text(value);
password = "************";
this->set_add_data_user(row_user, false, buf_key, password);
}
}
}
Glib::RefPtr<Gtk::TreeModel> treeViewUserModel = treeViewUser->get_model();
treeViewUserModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::remove_line_user));
this->view_add_colums_user(*treeViewUser);
}
void MainWindow::set_init_data_superuser(std::map<string, string> &map_temp) {
Glib::RefPtr<Gtk::TreeModel> treeViewUser_model = treeViewUser->get_model();
string names_superusers = map_temp["GRUB_SUPERUSERS"];
vector<string> vec_superusers = Utils::split(names_superusers, ',');
Gtk::TreeModel::Children children = treeViewUser_model->children();
for (string& str_superuser: vec_superusers) {
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
if (row[m_columns_user.name] == str_superuser) {
row[m_columns_user.check_button] = true;
}
}
}
}
void MainWindow::set_data_csv_melody() {
string path_name = "";
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
string line;
string all_melody = "";
string all_melody_old = "";
string code_melodyes = "";
ifstream in(path_name);
if (in.is_open()) {
while (getline(in, line)) {
all_melody_old += line + "\n";
}
}
Glib::RefPtr<Gtk::TreeModel> treeViewMelody_model = treeViewMelody->get_model();
Gtk::TreeModel::Children children = treeViewMelody_model->children();
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
code_melodyes = row[m_columns_melody.melody_code] + "";
if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) {
all_melody += row[m_columns_melody.title] + "," + code_melodyes + "\n";
if (row[m_columns_melody.check_button]) {
map_cmd_selection["GRUB_PLAY"] = code_melodyes + "";
}
else {
map_cmd_selection["GRUB_PLAY"] = "";
}
}
else {
cmbDefaultDonw->set_active(0);
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
info_status_app(info_box_error_css);
lblWarning->set_text(str_null_melody_name);
}
}
if (all_melody_old != all_melody) {
ofstream fout(path_name, ios_base::out | ios_base::trunc);
if (fout.is_open()) {
fout << all_melody;
fout.close();
}
}
}
void MainWindow::set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password) {
row = *(list_store_user->append());
row[m_columns_user.check_button] = flag;
row[m_columns_user.name] = name;
row[m_columns_user.password] = password;
}
void MainWindow::set_init_data_melody(std::map<string, string> &map_temp) {
treeViewMelody->remove_all_columns();
list_store_melody = Gtk::ListStore::create(m_columns_melody);
treeViewMelody->set_model(list_store_melody);
string path_name = "";
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
vector<tuple<string, string>> vec_melody = Utils::read_csv_melody(path_name);
bool flag = false;
string cgf_code_melody = map_temp["GRUB_PLAY"];
for (tuple<string, string>& tuple_melody: vec_melody) {
string name = get<0>(tuple_melody);
string code = get<1>(tuple_melody);
flag = (cgf_code_melody == code);
this->set_add_data_melody(row_melody, flag, name, code);
}
Glib::RefPtr<Gtk::TreeModel> treeViewMelodyModel = treeViewMelody->get_model();
treeViewMelodyModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::remove_line_melody));
this->view_add_colums_melody(*treeViewMelody);
}
void MainWindow::set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string &name, string &code) {
row = *(list_store_melody->append());
row[m_columns_melody.check_button] = flag;
row[m_columns_melody.title] = name;
row[m_columns_melody.melody_code] = code;
}
void MainWindow::remove_user() {
if (flag_validate_del_user && list_store_user->iter_is_valid(iter_user_del)) {
Gtk::TreeModel::Row row = *iter_user_del;
if(row) {
string name = row[m_columns_user.name] + "";
string key = "GRUB_PASSWORD[" + name + "]";
map_cmd_selection[key] = "";
}
list_store_user->erase(iter_user_del);
flag_validate_del_user = false;
info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text("");
}
flag_validate_del_user = false;
}
void MainWindow::remove_melody() {
if (flag_validate_del_melody && list_store_melody->iter_is_valid(iter_melody_del)) {
list_store_melody->erase(iter_melody_del);
flag_validate_del_melody = false;
info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text("");
}
flag_validate_del_melody = false;
}
void MainWindow::remove_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
treeViewKernel->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewIPT->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
iter_user_del = iter;
flag_validate_del_user = true;
bool flag_error = false;
string name = "";
string password = "";
Glib::RefPtr<Gtk::TreeModel> treeViewUser_model = treeViewUser->get_model();
Gtk::TreeModel::Children children = treeViewUser_model->children();
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
name = row[m_columns_user.name] + "";
password = row[m_columns_user.password] + "";
if (name.length() == 0 || password.length() == 0) {
flag_error = true;
break;
}
}
if (flag_error == true) {
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
info_status_app(info_box_error_css);
lblWarning->set_text(str_null_username);
}
else {
cmbDefaultDonw->set_active(-1);
info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text("");
}
}
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);
void MainWindow::remove_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) {
treeViewKernel->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewIPT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
iter_melody_del = iter;
flag_validate_del_melody = true;
string code_melodyes = "";
string melody_title = "";
bool flag_error = false;
Glib::RefPtr<Gtk::TreeModel> treeViewMelody_model = treeViewMelody->get_model();
Gtk::TreeModel::Children children = treeViewMelody_model->children();
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
code_melodyes = row[m_columns_melody.melody_code] + "";
melody_title = row[m_columns_melody.title] + "";
if (code_melodyes.length() == 0 || melody_title.length() == 0) {
flag_error = true;
break;
}
}
if (flag_error == true) {
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
info_status_app(info_box_error_css);
lblWarning->set_text(str_null_melody_name);
}
else {
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);
this->validate_melody();
}
void MainWindow::validate_melody() {
Glib::RefPtr<Gtk::TreeModel> treeViewMelody_model = treeViewMelody->get_model();
Gtk::TreeModel::Children children = treeViewMelody_model->children();
int count = 0;
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
if (row[m_columns_melody.check_button]) {
count+=1;
}
}
if (count>1) {
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
Gtk::TreeModel::Row row = *iter;
if (row[m_columns_melody.check_button]) {
count-=1;
row[m_columns_melody.check_button] = false;
}
}
}
}
bool MainWindow::focus_tree_view(GdkEventFocus*) {
treeViewKernel->set_can_focus(false);
treeViewIPT->set_can_focus(false);
treeViewOTT->set_can_focus(false);
treeViewKernel->collapse_all();
treeViewIPT->collapse_all();
treeViewOTT->collapse_all();
return true;
}
bool MainWindow::gui_exit(GdkEventAny*) {
exit(1);
return true;
}
void MainWindow::get_default_load(std::map <string, string> &map_temp) {
std::map <string, string>:: 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) {
entrListOS->set_text(value);
}
else {
entrListOS->set_text("");
}
}
else {
boxSave->set_sensitive(true);
entrListOS->set_text("");
}
}
@ -794,7 +1009,6 @@ void MainWindow::wrapper_save_local_cfg() {
map_local_cmd_selection = map_cmd_selection;
}
void MainWindow::set_data_cfg() {
string str_flags = entryKernel->get_text();
Utils::str_remove(str_flags, ",");
@ -815,25 +1029,27 @@ void MainWindow::set_data_cfg() {
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();
string name_os = entrListOS->get_text();
if (name_os.length() != 0) {
map_cmd_selection["GRUB_DEFAULT"] = name_os;
}
else {
map_cmd_selection["GRUB_DEFAULT"] = "";
}
this->set_download_mode();
this->set_security_login();
this->set_password_protec();
this->set_tree_view_user();
this->set_data_csv_melody();
}
void MainWindow::download_globl_cfg() {
str_flag_load = "global";
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() {
str_flag_load = "system";
this->load_template(&map_local_cmd_selection, system_load);
info_warning_error(0);
map_cmd_selection = map_local_cmd_selection;
@ -858,18 +1074,19 @@ void MainWindow::load_template(std::map<string, string>* map_temp, string cmd) {
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"];
this->set_init_data_user(*map_temp);
this->set_init_data_melody(*map_temp);
this->set_init_data_superuser(*map_temp);
if (str_last_launched_os_ubconfig.length() != 0) {
cmbDefaultDonw->set_active_text(str_last_launched_os_ubconfig);
entrListOS->set_text(str_last_launched_os_ubconfig);
}
else {
cmbDefaultDonw->set_active_text(str_last_launched_os);
entrListOS->set_text(str_last_launched_os);
}
}
@ -884,19 +1101,19 @@ void MainWindow::set_entry(Gtk::Entry* entry , std::map<string, string> &map_tem
else {
entry->set_text("");
}
}
void MainWindow::init_dict(string flag_load) {
std::map<std::string, std::string> map_cmd_selection_n;
std::map<string, string> 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_n["GRUB_PLAY"] = "";
map_cmd_selection_n["GRUB_SUPERUSERS"] = "";
map_cmd_selection = map_cmd_selection_n;
if (flag_load == "global") {
map_global_cmd_selection = map_cmd_selection_n;
@ -918,7 +1135,7 @@ void MainWindow::set_row_all(std::map <string, string> &map_cmd, Glib::RefPtr<Gt
}
}
void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox) {
void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, string name, bool flag_chbox) {
for (int index = 0; index < size; index++) {
Gtk::TreeModel::Row row = list_store->children()[index];
if(row) {
@ -957,7 +1174,7 @@ void MainWindow::template_open_browser() {
auto size = static_cast<size_t>(size_s);
std::unique_ptr<char[]> 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 );
cmd = string(buf.get(), buf.get() + size - 1);
}
index_error = system(cmd.c_str());
}

@ -18,6 +18,7 @@
#include "load.h"
#include <dlfcn.h>
#include "ubl-settings-bootloader-cm.h"
#include "menu_os.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
@ -40,7 +41,7 @@ void me_thread(string cmd);
#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 system_boot _("System boot setup")
#define str_about _("About ubl-settings-bootloader")
#define command_line_parameters _("Command line parameters:")
#define load_default _("Load default:")
@ -67,7 +68,8 @@ void me_thread(string cmd);
#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 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")
@ -91,11 +93,31 @@ void me_thread(string cmd);
#define program_as_root _("The program must be run as root")
#define str_active _("Active")
#define str_option _("Option")
#define str_title _("Title")
#define str_user _("User")
#define str_password _("Password")
#define str_administrator _("Administrator")
#define str_select _("Select")
#define str_melody_code _("Melody code")
#define str_ringtone_at_startup _("Ringtone at startup")
#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_title_Boot_Menu_Users _("Boot Menu Users")
#define str_title_Ringtone_Startup _("Ringtone at startup")
#define str_null_melody_name _("Enter the name and code of the tune in the \"Ringtone at startup\" field")
#define str_null_username _("Enter name and password code in the \"Boot Menu Users\" field")
#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 "
@ -129,22 +151,58 @@ public:
private:
int m_socketID = 0;
};
class MainWindow : public Gtk::ApplicationWindow {
class MainWindow : public Gtk::ApplicationWindow
{
public:
class ModelColumns : public Gtk::TreeModel::ColumnRecord {
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
ModelColumns() {add(check_button), add(name); add(description); }
ModelColumns()
{
add(check_button), add(name);
add(description);
}
// Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk::TreeModelColumn<bool> check_button;
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> description;
};
class ModelColumnsUser : public Gtk::TreeModel::ColumnRecord
{
public:
ModelColumnsUser()
{
add(check_button), add(name);
add(password);
}
// Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk::TreeModelColumn<bool> check_button;
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> password;
};
class ModelColumnsMelody : public Gtk::TreeModel::ColumnRecord
{
public:
ModelColumnsMelody()
{
add(check_button), add(title);
add(melody_code);
}
// Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk::TreeModelColumn<bool> check_button;
Gtk::TreeModelColumn<Glib::ustring> title;
Gtk::TreeModelColumn<Glib::ustring> melody_code;
};
ModelColumns m_columns;
ModelColumnsUser m_columns_user;
ModelColumnsMelody m_columns_melody;
Glib::RefPtr<Gtk::Builder> builder;
Gtk::SpinButton *spbSecond;
Gtk::Label *lblBootMenuUsers;
Gtk::Label *lblRingtoneStartup;
Gtk::Label *lblInfoSeconds;
Gtk::Label *lblInfoDefaultDonw;
Gtk::Label *lblInfoCommand;
@ -156,6 +214,10 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblInfoOutputTerminal;
Gtk::Label *lblHeaderName;
Gtk::Label *lblInfoHead;
Gtk::Button *btnAddUser;
Gtk::Button *btnRemoveUser;
Gtk::Button *btnAddMusic;
Gtk::Button *btnRemoveMusic;
Gtk::CheckButton *chbVgaText;
Gtk::CheckButton *chbLoadVariantSelectionTimer;
Gtk::Entry *entryKernel;
@ -183,14 +245,12 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::TreeView *treeViewKernel;
Gtk::TreeView *treeViewIPT;
Gtk::TreeView *treeViewOTT;
Gtk::TreeView *treeViewUser;
Gtk::TreeView *treeViewMelody;
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;
@ -200,6 +260,8 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Button *btnReadHelp;
Gtk::Button *btnCancelHelp;
Gtk::Window *wndShowWeb;
Gtk::Button *btnOpenMenuOS;
Gtk::Entry *entrListOS;
std::vector<std::string> vec_Option_kernel;
std::vector<std::string> vec_Option_IPT;
@ -208,23 +270,30 @@ class MainWindow : public Gtk::ApplicationWindow {
Glib::RefPtr<Gtk::ListStore> list_store_kernel;
Glib::RefPtr<Gtk::ListStore> list_store_IPT;
Glib::RefPtr<Gtk::ListStore> list_store_OTT;
Glib::RefPtr<Gtk::ListStore> list_store_user;
Glib::RefPtr<Gtk::ListStore> list_store_melody;
#ifdef WEBKIT_FOUND
Gtk::Window *wndWeb;
Gtk::Widget *three;
WebKitWebView *one;
#endif
void set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size);
Gtk::TreeModel::Row row_kernel;
Gtk::TreeModel::Row row_IPT;
Gtk::TreeModel::Row row_OTT;
Gtk::TreeModel::Row row_user;
Gtk::TreeModel::Row row_melody;
std::map<string, string> map_cmd_selection;
std::map<string, string> map_global_cmd_selection;
std::map<string, string> map_local_cmd_selection;
Gtk::TreeModel::iterator iter_user_del;
Gtk::TreeModel::iterator iter_melody_del;
bool flag_validate_del_user = false;
bool flag_validate_del_melody = false;
Gtk::Label *lblDownloadMode;
Lib_save::Save obj_save = Lib_save::Save();
Lib_Load::Load obj_load = Lib_Load::Load();
Menu_os obj_menu_os = Menu_os();
vector<string> 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();
@ -235,6 +304,7 @@ class MainWindow : public Gtk::ApplicationWindow {
bool flag_open_browser = false;
string str_last_launched_os = "";
int index_error = 0;
string str_flag_load = "";
size_t size_kernel = 0;
size_t size_IPT = 0;
size_t size_OTT = 0;
@ -251,6 +321,8 @@ class MainWindow : public Gtk::ApplicationWindow {
MainWindow(Glib::RefPtr<Gtk::Builder> const &builder);
~MainWindow();
void open_browser();
void remove_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter);
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);
void get_menu_boot(std::map<string, string> &map_temp);
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);
void set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox);
@ -261,14 +333,22 @@ class MainWindow : public Gtk::ApplicationWindow {
void show_pass();
void localization();
void event();
void remove_user();
void remove_melody();
void settings();
void validate_melody();
void remove_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter);
void view_add_colums_user(Gtk::TreeView &treeView);
void view_add_colums_melody(Gtk::TreeView &treeView);
void set_bat_save(Gtk::Button *btnSave);
string pars_last_launched_os();
vector<string> pars_os(vector<string> &os_control_list);
void fn_event_intelMax1();
void write_list_entry_os(vector<string> &os_control_list);
void fn_event_intelMax4();
void synopsis_show();
void set_data_cfg();
void set_data_csv_melody();
vector<tuple<string, vector<string>>> format_os_list(vector<string> &os_control_list);
void set_active_boot_second();
void get_download_mode(std::map<string, string> &map_temp);
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);
@ -282,6 +362,7 @@ class MainWindow : public Gtk::ApplicationWindow {
void view_add_colums(Gtk::TreeView &treeView);
vector<string> read_file_and_view(string file_name, Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m);
void download_local_cfg();
void set_tree_view_user();
void template_open_browser();
void download_globl_cfg();
void flag_block_gui();
@ -289,21 +370,15 @@ class MainWindow : public Gtk::ApplicationWindow {
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 focus_out_txt_kernel();
void focus_out_txt_IPT();
void focus_out_txt_OTT();
bool focus_in_txt_entry(GdkEventFocus*);
void fill_in_view();
void set_security_login();
void get_security_login(std::map <string, string> &map_temp);
bool focus_tree_view(GdkEventFocus *);
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<string, string> &map_temp);
bool focus_out_txt_password(GdkEventFocus*);
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);
@ -311,10 +386,16 @@ class MainWindow : public Gtk::ApplicationWindow {
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 template_item_selected(int size, Glib::RefPtr<Gtk::ListStore> &list_store, string key);
void set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string &name, string &code);
void set_init_data_melody(std::map<string, string> &map_temp);
void set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password);
void set_init_data_user(std::map<string, string> &map_temp);
void set_init_data_superuser(std::map<string, string> &map_temp);
};
class SettingsPlug : public Gtk::Plug{
class SettingsPlug : public Gtk::Plug
{
public:
Gtk::Window *window;
SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> builder);
@ -325,5 +406,3 @@ private:
};
void help();

@ -50,6 +50,23 @@ array<vector<string>, 5> read_csv(const string& filename) {
return array_vectors;
}
vector<tuple<string, string>> read_csv_melody(const string& filename) {
vector<tuple<string, string>> vec_music;
ifstream file(filename);
string line;
char delimiter = ',';
while (getline(file, line)) {
stringstream stream(line);
string name;
string code;
getline(stream, name, delimiter);
getline(stream, code, delimiter);
tuple<string, string> tuple_music(name, code);
vec_music.push_back(tuple_music);
}
return vec_music;
}
string call(string cmd) {
FILE *fp;
int status;
@ -104,66 +121,5 @@ std::vector<std::string> split(std::string text, char delim) {
}
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 <string> pars_users() {
vector <string> 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;
}
}

@ -1,6 +1,7 @@
#ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include <tuple>
#include <iostream>
#include <sstream>
#include <fstream>
@ -22,6 +23,7 @@
#include <stdio.h>
#include <map>
#include <pwd.h>
#include <set>
using namespace std;
@ -43,9 +45,6 @@ vector<int> 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<std::string> split(std::string text, char delim);
unsigned short read_uid_min_max(string filename, string search);
vector <string> pars_users();
string read_passwd(string username);
int synopsis_show(string str_link);
vector<tuple<string, string>> read_csv_melody(const string& filename);
}
#endif

@ -1,11 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Name=ubl-settings-bootloader
Name[ru]=Настройка загрузчика
GenericName=Настройка загрузчика
GenericName[ru]=Настройка загрузчика
Name[ru]=Настройка загрузки системы
GenericName=Настройка загрузки системы
GenericName[ru]=Настройка загрузки системы
Comment=Bootloader setup application
Comment[ru]=Приложение для настройки загрузчика
Comment[ru]=Приложение для настройки параметров загрузки системы
Type=Application
Exec=pkexec ubl-settings-bootloader
Icon=com.ublinux.ubl-settings-bootloader

File diff suppressed because it is too large Load Diff

@ -17,6 +17,37 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Enter the name and code of the tune in the \"Ringtone at startup\" field"
msgstr ""
msgid "Enter name and password code in the \"Boot Menu Users\" field"
msgstr ""
msgid "Boot Menu Users"
msgstr ""
msgid "Title"
msgstr ""
msgid ""
msgstr ""
msgid "Password"
msgstr ""
msgid "Administrator"
msgstr ""
msgid "Select"
msgstr ""
msgid "Melody code"
msgstr ""
msgid "Ringtone at startup"
msgstr ""
#: 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"
@ -369,7 +400,7 @@ msgstr ""
#: source/ubl-settings-bootloader.h:43 source/ubl-settings-bootloader.h:42
#: source/ubl-settings-bootloader.cc:419
msgid "System boot"
msgid "System boot setup"
msgstr ""
#: source/ubl-settings-bootloader.h:49 source/ubl-settings-bootloader.h:48

@ -24,7 +24,7 @@ msgstr "О программе"
#: source/ubl-settings-bootloader.h:44 source/ubl-settings-bootloader.h:43
msgid "About ubl-settings-bootloader"
msgstr "О программе Загрузка системы"
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
@ -37,7 +37,7 @@ msgstr "Всегда перенаправлять"
#: source/ubl-settings-bootloader.h:96 source/ubl-settings-bootloader.h:95
msgid "Argument not recognized\n"
msgstr ""
msgstr "Аргумент не распознан\n"
#: source/ubl-settings-bootloader.h:66 source/ubl-settings-bootloader.h:65
msgid "Boot menu user name:"
@ -349,6 +349,36 @@ msgstr "Прочитать онлайн"
msgid "Save"
msgstr "Сохранить"
msgid "Boot Menu Users"
msgstr "Пользователи меню загрузчика"
msgid "Title"
msgstr "Название"
msgid "User"
msgstr "Пользователь"
msgid "Enter the name and code of the tune in the \"Ringtone at startup\" field"
msgstr "Введите название и код мелодии в поле \"Мелодия при загрузке\""
msgid "Enter name and password code in the \"Boot Menu Users\" field"
msgstr "Введите имя и код пароль в поле \"Пользователи меню загрузчика\""
msgid "Password"
msgstr "Пароль"
msgid "Administrator"
msgstr "Администратор"
msgid "Select"
msgstr "Выбор"
msgid "Melody code"
msgstr "Код мелодии"
msgid "Ringtone at startup"
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"
@ -389,8 +419,8 @@ msgstr "Успешно записаны локальная и глобальна
#: source/ubl-settings-bootloader.h:43 source/ubl-settings-bootloader.h:42
#: source/ubl-settings-bootloader.cc:419
msgid "System boot"
msgstr "Загрузка системы"
msgid "System boot setup"
msgstr "Настройка загрузки системы"
#: source/ubl-settings-bootloader.h:49 source/ubl-settings-bootloader.h:48
#: source/ubl-settings-bootloader.cc:427
@ -537,7 +567,7 @@ msgstr "splash (Показать окно приветствия)"
#: 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 "Загрузка системы"
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

Loading…
Cancel
Save