|
|
|
|
@ -78,6 +78,8 @@ void MainWindow::settings(){
|
|
|
|
|
btnBoxAboutDialog->set_visible(false);
|
|
|
|
|
ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I);
|
|
|
|
|
if (this->check_root() == 0) {
|
|
|
|
|
spbSecond->set_range(0, 100000000000);
|
|
|
|
|
spbSecond->set_increments(1.0, 1.0);
|
|
|
|
|
this->fill_in_view();
|
|
|
|
|
this->download_local_cfg();
|
|
|
|
|
this->download_globl_cfg();
|
|
|
|
|
@ -109,9 +111,9 @@ void MainWindow::fill_in_view() {
|
|
|
|
|
this->view_add_colums(*treeViewKernel);
|
|
|
|
|
this->view_add_colums(*treeViewIPT);
|
|
|
|
|
this->view_add_colums(*treeViewOTT);
|
|
|
|
|
// auto iter = list_store_kernel->prepend();
|
|
|
|
|
// row_kernel[m_columns.cmd_set_true];
|
|
|
|
|
// cout << cmd << endl;
|
|
|
|
|
std::vector<Gtk::TreeViewColumn*> treeViewKernalCol = treeViewKernel->get_columns();
|
|
|
|
|
|
|
|
|
|
//cout << treeViewKernalCol[2]->get_alignment() << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator&) {
|
|
|
|
|
@ -215,14 +217,6 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListS
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_monitor_size(){
|
|
|
|
|
GdkRectangle workarea;
|
|
|
|
|
gdk_monitor_get_workarea(
|
|
|
|
|
gdk_display_get_primary_monitor(gdk_display_get_default()),&workarea);
|
|
|
|
|
screen_width = workarea.width;
|
|
|
|
|
screen_hight = workarea.height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_builder(){
|
|
|
|
|
builder->get_widget("chbLoadVariantSelectionTimer", chbLoadVariantSelectionTimer);
|
|
|
|
|
builder->get_widget("chbLastSelectionWillBecome", chbLastSelectionWillBecome);
|
|
|
|
|
@ -309,7 +303,35 @@ void MainWindow::localization(){
|
|
|
|
|
this->set_title(gettext("ubl-settings-bootloader"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_menu_boot(string cmd) {
|
|
|
|
|
struct Result<string> res_response = this->wrapper_call(cmd);
|
|
|
|
|
|
|
|
|
|
if (res_response.error == 0) {
|
|
|
|
|
spbSecond->set_value(atoi(res_response.response.c_str()));
|
|
|
|
|
}
|
|
|
|
|
else if (res_response.error == 3) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_menu_boot(string cmd) {
|
|
|
|
|
std::string seconds = to_string(spbSecond->get_value());
|
|
|
|
|
cmd += seconds;
|
|
|
|
|
struct Result<string> res_response = this->wrapper_call(cmd);
|
|
|
|
|
if (res_response.error == 0) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (res_response.error == 3) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::event(){
|
|
|
|
|
btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show));
|
|
|
|
|
@ -332,9 +354,13 @@ void MainWindow::event(){
|
|
|
|
|
void MainWindow::save_global_local_cfg() {
|
|
|
|
|
if (flag_save_global == false) {
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source global get boot GRUB_TIMEOU";
|
|
|
|
|
this->set_menu_boot(cmd_boot_time);
|
|
|
|
|
}
|
|
|
|
|
else if (flag_save_local == false) {
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source system get boot GRUB_TIMEOU";
|
|
|
|
|
this->set_menu_boot(cmd_boot_time);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
info_status_app("boxInfoMessOK");
|
|
|
|
|
@ -348,27 +374,31 @@ void MainWindow::save_global_local_cfg() {
|
|
|
|
|
void MainWindow::save_global_cfg() {
|
|
|
|
|
if (flag_save_global == false) {
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
if (flag_save_all == false) {
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source global get boot GRUB_TIMEOU";
|
|
|
|
|
this->set_menu_boot(cmd_boot_time);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
info_status_app("boxInfoMessOK");
|
|
|
|
|
lblWarning->set_text(gettext("Nothing to save!"));
|
|
|
|
|
}
|
|
|
|
|
info_warning_error(3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::save_local_cfg() {
|
|
|
|
|
if (flag_save_local == false) {
|
|
|
|
|
flag_save_local = true;
|
|
|
|
|
if (flag_save_all == false) {
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source system get boot GRUB_TIMEOU";
|
|
|
|
|
this->set_menu_boot(cmd_boot_time);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else {
|
|
|
|
|
info_status_app("boxInfoMessOK");
|
|
|
|
|
lblWarning->set_text(gettext("Nothing to save!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info_warning_error(2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::download_globl_cfg() {
|
|
|
|
|
@ -380,6 +410,8 @@ void MainWindow::download_globl_cfg() {
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
flag_load = true;
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source system get boot GRUB_TIMEOU";
|
|
|
|
|
this->get_menu_boot(cmd_boot_time);
|
|
|
|
|
info_warning_error(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -391,6 +423,8 @@ void MainWindow::download_local_cfg() {
|
|
|
|
|
flag_save_local = true;
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
std::string cmd_boot_time = "sudo ubconfig --default --source global get boot GRUB_TIMEOU";
|
|
|
|
|
this->get_menu_boot(cmd_boot_time);
|
|
|
|
|
info_warning_error(0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|