|
|
|
@ -228,21 +228,19 @@ void MainWindow::set_download_mode() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_security_login() {
|
|
|
|
void MainWindow::set_security_login() {
|
|
|
|
int index = chbSecurityLogin->get_active_row_number();
|
|
|
|
bool index = chbSecurityLogin->get_active();
|
|
|
|
string key = "";
|
|
|
|
string key = "";
|
|
|
|
if (index == 0) {
|
|
|
|
if (index == false) {
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == 1) {
|
|
|
|
else if (index == true) {
|
|
|
|
key = entrySecurityLogin->get_text();
|
|
|
|
key = entrySecurityLogin->get_text();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == -1) {
|
|
|
|
|
|
|
|
key = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_USER"] = key;
|
|
|
|
map_cmd_selection["GRUB_USER"] = key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_security_login(std::map <string, string> &map_temp) {
|
|
|
|
void MainWindow::get_security_login(std::map <string, string> &map_temp) {
|
|
|
|
|
|
|
|
// Todo;
|
|
|
|
std::map <string, string>:: iterator iter_map_data;
|
|
|
|
std::map <string, string>:: iterator iter_map_data;
|
|
|
|
iter_map_data = map_temp.find("GRUB_USER");
|
|
|
|
iter_map_data = map_temp.find("GRUB_USER");
|
|
|
|
if (iter_map_data != map_temp.end()) {
|
|
|
|
if (iter_map_data != map_temp.end()) {
|
|
|
|
@ -268,23 +266,17 @@ void MainWindow::get_security_login(std::map <string, string> &map_temp) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_password_protec() {
|
|
|
|
void MainWindow::set_password_protec() {
|
|
|
|
int index = chbPasswordProtecc->get_active_row_number();
|
|
|
|
bool index = chbPasswordProtecc->get_active();
|
|
|
|
string key = "";
|
|
|
|
string key = "";
|
|
|
|
if (index == 0){
|
|
|
|
if (index == false){
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == 1) {
|
|
|
|
else if (index == true) {
|
|
|
|
key = entryPasswordProtecc->get_text();
|
|
|
|
key = entryPasswordProtecc->get_text();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == -1) {
|
|
|
|
if (key != "************") {
|
|
|
|
key = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (key!= "************") {
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_PASSWORD"] = key;
|
|
|
|
map_cmd_selection["GRUB_PASSWORD"] = key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
key = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_password_protec(std::map <string, string> &map_temp) {
|
|
|
|
void MainWindow::get_password_protec(std::map <string, string> &map_temp) {
|
|
|
|
@ -393,8 +385,6 @@ void MainWindow::get_builder(){
|
|
|
|
builder->get_widget("imgBG", imgBG);
|
|
|
|
builder->get_widget("imgBG", imgBG);
|
|
|
|
builder->get_widget("overHead", overHead);
|
|
|
|
builder->get_widget("overHead", overHead);
|
|
|
|
builder->get_widget("lblDownloadMode", lblDownloadMode);
|
|
|
|
builder->get_widget("lblDownloadMode", lblDownloadMode);
|
|
|
|
builder->get_widget("lblSecurityLogin", lblSecurityLogin);
|
|
|
|
|
|
|
|
builder->get_widget("lblPasswordProtec", lblPasswordProtec);
|
|
|
|
|
|
|
|
builder->get_widget("cmbDownloadMode", cmbDownloadMode);
|
|
|
|
builder->get_widget("cmbDownloadMode", cmbDownloadMode);
|
|
|
|
builder->get_widget("chbSecurityLogin", chbSecurityLogin);
|
|
|
|
builder->get_widget("chbSecurityLogin", chbSecurityLogin);
|
|
|
|
builder->get_widget("chbPasswordProtecc", chbPasswordProtecc);
|
|
|
|
builder->get_widget("chbPasswordProtecc", chbPasswordProtecc);
|
|
|
|
@ -426,7 +416,7 @@ void MainWindow::localization(){
|
|
|
|
lblLoadMenu->set_text(_("Download menu"));
|
|
|
|
lblLoadMenu->set_text(_("Download menu"));
|
|
|
|
lblInfoInputTerminal->set_text(_("Terminal for input"));
|
|
|
|
lblInfoInputTerminal->set_text(_("Terminal for input"));
|
|
|
|
lblInfoOutputTerminal->set_text(_("Terminal for output"));
|
|
|
|
lblInfoOutputTerminal->set_text(_("Terminal for output"));
|
|
|
|
chbLoadVariantSelectionTimer->set_label(_("Load option timer"));
|
|
|
|
chbLoadVariantSelectionTimer->set_label(_("Boot selection menu timer"));
|
|
|
|
btnSynopsis->set_label(_("Help"));
|
|
|
|
btnSynopsis->set_label(_("Help"));
|
|
|
|
btnAbout->set_label(_("About"));
|
|
|
|
btnAbout->set_label(_("About"));
|
|
|
|
btnSaveLocalGlob->set_label(_("Save to global and local configuration"));
|
|
|
|
btnSaveLocalGlob->set_label(_("Save to global and local configuration"));
|
|
|
|
@ -437,14 +427,14 @@ void MainWindow::localization(){
|
|
|
|
btnSave->set_label(_("Save"));
|
|
|
|
btnSave->set_label(_("Save"));
|
|
|
|
btnLoad->set_label(_("Load"));
|
|
|
|
btnLoad->set_label(_("Load"));
|
|
|
|
this->set_title(_("ubl-settings-bootloader"));
|
|
|
|
this->set_title(_("ubl-settings-bootloader"));
|
|
|
|
lblSecurityLogin->set_tooltip_text(gettext("User name to enter boot configuration editing mode"));
|
|
|
|
// Todo: check
|
|
|
|
lblDownloadMode->set_text(_("Load screen display mode:"));
|
|
|
|
entrySecurityLogin->set_tooltip_text(gettext("User name to enter boot configuration editing mode"));
|
|
|
|
lblSecurityLogin->set_text(_("Load menu user name:"));
|
|
|
|
entryPasswordProtecc->set_tooltip_text(gettext("User password to enter boot configuration edit mode"));
|
|
|
|
lblPasswordProtec->set_text(_("Load menu user password:"));
|
|
|
|
chbSecurityLogin->set_tooltip_text(gettext("User name to enter boot configuration editing mode"));
|
|
|
|
chbSecurityLogin->append(_("Not available"));
|
|
|
|
chbPasswordProtecc->set_tooltip_text(gettext("User password to enter boot configuration edit mode"));
|
|
|
|
chbSecurityLogin->append(_("Manually"));
|
|
|
|
lblDownloadMode->set_text(_("Boot screen display mode:"));
|
|
|
|
chbPasswordProtecc->append(_("Not available"));
|
|
|
|
chbSecurityLogin->set_label(_("Boot menu user name:"));
|
|
|
|
chbPasswordProtecc->append(_("Manually"));
|
|
|
|
chbPasswordProtecc->set_label(_("Boot menu user password:"));
|
|
|
|
cmbDownloadMode->append(_("Loading animation with the magazine"));
|
|
|
|
cmbDownloadMode->append(_("Loading animation with the magazine"));
|
|
|
|
cmbDownloadMode->append(_("Loading animation without a magazine"));
|
|
|
|
cmbDownloadMode->append(_("Loading animation without a magazine"));
|
|
|
|
cmbDownloadMode->append(_("Нет анимации загрузки, полный журнал"));
|
|
|
|
cmbDownloadMode->append(_("Нет анимации загрузки, полный журнал"));
|
|
|
|
@ -587,8 +577,8 @@ void MainWindow::event(){
|
|
|
|
entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
|
|
|
|
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));
|
|
|
|
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));
|
|
|
|
entryPasswordProtecc->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_password));
|
|
|
|
chbPasswordProtecc->signal_changed().connect([&]() {change_password_protecc();});
|
|
|
|
chbPasswordProtecc->signal_toggled().connect([&]() {change_password_protecc();});
|
|
|
|
chbSecurityLogin->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::change_security_login));
|
|
|
|
chbSecurityLogin->signal_toggled().connect([&]() {change_security_login();});
|
|
|
|
if (this->check_root() == 0) {
|
|
|
|
if (this->check_root() == 0) {
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
|
|
|
|
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
|
|
|
|
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
|
|
|
|
@ -610,8 +600,8 @@ bool MainWindow::gui_exit(GdkEventAny*) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::change_security_login() {
|
|
|
|
void MainWindow::change_security_login() {
|
|
|
|
int index = chbSecurityLogin->get_active_row_number();
|
|
|
|
bool index = chbSecurityLogin->get_active();
|
|
|
|
if (index == 0) {
|
|
|
|
if (index == false) {
|
|
|
|
entrySecurityLogin->set_sensitive(false);
|
|
|
|
entrySecurityLogin->set_sensitive(false);
|
|
|
|
entrySecurityLogin->set_text("");
|
|
|
|
entrySecurityLogin->set_text("");
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
@ -619,16 +609,11 @@ void MainWindow::change_security_login() {
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.checked", Gtk::ICON_SIZE_MENU);
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.checked", Gtk::ICON_SIZE_MENU);
|
|
|
|
lblWarning->set_text("");
|
|
|
|
lblWarning->set_text("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == 1) {
|
|
|
|
else if (index == true) {
|
|
|
|
entrySecurityLogin->set_sensitive(true);
|
|
|
|
entrySecurityLogin->set_sensitive(true);
|
|
|
|
entrySecurityLogin->set_text("");
|
|
|
|
entrySecurityLogin->set_text("");
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
entrySecurityLogin->set_sensitive(false);
|
|
|
|
|
|
|
|
entrySecurityLogin->set_text("");
|
|
|
|
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_default_load(std::map <string, string> &map_temp) {
|
|
|
|
void MainWindow::get_default_load(std::map <string, string> &map_temp) {
|
|
|
|
@ -649,8 +634,9 @@ void MainWindow::get_default_load(std::map <string, string> &map_temp) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::change_password_protecc() {
|
|
|
|
void MainWindow::change_password_protecc() {
|
|
|
|
int index = chbPasswordProtecc->get_active_row_number();
|
|
|
|
// Todo;
|
|
|
|
if (index == 0 || index == 2 || index == -1) {
|
|
|
|
bool index = chbPasswordProtecc->get_active();
|
|
|
|
|
|
|
|
if (index == false) {
|
|
|
|
entryPasswordProtecc->set_sensitive(false);
|
|
|
|
entryPasswordProtecc->set_sensitive(false);
|
|
|
|
entryPasswordProtecc->set_text("");
|
|
|
|
entryPasswordProtecc->set_text("");
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
@ -658,7 +644,7 @@ void MainWindow::change_password_protecc() {
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.checked", Gtk::ICON_SIZE_MENU);
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.checked", Gtk::ICON_SIZE_MENU);
|
|
|
|
lblWarning->set_text("");
|
|
|
|
lblWarning->set_text("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index == 1) {
|
|
|
|
else if (index == true) {
|
|
|
|
entryPasswordProtecc->set_sensitive(true);
|
|
|
|
entryPasswordProtecc->set_sensitive(true);
|
|
|
|
entryPasswordProtecc->set_text("");
|
|
|
|
entryPasswordProtecc->set_text("");
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
boxSave->set_sensitive(true);
|
|
|
|
|