diff --git a/source/ublexec.cc b/source/ublexec.cc index 6a254ee..1348cc5 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -187,8 +187,31 @@ void MainWindow::event(){ iconSystem->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_System)); btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show)); btnAbout->signal_activate().connect([&](){aboutWindows->show();}); + rbSudo->signal_toggled().connect([&](){ + spinPriority->set_range(-20,19); + spinPriority->set_increments(1.0,-1.0); + scalePriority->set_range(-20,19); + scalePriority->set_value(0); + lblTimeEpriorityLow->set_text("19 (Низкий)"); + lblTime4EpriorityHigh->set_text("-20 (Высокий)"); + }); + rbSu->signal_toggled().connect(sigc::mem_fun(*this,&MainWindow::nice_hight)); + rbPkexec->signal_toggled().connect(sigc::mem_fun(*this,&MainWindow::nice_hight)); } +void MainWindow::nice_hight(){ + Glib::ustring entry_user = cmbUser->get_active_text(); + if (geteuid() != 0){ + spinPriority->set_range(0,19); + spinPriority->set_increments(1.0,-1.0); + scalePriority->set_range(0,19); + scalePriority->set_value(0); + lblTimeEpriorityLow->set_text("19 (Низкий)"); + lblTime4EpriorityHigh->set_text("0 (Высокий)"); + } +} + + void MainWindow::synopsis_show(){ system("xdg-open https://wiki.ublinux.ru/ru/home &"); } diff --git a/source/ublexec.h b/source/ublexec.h index a6b3f50..5c00d9d 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -54,6 +54,7 @@ public: void open_list_app(); void start_cmd(); void changed_user(); + void nice_hight(); void execute_terminal(){} void execute_another_User(){} void activ_or_block_other_user();