From 0c1b2e3d35b0feefdb30c15fa3c1b6ad06ed4ec5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 1 Sep 2023 16:45:34 +0600 Subject: [PATCH] Fixes --- source/ubl-strings.h | 29 ++------------- source/ublexec.c | 40 ++++++++++---------- ublexec.glade | 88 ++++++++++++++++---------------------------- 3 files changed, 55 insertions(+), 102 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 2f9831d..e169970 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -1,39 +1,18 @@ #define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL) -#define HELP_LABEL yon_char_unite(_("ublexec version:")," ", version_application,"\n",_("TEMPLATE Manager"),"\n",_("Usage:"), " ublexec ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL) +#define HELP_LABEL yon_char_unite(_("ublexec version:")," ", version_application,"\n",_("Run as..."),"\n",_("Usage:"), " ublexec ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL) -#define TITLE_LABEL _("TEMPLATE Manager") -#define TITLE_INFO_LABEL _("System TEMPLATE settings management") +#define TITLE_LABEL _("Run as...") +#define TITLE_INFO_LABEL _("Run the application as a user with a changed priority") #define SUCCESS_LABEL _("Operation succeeded") -#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked") #define ABOUT_LABEL _("About") #define DOCUMENTATION_LABEL _("Documentation") -#define SAVE_LOCAL_LABEL _("Save to local configuration") -#define SAVE_GLOBAL_LABEL _("Save to global configuration") -#define SAVE_CONFIGURATION_LABEL _("Save configuration") -#define SAVE_LABEL _("Save") - -#define LOAD_LOCAL_LABEL _("Load local configuration") -#define LOAD_GLOBAL_LABEL _("Load global configuration") -#define LOAD_LABEL _("Load") - #define CANCEL_LABEL _("Cancel") #define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") #define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.") #define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation") #define OPEN_HELP_LABEL _("Open documentation") -#define PROJECT_HOME_LABEL _("Project Home Page") -#define NOTHING_CHOSEN_LABEL _("Nothing were chosen") - - -#define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succseeded.") -#define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succseeded.") -#define LOAD_FAILED_LABEL _("Config loading failed") - -#define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succseeded.") -#define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succseeded.") -#define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succseeded.") -#define SAVE_FAILED_LABEL \ No newline at end of file +#define PROJECT_HOME_LABEL _("Project homepage") \ No newline at end of file diff --git a/source/ublexec.c b/source/ublexec.c index 5e50471..1c539d9 100644 --- a/source/ublexec.c +++ b/source/ublexec.c @@ -132,30 +132,30 @@ main_window *setup_window(){ /* Widgets getting | Получение виджетов */ main_window *widgets = malloc(sizeof(main_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); - widgets->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); - widgets->HatLabel = yon_gtk_builder_get_widget(builder,"headerTopic"); + widgets->Window = yon_gtk_builder_get_widget(builder,"window"); widgets->PlugBox = yon_gtk_builder_get_widget(builder,"plugBox"); + widgets->TargetNameEntry = yon_gtk_builder_get_widget(builder,"targetNameEntry"); + widgets->chooseFileButton = yon_gtk_builder_get_widget(builder,"chooseFileButton"); + widgets->chooseDesktopButton = yon_gtk_builder_get_widget(builder,"chooseDesktopButton"); - widgets->HeadOverlay = yon_gtk_builder_get_widget(builder,"HeadOverlay"); - widgets->HeadImage = yon_gtk_builder_get_widget(builder,"HeadBackgroundImage"); - widgets->HeadBox = yon_gtk_builder_get_widget(builder,"HeaderBox"); - widgets->HeadTitleLabel = yon_gtk_builder_get_widget(builder,"HeaderTitleLabel"); - widgets->HeadInfoLabel = yon_gtk_builder_get_widget(builder,"HeaderInfoLabel"); - - widgets->StatusBox = yon_gtk_builder_get_widget(builder,"mainStatusBox"); - widgets->StatusIcon = yon_gtk_builder_get_widget(builder,"mainStatusIcon"); - widgets->StatusLabel = yon_gtk_builder_get_widget(builder,"mainStatusLabel"); + widgets->runWithTerminalCheck = yon_gtk_builder_get_widget(builder,"runWithTerminalCheck"); + widgets->runWithTerminalCombo = yon_gtk_builder_get_widget(builder,"runWithTerminalCombo"); + + widgets->runWithUserCheck = yon_gtk_builder_get_widget(builder,"runWithUserCheck"); + widgets->runWithUserPkexecCheck = yon_gtk_builder_get_widget(builder,"runWithUserPkexecCheck"); + widgets->runWithUserSuCheck = yon_gtk_builder_get_widget(builder,"runWithUserSuCheck"); + widgets->runWithUserSudoCheck = yon_gtk_builder_get_widget(builder,"runWithUserSudoCheck"); + widgets->runWithUserCombo = yon_gtk_builder_get_widget(builder,"runWithUserCombo"); + + widgets->priorityCheck = yon_gtk_builder_get_widget(builder,"priorityCheck"); + widgets->priorityScale = yon_gtk_builder_get_widget(builder,"priorityScale"); + widgets->prioritySpin = yon_gtk_builder_get_widget(builder,"prioritySpin"); + widgets->highestPriorityLabel = yon_gtk_builder_get_widget(builder,"highestPriorityLabel"); - widgets->SaveLabel = yon_gtk_builder_get_widget(builder,"headerSaveConfigLabel"); - widgets->SaveMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem"); - widgets->SaveGlobalMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem"); - widgets->SaveLocalMenuItem = yon_gtk_builder_get_widget(builder,"SaveLocalConfigurationMenuItem"); - widgets->RightBox = yon_gtk_builder_get_widget(builder,"HeaderRightBox"); + widgets->commandCheck = yon_gtk_builder_get_widget(builder,"commandCheck"); + widgets->commandEntry = yon_gtk_builder_get_widget(builder,"commandEntry"); - widgets->LoadLabel = yon_gtk_builder_get_widget(builder,"headerLoadConfigLabel"); - widgets->LoadGlobalMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem"); - widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem"); - widgets->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox"); + widgets->runButton = yon_gtk_builder_get_widget(builder,"runButton"); widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL); diff --git a/ublexec.glade b/ublexec.glade index 6799fb2..36e5a0e 100644 --- a/ublexec.glade +++ b/ublexec.glade @@ -1059,13 +1059,7 @@ True False - 5 - 5 - 5 - 5 - 6 - 6 - gtk-media-play + media-playback-start-symbolic @@ -1083,33 +1077,13 @@ - + True False False False 4 dropdown-menu - - - True - False - Help - - - - - - True - False - About - - - 800 @@ -1188,7 +1162,7 @@ True 5 - + True False @@ -1199,7 +1173,7 @@ - + True True True @@ -1235,7 +1209,7 @@ - + True True True @@ -1278,7 +1252,7 @@ True 5 - + True True False @@ -1286,7 +1260,7 @@ center True - + True False Run in the terminal emulator @@ -1300,7 +1274,7 @@ - + True False @@ -1320,11 +1294,11 @@ - + True False start - File or app opening + File or app for running @@ -1371,7 +1345,7 @@ True 5 - + True True False @@ -1393,14 +1367,14 @@ - + pkexec True True False 6 True - rbSu + runWithUserSuCheck False @@ -1409,13 +1383,13 @@ - + su True True False True - rbPkexec + runWithUserPkexecCheck False @@ -1424,13 +1398,13 @@ - + sudo True True False True - rbSu + runWithUserSuCheck False @@ -1452,7 +1426,7 @@ True 5 - + True False User Name: @@ -1466,7 +1440,7 @@ - + True False @@ -1486,7 +1460,7 @@ - + True False start @@ -1531,7 +1505,7 @@ vertical 5 - + True True False @@ -1539,7 +1513,7 @@ center True - + True False Change startup priority @@ -1575,7 +1549,7 @@ - + True True 15 @@ -1591,7 +1565,7 @@ - + True True center @@ -1619,7 +1593,7 @@ False 5 - + True False 19 (Low) @@ -1632,7 +1606,7 @@ - + True False end @@ -1656,7 +1630,7 @@ - + True False start @@ -1738,7 +1712,7 @@ - + True False start @@ -1753,7 +1727,7 @@ - + Run True True @@ -1819,7 +1793,7 @@ False True True - menu1 + menu2 none @@ -1842,7 +1816,7 @@ - +