Часть переменных вынесены в отдельный файл

pull/11/head
Igor Belitskiy 3 years ago
parent 085c66ec44
commit 7ba4533fc0

@ -35,7 +35,7 @@ set(SOURCE_FILES
ubl-settings-bootloader-cm.h ubl-settings-bootloader-cm.h
ubl-settings-bootloader.h ubl-settings-bootloader.h
ubl-settings-bootloader.cc ubl-settings-bootloader.cc
my_cmd.h my_cmd_and_path.h
save.h save.h
save.cc save.cc
load.h load.h

@ -14,4 +14,15 @@
#define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \"" #define cmd_execute "su -l %s -c \" DISPLAY=$DISPLAY %s \""
#define icon_checked "com.ublinux.ubl-settings-bootloader.checked" #define icon_checked "com.ublinux.ubl-settings-bootloader.checked"
#define icon_warning "com.ublinux.ubl-settings-bootloader.warning" #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 #endif

@ -2,12 +2,6 @@
#include "ubl-settings-bootloader.h" #include "ubl-settings-bootloader.h"
using namespace std; 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_ext_id_I = 0;
int socket_trd_id_I = 0; int socket_trd_id_I = 0;
bool flag_save = false; bool flag_save = false;
@ -153,9 +147,9 @@ void MainWindow::fill_in_view() {
treeViewIPT->set_model(list_store_IPT); treeViewIPT->set_model(list_store_IPT);
treeViewOTT->set_model(list_store_OTT); treeViewOTT->set_model(list_store_OTT);
vec_Option_kernel = this->read_file_and_view("cmdline-linux.csv", row_kernel, list_store_kernel); vec_Option_kernel = this->read_file_and_view(kernel_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_IPT = this->read_file_and_view(IPT_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_OTT = this->read_file_and_view(OTT_csv, row_OTT, list_store_OTT);
size_kernel = vec_Option_kernel.size(); size_kernel = vec_Option_kernel.size();
size_IPT = vec_Option_IPT.size(); size_IPT = vec_Option_IPT.size();
size_OTT = vec_Option_OTT.size(); size_OTT = vec_Option_OTT.size();
@ -350,7 +344,7 @@ string MainWindow::template_item_selected(int size, Glib::RefPtr<Gtk::ListStore>
vector<string> MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m) { vector<string> MainWindow::read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m) {
std::array<std::vector<std::string>, 5> arr_view = Utils::read_csv(path_resources + "/" + file_name); std::array<std::vector<std::string>, 5> arr_view = Utils::read_csv(string(path_resources) + "/" + file_name);
std::vector<std::string> vec_Option = arr_view[0]; std::vector<std::string> vec_Option = arr_view[0];
for (size_t index = 0; index < vec_Option.size(); index++) { for (size_t index = 0; index < vec_Option.size(); index++) {

@ -12,7 +12,7 @@
#include <libintl.h> #include <libintl.h>
#include <glibmm/i18n.h> #include <glibmm/i18n.h>
#include <map> #include <map>
#include "my_cmd.h" #include "my_cmd_and_path.h"
#include "ubl-util-standard.c" #include "ubl-util-standard.c"
#include "util.h" #include "util.h"
#include "save.h" #include "save.h"
@ -27,13 +27,8 @@
#include "my_process.h" #include "my_process.h"
using namespace std; 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_ext_id_I;
extern int socket_trd_id_I; extern int socket_trd_id_I;
extern const string path_img_head_background;
extern string version_application; extern string version_application;
extern bool flag_save; extern bool flag_save;
extern bool flag_save_local; extern bool flag_save_local;

Loading…
Cancel
Save