Merge pull request 'master' (#15) from YanTheKaller/libublsettingsui-gtk3:master into master

Reviewed-on: #15
pull/21/head v1.13
Dmitry Razumov 2 years ago
commit 73843c3e16

@ -14,7 +14,7 @@
<property name="version">1.1</property>
<property name="copyright" translatable="yes">Copyright © 2022 - 2023, UBSoft LLC</property>
<property name="comments" translatable="yes">TEMPLATE Manager</property>
<property name="website">https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/libublsettingsui-gtk3</property>
<property name="website">https://ublinux.ru/</property>
<property name="website-label" translatable="yes">Project Home Page</property>
<property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий.
Подробнее в &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;GNU General Public License, версии 2 или позднее&lt;/a&gt;.</property>

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkWindow" id="Window">
<property name="width-request">450</property>
<property name="height-request">500</property>
<property name="can-focus">False</property>
<property name="modal">True</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3</property>
<property name="type-hint">dialog</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="StatusBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkFileChooserWidget">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="create-folders">False</property>
<property name="do-overwrite-confirmation">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="HeaderTopic">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">TEMPLATE Manager</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkImage" id="HeaderImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3</property>
</object>
</child>
<child>
<object class="GtkButton" id="CancelButton">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image1</property>
<style>
<class name="marginright"/>
</style>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="SaveButton">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image2</property>
<style>
<class name="marginright"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
<style>
<class name="toolbar"/>
</style>
</object>
</child>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.cancel-symbolic</property>
<style>
<class name="marginright"/>
</style>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.accept-symbolic</property>
<style>
<class name="marginright"/>
</style>
</object>
</interface>

@ -36,14 +36,14 @@
<column type="gchararray"/>
<!-- column-name NewValue -->
<column type="gchararray"/>
<!-- column-name CompareString -->
<column type="gchararray"/>
<!-- column-name Color -->
<column type="gchararray"/>
<!-- column-name Show -->
<column type="gboolean"/>
<!-- column-name Section -->
<column type="gchararray"/>
<!-- column-name CompareString -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="Window">
@ -105,8 +105,8 @@
<child>
<object class="GtkCellRendererToggle" id="ToggleCell"/>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>
<attribute name="cell-background">5</attribute>
<attribute name="sensitive">6</attribute>
<attribute name="active">0</attribute>
</attributes>
</child>
@ -121,8 +121,8 @@
<property name="wrap-width">150</property>
</object>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>
<attribute name="cell-background">5</attribute>
<attribute name="sensitive">6</attribute>
<attribute name="text">1</attribute>
</attributes>
</child>
@ -139,8 +139,8 @@
<property name="wrap-width">250</property>
</object>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>
<attribute name="cell-background">5</attribute>
<attribute name="sensitive">6</attribute>
<attribute name="text">2</attribute>
</attributes>
</child>
@ -156,8 +156,8 @@
<property name="wrap-width">250</property>
</object>
<attributes>
<attribute name="cell-background">4</attribute>
<attribute name="sensitive">5</attribute>
<attribute name="cell-background">5</attribute>
<attribute name="sensitive">6</attribute>
<attribute name="text">3</attribute>
</attributes>
</child>
@ -170,7 +170,9 @@
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="markup">7</attribute>
<attribute name="cell-background">5</attribute>
<attribute name="sensitive">6</attribute>
<attribute name="markup">4</attribute>
</attributes>
</child>
</object>
@ -252,7 +254,24 @@
</object>
</child>
</object>
<object class="GtkTreeModelFilter" id="listfilter1">
<property name="child-model">liststore1</property>
<object class="GtkListStore" id="liststore1fwe">
<columns>
<!-- column-name Active -->
<column type="gboolean"/>
<!-- column-name Parameter -->
<column type="gchararray"/>
<!-- column-name OldValue -->
<column type="gchararray"/>
<!-- column-name NewValue -->
<column type="gchararray"/>
<!-- column-name CompareString -->
<column type="gchararray"/>
<!-- column-name Color -->
<column type="gchararray"/>
<!-- column-name Show -->
<column type="gboolean"/>
<!-- column-name SaveCommand -->
<column type="gchararray"/>
</columns>
</object>
</interface>

@ -148,6 +148,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Load local configuration</property>
<style>
<class name="menuitemmiddle"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="LoadExternalConfigurationMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Load from specific file</property>
<property name="use-underline">True</property>
<style>
<class name="menuitembottom"/>
</style>
@ -195,6 +206,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save to local configuration</property>
<style>
<class name="menuitemmiddle"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuItem" id="SaveExternalConfigurationMenuItem">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Save to specific file</property>
<property name="use-underline">True</property>
<style>
<class name="menuitembottom"/>
</style>

@ -17,168 +17,232 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: source/libublsettingsui-gtk3.h:31
#: source/libublsettingsui-gtk3.h:34
msgid "Version:"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid " version:"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Usage:"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "[OPTIONS]"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Options:"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Show this help"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Show package version"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Lock this help menu"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Lock configuration saving"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Lock local configration saving"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Lock global configration saving"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Lock global configration loading"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
msgid "Reset application settings"
msgstr ""
#: source/libublsettingsui-gtk3.h:40
msgid "Operation succeeded"
msgstr ""
#: source/libublsettingsui-gtk3.h:32
#: source/libublsettingsui-gtk3.h:41
msgid ""
"Warning! Application was launched without root - root-dependent actions are "
"locked"
msgstr ""
#: source/libublsettingsui-gtk3.h:34
#: source/libublsettingsui-gtk3.h:43
msgid "About"
msgstr ""
#: source/libublsettingsui-gtk3.h:35
#: source/libublsettingsui-gtk3.h:44
msgid "Documentation"
msgstr ""
#: source/libublsettingsui-gtk3.h:37
#: source/libublsettingsui-gtk3.h:46
msgid "Save to specific file"
msgstr ""
#: source/libublsettingsui-gtk3.h:47
msgid "Save to local configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:38
#: source/libublsettingsui-gtk3.h:48
msgid "Save to global configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:39
#: source/libublsettingsui-gtk3.h:49
msgid "Save configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:40
#: source/libublsettingsui-gtk3.h:50
msgid "Save"
msgstr ""
#: source/libublsettingsui-gtk3.h:42
#: source/libublsettingsui-gtk3.h:52
msgid "Load from specific file"
msgstr ""
#: source/libublsettingsui-gtk3.h:53
msgid "Load local configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:43
#: source/libublsettingsui-gtk3.h:54
msgid "Load global configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:44
#: source/libublsettingsui-gtk3.h:55
msgid "Load"
msgstr ""
#: source/libublsettingsui-gtk3.h:46
#: source/libublsettingsui-gtk3.h:57
msgid "Cancel"
msgstr ""
#: source/libublsettingsui-gtk3.h:47
#: source/libublsettingsui-gtk3.h:58
msgid "Accept"
msgstr ""
#: source/libublsettingsui-gtk3.h:49
#: source/libublsettingsui-gtk3.h:59
msgid "Open"
msgstr ""
#: source/libublsettingsui-gtk3.h:61
msgid "Would you like to read documentation in the Web?"
msgstr ""
#: source/libublsettingsui-gtk3.h:50
#: source/libublsettingsui-gtk3.h:62
msgid ""
"You will be redirected to documentation website where documentation is\n"
"translated and supported by community."
msgstr ""
#: source/libublsettingsui-gtk3.h:51
#: source/libublsettingsui-gtk3.h:63
msgid "Always redirect to online documentation"
msgstr ""
#: source/libublsettingsui-gtk3.h:52
#: source/libublsettingsui-gtk3.h:64
msgid "Open documentation"
msgstr ""
#: source/libublsettingsui-gtk3.h:53
#: source/libublsettingsui-gtk3.h:65
msgid "Project Home Page"
msgstr ""
#: source/libublsettingsui-gtk3.h:54
#: source/libublsettingsui-gtk3.h:66
msgid "Nothing were chosen"
msgstr ""
#: source/libublsettingsui-gtk3.h:55
#: source/libublsettingsui-gtk3.h:67
msgid "Copyright © 2022 - 2023, UBSoft LLC"
msgstr ""
#: source/libublsettingsui-gtk3.h:58
#: source/libublsettingsui-gtk3.h:70
msgid "Global configuration loading succeeded."
msgstr ""
#: source/libublsettingsui-gtk3.h:59
#: source/libublsettingsui-gtk3.h:71
msgid "Local configuration loading succeeded."
msgstr ""
#: source/libublsettingsui-gtk3.h:60
#: source/libublsettingsui-gtk3.h:72
msgid "Config loading failed"
msgstr ""
#: source/libublsettingsui-gtk3.h:62
#: source/libublsettingsui-gtk3.h:74
msgid "Local and global configuration saving succeeded."
msgstr ""
#: source/libublsettingsui-gtk3.h:63
#: source/libublsettingsui-gtk3.h:75
msgid "Global configuration saving succeeded."
msgstr ""
#: source/libublsettingsui-gtk3.h:64
#: source/libublsettingsui-gtk3.h:76
msgid "Local configuration saving succeeded."
msgstr ""
#: source/libublsettingsui-gtk3.h:66
#: source/libublsettingsui-gtk3.h:78
msgid "Parameter"
msgstr ""
#: source/libublsettingsui-gtk3.h:67
#: source/libublsettingsui-gtk3.h:79
msgid "Old value"
msgstr ""
#: source/libublsettingsui-gtk3.h:68
#: source/libublsettingsui-gtk3.h:80
msgid "New value"
msgstr ""
#: source/libublsettingsui-gtk3.h:69
#: source/libublsettingsui-gtk3.h:81
msgid ""
"Value\n"
"(Old/New)"
msgstr ""
#: source/libublsettingsui-gtk3.h:71
#: source/libublsettingsui-gtk3.h:83
msgid "Nothing to save"
msgstr ""
#: source/libublsettingsui-gtk3.h:72
#: source/libublsettingsui-gtk3.h:84
msgid "Saving into local configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:73
#: source/libublsettingsui-gtk3.h:85
msgid "Saving into global configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:74
#: source/libublsettingsui-gtk3.h:86
msgid "Saving into global and local configuration"
msgstr ""
#: source/libublsettingsui-gtk3.h:79
#: source/libublsettingsui-gtk3.h:91
msgid "Full saving mode"
msgstr ""
#: source/libublsettingsui-gtk3.h:80
#: source/libublsettingsui-gtk3.h:92
msgid "Saving into module"
msgstr ""
#: source/libublsettingsui-gtk3.h:81
#: source/libublsettingsui-gtk3.h:93
msgid "Sandbox mode"
msgstr ""
#: source/libublsettingsui-gtk3.h:82
#: source/libublsettingsui-gtk3.h:94
msgid "Sandbox with profile saving"
msgstr ""
#: source/libublsettingsui-gtk3.h:83
#: source/libublsettingsui-gtk3.h:95
msgid "HDD sandbox"
msgstr ""
#: source/libublsettingsui-gtk3.h:84
#: source/libublsettingsui-gtk3.h:96
msgid "HDD sandbox with profile saving"
msgstr ""

@ -17,11 +17,63 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: source/libublsettingsui-gtk3.h:31
#: source/libublsettingsui-gtk3.h:34
msgid "Version:"
msgstr "Версия:"
#: source/libublsettingsui-gtk3.h:35
msgid " version:"
msgstr " версия:"
#: source/libublsettingsui-gtk3.h:35
msgid "Usage:"
msgstr "Использование:"
#: source/libublsettingsui-gtk3.h:35
msgid "[OPTIONS]"
msgstr "[АРГУМЕНТЫ]"
#: source/libublsettingsui-gtk3.h:35
msgid "Options:"
msgstr "Аргументы:"
#: source/libublsettingsui-gtk3.h:35
msgid "Show this help"
msgstr "Показать эту подсказку"
#: source/libublsettingsui-gtk3.h:35
msgid "Show package version"
msgstr "Показать версию пакета"
#: source/libublsettingsui-gtk3.h:35
msgid "Lock this help menu"
msgstr "Заблокировать это меню помощи"
#: source/libublsettingsui-gtk3.h:35
msgid "Lock configuration saving"
msgstr "Успешно записана локальная конфигурация"
#: source/libublsettingsui-gtk3.h:35
msgid "Lock local configration saving"
msgstr "Заблокировать сохранение локальной конфигурации"
#: source/libublsettingsui-gtk3.h:35
msgid "Lock global configration saving"
msgstr "Заблокировать сохранение глобальной конфигурации"
#: source/libublsettingsui-gtk3.h:35
msgid "Lock global configration loading"
msgstr "Заблокировать загрузку глобальную конфигурацию"
#: source/libublsettingsui-gtk3.h:35
msgid "Reset application settings"
msgstr "Сбросить настройки программы"
#: source/libublsettingsui-gtk3.h:40
msgid "Operation succeeded"
msgstr "Операция завершена"
#: source/libublsettingsui-gtk3.h:32
#: source/libublsettingsui-gtk3.h:41
msgid ""
"Warning! Application was launched without root - root-dependent actions are "
"locked"
@ -29,55 +81,67 @@ msgstr ""
"Внимание! Приложение было запущено без прав суперпользователя - действия, "
"требующие их наличия заблокированы"
#: source/libublsettingsui-gtk3.h:34
#: source/libublsettingsui-gtk3.h:43
msgid "About"
msgstr "О программе"
#: source/libublsettingsui-gtk3.h:35
#: source/libublsettingsui-gtk3.h:44
msgid "Documentation"
msgstr "Справка"
#: source/libublsettingsui-gtk3.h:37
#: source/libublsettingsui-gtk3.h:46
msgid "Save to specific file"
msgstr "Сохранить в файл"
#: source/libublsettingsui-gtk3.h:47
msgid "Save to local configuration"
msgstr "Сохранить в локальную конфигурацию"
#: source/libublsettingsui-gtk3.h:38
#: source/libublsettingsui-gtk3.h:48
msgid "Save to global configuration"
msgstr "Сохранить в глобальную конфигурацию"
#: source/libublsettingsui-gtk3.h:39
#: source/libublsettingsui-gtk3.h:49
msgid "Save configuration"
msgstr "Сохранить конфигурацию"
#: source/libublsettingsui-gtk3.h:40
#: source/libublsettingsui-gtk3.h:50
msgid "Save"
msgstr "Сохранить"
#: source/libublsettingsui-gtk3.h:42
#: source/libublsettingsui-gtk3.h:52
msgid "Load from specific file"
msgstr "Загрузить из файла"
#: source/libublsettingsui-gtk3.h:53
msgid "Load local configuration"
msgstr "Загрузить локальную конфигурацию"
#: source/libublsettingsui-gtk3.h:43
#: source/libublsettingsui-gtk3.h:54
msgid "Load global configuration"
msgstr "Загрузить глобальную конфигурацию"
#: source/libublsettingsui-gtk3.h:44
#: source/libublsettingsui-gtk3.h:55
msgid "Load"
msgstr "Загрузить"
#: source/libublsettingsui-gtk3.h:46
#: source/libublsettingsui-gtk3.h:57
msgid "Cancel"
msgstr "Отмена"
#: source/libublsettingsui-gtk3.h:47
#: source/libublsettingsui-gtk3.h:58
msgid "Accept"
msgstr "Принять"
#: source/libublsettingsui-gtk3.h:49
#: source/libublsettingsui-gtk3.h:59
msgid "Open"
msgstr "Открыть"
#: source/libublsettingsui-gtk3.h:61
msgid "Would you like to read documentation in the Web?"
msgstr "Вы хотите прочитать справку в Сети?"
#: source/libublsettingsui-gtk3.h:50
#: source/libublsettingsui-gtk3.h:62
msgid ""
"You will be redirected to documentation website where documentation is\n"
"translated and supported by community."
@ -85,63 +149,63 @@ msgstr ""
"Вы будете перенаправлены на сайт с документацией, где страницы помощи\n"
"переводятся и поддерживаются сообществом."
#: source/libublsettingsui-gtk3.h:51
#: source/libublsettingsui-gtk3.h:63
msgid "Always redirect to online documentation"
msgstr "Всегда перенаправлять"
#: source/libublsettingsui-gtk3.h:52
#: source/libublsettingsui-gtk3.h:64
msgid "Open documentation"
msgstr "Прочитать справку"
#: source/libublsettingsui-gtk3.h:53
#: source/libublsettingsui-gtk3.h:65
msgid "Project Home Page"
msgstr "Домашняя страница проекта"
#: source/libublsettingsui-gtk3.h:54
#: source/libublsettingsui-gtk3.h:66
msgid "Nothing were chosen"
msgstr "Ничего не было выбрано"
#: source/libublsettingsui-gtk3.h:55
#: source/libublsettingsui-gtk3.h:67
msgid "Copyright © 2022 - 2023, UBSoft LLC"
msgstr "Copyright © 2022 - 2023, ООО «Юбисофт»"
#: source/libublsettingsui-gtk3.h:58
#: source/libublsettingsui-gtk3.h:70
msgid "Global configuration loading succeeded."
msgstr "Успешно загружена глобальная конфигурация"
#: source/libublsettingsui-gtk3.h:59
#: source/libublsettingsui-gtk3.h:71
msgid "Local configuration loading succeeded."
msgstr "Успешно загружена локальная конфигурация"
#: source/libublsettingsui-gtk3.h:60
#: source/libublsettingsui-gtk3.h:72
msgid "Config loading failed"
msgstr "Ошибка загрузки конфига"
#: source/libublsettingsui-gtk3.h:62
#: source/libublsettingsui-gtk3.h:74
msgid "Local and global configuration saving succeeded."
msgstr "Успешно записаны локальная и глобальная конфигурация"
#: source/libublsettingsui-gtk3.h:63
#: source/libublsettingsui-gtk3.h:75
msgid "Global configuration saving succeeded."
msgstr "Успешно записана глобальная конфигурация"
#: source/libublsettingsui-gtk3.h:64
#: source/libublsettingsui-gtk3.h:76
msgid "Local configuration saving succeeded."
msgstr "Успешно записана локальная конфигурация"
#: source/libublsettingsui-gtk3.h:66
#: source/libublsettingsui-gtk3.h:78
msgid "Parameter"
msgstr "Параметр"
#: source/libublsettingsui-gtk3.h:67
#: source/libublsettingsui-gtk3.h:79
msgid "Old value"
msgstr "Старое значение"
#: source/libublsettingsui-gtk3.h:68
#: source/libublsettingsui-gtk3.h:80
msgid "New value"
msgstr "Новое значение"
#: source/libublsettingsui-gtk3.h:69
#: source/libublsettingsui-gtk3.h:81
msgid ""
"Value\n"
"(Old/New)"
@ -149,42 +213,42 @@ msgstr ""
"Значение\n"
"(Старое/Новое)"
#: source/libublsettingsui-gtk3.h:71
#: source/libublsettingsui-gtk3.h:83
msgid "Nothing to save"
msgstr "Нечего сохранять"
#: source/libublsettingsui-gtk3.h:72
#: source/libublsettingsui-gtk3.h:84
msgid "Saving into local configuration"
msgstr "Сохранение в локальный конфигурационный файл"
#: source/libublsettingsui-gtk3.h:73
#: source/libublsettingsui-gtk3.h:85
msgid "Saving into global configuration"
msgstr "Сохранение в глобальный конфигурационный файл"
#: source/libublsettingsui-gtk3.h:74
#: source/libublsettingsui-gtk3.h:86
msgid "Saving into global and local configuration"
msgstr "Сохранение в глобальный и локальный конфигурационный файл"
#: source/libublsettingsui-gtk3.h:79
#: source/libublsettingsui-gtk3.h:91
msgid "Full saving mode"
msgstr "Полное сохранение"
#: source/libublsettingsui-gtk3.h:80
#: source/libublsettingsui-gtk3.h:92
msgid "Saving into module"
msgstr "Сохранение в модуль"
#: source/libublsettingsui-gtk3.h:81
#: source/libublsettingsui-gtk3.h:93
msgid "Sandbox mode"
msgstr "Полная песочница в ОЗУ"
#: source/libublsettingsui-gtk3.h:82
#: source/libublsettingsui-gtk3.h:94
msgid "Sandbox with profile saving"
msgstr "Песочница с сохранением профиля пользователя"
#: source/libublsettingsui-gtk3.h:83
#: source/libublsettingsui-gtk3.h:95
msgid "HDD sandbox"
msgstr "Полная песочница на HDD"
#: source/libublsettingsui-gtk3.h:84
#: source/libublsettingsui-gtk3.h:96
msgid "HDD sandbox with profile saving"
msgstr "Полная песочница на HDD с сохранением профиля пользователя"

@ -53,7 +53,9 @@ void on_subwindow_close(GtkWidget *self){
}
void yon_open_browser(GtkWidget *self, char *link){
yon_ubl_browser_window_open(link,template_app_information.app_title);
GtkWidget *window = yon_ubl_browser_window_open(link,template_app_information.app_title);
if (window)
gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
}
void on_open_documentation_confirmation(GtkWidget *self, char *link){
@ -104,6 +106,7 @@ void on_about(GtkWidget *self, char *version_application){
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(window),version_application);
gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window),template_app_information.app_title);
gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(window),template_app_information.app_tech_name);
gtk_label_set_text(GTK_LABEL(title),template_app_information.app_title);
g_signal_connect(G_OBJECT(window),"activate-link",G_CALLBACK(on_link),NULL);
@ -113,7 +116,7 @@ void on_about(GtkWidget *self, char *version_application){
}
//functions
void (*save_success_function)(void*)=NULL;
void (*save_success_function)(void*,config_str,int)=NULL;
void *save_success_argument=NULL;
void yon_save_window_set_postsave_function(void *function, void *data){
@ -124,19 +127,10 @@ void yon_save_window_set_postsave_function(void *function, void *data){
void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path, template_saving_window *window){
GtkTreeIter iter,itar;
if (path){
if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->filteredModel),&itar,path)){
char *seek_name;
gtk_tree_model_get(window->filteredModel,&itar,1,&seek_name,-1);
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
char *name;
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&name,-1);
if (!strcmp(seek_name,name)){
if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&itar,path)){
gboolean is_active;
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&is_active,-1);
gtk_list_store_set(window->list,&iter,0,!is_active,-1);
}
}
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&is_active,-1);
gtk_list_store_set(window->list,&itar,0,!is_active,-1);
}
}
int once_active=0;
@ -151,7 +145,6 @@ void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path,
}
if (!once_active) gtk_widget_set_sensitive(window->SaveButton,0);
else gtk_widget_set_sensitive(window->SaveButton,1);
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(window->filteredModel));
}
@ -173,189 +166,148 @@ template_debug_window *template_debugger_window_new(){
}
void on_save_parameters(GtkWidget *self, template_saving_window *window){
char *append_command = yon_char_unite("ubconfig --target ",template_config->load_mode==1?"global":"system"," set ",NULL);
char *remove_command = yon_char_unite("ubconfig --target ",template_config->load_mode==1?"global":"system"," remove ",NULL);
dictionary *final_append=NULL;
dictionary *final_remove=NULL;
GtkTreeIter iter;
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){
gboolean is_active,can_save;
char *parameter,*old_value,*new_value,*section;
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&is_active,1,&parameter,2,&old_value,3,&new_value,5,&can_save,6,&section,-1);
if (is_active&&can_save){
if(!yon_char_is_empty(parameter)){
if (yon_char_is_empty(new_value)){ // empty new value - delete
if (yon_dictionary_get(&final_remove,section)){
final_remove->data = yon_char_unite((char*)final_remove->data," ",parameter,NULL);
} else {
yon_dictionary_add_or_create_if_exists_with_data(final_remove,section, parameter);
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(window->ParametersTree));
int valid = gtk_tree_model_get_iter_first(model,&iter);
int saved_size=0;
config_str saved_parameters=NULL;
for (;valid;valid = gtk_tree_model_iter_next(model,&iter)){
char *parameter;
int is_active;
gtk_tree_model_get(model,&iter,0,&is_active,1,&parameter,-1);
if (is_active){
yon_char_parsed_add_or_create_if_exists(saved_parameters,&saved_size,parameter);
}
}
int size=0;
config_str commands = yon_config_get_save_parameters_by_list(&size,saved_parameters,saved_size);
char *target = yon_config_get_type_path(window->type);
if (target){
if (yon_char_is_empty(target)){
yon_char_parsed_prepend_strings(commands,size,ubconfig_dull_command);
}
else {
yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(target));
}
} else { // non-empty new value - add
if (yon_dictionary_get(&final_append,section)){
final_append->data=yon_char_unite((char*)final_append->data," ",yon_char_unite(parameter,"=\'",new_value,"\'",NULL),NULL);
} else {
yon_dictionary_add_or_create_if_exists_with_data(final_append,section, yon_char_unite(parameter,"=",new_value[0]!='\''?"\'":"",new_value,new_value[strlen(new_value)-1]!='\''?"\'":"",NULL));
}
}
}
}
}
// if (debug_output==1){
// template_debug_window *debug_window = template_debugger_window_new();
// gtk_widget_show(debug_window->Window);
// dictionary *dict = NULL;
// char *final_command_line = "";
// if (final_remove){
// for_dictionaries(dict,final_remove){
// char *final_command = yon_char_unite(remove_command," ",dict->key," ",(char*)dict->data,NULL);
// char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \"":"echo \"",final_command,"\";",final_command,NULL);
// if (!yon_char_is_empty(final_command_line))
// free(final_command_line);
// final_command_line=temp;
// free(final_command);
// }
// }
// if (final_append){
// for_dictionaries(dict,final_append){
// char *final_command = yon_char_unite(append_command," ",dict->key," ",(char*)dict->data,NULL);
// char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \"":"echo \"",final_command,"\";",final_command,NULL);
// if (!yon_char_is_empty(final_command_line))
// free(final_command_line);
// final_command_line=temp;
// free(final_command);
// }
// }
// if (window->type==YON_CONFIG_BOTH) {
// if (template_config->load_mode==1){
// yon_config_save_registered("system");
// } else if (template_config->load_mode==0){
// yon_config_save_registered("global");
// }
// }
// if (!yon_char_is_empty(final_command_line)){
// if (debug_output)
// printf("%s\n",final_command_line);
// yon_terminal_integrated_start(debug_window->Vte,final_command_line,NULL,NULL);
// }
// } else
yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(window->custom_save_path));
}
char *final_command = yon_char_parsed_to_string(commands,size,";");
FILE *file = popen(final_command,"r");
int file_save;
config_str file_return = yon_config_load_file(file,&file_save);
file_return = yon_char_parsed_append(file_return,&file_save,final_command);
if (save_success_function)
{
dictionary *dict = NULL;
if (final_remove){
for_dictionaries(dict,final_remove){
char *final_command = yon_char_unite(remove_command," ",dict->key," ",(char*)dict->data,NULL);
system(final_command);
printf("%s\n",final_command);
free(final_command);
}
save_success_function(save_success_argument,file_return,file_save);
}
if (final_append){
for_dictionaries(dict,final_append){
char *final_command = yon_char_unite(append_command," ",dict->key," ",(char*)dict->data,NULL);
system(final_command);
printf("%s\n",final_command);
free(final_command);
yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
on_subwindow_close(self);
}
struct loaded_config {
dictionary_fields(loaded_config);
char *section;
};
struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
struct loaded_config *loaded=NULL;
for (int i=0;i<size;i++){
char *value = yon_char_new(parsed[i]);
char *key = yon_char_divide_search(value,"=",-1);
yon_char_remove_brackets(value);
if (!loaded){
loaded = (struct loaded_config*)malloc(sizeof(struct loaded_config));
loaded->key=key;
loaded->first=loaded;
loaded->next=NULL;
loaded->prev=NULL;
loaded->section=NULL;
loaded->data=value;
} else {
loaded->next = (struct loaded_config*)malloc(sizeof(struct loaded_config));
struct loaded_config *next=loaded->next;
next->first=loaded->first;
next->prev=loaded;
next->key=key;
next->first=loaded->first;
next->next=NULL;
next->section=NULL;
next->data=value;
loaded=next;
}
if (window->type==YON_CONFIG_BOTH) {
if (template_config->load_mode==1){
yon_config_save_registered("system");
} else if (template_config->load_mode==0){
yon_config_save_registered("global");
}
return loaded;
}
struct loaded_config *yon_config_get_compared(char *command, int *final_size){
if (command){
*final_size=0;
int size;
config_str config = yon_config_load(command,&size);
config_str temporary = NULL;
int temp_size;
if (config&&size>0){
for (int i=0;i<size;i++){
if (!yon_char_is_empty(config[i])&&strcmp(config[i],"(null)\n")){
if (config[i][strlen(config[i])-1]=='\n') config[i][strlen(config[i])-1]='\0';
yon_char_parsed_add_or_create_if_exists(temporary,&temp_size,config[i]);
}
}
yon_char_parsed_free(config,size);
}
struct loaded_config *loaded = yon_config_convert_parameter(temporary,temp_size);
return loaded;
}
textdomain(template_ui_LocaleName);
if (window->type == YON_CONFIG_GLOBAL)
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
else if (window->type == YON_CONFIG_LOCAL)
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
else if (window->type == YON_CONFIG_BOTH)
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
textdomain(template_app_information.app_locale);
yon_window_config_custom_window_set(GTK_WINDOW(window->Window),"SaveWindow");
on_subwindow_close(self);
}
template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
if (((type==YON_CONFIG_LOCAL&& template_config->load_mode==1)||(type==YON_CONFIG_GLOBAL&& template_config->load_mode==0))){
yon_config_save_registered(path);
textdomain(template_ui_LocaleName);
if (type == YON_CONFIG_GLOBAL)
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
else if (type == YON_CONFIG_LOCAL)
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
else if (type == YON_CONFIG_BOTH)
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
textdomain(template_app_information.app_locale);
return NULL;
} else {
char *config_to_save = NULL;
if (type==YON_CONFIG_GLOBAL) config_to_save="global";
else if (type==YON_CONFIG_LOCAL) config_to_save="system";
else if (type==YON_CONFIG_BOTH) {
if (template_config->load_mode==1){
config_to_save="global";
} else if (template_config->load_mode==0){
config_to_save="system";
}
}
config_str config_compare=NULL;
config_to_save = yon_config_get_type_path(type);
struct loaded_config *config_compare=NULL;
int compare_size=0;
va_list args;
va_start(args,type);
char *cur_section = NULL;
dictionary *section_commands=NULL;
while ((cur_section=va_arg(args,char*))){
char *cur_parameter = va_arg(args,char*);
yon_dictionary_add_or_create_if_exists_with_data(section_commands,cur_section,cur_parameter);
char *compare_command="";
char *cur_command;
if (!path&&type == YON_CONFIG_CUSTOM){
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,SAVE_LABEL,GTK_RESPONSE_ACCEPT,NULL);
GtkFileFilter *filter = gtk_file_filter_new();
gtk_file_filter_add_pattern(filter,"*.ini");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
int response = gtk_dialog_run(GTK_DIALOG(dialog));
if (response == GTK_RESPONSE_ACCEPT){
char *file = yon_file_path_proceed_spaces(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
char *directory = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog));
if (!yon_char_is_empty(file)){
if (!strstr(file,".ini")) file = yon_char_append(file,".ini");
if (access(file,0)!=F_OK){
char *command_creation = ubconfig_file_create(file);
system(command_creation);
if (access(file,0)!=F_OK){
yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
return NULL;
}
struct loaded_config {
dictionary *dict;
char *section;
};
struct loaded_config loaded;
loaded.dict = yon_dictionary_new();
dictionary *dct;
for_dictionaries(dct,section_commands){
char *command = yon_char_unite(ubconfig_load_command," ", config_to_save," get ", dct->key," ", yon_dictionary_get_data(dct,char*),NULL);
FILE *output = popen(command, "r");
char **output_strings = NULL;
output_strings = malloc(sizeof(char*));
int i = 0;
char str[4096];
memset(str, 0, 4096);
while (fgets(str, 4096, output))
{
if (!yon_char_is_empty(str)&& strcmp(str,"(null)\n")!=0)
{
char *final_str = yon_char_new(str);
char *key = yon_char_divide_search(final_str,"=",-1);
final_str=yon_char_divide_search(final_str,"\n",-1);
if ((final_str[0]=='\''&&final_str[strlen(final_str)-1]=='\'')||(final_str[0]=='\"'&&final_str[strlen(final_str)-1]=='\"')){
final_str[strlen(final_str)-1] = '\0';
free(yon_char_divide(final_str,0));
}
char *str_copy = yon_char_unite(key,"=",final_str,NULL);
dictionary *found=NULL;
if (!(found=yon_dictionary_get(&loaded.dict,key))){
yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,NULL,yon_char_new(dct->key));
yon_dictionary_add_or_create_if_exists_with_data(loaded.dict,key,yon_char_new(final_str));
yon_char_parsed_add_or_create_if_exists(config_compare,&compare_size,yon_char_new(str_copy));
} else{
int element = yon_char_parsed_check_exist(config_compare,compare_size,(char*)loaded.dict->data);
if (element>-1){
free(config_compare[element]);
config_compare[element]=yon_char_new(str_copy);
loaded.dict->data = yon_char_new(final_str);
}
}
path = file;
gtk_widget_destroy(dialog);
} else {
gtk_widget_destroy(dialog);
return NULL;
}
}
while ((cur_command=va_arg(args,char*))){
char *temp=cur_command;
cur_command = yon_config_parameter_prepare_command(cur_command,type!=YON_CONFIG_CUSTOM?yon_config_get_type_path(type):path,NULL,NULL);
compare_command = yon_char_unite(compare_command,!yon_char_is_empty(compare_command)?";":"",cur_command,NULL);
free(temp);
}
config_compare = yon_config_get_compared(compare_command,&compare_size);
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_saving);
template_saving_window *window = malloc(sizeof(template_saving_window));
window->Window = yon_gtk_builder_get_widget(builder,"Window");
@ -371,6 +323,17 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
window->OldValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"OldValueCell"));
window->NewValueColumn = GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"NewValueColumn"));
window->NewValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"NewValueCell"));
window->type=type;
window->filteredModel = GTK_TREE_MODEL(gtk_builder_get_object(builder,"listfilter1"));
window->custom_save_path=path;
yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"SaveWindow");
gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);
g_signal_connect(G_OBJECT(window->ToggleCell),"toggled", G_CALLBACK(on_save_window_parameter_switched),window);
textdomain(template_ui_LocaleName);
if (type==YON_CONFIG_BOTH){
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"savingTarget",SAVING_GLOBAL_LOCAL_STATE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
@ -382,115 +345,70 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
}
textdomain(template_app_information.app_locale);
window->type=type;
window->filteredModel = GTK_TREE_MODEL(gtk_builder_get_object(builder,"listfilter1"));
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(window->filteredModel),5);
yon_window_config_custom_window_setup(GTK_WINDOW(window->Window),"SaveWindow");
gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_save_parameters),window);
g_signal_connect(G_OBJECT(window->ToggleCell),"toggled", G_CALLBACK(on_save_window_parameter_switched),window);
int config_size=0;
config_str config_strings = yon_config_get_all(&config_size);
if (config_strings){ //untracked parameters
int current_size=0;
config_str current_config = yon_config_get_all(&current_size);
struct loaded_config *current_loaded = yon_config_convert_parameter(current_config,current_size);
struct loaded_config *current = NULL;
if (current_loaded){
for_dictionaries(current,current_loaded){
dictionary *dict = yon_dictionary_get((dictionary**)&config_compare,current->key);
gboolean status=0;
status = yon_config_get_status(current->key);
if (dict&&!yon_char_is_empty((char*)dict->data)&&status!=-2){
if (strcmp((char*)dict->data,(char*)current->data)){
GtkTreeIter iter;
if (status==0||status==-2) status = 0;
else status=1;
char *compare_string = yon_char_unite("<s>",(char*)dict->data,"</s>\n",(char*)current->data,NULL);
gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,status,1,current->key,2,(char*)dict->data,3,(char*)current->data,4,compare_string,6,1,-1);
free(compare_string);
}
} else if ((strcmp((char*)current->data,""))&&status!=-2){
GtkTreeIter iter;
gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),NULL);
config_str compare_keys = NULL;
compare_keys = yon_char_parsed_copy(config_compare,compare_size);
int compare_keys_size=compare_size;
yon_char_parsed_divide_search_full(compare_keys,compare_keys_size,"=",-1);
int config_keys_size=0;
config_str config_keys = yon_config_get_all_keys(&config_keys_size);
int final_size=0;
if (status==0||status==-2) status = 0;
else status=1;
char *compare_string = yon_char_unite("\n",(char*)current->data,NULL);
gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,status,1,current->key,3,(char*)current->data,4,compare_string,6,1,-1);
free(compare_string);
}
}
if (config_compare){
for_dictionaries(current,config_compare){
GtkTreeIter iter;
dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key);
if (!dict){
GdkRGBA rgba;
rgba.alpha=0.8;
rgba.red=1;
rgba.blue=0.3;
rgba.green=0.65;
char *rgba_string = gdk_rgba_to_string(&rgba);
for (int i=0;i<compare_keys_size;i++){
int status=0;
char *compare_string = yon_char_unite((char*)current->data,"\n",NULL);
gtk_list_store_append(window->list,&iter);
gtk_list_store_set(window->list,&iter,0,0,1,compare_keys[i],5,1,-1);
for (int j=0;j<compare_size;j++){
if(config_compare[j][strlen(config_compare[j])-1]=='\n') config_compare[j][strlen(config_compare[j])-1]='\0';
char *compare_value = yon_char_new(config_compare[j]);
char *compare_name = yon_char_divide_search(compare_value,"=",-1);
if (!strcmp(compare_name,compare_keys[i])){
char *cur_section = (char*)yon_dictionary_get(&loaded.dict->first,compare_keys[i])->prev->data;
char *combined = yon_char_unite("<s>",compare_value,"</s>\n",NULL);
gtk_list_store_set(window->list,&iter,2,compare_value,4,rgba_string,6,cur_section,7,combined,-1);
free(combined);
gtk_list_store_set(window->list,&iter,0,0,1,current->key,2,(char*)current->data,4,compare_string,5,rgba_string,6,1,-1);
free(compare_string);
}
free(compare_value);
free(compare_name);
}
if (yon_config_check_ignore(compare_keys[i])){
gtk_list_store_set(window->list,&iter,0,0,1,compare_keys[i],4,NULL,5,0,-1);
}
}
char *name,*value;
for (int i=0;i<config_keys_size;i++){
int found=0;
char *compare_value = yon_char_new(config_strings[i]);
char *compare_name = yon_char_divide_search(compare_value,"=",-1);
char *section = yon_config_get_section_for_key(compare_name);
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&iter)){ // found parameter
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&name,2,&value,-1);
if (!yon_char_is_empty(name)&&!strcmp(name,config_keys[i])){
if (!yon_config_check_ignore(name)){
char *combined = yon_char_unite("<s>",value,"</s>\n",compare_value,NULL);
gtk_list_store_set(window->list,&iter,3,compare_value,4,NULL,6,section,7,combined,-1);
free(combined);
if ((value&&!strcmp(value,compare_value))){
gtk_list_store_set(window->list,&iter,0,0,3,value,5,0,-1);
} else {
if (yon_config_get_status(name)!=0){
gtk_list_store_set(window->list,&iter,0,1,5,1,-1);
}
};
};
found=1;
break;
}
}
if (!found){ // new parameter
if (!yon_config_check_ignore(compare_name)&&!yon_char_is_empty(compare_value)){
GtkTreeIter itar;
gtk_list_store_append(window->list,&itar);
char *combined = yon_char_append("\n",compare_value);
gtk_list_store_set(window->list,&itar,0,0,1,compare_name,3,compare_value,5,1,6,section,7,combined,-1);
if (yon_config_get_status(compare_name)==1){
gtk_list_store_set(window->list,&itar,0,1,-1);
}
free(combined);
}
}
free(compare_value);
free(compare_name);
}
free(rgba_string);
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->filteredModel),&iter)){
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
gtk_widget_destroy(window->Window);
textdomain(template_ui_LocaleName);
yon_ubl_status_box_render(NOTHING_TO_SAVE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
textdomain(template_app_information.app_locale);
return NULL;
}
gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),window->filteredModel);
}
gtk_tree_view_set_model(GTK_TREE_VIEW(window->ParametersTree),GTK_TREE_MODEL(window->list));
gtk_widget_show(window->Window);
on_save_window_parameter_switched(NULL,NULL,window);
return window;
}
}
int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data){
@ -579,10 +497,12 @@ template_main_window *setup_window(){
widgets->SaveMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem");
widgets->SaveGlobalMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem");
widgets->SaveLocalMenuItem = yon_gtk_builder_get_widget(builder,"SaveLocalConfigurationMenuItem");
widgets->SaveCustomMenuItem = yon_gtk_builder_get_widget(builder,"SaveExternalConfigurationMenuItem");
widgets->RightBox = yon_gtk_builder_get_widget(builder,"HeaderRightBox");
widgets->LoadGlobalMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem");
widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem");
widgets->LoadCustomMenuItem = yon_gtk_builder_get_widget(builder,"LoadExternalConfigurationMenuItem");
widgets->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox");
widgets->InterfaceBox = yon_gtk_builder_get_widget(builder,"InterfaceBox");

@ -43,17 +43,20 @@
#define ABOUT_LABEL _("About")
#define DOCUMENTATION_LABEL _("Documentation")
#define SAVE_CUSTOM_LABEL _("Save to specific file")
#define SAVE_LOCAL_LABEL _("Save to local configuration")
#define SAVE_GLOBAL_LABEL _("Save to global configuration")
#define SAVE_CONFIGURATION_LABEL _("Save configuration")
#define SAVE_LABEL _("Save")
#define LOAD_CUSTOM_LABEL _("Load from specific file")
#define LOAD_LOCAL_LABEL _("Load local configuration")
#define LOAD_GLOBAL_LABEL _("Load global configuration")
#define LOAD_LABEL _("Load")
#define CANCEL_LABEL _("Cancel")
#define ACCEPT_LABEL _("Accept")
#define OPEN_LABEL _("Open")
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
@ -91,10 +94,15 @@
#define SAVE_MODE_RAM_HOME_LABEL _("Sandbox with profile saving")
#define SAVE_MODE_HDD_LABEL _("HDD sandbox")
#define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#endif
#define dull_parameter_get_command "ubconfig --source global get users PARAMETER"
#define SAVE_MODE_GET_COMMAND "ubconfig --raw --source system get [config] SYSTEMBOOT_STATEMODE"
#define ubconfig_file_create(target) yon_char_unite("ubconfig --target \"",target,"\" create",NULL)
typedef enum SAVE_MODE_TYPE {
SAVE_MODE_FULL,
SAVE_MODE_MODULE,
@ -125,51 +133,60 @@ typedef struct {
} template_app_info;
static template_app_info template_app_information;
typedef struct {
int socket_id;
int load_socket_id;
int save_socket_id;
int lock_help;
int lock_save_local;
int lock_save_global;
int lock_load_global;
int lock_load_system;
int load_mode;
#define template_config_fields\
int socket_id;\
int load_socket_id;\
int save_socket_id;\
\
int lock_help;\
int lock_save_local;\
int lock_save_global;\
int lock_load_global;\
int lock_load_system;\
\
int load_mode;\
\
int always_open_documentation;\
int always_open_documentation;
typedef struct {
template_config_fields
} _template_config;
static _template_config *template_config;
#define template_window_fields\
GtkWidget *Window;\
GtkWidget *HeadLabel;\
GtkWidget *PlugBox;\
\
GtkWidget *HeadOverlay;\
GtkWidget *HeadImage;\
GtkWidget *HeadBox;\
GtkWidget *HeadTitleLabel;\
GtkWidget *HeadInfoLabel;\
\
GtkWidget *StatusBox;\
GtkWidget *StatusIcon;\
GtkWidget *StatusLabel;\
\
GtkWidget *SaveMenuItem;\
GtkWidget *SaveGlobalMenuItem;\
GtkWidget *SaveLocalMenuItem;\
GtkWidget *SaveCustomMenuItem;\
GtkWidget *RightBox;\
\
GtkWidget *LoadGlobalMenuItem;\
GtkWidget *LoadLocalMenuItem;\
GtkWidget *LoadCustomMenuItem;\
GtkWidget *LeftBox;\
\
GtkWidget *DocumentationMenuItem;\
GtkWidget *AboutMenuItem;\
\
GtkWidget *InterfaceBox;\
//}
typedef struct {
GtkWidget *Window;
GtkWidget *HeadLabel;
GtkWidget *PlugBox;
GtkWidget *HeadOverlay;
GtkWidget *HeadImage;
GtkWidget *HeadBox;
GtkWidget *HeadTitleLabel;
GtkWidget *HeadInfoLabel;
GtkWidget *StatusBox;
GtkWidget *StatusIcon;
GtkWidget *StatusLabel;
GtkWidget *SaveMenuItem;
GtkWidget *SaveGlobalMenuItem;
GtkWidget *SaveLocalMenuItem;
GtkWidget *RightBox;
GtkWidget *LoadGlobalMenuItem;
GtkWidget *LoadLocalMenuItem;
GtkWidget *LeftBox;
GtkWidget *DocumentationMenuItem;
GtkWidget *AboutMenuItem;
GtkWidget *InterfaceBox;
template_window_fields
} template_main_window;
@ -199,6 +216,7 @@ typedef struct {
GtkTreeViewColumn *NewValueColumn;
GtkCellRenderer *NewValueCell;
YON_CONFIG_TYPE type;
char *custom_save_path;
} template_saving_window;
typedef struct {

Loading…
Cancel
Save