From 51d6e391f0b1979ff8dbd9c5fec6af9b6acb8ac5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 31 Aug 2023 17:38:06 +0600 Subject: [PATCH] Added new entry --- .gitignore | 7 +- source/CMakeLists.txt | 2 +- source/ublexec.cc | 105 ++++++----- source/ublexec.h | 17 +- ublexec.css | 4 + ublexec.glade | 415 ++++++++++++++---------------------------- 6 files changed, 211 insertions(+), 339 deletions(-) diff --git a/.gitignore b/.gitignore index e2c7ced..07e1ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -ublexec.glade~ -#ublexec.glade# +*~* +*#* test.cpp .vscode ublexec nohup.out -ublexec_ru.po~ \ No newline at end of file +ublexec_ru.po~ +compile/ \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 587687d..e35dd6d 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -71,7 +71,7 @@ add_custom_target( set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ - -fstack-clash-protection -fcf-protection") + -fstack-clash-protection -fcf-protection -g") diff --git a/source/ublexec.cc b/source/ublexec.cc index ed6f8af..4f341a6 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -64,7 +64,6 @@ 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); @@ -78,7 +77,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); @@ -125,11 +124,17 @@ 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 set_sensitive_from_check(Gtk::CheckButton *check, Gtk::Widget *widget){ + widget->set_sensitive(check->get_active()); +} void MainWindow::set_icon_array() { array_icon[0] = this->iconGraphics; @@ -177,53 +182,52 @@ 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); + // 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); + // 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() { @@ -461,9 +465,11 @@ 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(); @@ -471,6 +477,7 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtrset_text(name_app); txtCmd->set_text(name_app); break; } diff --git a/source/ublexec.h b/source/ublexec.h index e34f468..bc5119e 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -31,22 +31,13 @@ #define define_name_app _("Run as...") #define name_app_1 _("ublexec") #define website _("https://wiki.ublinux.com") -#define home_page _("Project Home Page") +#define home_page _("Project hompage") #define space_name_app _(" Run as...") #define str_about_1 _("About") -#define str_about _("About ubl-settings-datetime") #define str_help _("Help") -#define str_save _("Save") -#define str_load _("Load") -#define save_all _("Save to global and local configuration") -#define save_local _("Save local configuration") -#define save_global _("Save global configuration") -#define load_global _("Load global configuration") -#define load_local _("Load local configuration") #define read_online _("Read online") #define cancel _("Cancel") #define always_redirect _("Always redirect") -#define nothing_save _("Nothing to save!") #define read_documentation_web _("Would you like to read documentation in the Web?") #define redirected_documentation _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") #define str_help_h _("GTK \"Run applications as another user with the specified priority\" for ""UBLinux\n""\n""Usage: ublexec [OPTIONS...]\n""Options:\n"" -h, --help\t Show this help\n"" -V, --version\t Show package version\n"" -x APP_NAME Running the program\n"" -e FILE_NAME Running the file\n") @@ -79,7 +70,7 @@ #define str_please_select_file _("Please select File") #define str_localization_cmd_line _("Command Line") #define str_localization_user _("User") -#define str_localization_team _("Team:") +#define str_localization_team _("Command:") #define str_run _("Run") #define const_link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ublexec" @@ -291,6 +282,8 @@ public: Gtk::Button *btnReadHelp; Gtk::Button *btnCancelHelp; Gtk::Window *wndShowWeb; + Gtk::Entry *CommandEntry; + Gtk::CheckButton *CommandCheck; #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; @@ -343,4 +336,4 @@ private: void help(); void wrapper_help_show(GtkWidget *self, char* link, gpointer user_data); - +void set_sensitive_from_check(Gtk::CheckButton *check, Gtk::Widget *widget); diff --git a/ublexec.css b/ublexec.css index 1e33f1c..3d86970 100644 --- a/ublexec.css +++ b/ublexec.css @@ -2,6 +2,10 @@ text-shadow: 2px 2px @theme_bg_color; color: @theme_text_color; } +.thin { + margin:0px; + padding:0px; +} .bannerbackground { background-color: #404040; } diff --git a/ublexec.glade b/ublexec.glade index b31d342..6cc511f 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -1,7 +1,8 @@ - + + True True @@ -19,9 +20,9 @@ ublexec 1.0 Copyright © 2022 - 2023, UBSoft LLC - ublexec + Run as... https://ublinux.ru/ - Project Home Page + Project hompage Это приложение распространяется без каких-либо гарантий. Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. UBGroup @@ -46,9 +47,6 @@ 1 - - - @@ -65,7 +63,7 @@ 5 5 2 - ublexec + Run as... @@ -1114,6 +1112,8 @@ + 800 + 600 False com.ublinux.ublexec @@ -1147,12 +1147,17 @@ True False + 5 + 5 + 5 + 5 vertical True False vertical + 5 True @@ -1163,12 +1168,6 @@ True False - 5 - 5 - 5 - 5 - 6 - 6 True 0.019999999552965164 in @@ -1176,47 +1175,22 @@ True False - 5 5 + 5 + 5 True vertical + 5 True False True - - - 0 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Team: - True - 0 - - - False - True - 0 - - + 5 - 440 True - True - 5 - 5 - 5 - 5 - 6 - 6 + False True @@ -1226,17 +1200,12 @@ - 51 True True True + File view end - 5 - 5 - 5 5 - 6 - 6 True @@ -1250,8 +1219,14 @@ 3 3 gtk-directory + + False @@ -1261,17 +1236,11 @@ - 51 True True True + Program view end - 5 - 5 - 5 - 5 - 6 - 6 True @@ -1285,6 +1254,9 @@ view-list-details + False @@ -1303,25 +1275,8 @@ True False - 6 - 6 True - - - 44 - True - False - 15 - 5 - 15 - 5 - - - False - True - 0 - - + 5 True @@ -1329,11 +1284,6 @@ False start center - 5 - 5 - 5 - 5 - 6 True @@ -1353,30 +1303,13 @@ True False - start - 2 - 5 - 5 - 6 - False + True True 2 - - - 116 - True - False - - - False - True - 3 - - False @@ -1391,7 +1324,7 @@ True False start - Command Line + File or app opening @@ -1405,24 +1338,19 @@ False True - 1 + 0 True False - 5 True vertical True False - 5 - 5 - 5 - 5 True 0.019999999552965164 in @@ -1430,15 +1358,18 @@ True False - 5 5 + 5 + 5 True vertical + 5 True False True + 5 True @@ -1446,12 +1377,6 @@ False start center - 5 - 5 - 5 - 5 - 6 - 6 True @@ -1474,8 +1399,6 @@ True False 6 - 6 - 6 True rbSu @@ -1491,10 +1414,6 @@ True True False - 3 - 31 - 3 - 31 True rbPkexec @@ -1510,10 +1429,6 @@ True True False - 6 - 6 - 6 - 6 True rbSu @@ -1523,23 +1438,6 @@ 3 - - - 95 - True - False - end - 15 - 5 - 15 - 5 - - - False - True - 4 - - False @@ -1552,17 +1450,11 @@ True False True + 5 - 123 True False - 5 - 5 - 5 - 5 - 6 - 6 User Name: True 0 @@ -1575,35 +1467,15 @@ - 374 True False - 5 - 5 - 5 - 5 - 6 - 6 - False + True True 1 - - - 0 - True - False - 100 - - - False - True - 2 - - False @@ -1632,24 +1504,19 @@ False True - 2 + 1 True False - 5 True vertical True False - 5 - 5 - 5 - 5 True 0.019999999552965164 in @@ -1657,10 +1524,12 @@ True False - 5 5 + 5 + 5 True vertical + 5 True @@ -1668,12 +1537,6 @@ False start center - 5 - 5 - 5 - 5 - 6 - 6 True @@ -1694,16 +1557,13 @@ True False True + 5 5 True False - 5 - 5 - 5 - 5 - 13 + center Priority: True 0 @@ -1716,13 +1576,9 @@ - -1 True True - 5 - 5 - 5 - 5 + 15 adjustment1 20 0 @@ -1738,11 +1594,7 @@ True True - 5 - 5 - 5 - 5 - 15 + center True @@ -1762,37 +1614,15 @@ True False - 9 + 120 + 120 False - - - 62 - True - False - 15 - 5 - 15 - 5 - 0 - - - False - True - 0 - - + 5 - 145 True False - 5 - 5 - 5 - 5 - 6 19 (Low) - True 0 @@ -1807,13 +1637,7 @@ False end center - 5 - 5 - 5 - 5 - 6 -20 (High) - True 0 @@ -1822,23 +1646,6 @@ 3 - - - 107 - True - False - end - 15 - 5 - 15 - 5 - - - False - True - 4 - - False @@ -1867,6 +1674,80 @@ 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 + True + + + True + True + 1 + + + + + False + True + 0 + + + + + + + True + False + start + Command Line + + + + + True + True 3 @@ -1876,18 +1757,13 @@ True True True - 5 - 5 - 5 - 5 - 6 - 6 image1 True False True + end 4 @@ -1917,7 +1793,7 @@ True False center - Ublexec + Run as... @@ -1945,11 +1821,7 @@ menu1 none - - True - False - open-menu-symbolic - + @@ -1967,9 +1839,14 @@ + + + + + + False - start False @@ -1980,17 +1857,16 @@ True False + 5 + 5 + 5 + 5 + 5 True False center - 20 - 20 - 20 - 20 - 20 - 20 dialog-warning-symbolic 6 @@ -2002,14 +1878,9 @@ + 200 True False - 10 - 25 - 10 - 25 - 20 - 20 Select an executable file or program True 0 @@ -2122,16 +1993,12 @@ 0 - - - + 450 False - start - start False 450 250 @@ -2311,7 +2178,7 @@ True False - ublexec + Run as... @@ -2347,7 +2214,7 @@ True False - ublexec + Run as...