diff --git a/Makefile b/Makefile
index 371bb65..78b45dd 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,9 @@ PKGNAME = $(MAKEFILE_DIR)
FILE_VER = source/${PKGNAME}.h
PKGIDENT=$(subst /,-,${PREFIX})
+FILE_MO := $(PKGNAME).mo
+LOCALE_DIR := ./locale
+
default_target: all
.PHONY: all init depend debug prepare check build uninstall install clean help
@@ -104,14 +107,12 @@ uninstall:
install: check uninstall
@echo "Install ..."
- @for FILE_PO in $(wildcard *.po); do \
- LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
- install -dm755 "${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES"; \
- FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
- PATH_FILE_MO="${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
- echo "$${FILE_PO}"; \
- msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \
+ @for po in $(LOCALE_DIR)/$(PKGNAME)_*.po; do \
+ lang=$$(basename $$po | sed -E 's/^$(PKGNAME)_([^.]+)\.po$$/\1/'); \
+ file=$$(find ./locale/ -name '*_'"$$lang"'.po'); \
+ msgfmt $$file -v -f -o ${DESTDIR}/usr/share/locale/$$lang/LC_MESSAGES/$(FILE_MO); \
done
+
@for SIZE in 16 32 48; do \
install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \
@@ -132,6 +133,8 @@ install: check uninstall
fi
@echo "Install: OK"
+
+
clean:
@echo "Clean ..."
@$(RM) -rd ${CMAKE_BUILD_DIR}
diff --git a/gresource.xml b/gresource.xml
index a1da154..ef6c431 100644
--- a/gresource.xml
+++ b/gresource.xml
@@ -18,5 +18,6 @@
grub-parameters.csv
grub-terminal-input.csv
grub-terminal-output.csv
+ grub-melody.csv
\ No newline at end of file
diff --git a/grub-melody.csv b/grub-melody.csv
new file mode 100644
index 0000000..070f201
--- /dev/null
+++ b/grub-melody.csv
@@ -0,0 +1,2 @@
+Option|Tone code
+ubbeep|480 900 2 1000 2 800 2 400 2 600 3
\ No newline at end of file
diff --git a/locale/grub-parameters.pot b/locale/grub-parameters.pot
new file mode 100644
index 0000000..5b86d72
--- /dev/null
+++ b/locale/grub-parameters.pot
@@ -0,0 +1,147 @@
+# Language translations for ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-parameters.csv package.
+# Copyright (C) 2022, UBTech LLC
+# This file is distributed under the same license as the ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-parameters.csv package.
+# UBLinux Team , 2022
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-parameters.csv 1.0\n"
+"Report-Msgid-Bugs-To: support@ublinux.com\n"
+"POT-Creation-Date: 2023-01-01 00:00+0600\n"
+"PO-Revision-Date: 2023-01-01 00:00+0600\n"
+"Last-Translator: UBLinux Team \n"
+"Language-Team: UBLinux Team \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+
+#: ./grub-parameters.csv:1
+msgid "Description"
+msgstr ""
+
+#: ./grub-parameters.csv:4
+#: ./grub-parameters.csv:3
+#: ./grub-parameters.csv:2
+msgid "Disable Plymouth"
+msgstr ""
+
+#: ./grub-parameters.csv:5
+msgid "Write debug output into /var/log/plymouth-debug.log"
+msgstr ""
+
+#: ./grub-parameters.csv:6
+msgid "Disable ACPI"
+msgstr ""
+
+#: ./grub-parameters.csv:7
+msgid "Disable APIC"
+msgstr ""
+
+#: ./grub-parameters.csv:8
+msgid "Disable local APIC"
+msgstr ""
+
+#: ./grub-parameters.csv:9
+msgid "Single User Mode"
+msgstr ""
+
+#: ./grub-parameters.csv:10
+msgid "Disable kernel selection and loading of video drivers"
+msgstr ""
+
+#: ./grub-parameters.csv:11
+msgid "Enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:12
+msgid "Disable kernel/abi16 acceleration (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:13
+msgid "Use kernel modesetting [KMS] (0=disable, 1=on, -1=force vga console preference [default]) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:14
+msgid "Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:15
+msgid "Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6; 3=up to DC5 with DC3CO; 4=up to DC6 with DC3CO) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:16
+msgid "Enable PSR (0=disabled, 1=enabled) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:17
+msgid "Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:18
+msgid "Enable IPS (default: true) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:19
+msgid "Try to skip unnecessary mode sets at boot time (0=disabled, 1=enabled) Default: -1 (use per-chip default) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:20
+msgid "Disable display (default: false) (bool)"
+msgstr ""
+
+#: ./grub-parameters.csv:21
+msgid "Enable GuC load for GuC submission and/or HuC load. Required functionality can be selected using bitmask values. (-1=auto [default], 0=disable, 1=GuC submission, 2=HuC load) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:22
+msgid "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true) (bool)"
+msgstr ""
+
+#: ./grub-parameters.csv:23
+msgid "Enable support for Intel GVT-g graphics virtualization host support (default:false) (bool)"
+msgstr ""
+
+#: ./grub-parameters.csv:24
+msgid "Marvell SATA via AHCI (1 = enabled) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:25
+msgid "Default LPM policy for mobile chipsets (default:-1) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:26
+msgid "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:27
+msgid "Do not use ACPI _CST for building the idle states list (default:N) (bool)"
+msgstr ""
+
+#: ./grub-parameters.csv:28
+msgid "Use ACPI _CST for building the idle states list (default:N) (bool)"
+msgstr ""
+
+#: ./grub-parameters.csv:29
+msgid "Prevents the processor from going into a deep sleep state (default:9) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:30
+#: ./grub-parameters.csv:31
+#: ./grub-parameters.csv:32
+msgid "Eliminates flickering laptop display on Ultra Voltage processors (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:33
+msgid "Mask of disabled idle states (0=disabled, 1=enabled) Default: 0 (uint)"
+msgstr ""
+
+#: ./grub-parameters.csv:34
+msgid "Default autosuspend delay (-1=disabled) (int)"
+msgstr ""
+
+#: ./grub-parameters.csv:35
+msgid "Force dont`t load nouveau driver video for Nvidia"
+msgstr ""
diff --git a/locale/grub-parameters_ru.po b/locale/grub-parameters_ru.po
new file mode 100644
index 0000000..eb6399e
--- /dev/null
+++ b/locale/grub-parameters_ru.po
@@ -0,0 +1,123 @@
+#: ./grub-parameters.csv:3
+#: ./grub-parameters.csv:4
+#: ./grub-parameters.csv:2
+msgid "Disable Plymouth"
+msgstr "Отключить Plymouth"
+
+#: ./grub-parameters.csv:5
+msgid "Write debug output into /var/log/plymouth-debug.log"
+msgstr "Записать отладочный вывод в /var/log/plywright-debug.log"
+
+#: ./grub-parameters.csv:6
+msgid "Disable ACPI"
+msgstr "Отключить ACPI"
+
+#: ./grub-parameters.csv:7
+msgid "Disable APIC"
+msgstr "Отключить APIC"
+
+#: ./grub-parameters.csv:8
+msgid "Disable local APIC"
+msgstr "Отключить локальный APIC"
+
+#: ./grub-parameters.csv:9
+msgid "Single User Mode"
+msgstr "Однопользовательский режим"
+
+#: ./grub-parameters.csv:10
+msgid "Disable kernel selection and loading of video drivers"
+msgstr "Отключить выбор ядра и загрузку видеодрайверов"
+
+#: ./grub-parameters.csv:11
+msgid "Enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)"
+msgstr "Включить драйвер (по умолчанию: auto, 0 = отключен, 1 = включен, 2 = headless) (int)"
+
+#: ./grub-parameters.csv:12
+msgid "Disable kernel/abi16 acceleration (int)"
+msgstr "Отключить ускорение ядра/abi16 (int)"
+
+#: ./grub-parameters.csv:13
+msgid "Use kernel modesetting [KMS] (0=disable, 1=on, -1=force vga console preference [default]) (int)"
+msgstr "Использовать режим настройки ядра [KMS] (0 = отключить, 1 = включить, -1 = принудительно использовать предпочтение консоли VGA [по умолчанию]) (int)"
+
+#: ./grub-parameters.csv:14
+msgid "Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)"
+msgstr "Включить сжатие буфера кадра для экономии энергии (по умолчанию: -1 (использовать настройки для каждого чипа)) (int)"
+
+#: ./grub-parameters.csv:15
+msgid "Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6; 3=up to DC5 with DC3CO; 4=up to DC6 with DC3CO) (int)"
+msgstr "Включить энергосберегающие режимы C-состояния дисплея. (-1 = auto [по умолчанию], 0 = отключить, 1 = до DC5, 2 = до DC6, 3 = до DC5 с DC3CO, 4 = до DC6 с DC3CO) (int)"
+
+#: ./grub-parameters.csv:16
+msgid "Enable PSR (0=disabled, 1=enabled) (int)"
+msgstr "Включить PSR (0 = отключен, 1 = включен) (int)"
+
+#: ./grub-parameters.csv:17
+msgid "Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)"
+msgstr "Отключить питание дисплея, когда возможно (-1 = auto [по умолчанию], 0 = питание всегда включено, 1 = питание отключено, когда возможно) (int)"
+
+#: ./grub-parameters.csv:18
+msgid "Enable IPS (default: true) (int)"
+msgstr "Включить IPS (по умолчанию: true) (int)"
+
+#: ./grub-parameters.csv:19
+msgid "Try to skip unnecessary mode sets at boot time (0=disabled, 1=enabled) Default: -1 (use per-chip default) (int)"
+msgstr "Попытаться пропустить ненужные настройки режима при загрузке (0 = отключено, 1 = включено) По умолчанию: -1 (использовать настройки для каждого чипа) (int)"
+
+#: ./grub-parameters.csv:20
+msgid "Disable display (default: false) (bool)"
+msgstr "Отключить дисплей (по умолчанию: false) (bool)"
+
+#: ./grub-parameters.csv:21
+msgid "Enable GuC load for GuC submission and/or HuC load. Required functionality can be selected using bitmask values. (-1=auto [default], 0=disable, 1=GuC submission, 2=HuC load) (int)"
+msgstr "Включить загрузку GuC для отправки GuC и/или загрузки HuC. Необходимую функциональность можно выбрать с помощью битовой маски. (-1 = auto [по умолчанию], 0 = отключить, 1 = отправка GuC, 2 = загрузка HuC) (int)"
+
+#: ./grub-parameters.csv:22
+msgid "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true) (bool)"
+msgstr "Включить мультипотоковую передачу (MST) для новых устройств DisplayPort (по умолчанию: true) (bool)"
+
+#: ./grub-parameters.csv:23
+msgid "Enable support for Intel GVT-g graphics virtualization host support (default:false) (bool)"
+msgstr "Включить поддержку виртуализации графики Intel GVT-g (по умолчанию: false) (bool)"
+
+#: ./grub-parameters.csv:24
+msgid "Marvell SATA via AHCI (1 = enabled) (int)"
+msgstr "Marvell SATA через AHCI (1 = включено) (int)"
+
+#: ./grub-parameters.csv:25
+msgid "Default LPM policy for mobile chipsets (default:-1) (int)"
+msgstr "Политика LPM по умолчанию для мобильных чипсетов (по умолчанию: -1) (int)"
+
+#: ./grub-parameters.csv:26
+msgid "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF) (int)"
+msgstr "Принудительно использовать драйвер DSP для Intel DSP (0 = auto, 1 = legacy, 2 = SST, 3 = SOF) (int)"
+
+#: ./grub-parameters.csv:27
+msgid "Do not use ACPI _CST for building the idle states list (default:N) (bool)"
+msgstr "Не использовать ACPI _CST для построения списка состояний бездействия (по умолчанию: N) (bool)"
+
+#: ./grub-parameters.csv:28
+msgid "Use ACPI _CST for building the idle states list (default:N) (bool)"
+msgstr "Использовать ACPI _CST для построения списка состояний бездействия (по умолчанию: N) (bool)"
+
+#: ./grub-parameters.csv:29
+msgid "Prevents the processor from going into a deep sleep state (default:9) (int)"
+msgstr "Предотвратить переход процессора в глубокий режим сна (по умолчанию: 9) (int)"
+
+#: ./grub-parameters.csv:30
+#: ./grub-parameters.csv:31
+#: ./grub-parameters.csv:32
+msgid "Eliminates flickering laptop display on Ultra Voltage processors (int)"
+msgstr "Устранить мерцание экрана ноутбука на процессорах Ultra Voltage (int)"
+
+#: ./grub-parameters.csv:33
+msgid "Mask of disabled idle states (0=disabled, 1=enabled) Default: 0 (uint)"
+msgstr "Маска отключенных состояний бездействия (0 = отключено, 1 = включено) По умолчанию: 0 (uint)"
+
+#: ./grub-parameters.csv:34
+msgid "Default autosuspend delay (-1=disabled) (int)"
+msgstr "Задержка автоотключения по умолчанию (-1 = отключено) (int)"
+
+#: ./grub-parameters.csv:35
+msgid "Force dont`t load nouveau driver video for Nvidia"
+msgstr "Принудительно не загружать драйвер nouveau для видео Nvidia"
diff --git a/locale/grub-terminal-input.pot b/locale/grub-terminal-input.pot
new file mode 100644
index 0000000..96ed0f3
--- /dev/null
+++ b/locale/grub-terminal-input.pot
@@ -0,0 +1,43 @@
+# Language translations for ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-input.csv package.
+# Copyright (C) 2022, UBTech LLC
+# This file is distributed under the same license as the ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-input.csv package.
+# UBLinux Team , 2022
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-input.csv 1.0\n"
+"Report-Msgid-Bugs-To: support@ublinux.com\n"
+"POT-Creation-Date: 2023-01-01 00:00+0600\n"
+"PO-Revision-Date: 2023-01-01 00:00+0600\n"
+"Last-Translator: UBLinux Team \n"
+"Language-Team: UBLinux Team \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+
+#: ./grub-terminal-input.csv:1
+msgid "Description"
+msgstr ""
+
+#: ./grub-terminal-input.csv:2
+msgid "PC BIOS & EFI console"
+msgstr ""
+
+#: ./grub-terminal-input.csv:3
+msgid "Serial terminal"
+msgstr ""
+
+#: ./grub-terminal-input.csv:4
+msgid "Open Firmware Console"
+msgstr ""
+
+#: ./grub-terminal-input.csv:5
+msgid "PC AT Keyboard (Coreboot)"
+msgstr ""
+
+#: ./grub-terminal-input.csv:6
+msgid "USB Keyboard (HID Boot protocol)"
+msgstr ""
diff --git a/locale/grub-terminal-input_ru.po b/locale/grub-terminal-input_ru.po
new file mode 100644
index 0000000..a411d2a
--- /dev/null
+++ b/locale/grub-terminal-input_ru.po
@@ -0,0 +1,8 @@
+
+#: ./grub-terminal-input.csv:5
+msgid "PC AT Keyboard (Coreboot)"
+msgstr "Клавиатура PC AT (Coreboot)"
+
+#: ./grub-terminal-input.csv:6
+msgid "USB Keyboard (HID Boot protocol)"
+msgstr "USB клавиатура (HID протокол загрузки)"
diff --git a/locale/grub-terminal-output.pot b/locale/grub-terminal-output.pot
new file mode 100644
index 0000000..1754557
--- /dev/null
+++ b/locale/grub-terminal-output.pot
@@ -0,0 +1,43 @@
+# Language translations for ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-output.csv package.
+# Copyright (C) 2022, UBTech LLC
+# This file is distributed under the same license as the ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-output.csv package.
+# UBLinux Team , 2022
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ubl-settings-bootloader-/home/superadmin/Документы/ubl-settings-bootloader/grub-terminal-output.csv 1.0\n"
+"Report-Msgid-Bugs-To: support@ublinux.com\n"
+"POT-Creation-Date: 2023-01-01 00:00+0600\n"
+"PO-Revision-Date: 2023-01-01 00:00+0600\n"
+"Last-Translator: UBLinux Team \n"
+"Language-Team: UBLinux Team \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+
+#: ./grub-terminal-output.csv:1
+msgid "Description"
+msgstr ""
+
+#: ./grub-terminal-output.csv:2
+msgid "PC BIOS & EFI console"
+msgstr ""
+
+#: ./grub-terminal-output.csv:3
+msgid "Serial terminal"
+msgstr ""
+
+#: ./grub-terminal-output.csv:4
+msgid "Open Firmware Console"
+msgstr ""
+
+#: ./grub-terminal-output.csv:5
+msgid "Output in graphical mode"
+msgstr ""
+
+#: ./grub-terminal-output.csv:6
+msgid "VGA text output (Coreboot)"
+msgstr ""
diff --git a/locale/grub-terminal-output_ru.po b/locale/grub-terminal-output_ru.po
new file mode 100644
index 0000000..d2fd204
--- /dev/null
+++ b/locale/grub-terminal-output_ru.po
@@ -0,0 +1,19 @@
+#: ./grub-terminal-output.csv:2
+msgid "PC BIOS & EFI console"
+msgstr "PC BIOS & EFI консоль"
+
+#: ./grub-terminal-output.csv:3
+msgid "Serial terminal"
+msgstr "Терминал Serial"
+
+#: ./grub-terminal-output.csv:4
+msgid "Open Firmware Console"
+msgstr "Консоль Open Firmware"
+
+#: ./grub-terminal-output.csv:5
+msgid "Output in graphical mode"
+msgstr "Вывод в графическом режиме"
+
+#: ./grub-terminal-output.csv:6
+msgid "VGA text output (Coreboot)"
+msgstr "Текстовый вывод VGA (Coreboot)"
diff --git a/ubl-settings-bootloader.pot b/locale/ubl-settings-bootloader.pot
similarity index 55%
rename from ubl-settings-bootloader.pot
rename to locale/ubl-settings-bootloader.pot
index 43c9045..d681e6d 100644
--- a/ubl-settings-bootloader.pot
+++ b/locale/ubl-settings-bootloader.pot
@@ -1,17 +1,17 @@
# Language translations for ubl-settings-bootloader package.
-# Copyright (C) 2022, UBTech LLC
+# Copyright (C) 2025, UBTech LLC
# This file is distributed under the same license as the ubl-settings-bootloader package.
-# UBLinux Team , 2022
+# UBLinux Team , 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: ubl-settings-bootloader 1.0\n"
-"Report-Msgid-Bugs-To: info@ublinux.com\n"
+"Report-Msgid-Bugs-To: support@ublinux.com\n"
"POT-Creation-Date: 2023-01-01 00:00+0600\n"
"PO-Revision-Date: 2023-01-01 00:00+0600\n"
-"Last-Translator: UBLinux Team \n"
-"Language-Team: UBLinux Team \n"
+"Last-Translator: UBLinux Team \n"
+"Language-Team: UBLinux Team \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -73,7 +73,7 @@ msgstr ""
msgid "Output terminal"
msgstr ""
-#: source/ubl-strings.h:18 source/ubl-strings.h:55
+#: source/ubl-strings.h:18 source/ubl-strings.h:56
msgid "Administrator"
msgstr ""
@@ -193,130 +193,58 @@ msgstr ""
msgid "Edit user"
msgstr ""
-#: source/ubl-strings.h:56
-msgid "User name:"
+#: source/ubl-strings.h:55
+msgid "Delete user"
msgstr ""
#: source/ubl-strings.h:57
-msgid "User password:"
+msgid "User name:"
msgstr ""
#: source/ubl-strings.h:58
+msgid "User password:"
+msgstr ""
+
+#: source/ubl-strings.h:59
msgid "Are you sure you want to remove user"
msgstr ""
-#: source/ubl-strings.h:58
+#: source/ubl-strings.h:59
msgid "from boot menu users"
msgstr ""
#: source/ubl-strings.h:60
-msgid "Add ringtone"
-msgstr ""
-
-#: source/ubl-strings.h:61
-msgid "Edit ringtone"
+msgid "is already exists. Do you really want to save user"
msgstr ""
#: source/ubl-strings.h:62
-msgid "Chosen"
+msgid "Add ringtone"
msgstr ""
#: source/ubl-strings.h:63
-msgid "Name:"
+msgid "Edit ringtone"
msgstr ""
#: source/ubl-strings.h:64
-msgid "Melody code:"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Are you sure you want to remove ringtone"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Disable kernel/abi16 acceleration (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Use kernel modesetting [KMS] (0=disable, 1=on, -1=force vga console preference [default]) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6; 3=up to DC5 with DC3CO; 4=up to DC6 with DC3CO) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable PSR (0=disabled, 1=enabled) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable IPS (default: true) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Try to skip unnecessary mode sets at boot time (0=disabled, 1=enabled) Default: -1 (use per-chip default) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Disable display (default: false) (bool)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable GuC load for GuC submission and/or HuC load. Required functionality can be selected using bitmask values. (-1=auto [default], 0=disable, 1=GuC submission, 2=HuC load) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true) (bool)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Enable support for Intel GVT-g graphics virtualization host support (default:false) (bool)"
+msgid "Delete ringtone"
msgstr ""
#: source/ubl-strings.h:65
-msgid "Marvell SATA via AHCI (1 = enabled) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Default LPM policy for mobile chipsets (default:-1) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF) (int)"
-msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Do not use ACPI _CST for building the idle states list (default:N) (bool)"
+msgid "Chosen"
msgstr ""
-#: source/ubl-strings.h:65
-msgid "Use ACPI _CST for building the idle states list (default:N) (bool)"
+#: source/ubl-strings.h:66
+msgid "Name:"
msgstr ""
-#: source/ubl-strings.h:65
-msgid "Prevents the processor from going into a deep sleep state (default:9) (int)"
+#: source/ubl-strings.h:67
+msgid "Melody code:"
msgstr ""
-#: source/ubl-strings.h:65
-msgid "Eliminates flickering laptop display on Ultra Voltage processors (int)"
+#: source/ubl-strings.h:68
+msgid "Are you sure you want to remove ringtone"
msgstr ""
-#: source/ubl-strings.h:65
-msgid "Mask of disabled idle states (0=disabled, 1=enabled) Default: 0 (uint)"
+#: source/ubl-strings.h:69
+msgid "This ringtone name is already used by standard ringtone"
msgstr ""
-
-#: source/ubl-strings.h:65
-msgid "Default autosuspend delay (-1=disabled) (int)"
-msgstr ""
\ No newline at end of file
diff --git a/locale/ubl-settings-bootloader_ru.po b/locale/ubl-settings-bootloader_ru.po
new file mode 100644
index 0000000..f6f31d7
--- /dev/null
+++ b/locale/ubl-settings-bootloader_ru.po
@@ -0,0 +1,250 @@
+# Russian translations for ubl-settings-bootloader package.
+# Copyright (C) 2022, UBTech LLC
+# This file is distributed under the same license as the ubl-settings-bootloader package.
+# UBLinux Team , 2022
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ubl-settings-bootloader 1.0\n"
+"Report-Msgid-Bugs-To: info@ublinux.com\n"
+"POT-Creation-Date: 2023-01-01 00:00+0600\n"
+"PO-Revision-Date: 2025-04-17 23:28+0600\n"
+"Last-Translator: ublinux \n"
+"Language-Team: Russian - UBLinux Team \n"
+"Language: Russian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: source/ubl-strings.h:2
+msgid "System boot"
+msgstr "Загрузка системы"
+
+#: source/ubl-strings.h:3
+msgid "Configuring system boot parameters"
+msgstr "Настройка параметров загрузки системы"
+
+#: source/ubl-strings.h:5
+msgid "Boot menu"
+msgstr "Меню загрузки"
+
+#: source/ubl-strings.h:6
+msgid "Boot selection menu timer:"
+msgstr "Таймер меню выбора варианта загрузки:"
+
+#: source/ubl-strings.h:7
+msgid "seconds"
+msgstr "секунд"
+
+#: source/ubl-strings.h:8
+msgid "Default"
+msgstr "По умолчанию"
+
+#: source/ubl-strings.h:9
+msgid "Default OS:"
+msgstr "Загрузка по умолчанию:"
+
+#: source/ubl-strings.h:10
+msgid "Load screen display mode:"
+msgstr "Режим отображения экрана загрузки:"
+
+#: source/ubl-strings.h:11
+msgid "Boot Menu Users"
+msgstr "Пользователи меню загрузчика"
+
+#: source/ubl-strings.h:12
+msgid "Startup ringtone"
+msgstr "Мелодия при запуске"
+
+#: source/ubl-strings.h:13
+msgid "Parameters passed to the kernel"
+msgstr "Параметры, передаваемые ядру"
+
+#: source/ubl-strings.h:14
+msgid "Command line parameters:"
+msgstr "Параметры командной строки:"
+
+#: source/ubl-strings.h:15
+msgid "Input terminal"
+msgstr "Терминал для ввода"
+
+#: source/ubl-strings.h:16
+msgid "Output terminal"
+msgstr "Терминал для вывода"
+
+#: source/ubl-strings.h:18 source/ubl-strings.h:56
+msgid "Administrator"
+msgstr "Администратор"
+
+#: source/ubl-strings.h:19
+msgid "Name"
+msgstr "Название"
+
+#: source/ubl-strings.h:20
+msgid "User"
+msgstr "Пользователь"
+
+#: source/ubl-strings.h:21
+msgid "Password"
+msgstr "Пароль"
+
+#: source/ubl-strings.h:22
+msgid "Melody code"
+msgstr "Код мелодии"
+
+#: source/ubl-strings.h:23
+msgid "Option"
+msgstr "Опция"
+
+#: source/ubl-strings.h:24
+msgid "Description"
+msgstr "Описание"
+
+#: source/ubl-strings.h:26
+msgid "Add"
+msgstr "Добавить"
+
+#: source/ubl-strings.h:27
+msgid "Edit"
+msgstr "Редактировать"
+
+#: source/ubl-strings.h:28
+msgid "Remove"
+msgstr "Удалить"
+
+#: source/ubl-strings.h:30
+msgid "Accept"
+msgstr "Принять"
+
+#: source/ubl-strings.h:31
+msgid "Cancel"
+msgstr "Отменить"
+
+#: source/ubl-strings.h:33
+msgid "Boot animation with log"
+msgstr "Анимация загрузки с журналом"
+
+#: source/ubl-strings.h:34
+msgid "Boot animation without log"
+msgstr "Анимация загрузки без журнала"
+
+#: source/ubl-strings.h:35
+msgid "No boot animation with log"
+msgstr "Отсутствие анимации загрузки с выводом журнала"
+
+#: source/ubl-strings.h:36
+msgid "No boot animation with shortened log"
+msgstr "Отсутствие анимации загрузки с выводом сокращённого журнала"
+
+#: source/ubl-strings.h:37
+msgid "Back"
+msgstr "Назад"
+
+#: source/ubl-strings.h:38
+msgid "Default (Use last succeeded)"
+msgstr "По умолчанию (Последняя удачная загрузка)"
+
+#: source/ubl-strings.h:40
+msgid "Password input"
+msgstr "Ввод пароля"
+
+#: source/ubl-strings.h:41 source/ubl-strings.h:48
+msgid "Repeat password:"
+msgstr "Подтвердите ввод пароля:"
+
+#: source/ubl-strings.h:42 source/ubl-strings.h:50
+msgid "Password hash:"
+msgstr "Хэш пароля"
+
+#: source/ubl-strings.h:43 source/ubl-strings.h:49
+msgid "Do not encrypt password"
+msgstr "Не шифровать пароль"
+
+#: source/ubl-strings.h:44
+msgid "Password contain special symbols"
+msgstr "Пароль содержит специальные символы"
+
+#: source/ubl-strings.h:45
+msgid "Empty important field"
+msgstr "Пустое важное поле"
+
+#: source/ubl-strings.h:46
+msgid "Password mismatch"
+msgstr "Пароли не совпадают"
+
+#: source/ubl-strings.h:47
+msgid "Password:"
+msgstr "Пароль:"
+
+#: source/ubl-strings.h:51
+msgid "Password must be at least"
+msgstr "Пароль состоять из по крайней мере"
+
+#: source/ubl-strings.h:51
+msgid "characters"
+msgstr "символов"
+
+#: source/ubl-strings.h:53
+msgid "Add user"
+msgstr "Добавить пользователя"
+
+#: source/ubl-strings.h:54
+msgid "Edit user"
+msgstr "Редактировать пользователя"
+
+#: source/ubl-strings.h:55
+msgid "Delete user"
+msgstr "Удалить пользователя"
+
+#: source/ubl-strings.h:57
+msgid "User name:"
+msgstr "Имя пользователя:"
+
+#: source/ubl-strings.h:58
+msgid "User password:"
+msgstr "Пароль пользователя:"
+
+#: source/ubl-strings.h:59
+msgid "Are you sure you want to remove user"
+msgstr "Вы уверены, что хотите удалить пользователя"
+
+#: source/ubl-strings.h:59
+msgid "from boot menu users"
+msgstr "из пользователей меню загрузчика"
+
+#: source/ubl-strings.h:60
+msgid "is already exists. Do you really want to save user"
+msgstr "уже существует. Вы действительно хотите сохранить пользователя"
+
+#: source/ubl-strings.h:62
+msgid "Add ringtone"
+msgstr "Добавить мелодию"
+
+#: source/ubl-strings.h:63
+msgid "Edit ringtone"
+msgstr "Изменение мелодии"
+
+#: source/ubl-strings.h:64
+msgid "Delete ringtone"
+msgstr "Удалить мелодию"
+
+#: source/ubl-strings.h:65
+msgid "Chosen"
+msgstr "Выбран"
+
+#: source/ubl-strings.h:66
+msgid "Name:"
+msgstr "Название:"
+
+#: source/ubl-strings.h:67
+msgid "Melody code:"
+msgstr "Код мелодии:"
+
+#: source/ubl-strings.h:68
+msgid "Are you sure you want to remove ringtone"
+msgstr "Вы уверены, что хотите удалить мелодию"
+
+#: source/ubl-strings.h:69
+msgid "This ringtone name is already used by standard ringtone"
+msgstr "Название этой мелодии уже используется для одной из стандартных"
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 594b711..37dad89 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -40,6 +40,7 @@ set(DEPENDFILES
../grub-parameters.csv
../grub-terminal-input.csv
../grub-terminal-output.csv
+ ../grub-melody.csv
../gresource.xml
../ubl-settings-bootloader-banner.png
../ubl-settings-bootloader.css
diff --git a/source/ubl-settings-bootloader-melody.c b/source/ubl-settings-bootloader-melody.c
index 04ce4ce..2b9f8e4 100644
--- a/source/ubl-settings-bootloader-melody.c
+++ b/source/ubl-settings-bootloader-melody.c
@@ -5,6 +5,34 @@ void on_ringtone_accept(GtkWidget *,dictionary *dict){
yon_ringtone_window *window = yon_dictionary_get_data(dict->first->next,yon_ringtone_window*);
const char *username = gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
const char *password = gtk_entry_get_text(GTK_ENTRY(window->CodeEntry));
+ if (yon_char_is_empty(username)){
+ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
+ yon_ubl_status_highlight_incorrect(window->NameEntry);
+ return;
+ }
+ if (yon_char_is_empty(window->prev_name)){
+ GtkTreeIter iter;
+ GtkTreeModel *model = GTK_TREE_MODEL(widgets->BootUsersList);
+ for_iter(model,&iter){
+ char *name;
+ int user_created;
+ gtk_tree_model_get(model,&iter,1,&name,3,&user_created,-1);
+ if (user_created){
+ if (!strcmp(name,username)){
+ dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
+ data->action_text = USER_EXIST_LABEL(username);
+ if (yon_confirmation_dialog_call(window->Window,data)!=GTK_RESPONSE_ACCEPT){
+ return;
+ }
+ break;
+ }
+ } else {
+ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NAME_OCCUPIED_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
+ yon_ubl_status_highlight_incorrect(window->NameEntry);
+ return;
+ }
+ }
+ }
// if (yon_char_is_empty(username)){
// yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
// yon_ubl_status_highlight_incorrect(window->NameEntry);
@@ -23,20 +51,15 @@ void on_ringtone_accept(GtkWidget *,dictionary *dict){
}
}
yon_window_config_add_instant_parameter((char*)username,"melodies",(char*)password,YON_TYPE_STRING);
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ChooseCheck))){
- yon_config_register(GRUB_PLAY_parameter,GRUB_PLAY_command,(char*)password);
- } else {
- char *config_melody = config(GRUB_PLAY_parameter);
- if (!yon_char_is_empty(config_melody)&&!strcmp(config_melody,password)){
- yon_config_remove_by_key(GRUB_PLAY_parameter);
- }
- }
gtk_widget_destroy(window->Window);
yon_interface_update(widgets);
}
void on_ringtone_add_clicked(GtkWidget *,main_window *widgets){
yon_ringtone_window *window = yon_ringtone_window_new();
+ char *title = RINGTONE_ADD_TITLE_LABEL;
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),title,icon_path,"ringtone_add_window");
+ gtk_label_set_text(GTK_LABEL(window->TitleLabel),title);
dictionary *dict = NULL;
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
@@ -48,28 +71,31 @@ void on_ringtone_add_clicked(GtkWidget *,main_window *widgets){
}
void on_ringtone_edit_clicked(GtkWidget *,main_window *widgets){
- yon_ringtone_window *window = yon_ringtone_window_new();
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(widgets->BootRingtoneList);
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->BootRingtoneTree)),&model,&iter)){
+ yon_ringtone_window *window = yon_ringtone_window_new();
int is_chosen;
char *name, *code;
gtk_tree_model_get(model,&iter,0,&is_chosen,1,&name,2,&code,-1);
+ char *title = RINGTONE_EDIT_TITLE_LABEL(name);
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),title,icon_path,"ringtone_add_window");
+ gtk_label_set_text(GTK_LABEL(window->TitleLabel),title);
+ free(title);
window->prev_name = yon_char_new(name);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->ChooseCheck),is_chosen);
gtk_entry_set_text(GTK_ENTRY(window->NameEntry),name);
gtk_entry_set_text(GTK_ENTRY(window->CodeEntry),code);
- }
+ dictionary *dict = NULL;
+ yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
+ yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
- dictionary *dict = NULL;
- yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
- yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
+ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_ringtone_accept),dict);
+ gtk_widget_show(window->Window);
+ }
- g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_ringtone_accept),dict);
- gtk_widget_show(window->Window);
}
@@ -83,6 +109,7 @@ void on_ringtone_remove_clicked(GtkWidget *,main_window *widgets){
data->data=NULL;
data->function=NULL;
data->action_text = RINGTONE_REMOVE_CONFIRM_LABEL(name);
+ data->title = RINGTONE_DELETE_TITLE_LABEL(name);
if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
char *config_code = config(GRUB_PLAY_parameter);
yon_window_config_erase_instant_parameter(name,"melodies");
@@ -101,7 +128,6 @@ yon_ringtone_window *yon_ringtone_window_new(){
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel");
- window->ChooseCheck = yon_gtk_builder_get_widget(builder,"ChooseCheck");
window->NameEntry = yon_gtk_builder_get_widget(builder,"NameEntry");
window->CodeEntry = yon_gtk_builder_get_widget(builder,"CodeEntry");
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
diff --git a/source/ubl-settings-bootloader-menu.c b/source/ubl-settings-bootloader-menu.c
index c928c6c..9f1a621 100644
--- a/source/ubl-settings-bootloader-menu.c
+++ b/source/ubl-settings-bootloader-menu.c
@@ -66,7 +66,7 @@ yon_menu_window *yon_menu_window_open(GtkWidget *, main_window *widgets){
yon_menu_item *item_child = yon_menu_item_new();
gtk_widget_hide(item_child->NextIconButton);
gtk_label_set_text(GTK_LABEL(item_child->MenuTextLabel),parameter[1]);
- item_child->target=yon_char_new(parameter[1]);
+ item_child->target=yon_char_new(parsed[i]);
gtk_widget_show(item_child->MenuItemBox);
yon_dictionary_add_or_create_if_exists_with_data(item->children,parameter[1],item_child);
item_child->widgets=widgets;
@@ -77,7 +77,7 @@ yon_menu_window *yon_menu_window_open(GtkWidget *, main_window *widgets){
item->widgets=widgets;
item->window=window;
gtk_label_set_text(GTK_LABEL(item->MenuTextLabel),parameter[0]);
- item->target=yon_char_new(parameter[0]);
+ item->target=yon_char_new(parsed[i]);
gtk_list_box_insert(GTK_LIST_BOX(window->ItemsListBox),item->MenuItemBox,-1);
yon_dictionary_add_or_create_if_exists_with_data(window->menu_items,parameter[0],item);
gtk_widget_show(item->MenuItemBox);
@@ -86,7 +86,7 @@ yon_menu_window *yon_menu_window_open(GtkWidget *, main_window *widgets){
gtk_widget_show(item->NextIconButton);
gtk_widget_hide(item_child->NextIconButton);
gtk_label_set_text(GTK_LABEL(item_child->MenuTextLabel),parameter[1]);
- item_child->target=yon_char_new(parameter[1]);
+ item_child->target=yon_char_new(parsed[i]);
gtk_widget_show(item_child->MenuItemBox);
item_child->widgets=widgets;
item_child->window=window;
diff --git a/source/ubl-settings-bootloader-password.c b/source/ubl-settings-bootloader-password.c
index 46fe71c..8468721 100644
--- a/source/ubl-settings-bootloader-password.c
+++ b/source/ubl-settings-bootloader-password.c
@@ -6,7 +6,7 @@ void yon_password_change(GtkWidget *, GtkEntry *entry){
dictionary *dict = NULL;
char *password = (char*)gtk_entry_get_text(output_target);
if (!yon_char_is_empty(password)){
- if (main_config.load_mode==0){
+ if (main_config.load_mode==YON_CONFIG_LOCAL){
password = yon_char_new(password);
if (!check_is_password_hash(password)){
gtk_entry_set_text(GTK_ENTRY(window->PasswordHashEntry),password);
diff --git a/source/ubl-settings-bootloader-user.c b/source/ubl-settings-bootloader-user.c
index 554ac40..c60d1c7 100644
--- a/source/ubl-settings-bootloader-user.c
+++ b/source/ubl-settings-bootloader-user.c
@@ -4,6 +4,22 @@ void on_user_accept(GtkWidget *,dictionary *dict){
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
yon_user_window *window = yon_dictionary_get_data(dict->first->next,yon_user_window*);
const char *username = gtk_entry_get_text(GTK_ENTRY(window->UsernameEntry));
+
+ if (yon_char_is_empty(window->prev_name)){
+ GtkTreeIter iter;
+ GtkTreeModel *model = GTK_TREE_MODEL(widgets->BootUsersList);
+ for_iter(model,&iter){
+ char *name;
+ gtk_tree_model_get(model,&iter,1,&name,-1);
+ if (!strcmp(name,username)){
+ dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
+ data->action_text = USER_EXIST_LABEL(username);
+ if (yon_confirmation_dialog_call(window->Window,data)!=GTK_RESPONSE_ACCEPT){
+ return;
+ }
+ }
+ }
+ }
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
if (yon_char_is_empty(username)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
@@ -42,6 +58,18 @@ void on_user_accept(GtkWidget *,dictionary *dict){
char *superusers = yon_char_parsed_to_string(parsed,size,",");
yon_config_register(GRUB_SUPERUSERS_parameter,GRUB_SUPERUSERS_command,superusers);
}
+ } else {
+ int size;
+ char *superusers = config(GRUB_SUPERUSERS_parameter);
+ config_str parsed = yon_char_parse(superusers,&size,",");
+ int pos = yon_char_parsed_check_exist(parsed,size,(char*)username);
+ if (pos!=-1){
+ parsed = yon_char_parsed_rip(parsed,&size,pos);
+
+ char *superusers = yon_char_parsed_to_string(parsed,size,",");
+ yon_config_register(GRUB_SUPERUSERS_parameter,GRUB_SUPERUSERS_command,superusers);
+ }
+
}
gtk_widget_destroy(window->Window);
yon_interface_update(widgets);
@@ -49,7 +77,9 @@ void on_user_accept(GtkWidget *,dictionary *dict){
void on_user_add_clicked(GtkWidget *,main_window *widgets){
yon_user_window *window = yon_user_window_new();
-
+ char *title = USER_ADD_TITLE_LABEL;
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),title,icon_path,"ringtone_add_window");
+ gtk_label_set_text(GTK_LABEL(window->TitleLabel),title);
dictionary *dict = NULL;
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
@@ -60,15 +90,18 @@ void on_user_add_clicked(GtkWidget *,main_window *widgets){
}
void on_user_edit_clicked(GtkWidget *,main_window *widgets){
- yon_user_window *window = yon_user_window_new();
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(widgets->BootUsersList);
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->BootUsersTree)),&model,&iter)){
+ yon_user_window *window = yon_user_window_new();
int is_admin;
char *name;
gtk_tree_model_get(model,&iter,0,&is_admin,1,&name,-1);
+ char *title = USER_EDIT_TITLE_LABEL(name);
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),title,icon_path,"ringtone_add_window");
+ gtk_label_set_text(GTK_LABEL(window->TitleLabel),title);
window->prev_name = yon_char_new(name);
char *password = config(GRUB_PASSWORD(name));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->AdminCheck),is_admin);
@@ -76,14 +109,14 @@ void on_user_edit_clicked(GtkWidget *,main_window *widgets){
if (password){
gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),password);
}
- }
+ dictionary *dict = NULL;
+ yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
+ yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
- dictionary *dict = NULL;
- yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
- yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
+ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_user_accept),dict);
+ gtk_widget_show(window->Window);
+ }
- g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_user_accept),dict);
- gtk_widget_show(window->Window);
}
@@ -95,6 +128,7 @@ void on_user_remove_clicked(GtkWidget *,main_window *widgets){
gtk_tree_model_get(model,&iter,1,&name,-1);
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text = USER_REMOVE_CONFIRM_LABEL(name);
+ data->title = USER_DELETE_TITLE_LABEL(name);
if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
yon_config_remove_by_key(GRUB_PASSWORD(name));
yon_interface_update(widgets);
diff --git a/source/ubl-settings-bootloader.c b/source/ubl-settings-bootloader.c
index cbc4d36..d4d7786 100644
--- a/source/ubl-settings-bootloader.c
+++ b/source/ubl-settings-bootloader.c
@@ -80,13 +80,13 @@ void on_config_custom_save(GtkWidget *, main_window *){
void on_config_local_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_LOCAL);
yon_interface_update(widgets);
- main_config.load_mode=1;
+ main_config.load_mode=YON_CONFIG_LOCAL;
}
void on_config_global_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_GLOBAL);
yon_interface_update(widgets);
- main_config.load_mode=0;
+ main_config.load_mode=YON_CONFIG_GLOBAL;
}
@@ -94,7 +94,7 @@ void on_config_custom_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_CUSTOM);
textdomain(template_ui_LocaleName);
textdomain(LocaleName);
- main_config.load_mode=3;
+ main_config.load_mode=YON_CONFIG_CUSTOM;
yon_interface_update(widgets);
}
@@ -184,22 +184,42 @@ void yon_interface_update(main_window *widgets){
free(yon_char_divide_search(username,"[",-1));
yon_char_remove_last_symbol(username,']');
gtk_list_store_append(widgets->BootUsersList,&iter);
- gtk_list_store_set(widgets->BootUsersList,&iter,0,yon_char_parsed_check_exist(admins_parsed,admins_size,username),1,username,2,"******",-1);
+ gtk_list_store_set(widgets->BootUsersList,&iter,0,yon_char_parsed_check_exist(admins_parsed,admins_size,username)>-1,1,username,2,"******",-1);
}
}
{
+ GtkTreeIter iter;
+ int ringtones_size;
+ config_str standard_ringtones = yon_resource_open_file(melody_path,&ringtones_size);
+ for (int i=1;iBootRingtoneList,&iter);
+ gtk_list_store_set(widgets->BootRingtoneList,&iter,0,0,1,key,2,code,-1);
+ }
char *ringtone = config(GRUB_PLAY_parameter);
gsize size=0;
config_str codes = yon_window_config_get_section("melodies",&size);
- GtkTreeIter iter;
for (gsize i=0;iBootRingtoneList,&iter);
- gtk_list_store_set(widgets->BootRingtoneList,&iter,0,!yon_char_is_empty(ringtone)&&!strcmp(ringtone,cur_code),1,name,2,cur_code,-1);
+ int found = 0;
+ for_iter(GTK_TREE_MODEL(widgets->BootRingtoneList),&iter){
+ char *key;
+ gtk_tree_model_get(GTK_TREE_MODEL(widgets->BootRingtoneList),&iter,1,&key,-1);
+ if (!strcmp(key,name)){
+ found = 1;
+ break;
+ }
+ }
+ if (!found){
+ gtk_list_store_append(widgets->BootRingtoneList,&iter);
+ }
+ gtk_list_store_set(widgets->BootRingtoneList,&iter,0,!yon_char_is_empty(ringtone)&&!strcmp(ringtone,cur_code),1,name,2,cur_code,3,1,-1);
free(cur_code);
free(name);
}
@@ -293,6 +313,9 @@ void on_kernel_parameter_switch(GtkCellRenderer *, char *path, main_window *widg
gtk_entry_set_text(GTK_ENTRY(widgets->CommandLineParametersEntry),final);
free(final);
} else {
+ yon_char_parsed_free(parsed,size);
+ size=0;
+ parsed=NULL;
gtk_entry_set_text(GTK_ENTRY(widgets->CommandLineParametersEntry),"");
yon_config_remove_by_key(GRUB_CMDLINE_LINUX_parameter);
}
@@ -439,6 +462,56 @@ void on_output_option_switch(GtkCellRenderer *,char *path, main_window *widgets)
}
}
+
+void on_tree_view_selection_changed(GtkWidget *self, main_window *widgets){
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ if (self == widgets->BootUsersTree){
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->BootUsersTree)),&model,&iter)) {
+ gtk_widget_set_sensitive(widgets->BootUsersEditButton,1);
+ gtk_widget_set_sensitive(widgets->BootUsersRemoveButton,1);
+ } else {
+ gtk_widget_set_sensitive(widgets->BootUsersEditButton,0);
+ gtk_widget_set_sensitive(widgets->BootUsersRemoveButton,0);
+ }
+ } else if (self == widgets->BootRingtoneTree){
+
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->BootRingtoneTree)),&model,&iter)) {
+ int user_created;
+ gtk_tree_model_get(model,&iter,3,&user_created,-1);
+ if (user_created){
+ gtk_widget_set_sensitive(widgets->BootRingtoneEditButton,1);
+ gtk_widget_set_sensitive(widgets->BootRingtoneRemoveButton,1);
+ } else {
+ gtk_widget_set_sensitive(widgets->BootRingtoneEditButton,0);
+ gtk_widget_set_sensitive(widgets->BootRingtoneRemoveButton,0);
+ }
+ } else {
+ gtk_widget_set_sensitive(widgets->BootRingtoneEditButton,0);
+ gtk_widget_set_sensitive(widgets->BootRingtoneRemoveButton,0);
+ }
+ }
+}
+
+void on_melody_toggled(GtkCellRenderer *, char *path, main_window *widgets){
+ GtkTreeIter iter;
+ GtkTreeModel *model = GTK_TREE_MODEL(widgets->BootRingtoneList);
+ GtkTreePath *cur_path = gtk_tree_path_new_from_string(path);
+
+ for_iter(model,&iter){
+ GtkTreePath *compare_path = gtk_tree_model_get_path(model,&iter);
+ if (gtk_tree_path_compare(cur_path,compare_path)){
+ gtk_list_store_set(widgets->BootRingtoneList,&iter,0,0,-1);
+ } else {
+ gtk_list_store_set(widgets->BootRingtoneList,&iter,0,1,-1);
+ char *code;
+ gtk_tree_model_get(model,&iter,2,&code,-1);
+ yon_config_register(GRUB_PLAY_parameter,GRUB_PLAY_command,(char*)code);
+ }
+ gtk_tree_path_free(compare_path);
+ }
+ gtk_tree_path_free(cur_path);
+}
// standard functions
/**config_init()
@@ -457,7 +530,7 @@ void config_init(){
main_config.lock_load_global=0;
main_config.lock_save_global=0;
main_config.lock_save_local=0;
- main_config.load_mode=1;
+ main_config.load_mode=YON_CONFIG_LOCAL;
main_config.password_min_length = yon_password_get_min_len();
main_config.kernel_parameters = yon_resource_open_file(kernel_options_path,&main_config.kernel_size);
main_config.input_parameters = yon_resource_open_file(terminal_input_path,&main_config.input_size);
@@ -531,6 +604,7 @@ void yon_main_window_complete(main_window *widgets){
widgets->KernelParametersList = GTK_LIST_STORE(gtk_builder_get_object(builder,"KernelParametersList"));
widgets->InputTerminalList = GTK_LIST_STORE(gtk_builder_get_object(builder,"InputTerminalList"));
widgets->OutputTerminalList = GTK_LIST_STORE(gtk_builder_get_object(builder,"OutputTerminalList"));
+ widgets->MelodyChosenCellRenderer = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"MelodyChosenCellRenderer"));
}
@@ -542,6 +616,7 @@ void yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->BootRingtoneEditButton),"clicked",G_CALLBACK(on_ringtone_edit_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->BootRingtoneRemoveButton),"clicked",G_CALLBACK(on_ringtone_remove_clicked),widgets);
+ g_signal_connect(G_OBJECT(widgets->MelodyChosenCellRenderer),"toggled",G_CALLBACK(on_melody_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->KernelChooseCell),"toggled",G_CALLBACK(on_kernel_parameter_switch),widgets);
g_signal_connect(G_OBJECT(widgets->InputChosenCell),"toggled",G_CALLBACK(on_input_option_switch),widgets);
g_signal_connect(G_OBJECT(widgets->OutputChosenCell),"toggled",G_CALLBACK(on_output_option_switch),widgets);
@@ -564,6 +639,9 @@ void yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_local_save),NULL);
g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_global_save),NULL);
g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(on_config_custom_save),NULL);
+
+ g_signal_connect(G_OBJECT(widgets->BootUsersTree),"cursor-changed",G_CALLBACK(on_tree_view_selection_changed),widgets);
+ g_signal_connect(G_OBJECT(widgets->BootRingtoneTree),"cursor-changed",G_CALLBACK(on_tree_view_selection_changed),widgets);
yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size);
yon_save_window_set_postsave_function(on_save_done,widgets);
@@ -583,9 +661,9 @@ int main(int argc, char *argv[]){
yon_ubl_setup_arguments(argc,argv,&unfound,&size,NULL);
gtk_init(&argc,&argv);
template_main_window *widgets = yon_ubl_window_setup();
- yon_main_window_complete((main_window*)widgets);
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
yon_window_config_load(path);
+ yon_main_window_complete((main_window*)widgets);
main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
main_config.launch_size=argc;
if (getuid()!=0){
diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h
index 2ff40b0..b435921 100644
--- a/source/ubl-settings-bootloader.h
+++ b/source/ubl-settings-bootloader.h
@@ -32,6 +32,7 @@
#define kernel_options_path "resource:///com/ublinux/csv/grub-parameters.csv"
#define terminal_input_path "resource:///com/ublinux/csv/grub-terminal-input.csv"
#define terminal_output_path "resource:///com/ublinux/csv/grub-terminal-output.csv"
+#define melody_path "resource:///com/ublinux/csv/grub-melody.csv"
#define LocaleName "ubl-settings-bootloader"
@@ -126,6 +127,7 @@ typedef struct {
GtkWidget *OutputTerminalEntry;
GtkWidget *OutputTerminalTree;
+ GtkCellRenderer *MelodyChosenCellRenderer;
GtkCellRenderer *KernelChooseCell;
GtkCellRenderer *OutputChosenCell;
GtkCellRenderer *InputChosenCell;
@@ -174,7 +176,6 @@ typedef struct {
GtkWidget *StatusBox;
GtkWidget *TitleLabel;
- GtkWidget *ChooseCheck;
GtkWidget *NameEntry;
GtkWidget *CodeEntry;
@@ -272,4 +273,6 @@ void on_menu_chosen(GtkWidget *, yon_menu_item *item);
void on_submenu_open(GtkWidget *,yon_menu_item *item);
void on_children_clean(GtkWidget*, yon_menu_window *window);
gboolean yon_on_revealer_switched (yon_menu_window *window);
-void yon_save_window_hide_passwords(template_saving_window *window);
\ No newline at end of file
+void yon_save_window_hide_passwords(template_saving_window *window);
+void on_tree_view_selection_changed(GtkWidget *self, main_window *widgets);
+void on_melody_toggled(GtkCellRenderer *self, char *path, main_window *widgets);
\ No newline at end of file
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index 2909e66..930f63a 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -52,14 +52,18 @@
#define USER_ADD_TITLE_LABEL _("Add user")
#define USER_EDIT_TITLE_LABEL(target) yon_char_unite(_("Edit user")," - ", target,NULL)
+#define USER_DELETE_TITLE_LABEL(target) yon_char_unite(_("Delete user")," - ",target,NULL)
#define ADMINISTRATOR_LABEL _("Administrator")
#define USER_NAME_LABEL _("User name:")
#define USER_PASSWORD_LABEL _("User password:")
- #define USER_REMOVE_CONFIRM_LABEL(target) yon_char_unite(_("Are you sure you want to remove user")," ",target," ",_("from boot menu users"),"?",NULL)
+ #define USER_REMOVE_CONFIRM_LABEL(target) yon_char_unite(_("Are you sure you want to remove user")," ",target," ",_("from boot menu users"),"?",NULL)
+ #define USER_EXIST_LABEL(target) yon_char_unite(_("User")," ", target," ", _("is already exists. Do you really want to save user")," ",target,"?",NULL)
#define RINGTONE_ADD_TITLE_LABEL _("Add ringtone")
#define RINGTONE_EDIT_TITLE_LABEL(target) yon_char_unite(_("Edit ringtone")," - ", target,NULL)
+#define RINGTONE_DELETE_TITLE_LABEL(target) yon_char_unite(_("Delete ringtone")," - ",target,NULL)
#define CHOSEN_LABEL _("Chosen")
#define NAME_TEXT_LABEL _("Name:")
#define MELODY_CODE_TEXT_LABEL _("Melody code:")
- #define RINGTONE_REMOVE_CONFIRM_LABEL(target) yon_char_unite(_("Are you sure you want to remove ringtone")," ",target,"?",NULL)
\ No newline at end of file
+ #define RINGTONE_REMOVE_CONFIRM_LABEL(target) yon_char_unite(_("Are you sure you want to remove ringtone")," ",target,"?",NULL)
+ #define NAME_OCCUPIED_LABEL _("This ringtone name is already used by standard ringtone")
\ No newline at end of file
diff --git a/ubl-settings-bootloader-ringtone.glade b/ubl-settings-bootloader-ringtone.glade
index 49d1026..98da950 100644
--- a/ubl-settings-bootloader-ringtone.glade
+++ b/ubl-settings-bootloader-ringtone.glade
@@ -3,6 +3,16 @@
+
+
-
- True
- False
- com.ublinux.ubl-settings-usergroups.cancel-symbolic
-
-
- True
- False
- com.ublinux.ubl-settings-usergroups.accept-symbolic
-
diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade
index 67b2691..79ecf1d 100644
--- a/ubl-settings-bootloader.glade
+++ b/ubl-settings-bootloader.glade
@@ -11,6 +11,8 @@
+
+
@@ -396,6 +398,7 @@
True
+ False
False
document-edit-symbolic