Merge pull request 'develop' (#21) from develop into master

Reviewed-on: #21
pull/28/head
Dmitry Razumov 3 years ago
commit 2d0889ae0f

@ -123,10 +123,10 @@ install: check uninstall
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "logo-background.png"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg"
@install -Dm644 -t /usr/share/${PKGNAME}/ cmdline-linux.csv
@install -Dm644 -t /usr/share/${PKGNAME}/ grub-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-melodylist.csv
@install -Dm644 -t /usr/share/${PKGNAME}/ grub-play.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; \

@ -1,14 +0,0 @@
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
1 Option Description
2 quiet Downloading without text messages
3 splash Show welcome window
4 noplymouth Disable Plymouth
5 acpi=off Disable ACPI
6 noapic Disable APIC
7 nolapic Disable local APIC
8 single Single User Mode
9 nomodeset Disable kernel selection and loading of video drivers
10 915.enable_dc=0 Disable GPU power management
11 ahci.mobile_lpm_policy=1 Maximum performance, power management
12 snd-intel-dspcfg.dsp_driver=1 Forced selection of an Intel sound device driver
13 intel_idle.max_cstate=1 Prevents the processor from going into a deep sleep state
14 intel_idle.max_cstate=4 Eliminates flickering laptop display on Ultra Voltage processors

@ -0,0 +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
1 Option Description
2 quiet Downloading without text messages
3 splash Show welcome window
4 noplymouth Disable Plymouth
5 acpi=off Disable ACPI
6 noapic Disable APIC
7 nolapic Disable local APIC
8 single Single User Mode
9 nomodeset Disable kernel selection and loading of video drivers
10 915.enable_dc=0 Disable GPU power management
11 ahci.mobile_lpm_policy=1 Maximum performance, power management
12 snd-intel-dspcfg.dsp_driver=1 Forced selection of an Intel sound device driver
13 intel_idle.max_cstate=1 Prevents the processor from going into a deep sleep state
14 intel_idle.max_cstate=4 Eliminates flickering laptop display on Ultra Voltage processors

@ -1 +0,0 @@
ubbeep,1 22 333 4444 5555
1 ubbeep 1 22 333 4444 5555

@ -0,0 +1,2 @@
Option;Tone code
ubbeep;1 22 333 4444 5555
1 Option Tone code
2 ubbeep 1 22 333 4444 5555

@ -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)

1 Option Description
2 console PC BIOS & EFI console
3 serial Serial terminal
4 ofconsole Open Firmware Console
5 at_keyboard PC AT Keyboard (Coreboot)
6 usb_keyboard USB Keyboard (HID Boot protocol)

@ -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)

1 Option Description
2 console PC BIOS & EFI console
3 serial Serial terminal
4 ofconsole Open Firmware Console
5 gfxterm Output in graphical mode
6 vga_text VGA text output (Coreboot)

@ -8,7 +8,12 @@ int main(int argc, char** argv) {
string str_cmd_argv = "";
for (int i=1; i<argc; i++){
str_cmd_argv+= to_string(*argv[i]) + " ";
}
}
if (geteuid()!=0){
string cmd = "";
cmd = cmd + "pkexec " + app_name + " " + str_cmd_argv;
return system(cmd.c_str());
}
if (argc > 1){
str_argv = argv[1];
}

