Исправлен CMakeLists, define вынесены в общий файл

pull/35/head
Igor Belitskiy 3 years ago
parent f8ad8dfdb4
commit 5b2c0a5afb

@ -8,19 +8,15 @@ include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
add_definitions(${GTK_CFLAGS_OTHER})
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
option(WEBKIT_FOUND "No" OFF)
option(WEBKIT_FOUND "" ON)
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
if(WEBKIT_LIBRARIES_FOUND)
option(WEBKIT_FOUND "Yes" ON)
if(WEBKIT_FOUND)
PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
include_directories(${WEBKIT_INCLUDE_DIRS})
link_directories(${WEBKIT_LIBRARY_DIRS})
add_definitions(${WEBKIT_CFLAGS_OTHER})
endif()
configure_file(ublexec.h.in ublexec-cm.h)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
@ -29,8 +25,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
-fstack-clash-protection -fcf-protection -g")
set(SOURCE_FILES
my_cmd_and_path.h
ublexec-cm.h
main.cc
ublexec.cc
ublexec.h

@ -1,15 +0,0 @@
#ifndef MY_CMD_H
#define MY_CMD_H
#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/ublexec"
#define cmd_xdg "xdg-open "
#define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \""
#define path_app "/usr/bin/"
#define path_glade "/usr/share/ublexec/ui/ublexec.glade"
#define path_css "/usr/share/ublexec/css/ublexec.css"
#define app_name "ublexec"
#define path_img_head_background "/usr/share/ublexec/images/logo-background.png"
#define path_all_applications "/usr/share/applications/"
#define file_source_login_min_max "/etc/login.defs"
#endif

@ -1,61 +0,0 @@
#ifndef MY_LOCALIZATION
#define MY_LOCALIZATION
#include <gtkmm/plug.h>
#define copyright _("Copyright © UBSoft LLC, 2022 - ")
#define define_name_app _("Run as...")
#define name_app_1 _("ublexec")
#define website _("https://wiki.ublinux.com")
#define home_page _("Project Home Page")
#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 site, where user help pages are ""translated and supported by community.")
#define str_help_h _("GTK settings datetime for UBLinux\n\n""Usage: ubl-settings-datetime [OPTIONS...]\n""Options:\n"" -h, --help Show this help\n"" -V, --version Show package version\n"" --lock-datetime Lock date and time changes\n"" --lock-timezone Lock time zone changes\n"" --lock-ntp-mode Lock NTP mode selection\n"" --lock-ntp-edit Lock editing NTP servers\n"" --lock-sync-hwclock Lock sync hwclock mode selection\n"" --lock-save Lock saving local and global configuration\n"" --lock-save-local Lock save global configuration\n"" --lock-save-global Lock load global configuration\n"" --lock-load-global Lock load global configuration\n")
#define str_version _("ublexec version: ")
#define nice_19 _("19 (Low)")
#define nice_0 _("0 (High)")
#define nice__20 _("-20 (High)")
#define str_close _("Close")
#define str_localization_system _("System")
#define str_localization_development _("Development")
#define str_localization_other _("Other")
#define str_localization_office _("Office")
#define str_localization_education _("Education")
#define str_localization_settings _("Settings")
#define str_localization_multimedia _("Multimedia")
#define str_localization_internet _("Internet")
#define str_localization_tools _("Tools")
#define str_localization_graphics _("Graphics")
#define str_localization_attention _("Attention")
#define str_localization_priority _("Priority")
#define str_run_of_user _("Run as another user:")
#define str_select_app_program _("Select an executable file or program")
#define str_change_priority _("Change startup priority")
#define str_run_terminal _("Run in the terminal emulator")
#define str_file_overview _("File Overview")
#define str_application_overview _("Application Overview")
#define str_run_applications_as_another _("Run applications as another user\nwith the specified priority")
#define str_localization_username _("User Name:")
#define str_selecting_programs _("Selecting Programs")
#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_run _("Run")
#endif

@ -18,14 +18,78 @@
#include <fstream>
#include <dlfcn.h>
#include "ubl-util-standard.c"
#include "ublexec-cm.h"
#include "my_cmd_and_path.h"
#include "my_localization.h"
#include <stdbool.h>
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#define copyright _("Copyright © UBSoft LLC, 2022 - ")
#define define_name_app _("Run as...")
#define name_app_1 _("ublexec")
#define website _("https://wiki.ublinux.com")
#define home_page _("Project Home Page")
#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 site, where user help pages are ""translated and supported by community.")
#define str_help_h _("GTK settings datetime for UBLinux\n\n""Usage: ubl-settings-datetime [OPTIONS...]\n""Options:\n"" -h, --help Show this help\n"" -V, --version Show package version\n"" --lock-datetime Lock date and time changes\n"" --lock-timezone Lock time zone changes\n"" --lock-ntp-mode Lock NTP mode selection\n"" --lock-ntp-edit Lock editing NTP servers\n"" --lock-sync-hwclock Lock sync hwclock mode selection\n"" --lock-save Lock saving local and global configuration\n"" --lock-save-local Lock save global configuration\n"" --lock-save-global Lock load global configuration\n"" --lock-load-global Lock load global configuration\n")
#define str_version _("ublexec version: ")
#define nice_19 _("19 (Low)")
#define nice_0 _("0 (High)")
#define nice__20 _("-20 (High)")
#define str_close _("Close")
#define str_localization_system _("System")
#define str_localization_development _("Development")
#define str_localization_other _("Other")
#define str_localization_office _("Office")
#define str_localization_education _("Education")
#define str_localization_settings _("Settings")
#define str_localization_multimedia _("Multimedia")
#define str_localization_internet _("Internet")
#define str_localization_tools _("Tools")
#define str_localization_graphics _("Graphics")
#define str_localization_attention _("Attention")
#define str_localization_priority _("Priority")
#define str_run_of_user _("Run as another user:")
#define str_select_app_program _("Select an executable file or program")
#define str_change_priority _("Change startup priority")
#define str_run_terminal _("Run in the terminal emulator")
#define str_file_overview _("File Overview")
#define str_application_overview _("Application Overview")
#define str_run_applications_as_another _("Run applications as another user\nwith the specified priority")
#define str_localization_username _("User Name:")
#define str_selecting_programs _("Selecting Programs")
#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_run _("Run")
#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/ublexec"
#define cmd_xdg "xdg-open "
#define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \""
#define path_app "/usr/bin/"
#define path_glade "/usr/share/ublexec/ui/ublexec.glade"
#define path_css "/usr/share/ublexec/css/ublexec.css"
#define app_name "ublexec"
#define path_img_head_background "/usr/share/ublexec/images/logo-background.png"
#define path_all_applications "/usr/share/applications/"
#define file_source_login_min_max "/etc/login.defs"
using namespace std;
extern string name_app_cmd;

Loading…
Cancel
Save