diff --git a/source/main.cc b/source/main.cc index 91c417f..9c08001 100644 --- a/source/main.cc +++ b/source/main.cc @@ -41,9 +41,9 @@ int main(int argc, char** argv) str_cmd_argv+= to_string(*argv[i]) + " "; } if (geteuid()!=0){ - string cmd = "pkexec " + app_name + " " + str_cmd_argv; - system(cmd.c_str()); - return 0; + //string cmd = "pkexec " + app_name + " " + str_cmd_argv; + //system(cmd.c_str()); + //return 0; } auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); auto builder = Gtk::Builder::create_from_file(path_glade); diff --git a/source/ublexec.cc b/source/ublexec.cc index 6127199..d8e7f43 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -128,6 +128,7 @@ void MainWindow::get_builder(){ builder->get_widget("liststoreOther", liststoreOther); builder->get_widget("liststoreDevelopment", liststoreDevelopment); builder->get_widget("liststoreSystem", liststoreSystem); + } void MainWindow::add_CSS(){ @@ -192,8 +193,12 @@ void MainWindow::settings(){ this->event(); this->localization(); this->add_CSS(); - spinPriority->set_range(-20,19); + 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 (Высокий)"); scalePriority->set_inverted(true); this->pars_dir_bin(); this->pars_users(); @@ -235,8 +240,10 @@ void MainWindow::get_path_filemaneg(){ } } void MainWindow::open_list_app(){ + + //liststoreDevelopment = iconDevelopment->get_model(); - /* + for ( const auto &str_app : list_app){ for ( const auto &str_categor : str_app.Categories){ if (str_categor=="Graphics"){ @@ -272,15 +279,16 @@ void MainWindow::open_list_app(){ } } + /* for (const auto & str_categor : set_categories){ Gtk::Label* Label1 = new Gtk::Label(str_categor); Gtk::IconView* icon = new Gtk::IconView(); boxlistProgramm->pack_start(*icon); boxlistProgramm->pack_start(*Label1); - } + }*/ - */ + dialogStartMenu->show_all(); } @@ -363,7 +371,7 @@ void MainWindow::start_cmd(){ str_cmd_terminal=""; } string cmd = ""; - cmd = "" + str_cmd_terminal + str_variants_root + str_nice_cmd + user_cmd + " &"; + cmd = "nohup " + str_cmd_terminal + str_variants_root + str_nice_cmd + user_cmd + " &"; txtCmd->set_text(cmd); system(cmd.c_str()); @@ -371,7 +379,7 @@ void MainWindow::start_cmd(){ } void MainWindow::changed_user(){ Glib::ustring entry_user = cmbUser->get_active_text(); - if (entry_user == "superadmin" || entry_user == "root"){ + if (geteuid()==0 || entry_user == "root"){ spinPriority->set_range(-20,19); spinPriority->set_increments(1.0,-1.0); scalePriority->set_range(-20,19); @@ -393,7 +401,9 @@ void MainWindow::changed_user(){ void MainWindow::activ_or_block_other_user(){ bool flag = chbAnotherUser->get_active(); cmbUser->set_sensitive(flag); + lblInfoUserName->set_sensitive(flag); //lblInfoUserOther->set_sensitive(flag); + if (flag_pkexec==true){ rbPkexec->set_sensitive(flag); }