Added saving and loading from specific file

pull/15/head
parent 6f0b88564d
commit 114cd74f7a

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

@ -148,6 +148,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Load local configuration</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> <style>
<class name="menuitembottom"/> <class name="menuitembottom"/>
</style> </style>
@ -195,6 +206,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Save to local configuration</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> <style>
<class name="menuitembottom"/> <class name="menuitembottom"/>
</style> </style>

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

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

@ -185,7 +185,9 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
yon_char_parsed_prepend_strings(commands,size,ubconfig_dull_command); yon_char_parsed_prepend_strings(commands,size,ubconfig_dull_command);
} }
yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(target)); yon_char_parsed_prepend_strings(commands,size,ubconfig_set_command(target));
} else return; } 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,";"); char *final_command = yon_char_parsed_to_string(commands,size,";");
FILE *file = popen(final_command,"r"); FILE *file = popen(final_command,"r");
int file_save; int file_save;
@ -265,10 +267,40 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
va_start(args,type); va_start(args,type);
char *compare_command=""; char *compare_command="";
char *cur_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){
FILE *source_file = fopen("/lib/ublinux/templates/ublinux-data.ini","r");
FILE *dest_file = fopen(file,"w");
int ch;
while ((ch = fgetc(source_file)) != EOF) {
fputc(ch, dest_file);
}
}
}
path = file;
gtk_widget_destroy(dialog);
} else {
gtk_widget_destroy(dialog);
return NULL;
}
}
while ((cur_command=va_arg(args,char*))){ 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); 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); /////////////////////////////////////////////// config_compare = yon_config_get_compared(compare_command,&compare_size);
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_saving); GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_saving);
template_saving_window *window = malloc(sizeof(template_saving_window)); template_saving_window *window = malloc(sizeof(template_saving_window));
@ -287,6 +319,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
window->NewValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"NewValueCell")); window->NewValueCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"NewValueCell"));
window->type=type; window->type=type;
window->filteredModel = GTK_TREE_MODEL(gtk_builder_get_object(builder,"listfilter1")); 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"); 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_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_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
@ -337,6 +370,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
free(compare_string); free(compare_string);
} }
} }
if (config_compare){
for_dictionaries(current,config_compare){ for_dictionaries(current,config_compare){
GtkTreeIter iter; GtkTreeIter iter;
dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key); dictionary *dict = yon_dictionary_get((dictionary**)&current_loaded,current->key);
@ -354,6 +388,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
free(compare_string); free(compare_string);
} }
} }
}
GtkTreeIter iter; GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){ if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
gtk_widget_destroy(window->Window); gtk_widget_destroy(window->Window);
@ -454,10 +489,12 @@ template_main_window *setup_window(){
widgets->SaveMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem"); widgets->SaveMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem");
widgets->SaveGlobalMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem"); widgets->SaveGlobalMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem");
widgets->SaveLocalMenuItem = yon_gtk_builder_get_widget(builder,"SaveLocalConfigurationMenuItem"); 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->RightBox = yon_gtk_builder_get_widget(builder,"HeaderRightBox");
widgets->LoadGlobalMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem"); widgets->LoadGlobalMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem");
widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem"); 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->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox");
widgets->InterfaceBox = yon_gtk_builder_get_widget(builder,"InterfaceBox"); widgets->InterfaceBox = yon_gtk_builder_get_widget(builder,"InterfaceBox");

@ -43,17 +43,20 @@
#define ABOUT_LABEL _("About") #define ABOUT_LABEL _("About")
#define DOCUMENTATION_LABEL _("Documentation") #define DOCUMENTATION_LABEL _("Documentation")
#define SAVE_CUSTOM_LABEL _("Save to specific file")
#define SAVE_LOCAL_LABEL _("Save to local configuration") #define SAVE_LOCAL_LABEL _("Save to local configuration")
#define SAVE_GLOBAL_LABEL _("Save to global configuration") #define SAVE_GLOBAL_LABEL _("Save to global configuration")
#define SAVE_CONFIGURATION_LABEL _("Save configuration") #define SAVE_CONFIGURATION_LABEL _("Save configuration")
#define SAVE_LABEL _("Save") #define SAVE_LABEL _("Save")
#define LOAD_CUSTOM_LABEL _("Load from specific file")
#define LOAD_LOCAL_LABEL _("Load local configuration") #define LOAD_LOCAL_LABEL _("Load local configuration")
#define LOAD_GLOBAL_LABEL _("Load global configuration") #define LOAD_GLOBAL_LABEL _("Load global configuration")
#define LOAD_LABEL _("Load") #define LOAD_LABEL _("Load")
#define CANCEL_LABEL _("Cancel") #define CANCEL_LABEL _("Cancel")
#define ACCEPT_LABEL _("Accept") #define ACCEPT_LABEL _("Accept")
#define OPEN_LABEL _("Open")
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") #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.") #define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
@ -127,51 +130,60 @@ typedef struct {
} template_app_info; } template_app_info;
static template_app_info template_app_information; 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; } _template_config;
static _template_config *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 { typedef struct {
GtkWidget *Window; template_window_fields
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_main_window; } template_main_window;
@ -201,6 +213,7 @@ typedef struct {
GtkTreeViewColumn *NewValueColumn; GtkTreeViewColumn *NewValueColumn;
GtkCellRenderer *NewValueCell; GtkCellRenderer *NewValueCell;
YON_CONFIG_TYPE type; YON_CONFIG_TYPE type;
char *custom_save_path;
} template_saving_window; } template_saving_window;
typedef struct { typedef struct {

Loading…
Cancel
Save