Убрал старый код

pull/18/head
Igor Belitskiy 3 years ago
parent abcaea34b9
commit 38f193d76d

@ -94,9 +94,6 @@ void MainWindow::settings(){
spbSecond->set_increments(1.0, 1.0); spbSecond->set_increments(1.0, 1.0);
spbSecond->set_value(1); spbSecond->set_value(1);
this->fill_in_view(); this->fill_in_view();
this->change_password_protecc();
this->change_security_login();
this->set_active_boot_second(); this->set_active_boot_second();
this->str_last_launched_os = this->pars_last_launched_os(); this->str_last_launched_os = this->pars_last_launched_os();
vector<string> os_control_list; vector<string> os_control_list;
@ -422,10 +419,6 @@ void MainWindow::get_builder() {
builder->get_widget("overHead", overHead); builder->get_widget("overHead", overHead);
builder->get_widget("lblDownloadMode", lblDownloadMode); builder->get_widget("lblDownloadMode", lblDownloadMode);
builder->get_widget("cmbDownloadMode", cmbDownloadMode); 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);
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND
builder->get_widget("wndWeb", wndWeb); builder->get_widget("wndWeb", wndWeb);
#endif #endif
@ -492,13 +485,7 @@ void MainWindow::localization(){
btnLoad->set_label(str_load); btnLoad->set_label(str_load);
this->set_title(name_app); this->set_title(name_app);
// Todo: check // 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); 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_with);
cmbDownloadMode->append(loading_animation_without); cmbDownloadMode->append(loading_animation_without);
cmbDownloadMode->append(no_loading_animation); cmbDownloadMode->append(no_loading_animation);
@ -529,43 +516,6 @@ vector<string> MainWindow::get_setting_entry_all(string key, std::map <string, s
return vec_params; 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;
}
}
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;
}
bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) { bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) {
auto selection_kernel = treeViewKernel->get_selection(); auto selection_kernel = treeViewKernel->get_selection();
selection_kernel->unselect_all(); selection_kernel->unselect_all();
@ -701,10 +651,6 @@ void MainWindow::event() {
entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel)); 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)); 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)); 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();});
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));
@ -958,23 +904,6 @@ bool MainWindow::gui_exit(GdkEventAny*) {
return true; return true;
} }
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);
}
}
void MainWindow::get_default_load(std::map <string, string> &map_temp) { void MainWindow::get_default_load(std::map <string, string> &map_temp) {
std::map <string, string>:: iterator iter_map_data; std::map <string, string>:: iterator iter_map_data;
iter_map_data = map_temp.find("GRUB_DEFAULT"); iter_map_data = map_temp.find("GRUB_DEFAULT");
@ -992,27 +921,6 @@ void MainWindow::get_default_load(std::map <string, string> &map_temp) {
} }
} }
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);
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);
}
else {
boxSave->set_sensitive(true);
}
}
void MainWindow::set_active_boot_second() { void MainWindow::set_active_boot_second() {
spbSecond->set_sensitive(chbLoadVariantSelectionTimer->get_active()); spbSecond->set_sensitive(chbLoadVariantSelectionTimer->get_active());
lblInfoSeconds->set_sensitive(chbLoadVariantSelectionTimer->get_active()); lblInfoSeconds->set_sensitive(chbLoadVariantSelectionTimer->get_active());

@ -250,10 +250,7 @@ public:
Gtk::Image *imgBG; Gtk::Image *imgBG;
Gtk::Overlay *overHead; Gtk::Overlay *overHead;
Gtk::ComboBoxText *cmbDownloadMode; Gtk::ComboBoxText *cmbDownloadMode;
Gtk::CheckButton *chbSecurityLogin;
Gtk::CheckButton *chbPasswordProtecc; Gtk::CheckButton *chbPasswordProtecc;
Gtk::Entry *entrySecurityLogin;
Gtk::Entry *entryPasswordProtecc;
Gtk::Label *lblHeadeWndWeb; Gtk::Label *lblHeadeWndWeb;
Gtk::Label *lblwebHeaderName; Gtk::Label *lblwebHeaderName;
@ -382,11 +379,7 @@ public:
bool focus_tree_view(GdkEventFocus *); bool focus_tree_view(GdkEventFocus *);
bool check_flag_save(string flag_save); bool check_flag_save(string flag_save);
void set_download_mode(); 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); void get_default_load(std::map<string, string> &map_temp);
bool focus_out_txt_password(GdkEventFocus *);
void set_entry(Gtk::Entry *entry, std::map<string, string> &map_temp, string key); 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); 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); vector<string> get_setting_entry_all(string key, std::map<string, string> *map_temp);

@ -579,102 +579,6 @@ specified priority</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkCheckButton" id="chbSecurityLogin">
<property name="label" translatable="yes">Boot menu user name:</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="margin-left">2</property>
<property name="margin-right">5</property>
<property name="margin-start">2</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entrySecurityLogin">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkCheckButton" id="chbPasswordProtecc">
<property name="label" translatable="yes">Boot menu user password:</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="margin-left">2</property>
<property name="margin-right">5</property>
<property name="margin-start">2</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entryPasswordProtecc">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child> <child>
<object class="GtkFrame"> <object class="GtkFrame">
<property name="visible">True</property> <property name="visible">True</property>
@ -700,8 +604,6 @@ specified priority</property>
<property name="height-request">70</property> <property name="height-request">70</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="margin-right">5</property>
<property name="margin-end">5</property>
<property name="shadow-type">in</property> <property name="shadow-type">in</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
@ -709,12 +611,8 @@ specified priority</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkTreeView" id="treeViewUser"> <object class="GtkTreeView" id="treeViewUser">
<property name="height-request">-1</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
</object> </object>
</child> </child>
</object> </object>
@ -774,7 +672,7 @@ specified priority</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">3</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
@ -846,8 +744,6 @@ specified priority</property>
<property name="height-request">70</property> <property name="height-request">70</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="margin-right">5</property>
<property name="margin-end">5</property>
<property name="shadow-type">in</property> <property name="shadow-type">in</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
@ -855,7 +751,6 @@ specified priority</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkTreeView" id="treeViewMusic"> <object class="GtkTreeView" id="treeViewMusic">
<property name="height-request">-1</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<child internal-child="selection"> <child internal-child="selection">
@ -920,7 +815,7 @@ specified priority</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">3</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
@ -1570,8 +1465,6 @@ specified priority</property>
<widget name="chbLoadVariantSelectionTimer"/> <widget name="chbLoadVariantSelectionTimer"/>
<widget name="lblInfoDefaultDonw"/> <widget name="lblInfoDefaultDonw"/>
<widget name="lblDownloadMode"/> <widget name="lblDownloadMode"/>
<widget name="chbSecurityLogin"/>
<widget name="chbPasswordProtecc"/>
</widgets> </widgets>
</object> </object>
<object class="GtkPopover" id="popoverMenuOS"> <object class="GtkPopover" id="popoverMenuOS">

Loading…
Cancel
Save