From 1e0028bd9ef730e28e2e499edac06e6fa2e7ac44 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Wed, 10 May 2023 09:49:21 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=81=20csv=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grub-cmdline-linux.csv | 28 ++++++++++++++-------------- grub-play.csv | 2 +- grub-terminal-input.csv | 12 ++++++------ grub-terminal-output.csv | 12 ++++++------ source/ubl-settings-bootloader.cc | 8 ++------ source/util.cc | 12 ++++++++++-- source/util.h | 1 + 7 files changed, 40 insertions(+), 35 deletions(-) diff --git a/grub-cmdline-linux.csv b/grub-cmdline-linux.csv index 1aba2df..214b158 100644 --- a/grub-cmdline-linux.csv +++ b/grub-cmdline-linux.csv @@ -1,14 +1,14 @@ -Option,Description -quiet,Downloading without text messages -splash,Show welcome window -noplymouth,Disable Plymouth -acpi=off,Disable ACPI -noapic,Disable APIC -nolapic,Disable local APIC -single,Single User Mode -nomodeset,Disable kernel selection and loading of video drivers -915.enable_dc=0,Disable GPU power management -ahci.mobile_lpm_policy=1,"Maximum performance, power management" -snd-intel-dspcfg.dsp_driver=1,Forced selection of an Intel sound device driver -intel_idle.max_cstate=1,Prevents the processor from going into a deep sleep state -intel_idle.max_cstate=4,Eliminates flickering laptop display on Ultra Voltage processors +Option;Description +quiet;Downloading without text messages +splash;Show welcome window +noplymouth;Disable Plymouth +acpi=off;Disable ACPI +noapic;Disable APIC +nolapic;Disable local APIC +single;Single User Mode +nomodeset;Disable kernel selection and loading of video drivers +915.enable_dc=0;Disable GPU power management +ahci.mobile_lpm_policy=1;Maximum performance, power management +snd-intel-dspcfg.dsp_driver=1;Forced selection of an Intel sound device driver +intel_idle.max_cstate=1;Prevents the processor from going into a deep sleep state +intel_idle.max_cstate=4;Eliminates flickering laptop display on Ultra Voltage processors diff --git a/grub-play.csv b/grub-play.csv index 79edc2e..b4167ab 100644 --- a/grub-play.csv +++ b/grub-play.csv @@ -1 +1 @@ -ubbeep,1 22 333 4444 5555 \ No newline at end of file +ubbeep;1 22 333 4444 5555 \ No newline at end of file diff --git a/grub-terminal-input.csv b/grub-terminal-input.csv index 4bd7f47..98148e6 100644 --- a/grub-terminal-input.csv +++ b/grub-terminal-input.csv @@ -1,6 +1,6 @@ -Option,Description -console,PC BIOS & EFI console -serial,Serial terminal -ofconsole,Open Firmware Console -at_keyboard,PC AT Keyboard (Coreboot) -usb_keyboard,USB Keyboard (HID Boot protocol) +Option;Description +console;PC BIOS & EFI console +serial;Serial terminal +ofconsole;Open Firmware Console +at_keyboard;PC AT Keyboard (Coreboot) +usb_keyboard;USB Keyboard (HID Boot protocol) diff --git a/grub-terminal-output.csv b/grub-terminal-output.csv index 30453d6..e4a86fd 100644 --- a/grub-terminal-output.csv +++ b/grub-terminal-output.csv @@ -1,6 +1,6 @@ -Option,Description -console,PC BIOS & EFI console -serial,Serial terminal -ofconsole,Open Firmware Console -gfxterm,Output in graphical mode -vga_text,VGA text output (Coreboot) +Option;Description +console;PC BIOS & EFI console +serial;Serial terminal +ofconsole;Open Firmware Console +gfxterm;Output in graphical mode +vga_text;VGA text output (Coreboot) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 596b3af..4bd132f 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -734,7 +734,7 @@ void MainWindow::set_data_csv_melody() { Gtk::TreeModel::Row row = *iter; 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"; + all_melody += row[m_columns_melody.title] + ";" + code_melodyes + "\n"; if (row[m_columns_melody.check_button]) { map_cmd_selection["GRUB_PLAY"] = code_melodyes + ""; } @@ -749,11 +749,7 @@ void MainWindow::set_data_csv_melody() { } } if (all_melody_old != all_melody) { - ofstream fout(path_name, ios_base::out | ios_base::trunc); - if (fout.is_open()) { - fout << all_melody; - fout.close(); - } + Utils::write_file(path_name, all_melody); } } diff --git a/source/util.cc b/source/util.cc index f2e47de..943146d 100644 --- a/source/util.cc +++ b/source/util.cc @@ -8,7 +8,7 @@ array, 5> read_csv(const string& filename) { vector vec_opcision; ifstream file(filename); string line; - char delimiter = ','; + char delimiter = ';'; getline(file, line); while (getline(file, line)) { stringstream stream(line); @@ -50,11 +50,19 @@ array, 5> read_csv(const string& filename) { return array_vectors; } +void write_file(string path_name, string data) { + ofstream fout(path_name, ios_base::out | ios_base::trunc); + if (fout.is_open()) { + fout << data; + fout.close(); + } +} + vector> read_csv_melody(const string& filename) { vector> vec_music; ifstream file(filename); string line; - char delimiter = ','; + char delimiter = ';'; while (getline(file, line)) { stringstream stream(line); string name; diff --git a/source/util.h b/source/util.h index 59909c2..0267564 100644 --- a/source/util.h +++ b/source/util.h @@ -46,5 +46,6 @@ 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_melody(const string& filename); +void write_file(string path_name, string data); } #endif \ No newline at end of file