Добавил загрузку данных с конфига в treeView "мелодия"

pull/18/head
Igor Belitskiy 3 years ago
parent b735c42c23
commit 9fdd8f916c

@ -1,3 +1 @@
ubbeep,1 22 333 4444 5555 ubbeep,1 22 333 4444 5555
acdc,23 233 444
kipelov,23 66 333
1 ubbeep 1 22 333 4444 5555
acdc 23 233 444
kipelov 23 66 333

@ -74,6 +74,7 @@ void MainWindow::settings(){
vec_param_names.push_back("GRUB_USER"); vec_param_names.push_back("GRUB_USER");
vec_param_names.push_back("GRUB_PASSWORD"); vec_param_names.push_back("GRUB_PASSWORD");
vec_param_names.push_back("GRUB_DEFAULT"); vec_param_names.push_back("GRUB_DEFAULT");
vec_param_names.push_back("GRUB_PLAY");
this->get_builder(); this->get_builder();
this->localization(); this->localization();
this->add_CSS(); this->add_CSS();
@ -93,15 +94,17 @@ void MainWindow::settings(){
spbSecond->set_increments(1.0, 1.0); spbSecond->set_increments(1.0, 1.0);
spbSecond->set_value(1); spbSecond->set_value(1);
this->fill_in_view(); this->fill_in_view();
this->set_init_data_music();
this->change_password_protecc(); this->change_password_protecc();
this->change_security_login(); this->change_security_login();
this->set_active_boot_second(); this->set_active_boot_second();
this->str_last_launched_os = this->pars_last_launched_os(); this->str_last_launched_os = this->pars_last_launched_os();
vector<string> os_control_list; vector<string> os_control_list;
this->pars_os(os_control_list); this->pars_os(os_control_list);
this->download_local_cfg(); this->download_local_cfg();
this->download_globl_cfg(); this->download_globl_cfg();
this->view_add_colums_music(*treeViewMusic);
std::map<string, vector<string>> map_list_os = format_os_list(os_control_list); std::map<string, vector<string>> map_list_os = format_os_list(os_control_list);
obj_menu_os.set_builder(builder, path_glade); obj_menu_os.set_builder(builder, path_glade);
obj_menu_os.set_map(map_list_os); obj_menu_os.set_map(map_list_os);
@ -843,14 +846,16 @@ void get_tree_view_music() {
} }
*/ */
void MainWindow::set_init_data_music() { void MainWindow::set_init_data_music(std::map<string, string> &map_temp) {
treeViewMusic->reset_expander_column();
list_store_music = Gtk::ListStore::create(m_columns_music); list_store_music = Gtk::ListStore::create(m_columns_music);
treeViewMusic->set_model(list_store_music); treeViewMusic->set_model(list_store_music);
string path_name = ""; string path_name = "";
path_name = path_name + path_resources + "/" + "grub-music.csv"; path_name = path_name + path_resources + "/" + "grub-music.csv";
vector<tuple<string, string>> vec_music = Utils::read_csv_music(path_name); vector<tuple<string, string>> vec_music = Utils::read_csv_music(path_name);
bool flag = false; bool flag = false;
string cgf_code_music = map_cmd_selection["GRUB_PLAY"]; string cgf_code_music = map_temp["GRUB_PLAY"];
cout << cgf_code_music << endl;
for (tuple<string, string>& tuple_music: vec_music) { for (tuple<string, string>& tuple_music: vec_music) {
string name = get<0>(tuple_music); string name = get<0>(tuple_music);
string code = get<1>(tuple_music); string code = get<1>(tuple_music);
@ -858,7 +863,7 @@ void MainWindow::set_init_data_music() {
this->set_add_data_music(row_music, flag, name, code); this->set_add_data_music(row_music, flag, name, code);
} }
this->view_add_colums_music(*treeViewMusic);
} }
void MainWindow::set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code) { void MainWindow::set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code) {
@ -1107,6 +1112,7 @@ void MainWindow::load_template(std::map<string, string>* map_temp, string cmd) {
this->set_entry(entryIPT, *map_temp, "GRUB_TERMINAL_INPUT"); this->set_entry(entryIPT, *map_temp, "GRUB_TERMINAL_INPUT");
this->set_entry(entryOTT, *map_temp, "GRUB_TERMINAL_OUTPUT"); this->set_entry(entryOTT, *map_temp, "GRUB_TERMINAL_OUTPUT");
string str_last_launched_os_ubconfig = (*map_temp)["GRUB_DEFAULT"]; string str_last_launched_os_ubconfig = (*map_temp)["GRUB_DEFAULT"];
this->set_init_data_music(*map_temp);
if (str_last_launched_os_ubconfig.length() != 0) { if (str_last_launched_os_ubconfig.length() != 0) {
entrListOS->set_text(str_last_launched_os_ubconfig); entrListOS->set_text(str_last_launched_os_ubconfig);
} }

@ -398,7 +398,7 @@ public:
void view_add_line_user(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m); void view_add_line_user(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m);
void view_add_line_music(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m); void view_add_line_music(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m);
void set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code); void set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code);
void set_init_data_music(); void set_init_data_music(std::map<string, string> &map_temp);
}; };
class SettingsPlug : public Gtk::Plug class SettingsPlug : public Gtk::Plug

Loading…
Cancel
Save