diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ae1516d..81b3f41 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -29,7 +29,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin -fstack-clash-protection -fcf-protection -g") set(SOURCE_FILES - my_cmd.h + my_cmd_and_path.h ublexec-cm.h main.cc ublexec.cc diff --git a/source/main.cc b/source/main.cc index 91d0885..452dd26 100644 --- a/source/main.cc +++ b/source/main.cc @@ -9,7 +9,7 @@ int main(int argc, char** argv) { setlocale(LC_ALL, ""); bindtextdomain("ublexec", "/usr/share/locale/"); bind_textdomain_codeset("ublexec", "UTF-8"); - textdomain(app_name.c_str()); + textdomain(app_name); if (argc > 1){ str_argv = argv[1]; } diff --git a/source/my_cmd.h b/source/my_cmd_and_path.h similarity index 51% rename from source/my_cmd.h rename to source/my_cmd_and_path.h index 3047992..dfdb4b7 100644 --- a/source/my_cmd.h +++ b/source/my_cmd_and_path.h @@ -4,4 +4,10 @@ #define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ublexec" #define cmd_xdg "xdg-open " #define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \"" -#endif \ No newline at end of file +#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" +#endif + diff --git a/source/ublexec.cc b/source/ublexec.cc index bb5438f..f51c584 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -1,14 +1,10 @@ #include "ublexec.h" using namespace std; -const string path_app = "/usr/bin/"; -const string path_glade = "/usr/share/ublexec/ui/ublexec.glade"; -const string path_css = "/usr/share/ublexec/css/ublexec.css"; -const string app_name = "ublexec"; + int flag_prog_file = 0; string name_app_cmd = ""; string version_application = "2.24"; -const string path_img_head_background = "/usr/share/ublexec/images/logo-background.png"; int socket_ext_id_I = 0; int socket_trd_id_I = 0; @@ -379,6 +375,7 @@ void MainWindow::open_browser() { this->template_open_browser(); #endif } + void MainWindow::template_open_browser() { string cmd = cmd_xdg + string(_(link_doc)) + " &"; string buf = ""; @@ -392,6 +389,7 @@ void MainWindow::template_open_browser() { } index_error = system(cmd.c_str()); } + void MainWindow::icon_clear() { list_Graphics->clear(); list_Tools->clear(); diff --git a/source/ublexec.h b/source/ublexec.h index 0e893ef..2b1f451 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -19,7 +19,7 @@ #include #include "ubl-util-standard.c" #include "ublexec-cm.h" -#include "my_cmd.h" +#include "my_cmd_and_path.h" #include "my_localization.h" #include #ifdef WEBKIT_FOUND @@ -28,13 +28,7 @@ #endif using namespace std; - -extern const string path_app; -extern const string app_name; -extern const string path_glade; -extern const string path_css; extern string name_app_cmd; -extern const string path_img_head_background; extern int socket_ext_id_I; extern int socket_trd_id_I; extern int flag_prog_file;