diff --git a/Makefile b/Makefile index b5911fa..cf46ddb 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ install: check uninstall @install -Dm644 -t /usr/share/${PKGNAME}/ cmdline-linux.csv @install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-input.csv @install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-output.csv - @install -Dm644 -t /usr/share/${PKGNAME}/ grub-beeplist.csv + @install -Dm644 -t /usr/share/${PKGNAME}/ grub-melodylist.csv @if [ -z ${DESTDIR} ]; then \ [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ update-desktop-database --quiet &>/dev/null || true; \ diff --git a/grub-beeplist.csv b/grub-melodylist.csv similarity index 100% rename from grub-beeplist.csv rename to grub-melodylist.csv diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index dfcee94..a290dc7 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -101,7 +101,7 @@ void MainWindow::settings(){ this->download_local_cfg(); this->download_globl_cfg(); - this->view_add_colums_music(*treeViewMusic); + this->view_add_colums_melody(*treeViewMusic); this->view_add_colums_user(*treeViewUser); std::map> map_list_os = format_os_list(os_control_list); obj_menu_os.set_builder(builder, path_glade); @@ -218,10 +218,10 @@ void MainWindow::view_add_colums_user(Gtk::TreeView &treeView) { treeView.append_column_editable(str_password, m_columns_user.password); } -void MainWindow::view_add_colums_music(Gtk::TreeView &treeView) { - treeView.append_column_editable(str_active, m_columns_music.check_button); - treeView.append_column_editable(str_option, m_columns_music.title); - treeView.append_column_editable(str_melody_code, m_columns_music.melody_code); +void MainWindow::view_add_colums_melody(Gtk::TreeView &treeView) { + treeView.append_column_editable(str_active, m_columns_melody.check_button); + treeView.append_column_editable(str_option, m_columns_melody.title); + treeView.append_column_editable(str_melody_code, m_columns_melody.melody_code); } void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { @@ -632,11 +632,11 @@ void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cm void MainWindow::event() { btnRemoveUser->signal_clicked().connect([&]() {remove_user();}); - btnRemoveMusic->signal_clicked().connect([&]() {remove_music();}); + btnRemoveMusic->signal_clicked().connect([&]() {remove_melody();}); btnAddUser->signal_clicked().connect([&]() {string name = "", passwd = ""; set_add_data_user(row_user, false, name, passwd);}); btnAddMusic->signal_clicked().connect([&]() {string code = "", name = ""; - set_add_data_music(row_music, false,name, code);}); + set_add_data_melody(row_melody, false,name, code);}); btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();}); btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();}); chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;}); @@ -667,7 +667,7 @@ void MainWindow::event() { Glib::RefPtr treeViewUserModel = treeViewUser->get_model(); treeViewUserModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::remove_line_user)); Glib::RefPtr treeViewMusicModel = treeViewMusic->get_model(); - treeViewMusicModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::remove_line_music)); + treeViewMusicModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::remove_line_melody)); } this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit)); chbLoadVariantSelectionTimer->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_active_boot_second)); @@ -742,28 +742,28 @@ void MainWindow::set_init_data_superuser(std::map &map_temp) { } } -void MainWindow::set_data_csv_music() { +void MainWindow::set_data_csv_melody() { string path_name = ""; - path_name = path_name + path_resources + "/" + "grub-beeplist.csv"; + path_name = path_name + path_resources + "/" + "grub-melodylist.csv"; string line; - string all_music = ""; - string all_music_old = ""; - string code_melodies = ""; + string all_melody = ""; + string all_melody_old = ""; + string code_melodyes = ""; ifstream in(path_name); if (in.is_open()) { while (getline(in, line)){ - all_music_old += line + "\n"; + all_melody_old += line + "\n"; } } Glib::RefPtr treeViewMusic_model = treeViewMusic->get_model(); Gtk::TreeModel::Children children = treeViewMusic_model->children(); for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter){ Gtk::TreeModel::Row row = *iter; - code_melodies = row[m_columns_music.melody_code] + ""; - if (code_melodies.length() != 0 && (row[m_columns_music.title] + "").length() != 0) { - all_music += row[m_columns_music.title] + "," + code_melodies + "\n"; - if (row[m_columns_music.check_button]) { - map_cmd_selection["GRUB_PLAY"] = code_melodies + ""; + code_melodyes = row[m_columns_melody.melody_code] + ""; + if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) { + all_melody += row[m_columns_melody.title] + "," + code_melodyes + "\n"; + if (row[m_columns_melody.check_button]) { + map_cmd_selection["GRUB_PLAY"] = code_melodyes + ""; } else { map_cmd_selection["GRUB_PLAY"] = ""; @@ -772,13 +772,13 @@ void MainWindow::set_data_csv_music() { else { imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); info_status_app(info_box_error_css); - lblWarning->set_text(str_null_music_name); + lblWarning->set_text(str_null_melody_name); } } - if (all_music_old != all_music) { + if (all_melody_old != all_melody) { ofstream fout(path_name, ios_base::out | ios_base::trunc); if (fout.is_open()) { - fout << all_music; + fout << all_melody; fout.close(); } } @@ -791,28 +791,28 @@ void MainWindow::set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string & row[m_columns_user.password] = password; } -void MainWindow::set_init_data_music(std::map &map_temp) { +void MainWindow::set_init_data_melody(std::map &map_temp) { treeViewMusic->reset_expander_column(); - list_store_music = Gtk::ListStore::create(m_columns_music); - treeViewMusic->set_model(list_store_music); + list_store_melody = Gtk::ListStore::create(m_columns_melody); + treeViewMusic->set_model(list_store_melody); string path_name = ""; - path_name = path_name + path_resources + "/" + "grub-beeplist.csv"; - vector> vec_music = Utils::read_csv_music(path_name); + path_name = path_name + path_resources + "/" + "grub-melodylist.csv"; + vector> vec_melody = Utils::read_csv_melody(path_name); bool flag = false; - string cgf_code_music = map_temp["GRUB_PLAY"]; - for (tuple& tuple_music: vec_music) { - string name = get<0>(tuple_music); - string code = get<1>(tuple_music); - flag = (cgf_code_music == code); - this->set_add_data_music(row_music, flag, name, code); + string cgf_code_melody = map_temp["GRUB_PLAY"]; + for (tuple& tuple_melody: vec_melody) { + string name = get<0>(tuple_melody); + string code = get<1>(tuple_melody); + flag = (cgf_code_melody == code); + this->set_add_data_melody(row_melody, flag, name, code); } } -void MainWindow::set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code) { - row = *(list_store_music->append()); - row[m_columns_music.check_button] = flag; - row[m_columns_music.title] = name; - row[m_columns_music.melody_code] = code; +void MainWindow::set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string &name, string &code) { + row = *(list_store_melody->append()); + row[m_columns_melody.check_button] = flag; + row[m_columns_melody.title] = name; + row[m_columns_melody.melody_code] = code; } void MainWindow::remove_user() { @@ -823,12 +823,12 @@ void MainWindow::remove_user() { flag_validate_del_user = false; } -void MainWindow::remove_music() { - if (flag_validate_del_music && list_store_music->iter_is_valid(iter_music_del)) { - list_store_music->erase(iter_music_del); - flag_validate_del_music = false; +void MainWindow::remove_melody() { + if (flag_validate_del_melody && list_store_melody->iter_is_valid(iter_melody_del)) { + list_store_melody->erase(iter_melody_del); + flag_validate_del_melody = false; } - flag_validate_del_music = false; + flag_validate_del_melody = false; } void MainWindow::remove_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { @@ -860,17 +860,17 @@ void MainWindow::remove_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeMo } } -void MainWindow::remove_line_music(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { - iter_music_del = iter; - flag_validate_del_music = true; - string code_melodies = ""; +void MainWindow::remove_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { + iter_melody_del = iter; + flag_validate_del_melody = true; + string code_melodyes = ""; bool flag_error = false; Glib::RefPtr treeViewMusic_model = treeViewMusic->get_model(); Gtk::TreeModel::Children children = treeViewMusic_model->children(); for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter){ Gtk::TreeModel::Row row = *iter; - code_melodies = row[m_columns_music.melody_code] + ""; - if (code_melodies.length() == 0 && (row[m_columns_music.title] + "").length() == 0) { + code_melodyes = row[m_columns_melody.melody_code] + ""; + if (code_melodyes.length() == 0 && (row[m_columns_melody.title] + "").length() == 0) { flag_error = true; break; } @@ -878,7 +878,7 @@ void MainWindow::remove_line_music(const Gtk::TreeModel::Path&, const Gtk::TreeM if (flag_error == true) { imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); info_status_app(info_box_error_css); - lblWarning->set_text(str_null_music_name); + lblWarning->set_text(str_null_melody_name); } else { info_status_app(info_box_ok_css); @@ -1020,7 +1020,7 @@ void MainWindow::set_data_cfg() { } this->set_download_mode(); this->set_tree_view_user(); - this->set_data_csv_music(); + this->set_data_csv_melody(); } void MainWindow::download_globl_cfg() { @@ -1062,7 +1062,7 @@ void MainWindow::load_template(std::map* map_temp, string cmd) { this->set_entry(entryOTT, *map_temp, "GRUB_TERMINAL_OUTPUT"); string str_last_launched_os_ubconfig = (*map_temp)["GRUB_DEFAULT"]; this->set_init_data_user(*map_temp); - this->set_init_data_music(*map_temp); + this->set_init_data_melody(*map_temp); this->set_init_data_superuser(*map_temp); if (str_last_launched_os_ubconfig.length() != 0) { entrListOS->set_text(str_last_launched_os_ubconfig); diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index be5e10a..52d788c 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -103,7 +103,7 @@ void me_thread(string cmd); #define str_description _("Description") #define str_title_Boot_Menu_Users _("Boot Menu Users") #define str_title_Ringtone_Startup _("Ringtone at startup") -#define str_null_music_name _("Enter the name and code of the tune in the \"Ringtone at startup\" field") +#define str_null_melody_name _("Enter the name and code of the tune in the \"Ringtone at startup\" field") #define str_null_username _("Enter name and password code in the \"Boot Menu Users\" field") #define str_help_h _("GTK settings bootloader for UBLinux\n" \ "\n" \ @@ -182,10 +182,10 @@ public: Gtk::TreeModelColumn name; Gtk::TreeModelColumn password; }; - class ModelColumnsMusic : public Gtk::TreeModel::ColumnRecord + class ModelColumnsMelody : public Gtk::TreeModel::ColumnRecord { public: - ModelColumnsMusic() + ModelColumnsMelody() { add(check_button), add(title); add(melody_code); @@ -198,7 +198,7 @@ public: ModelColumns m_columns; ModelColumnsUser m_columns_user; - ModelColumnsMusic m_columns_music; + ModelColumnsMelody m_columns_melody; Glib::RefPtr builder; Gtk::SpinButton *spbSecond; Gtk::Label *lblBootMenuUsers; @@ -271,7 +271,7 @@ public: Glib::RefPtr list_store_IPT; Glib::RefPtr list_store_OTT; Glib::RefPtr list_store_user; - Glib::RefPtr list_store_music; + Glib::RefPtr list_store_melody; #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; Gtk::Widget *three; @@ -281,14 +281,14 @@ public: Gtk::TreeModel::Row row_IPT; Gtk::TreeModel::Row row_OTT; Gtk::TreeModel::Row row_user; - Gtk::TreeModel::Row row_music; + Gtk::TreeModel::Row row_melody; std::map map_cmd_selection; std::map map_global_cmd_selection; std::map map_local_cmd_selection; Gtk::TreeModel::iterator iter_user_del; - Gtk::TreeModel::iterator iter_music_del; + Gtk::TreeModel::iterator iter_melody_del; bool flag_validate_del_user = false; - bool flag_validate_del_music = false; + bool flag_validate_del_melody = false; Gtk::Label *lblDownloadMode; Lib_save::Save obj_save = Lib_save::Save(); @@ -334,11 +334,11 @@ public: void localization(); void event(); void remove_user(); - void remove_music(); + void remove_melody(); void settings(); - void remove_line_music(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter); + void remove_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter); void view_add_colums_user(Gtk::TreeView &treeView); - void view_add_colums_music(Gtk::TreeView &treeView); + void view_add_colums_melody(Gtk::TreeView &treeView); void set_bat_save(Gtk::Button *btnSave); string pars_last_launched_os(); vector pars_os(vector &os_control_list); @@ -346,7 +346,7 @@ public: void fn_event_intelMax4(); void synopsis_show(); void set_data_cfg(); - void set_data_csv_music(); + void set_data_csv_melody(); std::map> format_os_list(vector &os_control_list); void set_active_boot_second(); void get_download_mode(std::map &map_temp); @@ -388,8 +388,8 @@ public: void item_selected_OTT(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &); void item_selected_IPT(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &); string template_item_selected(int size, Glib::RefPtr &list_store, string key); - void set_add_data_music(Gtk::TreeModel::Row &row, bool flag, string &name, string &code); - void set_init_data_music(std::map &map_temp); + void set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string &name, string &code); + void set_init_data_melody(std::map &map_temp); void set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password); void set_init_data_user(std::map &map_temp); void set_init_data_superuser(std::map &map_temp); diff --git a/source/util.cc b/source/util.cc index 15a6c25..f2e47de 100644 --- a/source/util.cc +++ b/source/util.cc @@ -50,7 +50,7 @@ array, 5> read_csv(const string& filename) { return array_vectors; } -vector> read_csv_music(const string& filename) { +vector> read_csv_melody(const string& filename) { vector> vec_music; ifstream file(filename); string line; diff --git a/source/util.h b/source/util.h index 3f97598..59909c2 100644 --- a/source/util.h +++ b/source/util.h @@ -45,6 +45,6 @@ vector find_all(string &str_ntp, string substr); void str_remove(std::string& source, std::string to_remove); void str_replace_all(string &str_base, string str_find, string str_replace); std::vector split(std::string text, char delim); -vector> read_csv_music(const string& filename); +vector> read_csv_melody(const string& filename); } #endif \ No newline at end of file diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 0c25c41..335deb4 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -359,7 +359,7 @@ msgid "User" msgstr "Пользователь" msgid "Enter the name and code of the tune in the \"Ringtone at startup\" field" -msgstr "Введите название и код мелодии в поле \"Мелодия при загрузки\"" +msgstr "Введите название и код мелодии в поле \"Мелодия при загрузке\"" msgid "Enter name and password code in the \"Boot Menu Users\" field" msgstr "Введите имя и код пароль в поле \"Пользователи меню загрузчика\"" @@ -377,7 +377,7 @@ msgid "Melody code" msgstr "Код мелодии" msgid "Ringtone at startup" -msgstr "Мелодия при загрузки" +msgstr "Мелодия при загрузке" #: source/ubl-settings-bootloader.h:58 source/ubl-settings-bootloader.h:57 #: source/ubl-settings-bootloader.cc:434 source/ubl-settings-bootloader.cc:304