@ -57,6 +57,20 @@ bool Save::check_save(string flag_save, string key_name) {
return true;
}
bool Save::wrapper_check_save(string flag_save, string key_name) {
if (flag_save == "all") {
bool bool_flag_save = this->check_save("system", key_name);
if (bool_flag_save) {
return true;
}
return this->check_save("global", key_name);
}
else {
return this->check_save(flag_save, key_name);
}
}
int Save::get_count_error() {
return process.get_count_error();
}
@ -82,7 +96,7 @@ void Save::save(string sections, string str_flag_save) {
for (const auto &key: *vec_param_names) {
if (map_gui->find(key) != map_gui->end()) {
value = (*map_gui)[key];
if (this->check_save(str_flag_save, key)) {
if (this->wrapper_check_save(str_flag_save, key)) {
if (value.length() != 0) {
cmd = "ubconfig --target " + str_flag_save + " set " + sections + " " +
key + "=\"" + value + "\"";
@ -117,7 +131,7 @@ void Save::save_one_cmd(string cmd1, string cmd_remove, string str_flag_save) {
for (const auto &key: *vec_param_names) {
if (map_gui->find(key) != map_gui->end()) {
value = (*map_gui)[key];
if (this->check_save(str_flag_save, key)) {
if (this->wrapper_check_save(str_flag_save, key)) {
if (value.length() != 0) {
cmd = cmd + key + "=\"" + value + "\" ";
}

@ -20,7 +20,7 @@ public:
void set_data_gui(std::map <string, string> &map_gui);
bool check_save(string flag_save, string key_name);
bool get_state_save();
bool wrapper_check_save(string flag_save, string key_name);
void save_one_cmd(string cmd1, string cmd_remove, string str_flag_save);
int get_count_error();
string get_cmd_error();

@ -717,10 +717,10 @@ void MainWindow::set_init_data_superuser(std::map<string, string> &map_temp) {
void MainWindow::set_data_csv_melody() {
string path_name = "";
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
path_name = path_name + path_resources + "/" + melody_csv;
string line;
string all_melody = "";
string all_melody_old = "";
string all_melody = "Option;Tone code\n";
string all_melody_old = "Option;Tone code\n";
string code_melodyes = "";
ifstream in(path_name);
if (in.is_open()) {
@ -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);
}
}
@ -769,7 +765,7 @@ void MainWindow::set_init_data_melody(std::map<string, string> &map_temp) {
list_store_melody = Gtk::ListStore::create(m_columns_melody);
treeViewMelody->set_model(list_store_melody);
string path_name = "";
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
path_name = path_name + path_resources + "/" + melody_csv;
vector<tuple<string, string>> vec_melody = Utils::read_csv_melody(path_name);
bool flag = false;
string cgf_code_melody = map_temp["GRUB_PLAY"];
@ -955,15 +951,11 @@ void MainWindow::set_active_boot_second() {
void MainWindow::wrapper_save_all_cfg() {
this->set_data_cfg();
bool _flag_save_global1 = true;
bool _flag_save_local1 = true;
if (flag_save_global == false) {
_flag_save_global1 = this->save_template(global_save, global_remove , "global");
}
if (flag_save_local == false) {
_flag_save_local1 = this->save_template(system_save, system_remove , "system");
bool _flag_save_all = true;
if (flag_save_global == false || flag_save_local == false) {
_flag_save_all = this->save_template(all_save, all_remove, "all");
}
if (_flag_save_global1 && _flag_save_local1) {
if (_flag_save_all) {
this->info_warning_error(5);
}
else {

@ -54,7 +54,7 @@ void me_thread(string cmd);
#define str_about_1 _("About")
#define str_save _("Save")
#define str_load _("Load")
#define save_all _("Save in global and local configuration")
#define save_all _("Save configuration")
#define save_local _("Save in local configuration")
#define save_global _("Save in global configuration")
#define load_global _("Load global configuration")
@ -120,16 +120,19 @@ void me_thread(string cmd);
#define global_load "ubconfig --default --source global get boot"
#define system_load "ubconfig --default --source system get boot"
#define global_save "ubconfig --target global set boot "
#define all_save "ubconfig set boot "
#define all_remove "ubconfig remove boot "
#define global_save "ubconfig --target global --noexecute set boot "
#define system_save "ubconfig --target system set boot "
#define global_remove "ubconfig --target global remove boot "
#define global_remove "ubconfig --target global --noexecute remove boot "
#define system_remove "ubconfig --target system remove boot "
#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-bootloader"
#define cmd_xdg "xdg-open "
#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 kernel_csv "grub-cmdline-linux.csv"
#define melody_csv "grub-play.csv"
#define IPT_csv "grub-terminal-input.csv"
#define OTT_csv "grub-terminal-output.csv"
#define path_app "/usr/bin/"

@ -8,7 +8,7 @@ array<vector<string>, 5> read_csv(const string& filename) {
vector<string> vec_opcision;
ifstream file(filename);
string line;
char delimiter = ',';
char delimiter = ';';
getline(file, line);
while (getline(file, line)) {
stringstream stream(line);
@ -50,11 +50,20 @@ array<vector<string>, 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<tuple<string, string>> read_csv_melody(const string& filename) {
vector<tuple<string, string>> vec_music;
ifstream file(filename);
string line;
char delimiter = ',';
char delimiter = ';';
getline(file, line);
while (getline(file, line)) {
stringstream stream(line);
string name;

@ -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<std::string> split(std::string text, char delim);
vector<tuple<string, string>> read_csv_melody(const string& filename);
void write_file(string path_name, string data);
}
#endif

@ -373,7 +373,7 @@ msgstr ""
#: source/ubl-settings-bootloader.h:56 source/ubl-settings-bootloader.h:55
#: source/ubl-settings-bootloader.cc:432 source/ubl-settings-bootloader.cc:302
msgid "Save in global and local configuration"
msgid "Save configuration"
msgstr ""
#: source/ubl-settings-bootloader.cc:293

@ -391,8 +391,8 @@ msgstr "Сохранить в локальную конфигурацию"
#: source/ubl-settings-bootloader.h:56 source/ubl-settings-bootloader.h:55
#: source/ubl-settings-bootloader.cc:432 source/ubl-settings-bootloader.cc:302
msgid "Save in global and local configuration"
msgstr "Сохранить в глобальную и локальную конфигурацию"
msgid "Save configuration"
msgstr "Сохранить конфигурацию"
#: source/ubl-settings-bootloader.cc:293
#, fuzzy

Loading…
Cancel
Save