diff --git a/gresource.xml b/gresource.xml
index 8f93c3d..39032f6 100644
--- a/gresource.xml
+++ b/gresource.xml
@@ -9,6 +9,7 @@
ubl-settings-update-repo-path-add.glade
ubl-settings-update-mirror-configure.glade
ubl-settings-update-password.glade
+ ubl-settings-update-ftp-publication.glade
ubl-settings-update.css
diff --git a/locale/ubl-settings-update.pot b/locale/ubl-settings-update.pot
index ea70c51..6bff029 100644
--- a/locale/ubl-settings-update.pot
+++ b/locale/ubl-settings-update.pot
@@ -185,7 +185,7 @@ msgid ""
"commas (,)"
msgstr ""
-#: source/ubl-strings.h:54 source/ubl-strings.h:82
+#: source/ubl-strings.h:54 source/ubl-strings.h:83
msgid "Update"
msgstr ""
@@ -217,10 +217,6 @@ msgstr ""
msgid "Automatic update"
msgstr ""
-#: source/ubl-strings.h:62
-msgid "Last update:"
-msgstr ""
-
#: source/ubl-strings.h:63
msgid "Update mode:"
msgstr ""
@@ -229,150 +225,154 @@ msgstr ""
msgid "Update interval:"
msgstr ""
-#: source/ubl-strings.h:66
-msgid "Update mode"
+#: source/ubl-strings.h:65
+msgid "Last update:"
msgstr ""
#: source/ubl-strings.h:67
-msgid "Update interval"
+msgid "Update mode"
msgstr ""
#: source/ubl-strings.h:68
+msgid "Update interval"
+msgstr ""
+
+#: source/ubl-strings.h:69
msgid "Boot"
msgstr ""
-#: source/ubl-strings.h:69 source/ubl-strings.h:152
+#: source/ubl-strings.h:70 source/ubl-strings.h:152
msgid "Minutes"
msgstr ""
-#: source/ubl-strings.h:70 source/ubl-strings.h:153
+#: source/ubl-strings.h:71 source/ubl-strings.h:153
msgid "Hours"
msgstr ""
-#: source/ubl-strings.h:71 source/ubl-strings.h:154
+#: source/ubl-strings.h:72 source/ubl-strings.h:154
msgid "Days"
msgstr ""
-#: source/ubl-strings.h:72 source/ubl-strings.h:155
+#: source/ubl-strings.h:73 source/ubl-strings.h:155
msgid "Months"
msgstr ""
-#: source/ubl-strings.h:73
+#: source/ubl-strings.h:74
msgid "Repositories from which the update will occur"
msgstr ""
-#: source/ubl-strings.h:74 source/ubl-strings.h:97
+#: source/ubl-strings.h:75 source/ubl-strings.h:98
msgid "Repositories list:"
msgstr ""
-#: source/ubl-strings.h:75
+#: source/ubl-strings.h:76
msgid "Repositories list"
msgstr ""
-#: source/ubl-strings.h:76
+#: source/ubl-strings.h:77
msgid "Default"
msgstr ""
-#: source/ubl-strings.h:77 source/ubl-strings.h:99
+#: source/ubl-strings.h:78 source/ubl-strings.h:100
msgid "Choose"
msgstr ""
-#: source/ubl-strings.h:78
+#: source/ubl-strings.h:79
msgid "Chosen"
msgstr ""
-#: source/ubl-strings.h:79
+#: source/ubl-strings.h:80
msgid "Repository"
msgstr ""
-#: source/ubl-strings.h:80
+#: source/ubl-strings.h:81
msgid "Manage repository list"
msgstr ""
-#: source/ubl-strings.h:81
+#: source/ubl-strings.h:82
msgid "Disable system repositories"
msgstr ""
-#: source/ubl-strings.h:83
+#: source/ubl-strings.h:84
msgid "Move up"
msgstr ""
-#: source/ubl-strings.h:84
+#: source/ubl-strings.h:85
msgid "Move down"
msgstr ""
-#: source/ubl-strings.h:85
+#: source/ubl-strings.h:86
msgid "Add"
msgstr ""
-#: source/ubl-strings.h:86
+#: source/ubl-strings.h:87
msgid "Edit"
msgstr ""
-#: source/ubl-strings.h:87
+#: source/ubl-strings.h:88
msgid "Remove"
msgstr ""
-#: source/ubl-strings.h:88
+#: source/ubl-strings.h:89
msgid "Enabled"
msgstr ""
-#: source/ubl-strings.h:89
+#: source/ubl-strings.h:90
msgid "Source"
msgstr ""
-#: source/ubl-strings.h:90
+#: source/ubl-strings.h:91
msgid "Signature level"
msgstr ""
-#: source/ubl-strings.h:91
+#: source/ubl-strings.h:92
msgid "Usage level"
msgstr ""
-#: source/ubl-strings.h:92
+#: source/ubl-strings.h:93
msgid "Repository connection configuration"
msgstr ""
-#: source/ubl-strings.h:93
+#: source/ubl-strings.h:94
msgid ""
"Setting up a connection to a distributed repository network and publishing "
"your repositories"
msgstr ""
-#: source/ubl-strings.h:94
+#: source/ubl-strings.h:95
msgid "Connect and publish"
msgstr ""
-#: source/ubl-strings.h:95
+#: source/ubl-strings.h:96
msgid "Recieve DB packages from shared network"
msgstr ""
-#: source/ubl-strings.h:96
+#: source/ubl-strings.h:97
msgid "Repositories for publishing"
msgstr ""
-#: source/ubl-strings.h:98
+#: source/ubl-strings.h:99
msgid "All repositories"
msgstr ""
-#: source/ubl-strings.h:100
+#: source/ubl-strings.h:101
msgid "Accept"
msgstr ""
-#: source/ubl-strings.h:101
+#: source/ubl-strings.h:102
msgid "Repository name"
msgstr ""
-#: source/ubl-strings.h:102
+#: source/ubl-strings.h:103
msgid ""
"Setting up publication of storage and/or repositories as a local WEB resource"
msgstr ""
-#: source/ubl-strings.h:103 source/ubl-strings.h:144
+#: source/ubl-strings.h:104 source/ubl-strings.h:144
msgid "Authorization parameters"
msgstr ""
-#: source/ubl-strings.h:104
+#: source/ubl-strings.h:105
msgid "Storage"
msgstr ""
@@ -610,3 +610,41 @@ msgstr ""
#: source/ubl-strings.h:167
msgid "Repeat password"
msgstr ""
+
+#: source/ubl-strings.h:168
+msgid ""
+"Setting up publishing of a repository and/or repositories as a local FTP "
+"resource"
+msgstr ""
+
+#: source/ubl-strings.h:169
+msgid "Enable publishing of a local repository and as a FTP resource"
+msgstr ""
+
+#: source/ubl-strings.h:170
+msgid "Storage:"
+msgstr ""
+
+#: source/ubl-strings.h:171
+msgid "Anonymous user:"
+msgstr ""
+
+#: source/ubl-strings.h:172
+msgid "Open user list"
+msgstr ""
+
+#: source/ubl-strings.h:173
+msgid "FTP-publication"
+msgstr ""
+
+#: source/ubl-strings.h:174
+msgid "Cancel"
+msgstr ""
+
+#: source/ubl-strings.h:174
+msgid "Check system updates at system startup"
+msgstr ""
+
+#: source/ubl-strings.h:174
+msgid "Remove repository"
+msgstr ""
diff --git a/locale/ubl-settings-update_ru.po b/locale/ubl-settings-update_ru.po
index 843d6d4..e35fd03 100644
--- a/locale/ubl-settings-update_ru.po
+++ b/locale/ubl-settings-update_ru.po
@@ -204,7 +204,7 @@ msgstr ""
"Полный адрес места, где можно найти базу данных, пакеты и подписа (если "
"доступны) для этого репозитория. Возможно указать несколько через запятую (,)"
-#: source/ubl-strings.h:54 source/ubl-strings.h:82
+#: source/ubl-strings.h:54 source/ubl-strings.h:83
msgid "Update"
msgstr "Обновление"
@@ -236,10 +236,6 @@ msgstr "Дата последнего автообновления"
msgid "Automatic update"
msgstr "Автоматическое обновление"
-#: source/ubl-strings.h:62
-msgid "Last update:"
-msgstr "Последнее обновление:"
-
#: source/ubl-strings.h:63
msgid "Update mode:"
msgstr "Режим обновления:"
@@ -248,111 +244,115 @@ msgstr "Режим обновления:"
msgid "Update interval:"
msgstr "Интервал обновлений:"
-#: source/ubl-strings.h:66
+#: source/ubl-strings.h:65
+msgid "Last update:"
+msgstr "Последнее обновление:"
+
+#: source/ubl-strings.h:67
msgid "Update mode"
msgstr "Режим обновления"
-#: source/ubl-strings.h:67
+#: source/ubl-strings.h:68
msgid "Update interval"
msgstr "Интервал обновлений"
-#: source/ubl-strings.h:68
+#: source/ubl-strings.h:69
msgid "Boot"
msgstr "Запуск"
-#: source/ubl-strings.h:69 source/ubl-strings.h:152
+#: source/ubl-strings.h:70 source/ubl-strings.h:152
msgid "Minutes"
msgstr "минут"
-#: source/ubl-strings.h:70 source/ubl-strings.h:153
+#: source/ubl-strings.h:71 source/ubl-strings.h:153
msgid "Hours"
msgstr "часов"
-#: source/ubl-strings.h:71 source/ubl-strings.h:154
+#: source/ubl-strings.h:72 source/ubl-strings.h:154
msgid "Days"
msgstr "дней"
-#: source/ubl-strings.h:72 source/ubl-strings.h:155
+#: source/ubl-strings.h:73 source/ubl-strings.h:155
msgid "Months"
msgstr "месяцев"
-#: source/ubl-strings.h:73
+#: source/ubl-strings.h:74
msgid "Repositories from which the update will occur"
msgstr "Репозитории с которых будет происходить обновление"
-#: source/ubl-strings.h:74 source/ubl-strings.h:97
+#: source/ubl-strings.h:75 source/ubl-strings.h:98
msgid "Repositories list:"
msgstr "Список репозиториев:"
-#: source/ubl-strings.h:75
+#: source/ubl-strings.h:76
msgid "Repositories list"
msgstr "Список репозиториев"
-#: source/ubl-strings.h:76
+#: source/ubl-strings.h:77
msgid "Default"
msgstr "По умолчанию"
-#: source/ubl-strings.h:77 source/ubl-strings.h:99
+#: source/ubl-strings.h:78 source/ubl-strings.h:100
msgid "Choose"
msgstr "Выбрать"
-#: source/ubl-strings.h:78
+#: source/ubl-strings.h:79
msgid "Chosen"
msgstr "Выбран"
-#: source/ubl-strings.h:79
+#: source/ubl-strings.h:80
msgid "Repository"
msgstr "Репозиторий"
-#: source/ubl-strings.h:80
+#: source/ubl-strings.h:81
msgid "Manage repository list"
msgstr "Управление списком репозиториев"
-#: source/ubl-strings.h:81
+#: source/ubl-strings.h:82
msgid "Disable system repositories"
msgstr "Отключить системные репозитории"
-#: source/ubl-strings.h:83
+#: source/ubl-strings.h:84
msgid "Move up"
msgstr "Переместить выше"
-#: source/ubl-strings.h:84
+#: source/ubl-strings.h:85
msgid "Move down"
msgstr "Переместить ниже"
-#: source/ubl-strings.h:85
+#: source/ubl-strings.h:86
msgid "Add"
msgstr "Добавить"
-#: source/ubl-strings.h:86
+#: source/ubl-strings.h:87
msgid "Edit"
msgstr "Изменить"
-#: source/ubl-strings.h:87
+#: source/ubl-strings.h:88
msgid "Remove"
msgstr "Удалить"
-#: source/ubl-strings.h:88
+#: source/ubl-strings.h:89
msgid "Enabled"
msgstr "Включен"
-#: source/ubl-strings.h:89
+#: source/ubl-strings.h:90
msgid "Source"
msgstr "Источник"
-#: source/ubl-strings.h:90
+#: source/ubl-strings.h:91
msgid "Signature level"
msgstr "Уровень подписи"
-#: source/ubl-strings.h:91
+#: source/ubl-strings.h:92
msgid "Usage level"
msgstr "Уровень использования"
-#: source/ubl-strings.h:92
+#: source/ubl-strings.h:93
msgid "Repository connection configuration"
msgstr "Настройки подключения репозитория"
-#: source/ubl-strings.h:93
+#: source/ubl-strings.h:94
msgid ""
"Setting up a connection to a distributed repository network and publishing "
"your repositories"
@@ -360,42 +360,42 @@ msgstr ""
"Настройки подключения к распределённой сети репозиториев и публикация своих "
"репозиториев"
-#: source/ubl-strings.h:94
+#: source/ubl-strings.h:95
msgid "Connect and publish"
msgstr "Подключиться и опубликовать"
-#: source/ubl-strings.h:95
+#: source/ubl-strings.h:96
msgid "Recieve DB packages from shared network"
msgstr "Получать БД пакетов из распределённой сети"
-#: source/ubl-strings.h:96
+#: source/ubl-strings.h:97
msgid "Repositories for publishing"
msgstr "Репозитории для публикации"
-#: source/ubl-strings.h:98
+#: source/ubl-strings.h:99
msgid "All repositories"
msgstr "Все репозитории"
-#: source/ubl-strings.h:100
+#: source/ubl-strings.h:101
msgid "Accept"
msgstr "Принять"
-#: source/ubl-strings.h:101
+#: source/ubl-strings.h:102
msgid "Repository name"
msgstr "Имя репозитория"
-#: source/ubl-strings.h:102
+#: source/ubl-strings.h:103
msgid ""
"Setting up publication of storage and/or repositories as a local WEB resource"
msgstr ""
"Настройка публикации хранилища и/или репозиториев в виде локального WEB "
"ресурса"
-#: source/ubl-strings.h:103 source/ubl-strings.h:144
+#: source/ubl-strings.h:104 source/ubl-strings.h:144
msgid "Authorization parameters"
msgstr "Параметры авторизации"
-#: source/ubl-strings.h:104
+#: source/ubl-strings.h:105
msgid "Storage"
msgstr "Хранилище"
@@ -641,11 +641,45 @@ msgstr "Пароль"
msgid "Repeat password"
msgstr "Подтвердите ввод пароля"
-msgid "Check system updates at system startup"
-msgstr "Проверять обновления при загрузке системы"
+#: source/ubl-strings.h:168
+msgid ""
+"Setting up publishing of a repository and/or repositories as a local FTP "
+"resource"
+msgstr ""
+"Настройка публикации хранилища и/или репозиториев в виде локального FTP "
+"ресурса"
-msgid "days"
-msgstr "дней"
+#: source/ubl-strings.h:169
+msgid "Enable publishing of a local repository and as a FTP resource"
+msgstr "Включить публикацию локального репозитория в виде FTP ресурса"
+
+#: source/ubl-strings.h:170
+msgid "Storage:"
+msgstr "Хранилище:"
+#: source/ubl-strings.h:171
+msgid "Anonymous user"
+msgstr "Аноноимный пользователь"
+
+#: source/ubl-strings.h:171
+msgid "Anonymous user:"
+msgstr "Аноноимный пользователь:"
+
+#: source/ubl-strings.h:172
+msgid "Open user list"
+msgstr "Открыть список пользователей"
+
+#: source/ubl-strings.h:173
+msgid "FTP-publication"
+msgstr "FTP-публикация"
+
+#: source/ubl-strings.h:174
msgid "Cancel"
msgstr "Отмена"
+
+msgid "Check system updates at system startup"
+msgstr "Проверять обновления при загрузке системы"
+
+#: source/ubl-strings.h:174
+msgid "Remove repository"
+msgstr "Удалить репозиторий"
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index e4dcc64..b6d519b 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -39,6 +39,7 @@ set(DEPENDFILES
../ubl-settings-update-repo-path-add.glade
../ubl-settings-update-mirror-configure.glade
../ubl-settings-update-password.glade
+ ../ubl-settings-update-ftp-publication.glade
../gresource.xml
../ubl-settings-update.css
)
@@ -82,6 +83,7 @@ set(SOURCE_FILES
ubl-settings-update-web.c
ubl-settings-update-mirror.c
ubl-settings-update-repo.c
+ ubl-settings-update-ftp.c
ubl-settings-update.h
ubl-strings.h
)
diff --git a/source/ubl-settings-update-ftp.c b/source/ubl-settings-update-ftp.c
new file mode 100644
index 0000000..1fb6b09
--- /dev/null
+++ b/source/ubl-settings-update-ftp.c
@@ -0,0 +1,191 @@
+#include "ubl-settings-update.h"
+
+
+void on_ftp_accept(GtkWidget *, ftp_window *window){
+ main_window *widgets = g_object_get_data(G_OBJECT(window->AcceptButton),"main_window");
+ GtkTreeIter iter;
+ const char *storage_path = gtk_entry_get_text(GTK_ENTRY(window->StorageEntry));
+ if (yon_char_is_empty(storage_path)){
+ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
+ yon_ubl_status_highlight_incorrect(window->StorageEntry);
+ return;
+ }
+ char *port = NULL;
+ gboolean enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnableCheck));
+ const char *user = NULL;
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PortCheck))){
+ port = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->PortSpin)));
+ }
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->AnonUserCheck))){
+ user = gtk_entry_get_text(GTK_ENTRY(window->AnonUserEntry));
+ if (yon_char_is_empty(user)){
+ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
+ yon_ubl_status_highlight_incorrect(window->AnonUserEntry);
+ return;
+ }
+ }
+ char *repos = NULL;
+ for_iter(window->ReposList,&iter){
+ int active;
+ char *target;
+ gtk_tree_model_get(GTK_TREE_MODEL(window->ReposList),&iter,0,&active,1,&target,-1);
+ if (active){
+ char *temp = yon_char_append_element(repos,target,",");
+ if (!yon_char_is_empty(repos)) free(repos);
+ repos = temp;
+ }
+ }
+ if (yon_char_is_empty(repos)){
+ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
+ yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->ReposTree));
+ return;
+ }
+
+ char *id_string = yon_char_unite(storage_path,":",repos,NULL);
+ int size;
+ config_str parameters = yon_char_parsed_new(&size,enable? "yes":"no",
+ yon_char_return_if_exist(port,""),
+ yon_char_return_if_exist(user,""),
+ NULL);
+ char *parameter_string = yon_char_parsed_to_string(parameters,size,":");
+
+ char *parameter_name = REPOPUBLIC_FTP(id_string);
+ char *parameter_command = REPOPUBLIC_FTP_command(id_string);
+ if (!yon_char_is_empty(window->prev_key)&&strcmp(id_string,window->prev_key)){
+ char *old_parameter = REPOPUBLIC_FTP(window->prev_key);
+ yon_config_remove_by_key(old_parameter);
+ free(old_parameter);
+ }
+ yon_config_register(parameter_name,parameter_command,parameter_string);
+ free(window->prev_key);
+ free(id_string);
+ free(parameter_string);
+ free(parameter_name);
+ free(parameter_command);
+ if (!yon_char_is_empty(port)) free(port);
+ if (!yon_char_is_empty(repos)) free(repos);
+ on_subwindow_close(window->Window);
+ free(window);
+ yon_interface_update(widgets);
+}
+
+void on_anon_user_select(GtkWidget *, ftp_window *window){
+ unsigned int size;
+ config_str users = yon_users_window_select(YON_USER_WINDOW_USERS,&size);
+ if (size){
+ char *users_string = yon_char_parsed_to_string(users,size," ");
+ gtk_entry_set_text(GTK_ENTRY(window->AnonUserEntry),users_string);
+ free(users_string);
+ yon_char_parsed_free(users,size);
+ }
+}
+
+ftp_window *yon_ftp_window_new(){
+ ftp_window *window = malloc(sizeof(ftp_window));
+ memset(window,0,sizeof(ftp_window));
+
+ GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ftp);
+
+ window->Window = yon_gtk_builder_get_widget(builder,"Window");
+ window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
+ window->EnableCheck = yon_gtk_builder_get_widget(builder,"EnableCheck");
+ window->StorageEntry = yon_gtk_builder_get_widget(builder,"StorageEntry");
+ window->StorageButton = yon_gtk_builder_get_widget(builder,"StorageButton");
+ window->ReposTree = yon_gtk_builder_get_widget(builder,"ReposTree");
+ window->PortCheck = yon_gtk_builder_get_widget(builder,"PortCheck");
+ window->PortSpin = yon_gtk_builder_get_widget(builder,"PortSpin");
+ window->AnonUserCheck = yon_gtk_builder_get_widget(builder,"AnonUserCheck");
+ window->AnonUserEntry = yon_gtk_builder_get_widget(builder,"AnonUserEntry");
+ window->AnonUserButton = yon_gtk_builder_get_widget(builder,"AnonUserButton");
+ window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
+ window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
+ window->ReposList = GTK_LIST_STORE(gtk_builder_get_object(builder,"ReposList"));
+ window->SelectionCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"SelectionCell"));
+
+ g_signal_connect(G_OBJECT(window->SelectionCell),"toggled",G_CALLBACK(on_cell_renderer_toggle_toggled),window->ReposTree);
+ g_signal_connect(G_OBJECT(window->StorageButton),"clicked",G_CALLBACK(on_file_chooser_open),window->StorageEntry);
+ g_signal_connect(G_OBJECT(window->StorageEntry),"changed",G_CALLBACK(on_web_publish_path_changed),window);
+ g_signal_connect(G_OBJECT(window->PortCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->PortSpin);
+ g_signal_connect(G_OBJECT(window->AnonUserCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->AnonUserEntry);
+ g_signal_connect(G_OBJECT(window->AnonUserCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->AnonUserButton);
+ g_signal_connect(G_OBJECT(window->AnonUserButton),"clicked",G_CALLBACK(on_anon_user_select),window);
+
+ g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_ftp_accept),window);
+ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
+
+ return window;
+}
+
+void yon_ftp_window_add(GtkWidget *, main_window *widgets){
+ ftp_window *window = yon_ftp_window_new();
+ g_object_set_data(G_OBJECT(window->AcceptButton),"main_window",widgets);
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),NULL,icon_path,"ftp_window");
+
+}
+
+void yon_ftp_window_edit(GtkWidget *, main_window *widgets){
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->FtpTree)),&model,&iter)){
+ ftp_window *window = yon_ftp_window_new();
+ g_object_set_data(G_OBJECT(window->AcceptButton),"main_window",widgets);
+ yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),NULL,icon_path,"ftp_window");
+ char *storage;
+ char *repos;
+ gtk_tree_model_get(model,&iter,1,&storage,2,&repos,-1);
+ char *repos_replaced = yon_char_replace(repos,"\n",",");
+ char *parameter_key = yon_char_unite(storage,":",repos_replaced,NULL);
+ window->prev_key = yon_char_new(parameter_key);
+ char *parameter_name = REPOPUBLIC_FTP(parameter_key);
+ char *parameter = config(parameter_name);
+ if (parameter){
+ int size;
+ config_str parsed = yon_char_parse(parameter,&size,":");
+ if (size>0&&!yon_char_is_empty(parsed[0])){
+ if (!strcmp(parsed[0],"enabled")||!strcmp(parsed[0],"yes")){
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnableCheck),1);
+ }
+ }
+ if (size>1&&!yon_char_is_empty(parsed[1])){
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->PortCheck),1);
+ gtk_adjustment_set_value(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(window->PortSpin)),atol(parsed[1]));
+ }
+ if (size>2&&!yon_char_is_empty(parsed[2])){
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->AnonUserCheck),1);
+ gtk_entry_set_text(GTK_ENTRY(window->AnonUserEntry),parsed[2]);
+ }
+ }
+ gtk_entry_set_text(GTK_ENTRY(window->StorageEntry),storage);
+ for_iter (window->ReposList,&iter){
+ char *target;
+ gtk_tree_model_get(GTK_TREE_MODEL(window->ReposList),&iter,1,&target,-1);
+ if (yon_char_check_element(repos_replaced,target,",")){
+ gtk_list_store_set(window->ReposList,&iter,0,1,-1);
+ }
+ }
+ }
+
+}
+
+void on_ftp_remove(GtkWidget *,main_window *widgets){
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->FtpTree)),&model,&iter)){
+ dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
+ data->title = REMOVE_FTP_TITLE_LABEL;
+ data->action_text = REMOVE_REPO_WARNING_LABEL;
+ if (yon_confirmation_dialog_call(widgets->Window,data)!=GTK_RESPONSE_CANCEL){
+ char *storage;
+ char *repos;
+ gtk_tree_model_get(model,&iter,1,&storage,2,&repos,-1);
+ char *repos_replaced = yon_char_replace(repos,"\n",",");
+ char *parameter_key = yon_char_unite(storage,":",repos_replaced,NULL);
+ char *parameter = REPOPUBLIC_FTP(parameter_key);
+ yon_config_remove_by_key(parameter);
+ free(parameter);
+ free(parameter_key);
+ free(repos_replaced);
+ yon_interface_update(widgets);
+ }
+ }
+}
\ No newline at end of file
diff --git a/source/ubl-settings-update-web.c b/source/ubl-settings-update-web.c
index 22442ed..c84b81a 100644
--- a/source/ubl-settings-update-web.c
+++ b/source/ubl-settings-update-web.c
@@ -69,7 +69,7 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
username_check?!yon_char_is_empty(user_password)&&!yon_char_is_empty(encryption)?user_password:"":"",
NULL);
if (!yon_char_is_empty(window->name)&&strcmp(final_name,window->name)){
- yon_config_remove_by_key(REPOPUBLIC_WEB_full(window->name));
+ yon_config_remove_by_key(window->name);
}
yon_config_register(REPOPUBLIC_WEB_full(final_name),REPOPUBLIC_WEB_command(final_name),final);
yon_interface_update(widgets);
@@ -130,6 +130,9 @@ void on_web_user_check(GtkToggleButton *self, web_publication_add_window *window
void on_web_publish_path_changed(GtkWidget *, web_publication_add_window *window){
gtk_list_store_clear(window->list);
char *path = (char*)gtk_entry_get_text(GTK_ENTRY(window->PathEntry));
+ if (!yon_file_is_directory(path)){
+ return;
+ }
if (yon_char_is_empty(path) || access(path,F_OK)) return;
int size;
config_str parsed = yon_dir_get_contents(path,&size);
diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c
index 5c64934..e89935b 100644
--- a/source/ubl-settings-update.c
+++ b/source/ubl-settings-update.c
@@ -516,6 +516,34 @@ void yon_interface_update(main_window *widgets){
}
}
}
+ {
+ gtk_list_store_clear(widgets->FtpList);
+ int size;
+ config_str ftp_parameters = yon_config_get_all_by_key(REPOPUBLIC_FTP_search,&size);
+ for (int i=0;i0&&(!strcmp(parsed[0],"enable")||!strcmp(parsed[0],"yes"));
+ char *port = NULL;
+ if (parsed_size>1&&!yon_char_is_empty(parsed[1])){
+ port = parsed[1];
+ }
+ char *user = NULL;
+ if (parsed_size>2&&!yon_char_is_empty(parsed[2])){
+ user = parsed[2];
+ }
+ gtk_list_store_append(widgets->FtpList,&iter);
+ gtk_list_store_set(widgets->FtpList,&iter,0,enabled,1,storage,2,repos,3,port,4,user,-1);
+ yon_char_parsed_free(parsed,parsed_size);
+ }
+ yon_char_parsed_free(ftp_parameters,size);
+ }
}
// standard functions
@@ -608,6 +636,14 @@ void on_selection_changed(GtkWidget *self, main_window *widgets){
gtk_widget_set_sensitive(widgets->MirrorEditButton,0);
gtk_widget_set_sensitive(widgets->MirrorRemoveButton,0);
}
+ } else if (self == widgets->FtpTree){
+ if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->FtpTree)),&model,&iter)){
+ gtk_widget_set_sensitive(widgets->FtpEditButton,1);
+ gtk_widget_set_sensitive(widgets->FtpRemoveButton,1);
+ } else {
+ gtk_widget_set_sensitive(widgets->FtpEditButton,0);
+ gtk_widget_set_sensitive(widgets->FtpRemoveButton,0);
+ }
}
}
@@ -1044,7 +1080,7 @@ void on_repo_source_add(GtkWidget *, repo_add_window *window){
void on_file_chooser_open(GtkWidget *, GtkEntry *target){
filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
if (yon_file_chooser_start(window)){
- char *file = window->last_success_selection;
+ char *file = window->last_any_selection;
if (!yon_char_is_empty(file)){
gtk_entry_set_text(target,file);
}
@@ -1300,6 +1336,11 @@ void yon_main_window_complete(main_window *widgets){
widgets->WebPublicationEditButton = yon_gtk_builder_get_widget(builder,"WebPublicationEditButton");
widgets->WebPublicationRemoveButton = yon_gtk_builder_get_widget(builder,"WebPublicationRemoveButton");
widgets->WebPublicationTree = yon_gtk_builder_get_widget(builder,"WebPublicationTree");
+ widgets->FtpUpdateButton = yon_gtk_builder_get_widget(builder,"FtpUpdateButton");
+ widgets->FtpAddButton = yon_gtk_builder_get_widget(builder,"FtpAddButton");
+ widgets->FtpRemoveButton = yon_gtk_builder_get_widget(builder,"FtpRemoveButton");
+ widgets->FtpEditButton = yon_gtk_builder_get_widget(builder,"FtpEditButton");
+ widgets->FtpTree = yon_gtk_builder_get_widget(builder,"FtpTree");
widgets->MirrorPublicCheck = yon_gtk_builder_get_widget(builder,"MirrorPublicCheck");
widgets->MirrorTree = yon_gtk_builder_get_widget(builder,"MirrorTree");
widgets->MirrorUpdateButton = yon_gtk_builder_get_widget(builder,"MirrorUpdateButton");
@@ -1314,6 +1355,7 @@ void yon_main_window_complete(main_window *widgets){
widgets->ReposList = GTK_LIST_STORE(gtk_builder_get_object(builder,"ReposList"));
widgets->PublicationList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PublicationList"));
widgets->WebPublicationList = GTK_LIST_STORE(gtk_builder_get_object(builder,"WebPublicationList"));
+ widgets->FtpList = GTK_LIST_STORE(gtk_builder_get_object(builder,"FtpList"));
widgets->MirrorList = GTK_LIST_STORE(gtk_builder_get_object(builder,"MirrorList"));
}
{
@@ -1321,17 +1363,21 @@ void yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->RepositoriesMoveDownButton),"clicked",G_CALLBACK(on_repo_move_down),widgets);
g_signal_connect(G_OBJECT(widgets->RepositoriesCreateButton),"clicked",G_CALLBACK(on_repo_add),widgets);
g_signal_connect(G_OBJECT(widgets->WebPublicationAddButton),"clicked",G_CALLBACK(on_web_publish_add),widgets);
+ g_signal_connect(G_OBJECT(widgets->FtpAddButton),"clicked",G_CALLBACK(yon_ftp_window_add),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorAddButton),"clicked",G_CALLBACK(on_mirror_add),widgets);
g_signal_connect(G_OBJECT(widgets->RepositoriesDeleteButton),"clicked",G_CALLBACK(on_repo_remove),widgets);
g_signal_connect(G_OBJECT(widgets->WebPublicationRemoveButton),"clicked",G_CALLBACK(on_web_publish_remove),widgets);
+ g_signal_connect(G_OBJECT(widgets->FtpRemoveButton),"clicked",G_CALLBACK(on_ftp_remove),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorRemoveButton),"clicked",G_CALLBACK(on_mirror_remove),widgets);
g_signal_connect(G_OBJECT(widgets->RepositoriesTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->PublicationTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->WebPublicationTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
+ g_signal_connect(G_OBJECT(widgets->FtpTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorTree),"cursor-changed",G_CALLBACK(on_selection_changed),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorEditButton),"clicked",G_CALLBACK(on_mirror_edit),widgets);
g_signal_connect(G_OBJECT(widgets->WebPublicationEditButton),"clicked",G_CALLBACK(on_web_publish_edit),widgets);
+ g_signal_connect(G_OBJECT(widgets->FtpEditButton),"clicked",G_CALLBACK(yon_ftp_window_edit),widgets);
g_signal_connect(G_OBJECT(widgets->RepositoriesEditButton),"clicked",G_CALLBACK(on_repo_edit),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorConfigureButton),"clicked",G_CALLBACK(on_mirror_configure),widgets);
@@ -1357,6 +1403,7 @@ void yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->RepositoriesUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->PublicationUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->WebPublicationUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
+ g_signal_connect(G_OBJECT(widgets->FtpUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
// g_signal_connect(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->RepositoriesTree);
diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h
index f46879e..6df50ae 100644
--- a/source/ubl-settings-update.h
+++ b/source/ubl-settings-update.h
@@ -32,7 +32,7 @@
#define glade_mirror_path_add_path "/com/ublinux/ui/ubl-settings-update-mirror-path-add.glade"
#define glade_repo_path_add_path "/com/ublinux/ui/ubl-settings-update-repo-path-add.glade"
#define glade_password_path "/com/ublinux/ui/ubl-settings-update-password.glade"
-#define banner_path "/com/ublinux/images/ubl-settings-update-banner.png"
+#define glade_path_ftp "/com/ublinux/ui/ubl-settings-update-ftp-publication.glade"
#define CssPath "/com/ublinux/css/ubl-settings-update.css"
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
@@ -61,6 +61,12 @@
#define REPOSITORY_parameter_command yon_char_unite("ubconfig --source global get [update] REPOSITORY",NULL)
#define REPOSITORY_search "REPOSITORY["
+#define REPOPUBLIC_FTP(target) yon_char_unite("REPOPUBLIC_FTP[",target,"]",NULL)
+#define REPOPUBLIC_FTP_parameter "REPOPUBLIC_FTP[*]"
+#define REPOPUBLIC_FTP_search "REPOPUBLIC_FTP["
+#define REPOPUBLIC_FTP_command(target) yon_char_unite("ubconfig --source global get [update] REPOPUBLIC_FTP[",target,"]",NULL)
+#define REPOPUBLIC_FTP_command_all "ubconfig --source global get [update] REPOPUBLIC_FTP[*]"
+
#define REPOPUBLIC_NET_parameter "REPOPUBLIC_NET"
#define REPOPUBLIC_NET_parameter_command "ubconfig --source global get [update] REPOPUBLIC_NET"
#define REPOPUBLIC_WEB "REPOPUBLIC_WEB"
@@ -151,6 +157,13 @@ typedef struct {
GtkWidget *WebPublicationUpperTree;
GtkListStore *WebPublicationList;
+ GtkWidget *FtpUpdateButton;
+ GtkWidget *FtpAddButton;
+ GtkWidget *FtpEditButton;
+ GtkWidget *FtpRemoveButton;
+ GtkWidget *FtpTree;
+ GtkListStore *FtpList;
+
GtkWidget *MirrorPublicCheck;
GtkWidget *MirrorTree;
GtkWidget *MirrorUpdateButton;
@@ -196,11 +209,13 @@ typedef struct {
} repo_add_window;
typedef struct {
+ GtkListStore *list;
+ GtkWidget *PathEntry;
+
GtkWidget *Window;
GtkWidget *HeadLabel;
GtkWidget *StatusBox;
GtkWidget *EnablePublishCheck;
- GtkWidget *PathEntry;
GtkWidget *PathButton;
GtkWidget *RepositoriesTree;
GtkWidget *PortCheck;
@@ -214,7 +229,6 @@ typedef struct {
GtkWidget *PasswordButton;
GtkWidget *AcceptButton;
GtkWidget *CancelButton;
- GtkListStore *list;
GtkCellRenderer *SelectionCellRenderer;
char *name;
@@ -303,6 +317,29 @@ typedef struct {
int edits;
} path_section;
+typedef struct {
+ GtkListStore *ReposList;
+ GtkWidget *StorageEntry;
+
+ GtkWidget *Window;
+ GtkWidget *StatusBox;
+ GtkWidget *EnableCheck;
+ GtkWidget *StorageButton;
+ GtkWidget *ReposTree;
+ GtkWidget *PortCheck;
+ GtkWidget *PortSpin;
+ GtkWidget *AnonUserCheck;
+ GtkWidget *AnonUserEntry;
+ GtkWidget *AnonUserButton;
+ GtkWidget *CancelButton;
+ GtkWidget *AcceptButton;
+
+ GtkCellRenderer *SelectionCell;
+
+ char *prev_key;
+
+} ftp_window;
+
void on_save_done(main_window *, config_str output, int size);
void on_toggle_button_toggled(GtkWidget *self, main_window *widgets);
@@ -392,5 +429,10 @@ void on_repo_move_up(GtkWidget *,main_window *widgets);
void on_repo_move_down(GtkWidget *,main_window *widgets);
void on_save_start(main_window *widgets, char* path);
void on_repo_file_chooser_open(GtkWidget *, repo_add_window *window);
-
+void on_ftp_accept(GtkWidget *, ftp_window *);
+ftp_window *yon_ftp_window_new();
+void yon_ftp_window_add(GtkWidget *, main_window *widgets);
+void on_anon_user_select(GtkWidget *, ftp_window *window);
+void yon_ftp_window_edit(GtkWidget *, main_window *widgets);
+void on_ftp_remove(GtkWidget *,main_window *widgets);
#endif
\ No newline at end of file
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index 561871e..674f2b7 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -32,6 +32,7 @@ Configuration - configuration path")
http_proxy - proxy-server for repository, replaces 'http_proxy'. Single parameter per repository\n\
mirrorlist - mirrors file, make sure server URL is NOT included in this file! Single parameter per repository")
#define PASSWORD_INPUT_LABEL _("Password input")
+ #define REMOVE_FTP_TITLE_LABEL _("Remove repository")
/*
#define _LABEL _("Signature verification will not be performed")
@@ -165,6 +166,15 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si
#define _LABEL _("Encryption")
#define _LABEL _("Password")
#define _LABEL _("Repeat password")
+ #define _LABEL _("Setting up publishing of a repository and/or repositories as a local FTP resource")
+ #define _LABEL _("Enable publishing of a local repository and as a FTP resource")
+ #define _LABEL _("Storage:")
+ #define _LABEL _("Anonymous user:")
+ #define _LABEL _("Anonymous user")
+ #define _LABEL _("Open user list")
+ #define _LABEL _("FTP-publication")
+ #define _LABEL _("Cancel")
+ #define _LABEL _("Check system updates at system startup")
*/
#endif
\ No newline at end of file
diff --git a/ubl-settings-update-ftp-publication.glade b/ubl-settings-update-ftp-publication.glade
new file mode 100644
index 0000000..e870698
--- /dev/null
+++ b/ubl-settings-update-ftp-publication.glade
@@ -0,0 +1,367 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ubl-settings-update-mirror-configure.glade b/ubl-settings-update-mirror-configure.glade
index 8ed890f..c5355c0 100644
--- a/ubl-settings-update-mirror-configure.glade
+++ b/ubl-settings-update-mirror-configure.glade
@@ -437,7 +437,7 @@
True
False
- The number of consecutie days that systems on the network have not been updated:
+ The number of consecutive days that systems on the network have not been updated:
False
diff --git a/ubl-settings-update.desktop b/ubl-settings-update.desktop
old mode 100644
new mode 100755
diff --git a/ubl-settings-update.glade b/ubl-settings-update.glade
index 6e3e4b1..a552f35 100644
--- a/ubl-settings-update.glade
+++ b/ubl-settings-update.glade
@@ -25,6 +25,29 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ file:///home/testrepo
+ main
+ 8080
+ superadmin
+
+
+
@@ -131,11 +154,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
False
com.ublinux.libublsettingsui-gtk3.settings-symbolic
+
+ True
+ False
+ com.ublinux.libublsettingsui-gtk3.sync-symbolic
+
True
False
com.ublinux.libublsettingsui-gtk3.sync-symbolic
+
+ True
+ False
+ com.ublinux.libublsettingsui-gtk3.increase-symbolic
+
+
+ True
+ False
+ document-edit-symbolic
+
+
+ True
+ False
+ com.ublinux.libublsettingsui-gtk3.trash-symbolic
+
True
False
@@ -1474,6 +1517,245 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
False
+
+
+ True
+ False
+ 5
+ 5
+ 5
+ 5
+ 5
+ 5
+ vertical
+ 5
+
+
+ True
+ False
+ Setting up publishing of a repository and/or repositories as a local FTP resource
+ 0
+
+
+
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+ 5
+
+
+ True
+ False
+ vertical
+ 5
+
+
+ 26
+ 26
+ True
+ True
+ True
+ Update
+ image19
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+ 1
+
+
+
+
+ 26
+ 26
+ True
+ True
+ True
+ Add
+ image20
+
+
+
+ False
+ True
+ 2
+
+
+
+
+ 26
+ 26
+ True
+ False
+ True
+ True
+ Edit
+ image21
+
+
+
+ False
+ True
+ 3
+
+
+
+
+ 26
+ 26
+ True
+ False
+ True
+ True
+ Remove
+ image22
+
+
+
+ False
+ True
+ 4
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ True
+ in
+
+
+ True
+ True
+ FtpList
+ both
+
+
+
+
+
+ Enabled
+
+
+
+ 0
+
+
+
+
+
+
+ autosize
+ Storage
+
+
+
+ 1
+
+
+
+
+
+
+ Repositories
+
+
+
+ 2
+
+
+
+
+
+
+ Port
+
+
+
+ 3
+
+
+
+
+
+
+ Anonymous user
+
+
+
+ 4
+
+
+
+
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+ 4
+
+
+
+
+ True
+ False
+ FTP-publication
+
+
+ 4
+ False
+
+
True
@@ -1713,7 +1995,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- 4
+ 5
@@ -1724,7 +2006,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Mirror publication
- 4
+ 5
False