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="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 с сохранением профиля пользователя"

@ -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_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,";");
FILE *file = popen(final_command,"r");
int file_save;
@ -265,10 +267,40 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
va_start(args,type);
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){
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*))){
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); ///////////////////////////////////////////////
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));
@ -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->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);
@ -337,6 +370,7 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
free(compare_string);
}
}
if (config_compare){
for_dictionaries(current,config_compare){
GtkTreeIter iter;
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);
}
}
}
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(window->list),&iter)){
gtk_widget_destroy(window->Window);
@ -454,10 +489,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.")
@ -127,51 +130,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;
@ -201,6 +213,7 @@ typedef struct {
GtkTreeViewColumn *NewValueColumn;
GtkCellRenderer *NewValueCell;
YON_CONFIG_TYPE type;
char *custom_save_path;
} template_saving_window;
typedef struct {

Loading…
Cancel
Save