Переменные css вынесены в отдельный файл

pull/11/head
Igor Belitskiy 3 years ago
parent 7fb35b8e9c
commit 6fc59b6964

@ -112,7 +112,7 @@ void MainWindow::settings(){
btnLoad->set_sensitive(false); btnLoad->set_sensitive(false);
btnSave->set_sensitive(false); btnSave->set_sensitive(false);
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
info_status_app("boxInfoMessError"); info_status_app(info_box_error_css);
lblWarning->set_text(program_as_root); lblWarning->set_text(program_as_root);
this->set_active_boot_second(); this->set_active_boot_second();
this->fill_in_view(); this->fill_in_view();
@ -537,13 +537,13 @@ vector<string> MainWindow::get_setting_entry_all(string key, std::map <string, s
bool MainWindow::focus_out_txt_password(GdkEventFocus*) { bool MainWindow::focus_out_txt_password(GdkEventFocus*) {
if (entryPasswordProtecc->get_text().length() == 0) { if (entryPasswordProtecc->get_text().length() == 0) {
info_status_app("boxInfoMessError"); info_status_app(info_box_error_css);
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(enter_password); lblWarning->set_text(enter_password);
boxSave->set_sensitive(false); boxSave->set_sensitive(false);
} }
else { else {
info_status_app("boxInfoMessOK"); info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(""); lblWarning->set_text("");
boxSave->set_sensitive(true); boxSave->set_sensitive(true);
@ -557,13 +557,13 @@ bool MainWindow::focus_out_txt_password(GdkEventFocus*) {
} }
bool MainWindow::focus_out_txt_login(GdkEventFocus*) { bool MainWindow::focus_out_txt_login(GdkEventFocus*) {
if (entrySecurityLogin->get_text().length() == 0) { if (entrySecurityLogin->get_text().length() == 0) {
info_status_app("boxInfoMessError"); info_status_app(info_box_error_css);
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(enter_login); lblWarning->set_text(enter_login);
boxSave->set_sensitive(false); boxSave->set_sensitive(false);
} }
else { else {
info_status_app("boxInfoMessOK"); info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(""); lblWarning->set_text("");
map_cmd_selection["GRUB_USER"] = entrySecurityLogin->get_text(); map_cmd_selection["GRUB_USER"] = entrySecurityLogin->get_text();
@ -684,7 +684,7 @@ void MainWindow::change_security_login() {
entrySecurityLogin->set_sensitive(false); entrySecurityLogin->set_sensitive(false);
entrySecurityLogin->set_text(""); entrySecurityLogin->set_text("");
boxSave->set_sensitive(true); boxSave->set_sensitive(true);
info_status_app("boxInfoMessOK"); info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(""); lblWarning->set_text("");
} }
@ -719,7 +719,7 @@ void MainWindow::change_password_protecc() {
entryPasswordProtecc->set_sensitive(false); entryPasswordProtecc->set_sensitive(false);
entryPasswordProtecc->set_text(""); entryPasswordProtecc->set_text("");
boxSave->set_sensitive(true); boxSave->set_sensitive(true);
info_status_app("boxInfoMessOK"); info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
lblWarning->set_text(""); lblWarning->set_text("");
} }
@ -977,14 +977,14 @@ void MainWindow::template_open_browser() {
index_error = system(cmd.c_str()); index_error = system(cmd.c_str());
} }
void MainWindow::info_status_app(string stule) { void MainWindow::info_status_app(string stule) {
boxInfo->remove_class("boxInfoMessOK"); boxInfo->remove_class(info_box_ok_css);
boxInfo->remove_class("boxInfoMessError"); boxInfo->remove_class(info_box_error_css);
boxInfo->add_class(stule); boxInfo->add_class(stule);
} }
void MainWindow::info_warning_error(int mess) { void MainWindow::info_warning_error(int mess) {
if (obj_load.get_count_error() > 0 || obj_save.get_count_error() > 0) { if (obj_load.get_count_error() > 0 || obj_save.get_count_error() > 0) {
info_status_app("boxInfoMessError"); info_status_app(info_box_error_css);
imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU);
string mess_error = ""; string mess_error = "";
if (mess == 0) { if (mess == 0) {
@ -1012,7 +1012,7 @@ void MainWindow::info_warning_error(int mess) {
obj_save.set_count_error(0); obj_save.set_count_error(0);
} }
else { else {
info_status_app("boxInfoMessOK"); info_status_app(info_box_ok_css);
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
if (mess == 0) { if (mess == 0) {
lblWarning->set_text(local_load_ok); lblWarning->set_text(local_load_ok);

@ -117,7 +117,8 @@ void me_thread(string cmd);
#define path_img_head_background "/usr/share/ubl-settings-bootloader/images/logo-background.png" #define path_img_head_background "/usr/share/ubl-settings-bootloader/images/logo-background.png"
#define cmd_pars_list_os "/usr/lib/ublinux/scripts/grub-functions exec_get_all_menuentry" #define cmd_pars_list_os "/usr/lib/ublinux/scripts/grub-functions exec_get_all_menuentry"
#define cmd_last_launched_os "/usr/lib/ublinux/scripts/grub-functions exec_get_last_menuentry" #define cmd_last_launched_os "/usr/lib/ublinux/scripts/grub-functions exec_get_last_menuentry"
#define info_box_ok_css "boxInfoMessOK"
#define info_box_error_css "boxInfoMessError"
class CmdArgParser : public Glib::OptionGroup class CmdArgParser : public Glib::OptionGroup
{ {

Loading…
Cancel
Save