From 7ba4533fc0db6da2006bea16d76a6e023f4c9e5f Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Mon, 24 Apr 2023 17:29:52 +0600 Subject: [PATCH] =?UTF-8?q?=D0=A7=D0=B0=D1=81=D1=82=D1=8C=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BE=D1=82?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 2 +- source/{my_cmd.h => my_cmd_and_path.h} | 11 +++++++++++ source/ubl-settings-bootloader.cc | 14 ++++---------- source/ubl-settings-bootloader.h | 7 +------ 4 files changed, 17 insertions(+), 17 deletions(-) rename source/{my_cmd.h => my_cmd_and_path.h} (59%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c58563a..5c46ea0 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -35,7 +35,7 @@ set(SOURCE_FILES ubl-settings-bootloader-cm.h ubl-settings-bootloader.h ubl-settings-bootloader.cc - my_cmd.h + my_cmd_and_path.h save.h save.cc load.h diff --git a/source/my_cmd.h b/source/my_cmd_and_path.h similarity index 59% rename from source/my_cmd.h rename to source/my_cmd_and_path.h index f8e9e2a..5e65601 100644 --- a/source/my_cmd.h +++ b/source/my_cmd_and_path.h @@ -14,4 +14,15 @@ #define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \"" #define icon_checked "com.ublinux.ubl-settings-bootloader.checked" #define icon_warning "com.ublinux.ubl-settings-bootloader.warning" +#define kernel_csv "cmdline-linux.csv" +#define IPT_csv "grub-terminal-input.csv" +#define OTT_csv "grub-terminal-output.csv" + + +#define path_app "/usr/bin/" +#define path_glade "/usr/share/ubl-settings-bootloader/ui/ubl-settings-bootloader.glade" +#define path_css "/usr/share/ubl-settings-bootloader/css/ubl-settings-bootloader.css" +#define app_name "ubl-settings-bootloader" +#define path_resources "/usr/share/ubl-settings-bootloader" +#define path_img_head_background "/usr/share/ubl-settings-bootloader/images/logo-background.png" #endif \ No newline at end of file diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 8ff48dd..6531511 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -2,12 +2,6 @@ #include "ubl-settings-bootloader.h" using namespace std; -string path_app = "/usr/bin/"; -string path_glade= "/usr/share/ubl-settings-bootloader/ui/ubl-settings-bootloader.glade"; -string path_css = "/usr/share/ubl-settings-bootloader/css/ubl-settings-bootloader.css"; -string app_name = "ubl-settings-bootloader"; -string path_resources = "/usr/share/ubl-settings-bootloader"; -const string path_img_head_background = "/usr/share/ubl-settings-bootloader/images/logo-background.png"; int socket_ext_id_I = 0; int socket_trd_id_I = 0; bool flag_save = false; @@ -153,9 +147,9 @@ void MainWindow::fill_in_view() { treeViewIPT->set_model(list_store_IPT); treeViewOTT->set_model(list_store_OTT); - vec_Option_kernel = this->read_file_and_view("cmdline-linux.csv", row_kernel, list_store_kernel); - vec_Option_IPT = this->read_file_and_view("grub-terminal-input.csv", row_IPT, list_store_IPT); - vec_Option_OTT = this->read_file_and_view("grub-terminal-output.csv", row_OTT, list_store_OTT); + vec_Option_kernel = this->read_file_and_view(kernel_csv, row_kernel, list_store_kernel); + vec_Option_IPT = this->read_file_and_view(IPT_csv, row_IPT, list_store_IPT); + vec_Option_OTT = this->read_file_and_view(OTT_csv, row_OTT, list_store_OTT); size_kernel = vec_Option_kernel.size(); size_IPT = vec_Option_IPT.size(); size_OTT = vec_Option_OTT.size(); @@ -350,7 +344,7 @@ string MainWindow::template_item_selected(int size, Glib::RefPtr vector MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m) { - std::array, 5> arr_view = Utils::read_csv(path_resources + "/" + file_name); + std::array, 5> arr_view = Utils::read_csv(string(path_resources) + "/" + file_name); std::vector vec_Option = arr_view[0]; for (size_t index = 0; index < vec_Option.size(); index++) { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index f8d1b41..3e5beb6 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -12,7 +12,7 @@ #include #include #include -#include "my_cmd.h" +#include "my_cmd_and_path.h" #include "ubl-util-standard.c" #include "util.h" #include "save.h" @@ -27,13 +27,8 @@ #include "my_process.h" using namespace std; -extern string path_app; -extern string app_name; -extern string path_glade; -extern string path_css; extern int socket_ext_id_I; extern int socket_trd_id_I; -extern const string path_img_head_background; extern string version_application; extern bool flag_save; extern bool flag_save_local;