From 35aaf01b8a476a4fc10275e062f57151dac69659 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Sun, 3 Sep 2023 15:29:09 +0600 Subject: [PATCH] Reverting --- .gitignore | 11 +- source/ublexec.cc | 73 +++++--- ublexec.glade | 419 ++++++++++++++++++++++++++++++---------------- 3 files changed, 332 insertions(+), 171 deletions(-) diff --git a/.gitignore b/.gitignore index 5a84a0a..e2c7ced 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,7 @@ -*~* -*#* +ublexec.glade~ +#ublexec.glade# test.cpp .vscode ublexec nohup.out -ublexec_ru.po~ -compile/ -.BUILD.md -.install.sh -.updatebuild.sh -terminal-commands/ \ No newline at end of file +ublexec_ru.po~ \ No newline at end of file diff --git a/source/ublexec.cc b/source/ublexec.cc index 35f21a6..ed6f8af 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -64,6 +64,7 @@ void MainWindow::get_builder() { builder->get_widget("rbPkexec", rbPkexec); builder->get_widget("rbSu", rbSu); builder->get_widget("rbSudo", rbSudo); + builder->get_widget("txtCmd", txtCmd); builder->get_widget("wndChooseFileWallpaper", wndChooseFileWallpaper); builder->get_widget("btnFilemangerExit", btnFilemangerExit); builder->get_widget("btnFilemangerOk", btnFilemangerOk); @@ -77,7 +78,7 @@ void MainWindow::get_builder() { builder->get_widget("btnStartMenuExit", btnStartMenuExit); builder->get_widget("lblInfoHead", lblInfoHead); builder->get_widget("lblinfoCmd", lblinfoCmd); - // builder->get_widget("lblInfoTime", lblInfoTime); + builder->get_widget("lblInfoTime", lblInfoTime); builder->get_widget("labInfoExecutTerm", labInfoExecutTerm); builder->get_widget("lblInfoUser", lblInfoUser); builder->get_widget("lblInfoUserOther", lblInfoUserOther); @@ -124,18 +125,11 @@ void MainWindow::get_builder() { builder->get_widget("btnCancelHelp", btnCancelHelp); builder->get_widget("wndShowWeb", wndShowWeb); builder->get_widget("lblHeadeWndWeb", lblHeadeWndWeb); - builder->get_widget("txtCmd", CommandEntry); - builder->get_widget("commandCheck", CommandCheck); - builder->get_widget("commandEntry", txtCmd); #ifdef WEBKIT_FOUND builder->get_widget("wndWeb", wndWeb); #endif } -void MainWindow::set_sensitive_from_check(){ - int active = CommandCheck->get_active(); - txtCmd->set_sensitive(active); -} void MainWindow::set_icon_array() { array_icon[0] = this->iconGraphics; @@ -183,6 +177,53 @@ void MainWindow::localization() { string str_authors = string(copyright) + to_string(year); aboutWindows->set_copyright(str_authors); aboutWindows->set_website(website); + btnhelp->set_label(str_help); + btnAbout->set_label(str_about_1); + aboutWindows->set_comments(define_name_app); + aboutWindows->set_website_label(home_page ); + aboutWindows->set_version(_(version_application.c_str())); + aboutWindows->set_title(space_name_app ); + lblHeaderAboutTopic->set_label(space_name_app ); + lblHeaderName->set_text(define_name_app); + this->set_title(define_name_app); + btnStart->set_label(str_run); + wndChooseFileWallpaper->set_title(str_please_select_file); + dialogStartMenu->set_title(str_selecting_programs); + lblInfoHead->set_text(define_name_app); + lblinfoCmd->set_text(str_localization_cmd_line); + lblInfoTime->set_text(str_localization_team); + labInfoExecutTerm->set_text(str_run_terminal); + lblInfoUser->set_text(str_localization_user); + lblInfoUserOther->set_text(str_run_of_user); + lblInfoUserName->set_text(str_localization_username); + lblInfoNooPriority->set_text(str_localization_priority); + lblInfoExec->set_text(str_change_priority); + lblInfoPriority->set_text(string(str_localization_priority) + ":"); + lblMessageError->set_text(str_select_app_program); + messageError->set_title(str_localization_attention); + lblGraphics->set_text(str_localization_graphics); + lblTools->set_text(str_localization_tools); + lblInternet->set_text(str_localization_internet); + lblMultimedia->set_text(str_localization_multimedia); + lblSettings->set_text(str_localization_settings); + lblEducation->set_text(str_localization_education); + lblOffice->set_text(str_localization_office); + lblOther->set_text(str_localization_other); + lblDevelopment->set_text(str_localization_development); + lblSystem->set_text(str_localization_system); + btnListApp->set_tooltip_text(str_application_overview); + btnFilemaneg->set_tooltip_text(str_file_overview); + btnMessageErrorOk->set_label(str_close); + lblhelpHeader->set_text(read_documentation_web); + lblhelpText->set_text(redirected_documentation); + btnReadHelp->set_label(read_online); + btnCancelHelp->set_label(cancel); + chkAlwaysOpenHelp->set_label(always_redirect); + lblwebHeaderName->set_label(name_app_1); + lblHeadeWndWeb->set_label(define_name_app); + lblwebHeaderName->set_label(define_name_app); + btnFilemaneg->set_tooltip_text(str_tooltip_filemanager); + btnListApp->set_tooltip_text(str_tooltip_list_app); } void MainWindow::event() { @@ -223,7 +264,6 @@ void MainWindow::event() { txtCmd->signal_delete_text().connect(sigc::mem_fun(*this, &MainWindow::delete_cmd)); rbSu->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::sudo_nice)); rbPkexec->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::sudo_nice)); - CommandCheck->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_sensitive_from_check)); cmbTerminal->signal_changed().connect([&]() {this->denamic_cmd();}); } @@ -421,11 +461,9 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtrset_text(app_name_exec); txtCmd->set_text(app_name_exec); name_app = txtCmd->get_text(); size_t len_name_app = name_app.length(); @@ -433,7 +471,6 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtrset_text(name_app); txtCmd->set_text(name_app); break; } @@ -637,20 +674,18 @@ string MainWindow::start_cmd(string user_cmd) { if (cbxExecuteEpriority->get_active()) { str_variants_root += " nice -n " + to_string(spinPriority->get_value_as_int()); } - if (cmbUser->get_active_text()=="root") - str_variants_root += " env HOME=$HOME DISPLAY=$DISPLAY WAYLAND_DISPLAY=$WAYLAND_DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS XDG_SESSION_TYPE=$XDG_SESSION_TYPE XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR SESSION_MANAGER=$SESSION_MANAGER GNOME_DESKTOP_SESSION_ID=$GNOME_DESKTOP_SESSION_ID KDE_FULL_SESSION=$KDE_FULL_SESSION "; - else - str_variants_root += " env HOME=$HOME DISPLAY=$DISPLAY WAYLAND_DISPLAY=$WAYLAND_DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS XDG_SESSION_TYPE=$XDG_SESSION_TYPE "; + str_variants_root += " env PATH=$PATH DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "; } else if (rbSu->get_active()) { chbTerminal->set_active(true); string str_user = cmbUser->get_active_text(); if (str_user != "root") { - str_variants_root = "su --preserve-environment --login " + cmbUser->get_active_text() + " --command \""; + str_variants_root = "su -l " + cmbUser->get_active_text(); } else{ - str_variants_root = "su --preserve-environment --command \""; + str_variants_root = "su "; } + str_variants_root += " -c \" DISPLAY=$DISPLAY "; if (cbxExecuteEpriority->get_active()) { str_variants_root += "nice -n " + to_string(spinPriority->get_value_as_int()) + " "; } @@ -658,7 +693,7 @@ string MainWindow::start_cmd(string user_cmd) { else if (rbSudo->get_active()) { chbTerminal->set_active(true); if (user_exec_app==cmbUser->get_active_text()) { - str_variants_root = "sudo --preserve-env setsid "; + str_variants_root = "sudo "; } else{ str_variants_root = "sudo -u " + cmbUser->get_active_text() + " "; diff --git a/ublexec.glade b/ublexec.glade index 8acfc23..b31d342 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -1,8 +1,7 @@ - + - True True @@ -20,9 +19,9 @@ ublexec 1.0 Copyright © 2022 - 2023, UBSoft LLC - Run as... + ublexec https://ublinux.ru/ - Project hompage + Project Home Page Это приложение распространяется без каких-либо гарантий. Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. UBGroup @@ -47,6 +46,9 @@ 1 + + + @@ -63,7 +65,7 @@ 5 5 2 - Run as... + ublexec @@ -1112,8 +1114,6 @@ - 800 - 600 False com.ublinux.ublexec @@ -1147,17 +1147,12 @@ True False - 5 - 5 - 5 - 5 vertical True False vertical - 5 True @@ -1168,6 +1163,12 @@ True False + 5 + 5 + 5 + 5 + 6 + 6 True 0.019999999552965164 in @@ -1175,22 +1176,47 @@ True False + 5 5 - 5 - 5 True vertical - 5 True False True - 5 - + + 0 True False + 5 + 5 + 5 + 5 + 6 + 6 + Team: + True + 0 + + + False + True + 0 + + + + + 440 + True + True + 5 + 5 + 5 + 5 + 6 + 6 True @@ -1200,12 +1226,17 @@ + 51 True True True - File view end + 5 + 5 + 5 5 + 6 + 6 True @@ -1219,14 +1250,8 @@ 3 3 gtk-directory - - False @@ -1236,11 +1261,17 @@ + 51 True True True - Program view end + 5 + 5 + 5 + 5 + 6 + 6 True @@ -1254,9 +1285,6 @@ view-list-details - False @@ -1275,8 +1303,25 @@ True False + 6 + 6 True - 5 + + + 44 + True + False + 15 + 5 + 15 + 5 + + + False + True + 0 + + True @@ -1284,6 +1329,11 @@ False start center + 5 + 5 + 5 + 5 + 6 True @@ -1303,13 +1353,30 @@ True False + start + 2 + 5 + 5 + 6 - True + False True 2 + + + 116 + True + False + + + False + True + 3 + + False @@ -1324,7 +1391,7 @@ True False start - File or app opening + Command Line @@ -1338,19 +1405,24 @@ False True - 0 + 1 True False + 5 True vertical True False + 5 + 5 + 5 + 5 True 0.019999999552965164 in @@ -1358,18 +1430,15 @@ True False + 5 5 - 5 - 5 True vertical - 5 True False True - 5 True @@ -1377,6 +1446,12 @@ False start center + 5 + 5 + 5 + 5 + 6 + 6 True @@ -1399,6 +1474,8 @@ True False 6 + 6 + 6 True rbSu @@ -1414,6 +1491,10 @@ True True False + 3 + 31 + 3 + 31 True rbPkexec @@ -1429,6 +1510,10 @@ True True False + 6 + 6 + 6 + 6 True rbSu @@ -1438,6 +1523,23 @@ 3 + + + 95 + True + False + end + 15 + 5 + 15 + 5 + + + False + True + 4 + + False @@ -1450,11 +1552,17 @@ True False True - 5 + 123 True False + 5 + 5 + 5 + 5 + 6 + 6 User Name: True 0 @@ -1467,15 +1575,35 @@ + 374 True False + 5 + 5 + 5 + 5 + 6 + 6 - True + False True 1 + + + 0 + True + False + 100 + + + False + True + 2 + + False @@ -1504,19 +1632,24 @@ False True - 1 + 2 True False + 5 True vertical True False + 5 + 5 + 5 + 5 True 0.019999999552965164 in @@ -1524,12 +1657,10 @@ True False + 5 5 - 5 - 5 True vertical - 5 True @@ -1537,6 +1668,12 @@ False start center + 5 + 5 + 5 + 5 + 6 + 6 True @@ -1557,13 +1694,16 @@ True False True - 5 5 True False - center + 5 + 5 + 5 + 5 + 13 Priority: True 0 @@ -1576,9 +1716,13 @@ + -1 True True - 15 + 5 + 5 + 5 + 5 adjustment1 20 0 @@ -1594,7 +1738,11 @@ True True - center + 5 + 5 + 5 + 5 + 15 True @@ -1614,15 +1762,37 @@ True False - 120 - 120 + 9 False - 5 + + + 62 + True + False + 15 + 5 + 15 + 5 + 0 + + + False + True + 0 + + + 145 True False + 5 + 5 + 5 + 5 + 6 19 (Low) + True 0 @@ -1637,7 +1807,13 @@ False end center + 5 + 5 + 5 + 5 + 6 -20 (High) + True 0 @@ -1646,6 +1822,23 @@ 3 + + + 107 + True + False + end + 15 + 5 + 15 + 5 + + + False + True + 4 + + False @@ -1674,81 +1867,6 @@ False True - 2 - - - - - True - False - True - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - 5 - True - vertical - 5 - - - True - False - True - 5 - - - Edit - True - True - False - True - - - False - True - 0 - - - - - True - False - True - - - True - True - 1 - - - - - False - True - 0 - - - - - - - True - False - start - Command Line - - - - - True - True 3 @@ -1758,13 +1876,18 @@ True True True + 5 + 5 + 5 + 5 + 6 + 6 image1 True False True - end 4 @@ -1794,7 +1917,7 @@ True False center - Run as... + Ublexec @@ -1822,7 +1945,11 @@ menu1 none - + + True + False + open-menu-symbolic + @@ -1840,16 +1967,10 @@ - - - - - - False + start False - com.ublinux.ublexec True @@ -1859,16 +1980,17 @@ True False - 5 - 5 - 5 - 5 - 5 True False center + 20 + 20 + 20 + 20 + 20 + 20 dialog-warning-symbolic 6 @@ -1880,9 +2002,14 @@ - 200 True False + 10 + 25 + 10 + 25 + 20 + 20 Select an executable file or program True 0 @@ -1995,16 +2122,20 @@ 0 + + + - 450 False + start + start False 450 250 - com.ublinux.ublexec + dialog-question-symbolic True @@ -2180,7 +2311,7 @@ True False - Run as... + ublexec @@ -2216,7 +2347,7 @@ True False - Run as... + ublexec