|
|
|
|
@ -49,7 +49,7 @@ SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> build
|
|
|
|
|
|
|
|
|
|
int MainWindow::check_root() {
|
|
|
|
|
if (geteuid() != 0) {
|
|
|
|
|
//lblMessageSudo->set_text(gettext("The program must be run with \nsuperuser privileges!"));
|
|
|
|
|
//lblMessageSudo->set_text(_("The program must be run with \nsuperuser privileges!"));
|
|
|
|
|
//mess_sudo->show();
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
@ -96,7 +96,7 @@ void MainWindow::settings(){
|
|
|
|
|
boxSave->set_sensitive(false);
|
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.warning", Gtk::ICON_SIZE_MENU);
|
|
|
|
|
info_status_app("boxInfoMessError");
|
|
|
|
|
lblWarning->set_text(gettext("The program must be run as root"));
|
|
|
|
|
lblWarning->set_text(_("The program must be run as root"));
|
|
|
|
|
this->set_active_boot_second();
|
|
|
|
|
this->event();
|
|
|
|
|
}
|
|
|
|
|
@ -415,9 +415,9 @@ vector<string> MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::view_add_colums(Gtk::TreeView &treeView) {
|
|
|
|
|
treeView.append_column_editable(gettext("Active"), m_columns.check_button);
|
|
|
|
|
treeView.append_column(gettext("Option"), m_columns.name);
|
|
|
|
|
treeView.append_column(gettext("Description"), m_columns.description);
|
|
|
|
|
treeView.append_column_editable(_("Active"), m_columns.check_button);
|
|
|
|
|
treeView.append_column(_("Option"), m_columns.name);
|
|
|
|
|
treeView.append_column(_("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) {
|
|
|
|
|
@ -425,8 +425,8 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListS
|
|
|
|
|
bool flag_chb = false;
|
|
|
|
|
string name = arr_view[0][index];
|
|
|
|
|
row[m_columns.check_button] = flag_chb;
|
|
|
|
|
row[m_columns.name] = gettext(name.c_str());
|
|
|
|
|
row[m_columns.description] = gettext(arr_view[1][index].c_str());
|
|
|
|
|
row[m_columns.name] = _(name.c_str());
|
|
|
|
|
row[m_columns.description] = _(arr_view[1][index].c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_builder(){
|
|
|
|
|
@ -488,53 +488,53 @@ void MainWindow::localization(){
|
|
|
|
|
time_t now = time(0);
|
|
|
|
|
tm *ltm = localtime(&now);
|
|
|
|
|
unsigned int year = 1900+ ltm->tm_year;
|
|
|
|
|
string str_authors = string(gettext("Copyright © UBSoft LLC, 2022 - ")) + to_string(year);
|
|
|
|
|
string str_authors = string(_("Copyright © UBSoft LLC, 2022 - ")) + to_string(year);
|
|
|
|
|
aboutWindows->set_copyright(str_authors);
|
|
|
|
|
aboutWindows->set_comments(gettext("ubl-settings-bootloader"));
|
|
|
|
|
aboutWindows->set_website(gettext("https://wiki.ublinux.com"));
|
|
|
|
|
aboutWindows->set_version(gettext(version_application.c_str()));
|
|
|
|
|
aboutWindows->set_website_label(gettext("Project Home Page"));
|
|
|
|
|
lblInfoHead->set_text(gettext("Configuring system boot parameters"));
|
|
|
|
|
lblHeaderName->set_text(gettext("ubl-settings-bootloader"));
|
|
|
|
|
aboutWindows->set_comments(gettext("Setting bootloader"));
|
|
|
|
|
aboutWindows->set_website_label(gettext("Project Home Page"));
|
|
|
|
|
lblInfoCommand->set_text(gettext("Command line parameters:"));
|
|
|
|
|
lblInfoCommand1->set_text(gettext("Command line parameters:"));
|
|
|
|
|
lblInfoCommand2->set_text(gettext("Command line parameters:"));
|
|
|
|
|
lblInfoDefaultDonw->set_text(gettext("Default download"));
|
|
|
|
|
lblInfoSeconds->set_text(gettext("Seconds"));
|
|
|
|
|
lblLoadMenu->set_text(gettext("Download menu"));
|
|
|
|
|
lblInfoInputTerminal->set_text(gettext("Terminal for input"));
|
|
|
|
|
lblInfoOutputTerminal->set_text(gettext("Terminal for output"));
|
|
|
|
|
aboutWindows->set_comments(_("ubl-settings-bootloader"));
|
|
|
|
|
aboutWindows->set_website(_("https://wiki.ublinux.com"));
|
|
|
|
|
aboutWindows->set_version(_(version_application.c_str()));
|
|
|
|
|
aboutWindows->set_website_label(_("Project Home Page"));
|
|
|
|
|
lblInfoHead->set_text(_("Configuring system boot parameters"));
|
|
|
|
|
lblHeaderName->set_text(_("ubl-settings-bootloader"));
|
|
|
|
|
aboutWindows->set_comments(_("Setting bootloader"));
|
|
|
|
|
aboutWindows->set_website_label(_("Project Home Page"));
|
|
|
|
|
lblInfoCommand->set_text(_("Command line parameters:"));
|
|
|
|
|
lblInfoCommand1->set_text(_("Command line parameters:"));
|
|
|
|
|
lblInfoCommand2->set_text(_("Command line parameters:"));
|
|
|
|
|
lblInfoDefaultDonw->set_text(_("Default download"));
|
|
|
|
|
lblInfoSeconds->set_text(_("Seconds"));
|
|
|
|
|
lblLoadMenu->set_text(_("Download menu"));
|
|
|
|
|
lblInfoInputTerminal->set_text(_("Terminal for input"));
|
|
|
|
|
lblInfoOutputTerminal->set_text(_("Terminal for output"));
|
|
|
|
|
|
|
|
|
|
chbLoadVariantSelectionTimer->set_label(gettext("Load variant selection timer"));
|
|
|
|
|
chbLastSelectionWillBecome->set_label(gettext("The last selection will become the default boot choice"));
|
|
|
|
|
btnSynopsis->set_label(gettext("Help"));
|
|
|
|
|
btnAbout->set_label(gettext("About"));
|
|
|
|
|
btnSaveLocalGlob->set_label(gettext("Save to global and local configuration"));
|
|
|
|
|
btnSaveLocal->set_label(gettext("Save local configuration"));
|
|
|
|
|
btnSaveGlob->set_label(gettext("Save global configuration"));
|
|
|
|
|
btnLoadGlob->set_label(gettext("Load global configuration"));
|
|
|
|
|
btnLoadLocal->set_label(gettext("Load local configuration"));
|
|
|
|
|
btnSave->set_label(gettext("Save"));
|
|
|
|
|
btnLoad->set_label(gettext("Load"));
|
|
|
|
|
this->set_title(gettext("ubl-settings-bootloader"));
|
|
|
|
|
|
|
|
|
|
lblDownloadMode->set_text(gettext("Download mode:"));
|
|
|
|
|
lblSecurityLogin->set_text(gettext("Security login:"));
|
|
|
|
|
lblPasswordProtec->set_text(gettext("Password protection:"));
|
|
|
|
|
|
|
|
|
|
chbSecurityLogin->append(gettext("Default"));
|
|
|
|
|
chbSecurityLogin->append(gettext("Mine"));
|
|
|
|
|
|
|
|
|
|
chbPasswordProtecc->append(gettext("Default"));
|
|
|
|
|
chbPasswordProtecc->append(gettext("Mine"));
|
|
|
|
|
chbPasswordProtecc->append(gettext("Disabled"));
|
|
|
|
|
|
|
|
|
|
cmbDownloadMode->append(gettext("Loading animation, full log"));
|
|
|
|
|
cmbDownloadMode->append(gettext("Loading animation, no log"));
|
|
|
|
|
cmbDownloadMode->append(gettext("No loading animation, full log."));
|
|
|
|
|
cmbDownloadMode->append(gettext("No loading animation, minimal log."));
|
|
|
|
|
chbLoadVariantSelectionTimer->set_label(_("Load variant selection timer"));
|
|
|
|
|
chbLastSelectionWillBecome->set_label(_("The last selection will become the default boot choice"));
|
|
|
|
|
btnSynopsis->set_label(_("Help"));
|
|
|
|
|
btnAbout->set_label(_("About"));
|
|
|
|
|
btnSaveLocalGlob->set_label(_("Save to global and local configuration"));
|
|
|
|
|
btnSaveLocal->set_label(_("Save local configuration"));
|
|
|
|
|
btnSaveGlob->set_label(_("Save global configuration"));
|
|
|
|
|
btnLoadGlob->set_label(_("Load global configuration"));
|
|
|
|
|
btnLoadLocal->set_label(_("Load local configuration"));
|
|
|
|
|
btnSave->set_label(_("Save"));
|
|
|
|
|
btnLoad->set_label(_("Load"));
|
|
|
|
|
this->set_title(_("ubl-settings-bootloader"));
|
|
|
|
|
|
|
|
|
|
lblDownloadMode->set_text(_("Download mode:"));
|
|
|
|
|
lblSecurityLogin->set_text(_("Security login:"));
|
|
|
|
|
lblPasswordProtec->set_text(_("Password protection:"));
|
|
|
|
|
|
|
|
|
|
chbSecurityLogin->append(_("Default"));
|
|
|
|
|
chbSecurityLogin->append(_("Mine"));
|
|
|
|
|
|
|
|
|
|
chbPasswordProtecc->append(_("Default"));
|
|
|
|
|
chbPasswordProtecc->append(_("Mine"));
|
|
|
|
|
chbPasswordProtecc->append(_("Disabled"));
|
|
|
|
|
|
|
|
|
|
cmbDownloadMode->append(_("Loading animation, full log"));
|
|
|
|
|
cmbDownloadMode->append(_("Loading animation, no log"));
|
|
|
|
|
cmbDownloadMode->append(_("No loading animation, full log."));
|
|
|
|
|
cmbDownloadMode->append(_("No loading animation, minimal log."));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vector<string> MainWindow::get_setting_entry_all(string key, string cmd, Gtk::Entry &entry_text, std::map <string, string> &map_temp) {
|
|
|
|
|
@ -567,7 +567,7 @@ vector<string> MainWindow::get_setting_entry_all(string key, string cmd, Gtk::En
|
|
|
|
|
bool MainWindow::focus_out_txt_password(GdkEventFocus*) {
|
|
|
|
|
if (entryPasswordProtecc->get_text().length() == 0) {
|
|
|
|
|
info_status_app("boxInfoMessError");
|
|
|
|
|
lblWarning->set_text(gettext("Enter your password"));
|
|
|
|
|
lblWarning->set_text(_("Enter your password"));
|
|
|
|
|
boxSave->set_sensitive(false);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
@ -579,7 +579,7 @@ bool MainWindow::focus_out_txt_password(GdkEventFocus*) {
|
|
|
|
|
bool MainWindow::focus_out_txt_login(GdkEventFocus*) {
|
|
|
|
|
if (entrySecurityLogin->get_text().length() == 0) {
|
|
|
|
|
info_status_app("boxInfoMessError");
|
|
|
|
|
lblWarning->set_text(gettext("Enter login"));
|
|
|
|
|
lblWarning->set_text(_("Enter login"));
|
|
|
|
|
boxSave->set_sensitive(false);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
@ -1030,7 +1030,7 @@ void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::synopsis_show() {
|
|
|
|
|
string cmd = "xdg-open " + string(gettext("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &";
|
|
|
|
|
string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &";
|
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
|
string response_user = getlogin();
|
|
|
|
|
cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \"";
|
|
|
|
|
@ -1061,23 +1061,23 @@ void MainWindow::info_warning_error(int mess) {
|
|
|
|
|
index_error = 0;
|
|
|
|
|
string mess_error = "";
|
|
|
|
|
if (mess == 0) {
|
|
|
|
|
mess_error = string(gettext("Local configuration reading error")) + str_cmd_error;
|
|
|
|
|
mess_error = string(_("Local configuration reading error")) + str_cmd_error;
|
|
|
|
|
lblWarning->set_text(mess_error);
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 1) {
|
|
|
|
|
mess_error = string(gettext("Global configuration read error")) + str_cmd_error;
|
|
|
|
|
mess_error = string(_("Global configuration read error")) + str_cmd_error;
|
|
|
|
|
lblWarning->set_text(mess_error);
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 2) {
|
|
|
|
|
mess_error = string(gettext("Local configuration write error")) + str_cmd_error;
|
|
|
|
|
mess_error = string(_("Local configuration write error")) + str_cmd_error;
|
|
|
|
|
lblWarning->set_text(mess_error);
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 3) {
|
|
|
|
|
mess_error = string(gettext("Global configuration write error")) + str_cmd_error;
|
|
|
|
|
mess_error = string(_("Global configuration write error")) + str_cmd_error;
|
|
|
|
|
lblWarning->set_text(mess_error);
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 4) {
|
|
|
|
|
mess_error = string(gettext("Error saved local and global configuration")) + str_cmd_error;
|
|
|
|
|
mess_error = string(_("Error saved local and global configuration")) + str_cmd_error;
|
|
|
|
|
lblWarning->set_text(mess_error);
|
|
|
|
|
}
|
|
|
|
|
str_cmd_error = "";
|
|
|
|
|
@ -1086,22 +1086,22 @@ void MainWindow::info_warning_error(int mess) {
|
|
|
|
|
info_status_app("boxInfoMessOK");
|
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.checked", Gtk::ICON_SIZE_MENU);
|
|
|
|
|
if (mess == 0) {
|
|
|
|
|
lblWarning->set_text(gettext("Local configuration downloaded successfully"));
|
|
|
|
|
lblWarning->set_text(_("Local configuration downloaded successfully"));
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 1) {
|
|
|
|
|
lblWarning->set_text(gettext("Global configuration downloaded successfully"));
|
|
|
|
|
lblWarning->set_text(_("Global configuration downloaded successfully"));
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 2) {
|
|
|
|
|
lblWarning->set_text(gettext("Local configuration successfully written"));
|
|
|
|
|
lblWarning->set_text(_("Local configuration successfully written"));
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 3) {
|
|
|
|
|
lblWarning->set_text(gettext("Global configuration successfully written"));
|
|
|
|
|
lblWarning->set_text(_("Global configuration successfully written"));
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 4) {
|
|
|
|
|
lblWarning->set_text(gettext("Successfully saved local and global configuration"));
|
|
|
|
|
lblWarning->set_text(_("Successfully saved local and global configuration"));
|
|
|
|
|
}
|
|
|
|
|
else if (mess == 5) {
|
|
|
|
|
lblWarning->set_text(gettext("Nothing to save!"));
|
|
|
|
|
lblWarning->set_text(_("Nothing to save!"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1178,7 +1178,7 @@ void MainWindow::add_CSS(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void help() {
|
|
|
|
|
string version = string(gettext("ubl-settings-bootloader version: ")) + version_application + "\n";
|
|
|
|
|
string version = string(_("ubl-settings-bootloader version: ")) + version_application + "\n";
|
|
|
|
|
cout << version.c_str();
|
|
|
|
|
string help;
|
|
|
|
|
help = "GTK settings bootloader for UBLinux\n\n"
|
|
|
|
|
@ -1186,7 +1186,7 @@ void help() {
|
|
|
|
|
"Options:\n"
|
|
|
|
|
" -h, --help Show this help\n"
|
|
|
|
|
" -V, --version Show package version\n";
|
|
|
|
|
cout << gettext(help.c_str());
|
|
|
|
|
cout << _(help.c_str());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|