master #121

Merged
asmeron merged 3 commits from YanTheKaller/ubl-settings-update:master into master 4 months ago

@ -9,6 +9,7 @@
<file>ubl-settings-update-repo-path-add.glade</file> <file>ubl-settings-update-repo-path-add.glade</file>
<file>ubl-settings-update-mirror-configure.glade</file> <file>ubl-settings-update-mirror-configure.glade</file>
<file>ubl-settings-update-password.glade</file> <file>ubl-settings-update-password.glade</file>
<file>ubl-settings-update-ftp-publication.glade</file>
</gresource> </gresource>
<gresource prefix="/com/ublinux/css"> <gresource prefix="/com/ublinux/css">
<file>ubl-settings-update.css</file> <file>ubl-settings-update.css</file>

@ -185,7 +185,7 @@ msgid ""
"commas (,)" "commas (,)"
msgstr "" msgstr ""
#: source/ubl-strings.h:54 source/ubl-strings.h:82 #: source/ubl-strings.h:54 source/ubl-strings.h:83
msgid "Update" msgid "Update"
msgstr "" msgstr ""
@ -217,10 +217,6 @@ msgstr ""
msgid "Automatic update" msgid "Automatic update"
msgstr "" msgstr ""
#: source/ubl-strings.h:62
msgid "Last update:"
msgstr ""
#: source/ubl-strings.h:63 #: source/ubl-strings.h:63
msgid "Update mode:" msgid "Update mode:"
msgstr "" msgstr ""
@ -229,150 +225,154 @@ msgstr ""
msgid "Update interval:" msgid "Update interval:"
msgstr "" msgstr ""
#: source/ubl-strings.h:66 #: source/ubl-strings.h:65
msgid "Update mode" msgid "Last update:"
msgstr "" msgstr ""
#: source/ubl-strings.h:67 #: source/ubl-strings.h:67
msgid "Update interval" msgid "Update mode"
msgstr "" msgstr ""
#: source/ubl-strings.h:68 #: source/ubl-strings.h:68
msgid "Update interval"
msgstr ""
#: source/ubl-strings.h:69
msgid "Boot" msgid "Boot"
msgstr "" msgstr ""
#: source/ubl-strings.h:69 source/ubl-strings.h:152 #: source/ubl-strings.h:70 source/ubl-strings.h:152
msgid "Minutes" msgid "Minutes"
msgstr "" msgstr ""
#: source/ubl-strings.h:70 source/ubl-strings.h:153 #: source/ubl-strings.h:71 source/ubl-strings.h:153
msgid "Hours" msgid "Hours"
msgstr "" msgstr ""
#: source/ubl-strings.h:71 source/ubl-strings.h:154 #: source/ubl-strings.h:72 source/ubl-strings.h:154
msgid "Days" msgid "Days"
msgstr "" msgstr ""
#: source/ubl-strings.h:72 source/ubl-strings.h:155 #: source/ubl-strings.h:73 source/ubl-strings.h:155
msgid "Months" msgid "Months"
msgstr "" msgstr ""
#: source/ubl-strings.h:73 #: source/ubl-strings.h:74
msgid "Repositories from which the update will occur" msgid "Repositories from which the update will occur"
msgstr "" msgstr ""
#: source/ubl-strings.h:74 source/ubl-strings.h:97 #: source/ubl-strings.h:75 source/ubl-strings.h:98
msgid "Repositories list:" msgid "Repositories list:"
msgstr "" msgstr ""
#: source/ubl-strings.h:75 #: source/ubl-strings.h:76
msgid "Repositories list" msgid "Repositories list"
msgstr "" msgstr ""
#: source/ubl-strings.h:76 #: source/ubl-strings.h:77
msgid "Default" msgid "Default"
msgstr "" msgstr ""
#: source/ubl-strings.h:77 source/ubl-strings.h:99 #: source/ubl-strings.h:78 source/ubl-strings.h:100
msgid "Choose" msgid "Choose"
msgstr "" msgstr ""
#: source/ubl-strings.h:78 #: source/ubl-strings.h:79
msgid "Chosen" msgid "Chosen"
msgstr "" msgstr ""
#: source/ubl-strings.h:79 #: source/ubl-strings.h:80
msgid "Repository" msgid "Repository"
msgstr "" msgstr ""
#: source/ubl-strings.h:80 #: source/ubl-strings.h:81
msgid "Manage repository list" msgid "Manage repository list"
msgstr "" msgstr ""
#: source/ubl-strings.h:81 #: source/ubl-strings.h:82
msgid "Disable system repositories" msgid "Disable system repositories"
msgstr "" msgstr ""
#: source/ubl-strings.h:83 #: source/ubl-strings.h:84
msgid "Move up" msgid "Move up"
msgstr "" msgstr ""
#: source/ubl-strings.h:84 #: source/ubl-strings.h:85
msgid "Move down" msgid "Move down"
msgstr "" msgstr ""
#: source/ubl-strings.h:85 #: source/ubl-strings.h:86
msgid "Add" msgid "Add"
msgstr "" msgstr ""
#: source/ubl-strings.h:86 #: source/ubl-strings.h:87
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: source/ubl-strings.h:87 #: source/ubl-strings.h:88
msgid "Remove" msgid "Remove"
msgstr "" msgstr ""
#: source/ubl-strings.h:88 #: source/ubl-strings.h:89
msgid "Enabled" msgid "Enabled"
msgstr "" msgstr ""
#: source/ubl-strings.h:89 #: source/ubl-strings.h:90
msgid "Source" msgid "Source"
msgstr "" msgstr ""
#: source/ubl-strings.h:90 #: source/ubl-strings.h:91
msgid "Signature level" msgid "Signature level"
msgstr "" msgstr ""
#: source/ubl-strings.h:91 #: source/ubl-strings.h:92
msgid "Usage level" msgid "Usage level"
msgstr "" msgstr ""
#: source/ubl-strings.h:92 #: source/ubl-strings.h:93
msgid "Repository connection configuration" msgid "Repository connection configuration"
msgstr "" msgstr ""
#: source/ubl-strings.h:93 #: source/ubl-strings.h:94
msgid "" msgid ""
"Setting up a connection to a distributed repository network and publishing " "Setting up a connection to a distributed repository network and publishing "
"your repositories" "your repositories"
msgstr "" msgstr ""
#: source/ubl-strings.h:94 #: source/ubl-strings.h:95
msgid "Connect and publish" msgid "Connect and publish"
msgstr "" msgstr ""
#: source/ubl-strings.h:95 #: source/ubl-strings.h:96
msgid "Recieve DB packages from shared network" msgid "Recieve DB packages from shared network"
msgstr "" msgstr ""
#: source/ubl-strings.h:96 #: source/ubl-strings.h:97
msgid "Repositories for publishing" msgid "Repositories for publishing"
msgstr "" msgstr ""
#: source/ubl-strings.h:98 #: source/ubl-strings.h:99
msgid "All repositories" msgid "All repositories"
msgstr "" msgstr ""
#: source/ubl-strings.h:100 #: source/ubl-strings.h:101
msgid "Accept" msgid "Accept"
msgstr "" msgstr ""
#: source/ubl-strings.h:101 #: source/ubl-strings.h:102
msgid "Repository name" msgid "Repository name"
msgstr "" msgstr ""
#: source/ubl-strings.h:102 #: source/ubl-strings.h:103
msgid "" msgid ""
"Setting up publication of storage and/or repositories as a local WEB resource" "Setting up publication of storage and/or repositories as a local WEB resource"
msgstr "" msgstr ""
#: source/ubl-strings.h:103 source/ubl-strings.h:144 #: source/ubl-strings.h:104 source/ubl-strings.h:144
msgid "Authorization parameters" msgid "Authorization parameters"
msgstr "" msgstr ""
#: source/ubl-strings.h:104 #: source/ubl-strings.h:105
msgid "Storage" msgid "Storage"
msgstr "" msgstr ""
@ -610,3 +610,41 @@ msgstr ""
#: source/ubl-strings.h:167 #: source/ubl-strings.h:167
msgid "Repeat password" msgid "Repeat password"
msgstr "" 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 ""

@ -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" msgid "Update"
msgstr "Обновление" msgstr "Обновление"
@ -236,10 +236,6 @@ msgstr "Дата последнего автообновления"
msgid "Automatic update" msgid "Automatic update"
msgstr "Автоматическое обновление" msgstr "Автоматическое обновление"
#: source/ubl-strings.h:62
msgid "Last update:"
msgstr "Последнее обновление:"
#: source/ubl-strings.h:63 #: source/ubl-strings.h:63
msgid "Update mode:" msgid "Update mode:"
msgstr "Режим обновления:" msgstr "Режим обновления:"
@ -248,111 +244,115 @@ msgstr "Режим обновления:"
msgid "Update interval:" msgid "Update interval:"
msgstr "Интервал обновлений:" msgstr "Интервал обновлений:"
#: source/ubl-strings.h:66 #: source/ubl-strings.h:65
msgid "Last update:"
msgstr "Последнее обновление:"
#: source/ubl-strings.h:67
msgid "Update mode" msgid "Update mode"
msgstr "Режим обновления" msgstr "Режим обновления"
#: source/ubl-strings.h:67 #: source/ubl-strings.h:68
msgid "Update interval" msgid "Update interval"
msgstr "Интервал обновлений" msgstr "Интервал обновлений"
#: source/ubl-strings.h:68 #: source/ubl-strings.h:69
msgid "Boot" msgid "Boot"
msgstr "Запуск" msgstr "Запуск"
#: source/ubl-strings.h:69 source/ubl-strings.h:152 #: source/ubl-strings.h:70 source/ubl-strings.h:152
msgid "Minutes" msgid "Minutes"
msgstr "минут" msgstr "минут"
#: source/ubl-strings.h:70 source/ubl-strings.h:153 #: source/ubl-strings.h:71 source/ubl-strings.h:153
msgid "Hours" msgid "Hours"
msgstr "часов" msgstr "часов"
#: source/ubl-strings.h:71 source/ubl-strings.h:154 #: source/ubl-strings.h:72 source/ubl-strings.h:154
msgid "Days" msgid "Days"
msgstr "дней" msgstr "дней"
#: source/ubl-strings.h:72 source/ubl-strings.h:155 #: source/ubl-strings.h:73 source/ubl-strings.h:155
msgid "Months" msgid "Months"
msgstr "месяцев" msgstr "месяцев"
#: source/ubl-strings.h:73 #: source/ubl-strings.h:74
msgid "Repositories from which the update will occur" msgid "Repositories from which the update will occur"
msgstr "Репозитории с которых будет происходить обновление" msgstr "Репозитории с которых будет происходить обновление"
#: source/ubl-strings.h:74 source/ubl-strings.h:97 #: source/ubl-strings.h:75 source/ubl-strings.h:98
msgid "Repositories list:" msgid "Repositories list:"
msgstr "Список репозиториев:" msgstr "Список репозиториев:"
#: source/ubl-strings.h:75 #: source/ubl-strings.h:76
msgid "Repositories list" msgid "Repositories list"
msgstr "Список репозиториев" msgstr "Список репозиториев"
#: source/ubl-strings.h:76 #: source/ubl-strings.h:77
msgid "Default" msgid "Default"
msgstr "По умолчанию" msgstr "По умолчанию"
#: source/ubl-strings.h:77 source/ubl-strings.h:99 #: source/ubl-strings.h:78 source/ubl-strings.h:100
msgid "Choose" msgid "Choose"
msgstr "Выбрать" msgstr "Выбрать"
#: source/ubl-strings.h:78 #: source/ubl-strings.h:79
msgid "Chosen" msgid "Chosen"
msgstr "Выбран" msgstr "Выбран"
#: source/ubl-strings.h:79 #: source/ubl-strings.h:80
msgid "Repository" msgid "Repository"
msgstr "Репозиторий" msgstr "Репозиторий"
#: source/ubl-strings.h:80 #: source/ubl-strings.h:81
msgid "Manage repository list" msgid "Manage repository list"
msgstr "Управление списком репозиториев" msgstr "Управление списком репозиториев"
#: source/ubl-strings.h:81 #: source/ubl-strings.h:82
msgid "Disable system repositories" msgid "Disable system repositories"
msgstr "Отключить системные репозитории" msgstr "Отключить системные репозитории"
#: source/ubl-strings.h:83 #: source/ubl-strings.h:84
msgid "Move up" msgid "Move up"
msgstr "Переместить выше" msgstr "Переместить выше"
#: source/ubl-strings.h:84 #: source/ubl-strings.h:85
msgid "Move down" msgid "Move down"
msgstr "Переместить ниже" msgstr "Переместить ниже"
#: source/ubl-strings.h:85 #: source/ubl-strings.h:86
msgid "Add" msgid "Add"
msgstr "Добавить" msgstr "Добавить"
#: source/ubl-strings.h:86 #: source/ubl-strings.h:87
msgid "Edit" msgid "Edit"
msgstr "Изменить" msgstr "Изменить"
#: source/ubl-strings.h:87 #: source/ubl-strings.h:88
msgid "Remove" msgid "Remove"
msgstr "Удалить" msgstr "Удалить"
#: source/ubl-strings.h:88 #: source/ubl-strings.h:89
msgid "Enabled" msgid "Enabled"
msgstr "Включен" msgstr "Включен"
#: source/ubl-strings.h:89 #: source/ubl-strings.h:90
msgid "Source" msgid "Source"
msgstr "Источник" msgstr "Источник"
#: source/ubl-strings.h:90 #: source/ubl-strings.h:91
msgid "Signature level" msgid "Signature level"
msgstr "Уровень подписи" msgstr "Уровень подписи"
#: source/ubl-strings.h:91 #: source/ubl-strings.h:92
msgid "Usage level" msgid "Usage level"
msgstr "Уровень использования" msgstr "Уровень использования"
#: source/ubl-strings.h:92 #: source/ubl-strings.h:93
msgid "Repository connection configuration" msgid "Repository connection configuration"
msgstr "Настройки подключения репозитория" msgstr "Настройки подключения репозитория"
#: source/ubl-strings.h:93 #: source/ubl-strings.h:94
msgid "" msgid ""
"Setting up a connection to a distributed repository network and publishing " "Setting up a connection to a distributed repository network and publishing "
"your repositories" "your repositories"
@ -360,42 +360,42 @@ msgstr ""
"Настройки подключения к распределённой сети репозиториев и публикация своих " "Настройки подключения к распределённой сети репозиториев и публикация своих "
"репозиториев" "репозиториев"
#: source/ubl-strings.h:94 #: source/ubl-strings.h:95
msgid "Connect and publish" msgid "Connect and publish"
msgstr "Подключиться и опубликовать" msgstr "Подключиться и опубликовать"
#: source/ubl-strings.h:95 #: source/ubl-strings.h:96
msgid "Recieve DB packages from shared network" msgid "Recieve DB packages from shared network"
msgstr "Получать БД пакетов из распределённой сети" msgstr "Получать БД пакетов из распределённой сети"
#: source/ubl-strings.h:96 #: source/ubl-strings.h:97
msgid "Repositories for publishing" msgid "Repositories for publishing"
msgstr "Репозитории для публикации" msgstr "Репозитории для публикации"
#: source/ubl-strings.h:98 #: source/ubl-strings.h:99
msgid "All repositories" msgid "All repositories"
msgstr "Все репозитории" msgstr "Все репозитории"
#: source/ubl-strings.h:100 #: source/ubl-strings.h:101
msgid "Accept" msgid "Accept"
msgstr "Принять" msgstr "Принять"
#: source/ubl-strings.h:101 #: source/ubl-strings.h:102
msgid "Repository name" msgid "Repository name"
msgstr "Имя репозитория" msgstr "Имя репозитория"
#: source/ubl-strings.h:102 #: source/ubl-strings.h:103
msgid "" msgid ""
"Setting up publication of storage and/or repositories as a local WEB resource" "Setting up publication of storage and/or repositories as a local WEB resource"
msgstr "" msgstr ""
"Настройка публикации хранилища и/или репозиториев в виде локального WEB " "Настройка публикации хранилища и/или репозиториев в виде локального WEB "
"ресурса" "ресурса"
#: source/ubl-strings.h:103 source/ubl-strings.h:144 #: source/ubl-strings.h:104 source/ubl-strings.h:144
msgid "Authorization parameters" msgid "Authorization parameters"
msgstr "Параметры авторизации" msgstr "Параметры авторизации"
#: source/ubl-strings.h:104 #: source/ubl-strings.h:105
msgid "Storage" msgid "Storage"
msgstr "Хранилище" msgstr "Хранилище"
@ -641,11 +641,45 @@ msgstr "Пароль"
msgid "Repeat password" msgid "Repeat password"
msgstr "Подтвердите ввод пароля" msgstr "Подтвердите ввод пароля"
msgid "Check system updates at system startup" #: source/ubl-strings.h:168
msgstr "Проверять обновления при загрузке системы" msgid ""
"Setting up publishing of a repository and/or repositories as a local FTP "
"resource"
msgstr ""
"Настройка публикации хранилища и/или репозиториев в виде локального FTP "
"ресурса"
msgid "days" #: source/ubl-strings.h:169
msgstr "дней" 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" msgid "Cancel"
msgstr "Отмена" msgstr "Отмена"
msgid "Check system updates at system startup"
msgstr "Проверять обновления при загрузке системы"
#: source/ubl-strings.h:174
msgid "Remove repository"
msgstr "Удалить репозиторий"

@ -39,6 +39,7 @@ set(DEPENDFILES
../ubl-settings-update-repo-path-add.glade ../ubl-settings-update-repo-path-add.glade
../ubl-settings-update-mirror-configure.glade ../ubl-settings-update-mirror-configure.glade
../ubl-settings-update-password.glade ../ubl-settings-update-password.glade
../ubl-settings-update-ftp-publication.glade
../gresource.xml ../gresource.xml
../ubl-settings-update.css ../ubl-settings-update.css
) )
@ -82,6 +83,7 @@ set(SOURCE_FILES
ubl-settings-update-web.c ubl-settings-update-web.c
ubl-settings-update-mirror.c ubl-settings-update-mirror.c
ubl-settings-update-repo.c ubl-settings-update-repo.c
ubl-settings-update-ftp.c
ubl-settings-update.h ubl-settings-update.h
ubl-strings.h ubl-strings.h
) )

@ -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);
}
}
}

@ -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:"":"", username_check?!yon_char_is_empty(user_password)&&!yon_char_is_empty(encryption)?user_password:"":"",
NULL); NULL);
if (!yon_char_is_empty(window->name)&&strcmp(final_name,window->name)){ 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_config_register(REPOPUBLIC_WEB_full(final_name),REPOPUBLIC_WEB_command(final_name),final);
yon_interface_update(widgets); 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){ void on_web_publish_path_changed(GtkWidget *, web_publication_add_window *window){
gtk_list_store_clear(window->list); gtk_list_store_clear(window->list);
char *path = (char*)gtk_entry_get_text(GTK_ENTRY(window->PathEntry)); 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; if (yon_char_is_empty(path) || access(path,F_OK)) return;
int size; int size;
config_str parsed = yon_dir_get_contents(path,&size); config_str parsed = yon_dir_get_contents(path,&size);

@ -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;i<size;i++){
char *parameter_string = yon_char_new(ftp_parameters[i]);
char *parameter_name = yon_char_divide_search(parameter_string,"=",-1);
char *key = yon_config_parameter_get_key(parameter_name);
char *repos = yon_char_replace(key,",","\n");
char *storage = yon_char_divide_search(repos,":",-1);
int parsed_size;
config_str parsed = yon_char_parse(parameter_string,&parsed_size,":");
int enabled = size>0&&(!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 // 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->MirrorEditButton,0);
gtk_widget_set_sensitive(widgets->MirrorRemoveButton,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){ void on_file_chooser_open(GtkWidget *, GtkEntry *target){
filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN); filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
if (yon_file_chooser_start(window)){ if (yon_file_chooser_start(window)){
char *file = window->last_success_selection; char *file = window->last_any_selection;
if (!yon_char_is_empty(file)){ if (!yon_char_is_empty(file)){
gtk_entry_set_text(target,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->WebPublicationEditButton = yon_gtk_builder_get_widget(builder,"WebPublicationEditButton");
widgets->WebPublicationRemoveButton = yon_gtk_builder_get_widget(builder,"WebPublicationRemoveButton"); widgets->WebPublicationRemoveButton = yon_gtk_builder_get_widget(builder,"WebPublicationRemoveButton");
widgets->WebPublicationTree = yon_gtk_builder_get_widget(builder,"WebPublicationTree"); 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->MirrorPublicCheck = yon_gtk_builder_get_widget(builder,"MirrorPublicCheck");
widgets->MirrorTree = yon_gtk_builder_get_widget(builder,"MirrorTree"); widgets->MirrorTree = yon_gtk_builder_get_widget(builder,"MirrorTree");
widgets->MirrorUpdateButton = yon_gtk_builder_get_widget(builder,"MirrorUpdateButton"); 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->ReposList = GTK_LIST_STORE(gtk_builder_get_object(builder,"ReposList"));
widgets->PublicationList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PublicationList")); widgets->PublicationList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PublicationList"));
widgets->WebPublicationList = GTK_LIST_STORE(gtk_builder_get_object(builder,"WebPublicationList")); 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")); 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->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->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->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->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->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->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->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->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->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->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->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->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->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->RepositoriesEditButton),"clicked",G_CALLBACK(on_repo_edit),widgets);
g_signal_connect(G_OBJECT(widgets->MirrorConfigureButton),"clicked",G_CALLBACK(on_mirror_configure),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->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->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->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->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); // g_signal_connect(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->RepositoriesTree);

@ -32,7 +32,7 @@
#define glade_mirror_path_add_path "/com/ublinux/ui/ubl-settings-update-mirror-path-add.glade" #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_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 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 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) #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_parameter_command yon_char_unite("ubconfig --source global get [update] REPOSITORY",NULL)
#define REPOSITORY_search "REPOSITORY[" #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 "REPOPUBLIC_NET"
#define REPOPUBLIC_NET_parameter_command "ubconfig --source global get [update] REPOPUBLIC_NET" #define REPOPUBLIC_NET_parameter_command "ubconfig --source global get [update] REPOPUBLIC_NET"
#define REPOPUBLIC_WEB "REPOPUBLIC_WEB" #define REPOPUBLIC_WEB "REPOPUBLIC_WEB"
@ -151,6 +157,13 @@ typedef struct {
GtkWidget *WebPublicationUpperTree; GtkWidget *WebPublicationUpperTree;
GtkListStore *WebPublicationList; GtkListStore *WebPublicationList;
GtkWidget *FtpUpdateButton;
GtkWidget *FtpAddButton;
GtkWidget *FtpEditButton;
GtkWidget *FtpRemoveButton;
GtkWidget *FtpTree;
GtkListStore *FtpList;
GtkWidget *MirrorPublicCheck; GtkWidget *MirrorPublicCheck;
GtkWidget *MirrorTree; GtkWidget *MirrorTree;
GtkWidget *MirrorUpdateButton; GtkWidget *MirrorUpdateButton;
@ -196,11 +209,13 @@ typedef struct {
} repo_add_window; } repo_add_window;
typedef struct { typedef struct {
GtkListStore *list;
GtkWidget *PathEntry;
GtkWidget *Window; GtkWidget *Window;
GtkWidget *HeadLabel; GtkWidget *HeadLabel;
GtkWidget *StatusBox; GtkWidget *StatusBox;
GtkWidget *EnablePublishCheck; GtkWidget *EnablePublishCheck;
GtkWidget *PathEntry;
GtkWidget *PathButton; GtkWidget *PathButton;
GtkWidget *RepositoriesTree; GtkWidget *RepositoriesTree;
GtkWidget *PortCheck; GtkWidget *PortCheck;
@ -214,7 +229,6 @@ typedef struct {
GtkWidget *PasswordButton; GtkWidget *PasswordButton;
GtkWidget *AcceptButton; GtkWidget *AcceptButton;
GtkWidget *CancelButton; GtkWidget *CancelButton;
GtkListStore *list;
GtkCellRenderer *SelectionCellRenderer; GtkCellRenderer *SelectionCellRenderer;
char *name; char *name;
@ -303,6 +317,29 @@ typedef struct {
int edits; int edits;
} path_section; } 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_save_done(main_window *, config_str output, int size);
void on_toggle_button_toggled(GtkWidget *self, main_window *widgets); 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_repo_move_down(GtkWidget *,main_window *widgets);
void on_save_start(main_window *widgets, char* path); void on_save_start(main_window *widgets, char* path);
void on_repo_file_chooser_open(GtkWidget *, repo_add_window *window); 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 #endif

@ -32,6 +32,7 @@ Configuration - configuration path")
http_proxy - proxy-server for repository, replaces 'http_proxy'. Single parameter per repository\n\ 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") mirrorlist - mirrors file, make sure server URL is NOT included in this file! Single parameter per repository")
#define PASSWORD_INPUT_LABEL _("Password input") #define PASSWORD_INPUT_LABEL _("Password input")
#define REMOVE_FTP_TITLE_LABEL _("Remove repository")
/* /*
#define _LABEL _("Signature verification will not be performed") #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 _("Encryption")
#define _LABEL _("Password") #define _LABEL _("Password")
#define _LABEL _("Repeat 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 #endif

@ -0,0 +1,367 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface domain="ubl-settings-update">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubl-settings-update.css -->
<object class="GtkListStore" id="ReposList">
<columns>
<!-- column-name Enabled -->
<column type="gboolean"/>
<!-- column-name RepoName -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">65535</property>
<property name="value">8080</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</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.accept-symbolic</property>
</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.cancel-uncolored-symbolic</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.zoom-symbolic</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.avatar-symbolic</property>
</object>
<object class="GtkWindow" id="Window">
<property name="width-request">450</property>
<property name="height-request">350</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="window-position">center-on-parent</property>
<property name="icon-name">com.ublinux.ubl-settings-update</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="StatusBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</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-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="GtkCheckButton" id="EnableCheck">
<property name="label" translatable="yes">Enable publishing of a local repository and as a FTP resource</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Storage:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="StorageEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="StorageButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open file explorer</property>
<property name="image">image3</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="ReposTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">ReposList</property>
<property name="search-column">1</property>
<property name="enable-grid-lines">both</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Chosen</property>
<child>
<object class="GtkCellRendererToggle" id="SelectionCell"/>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Repository name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Port:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="PortCheck">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="PortSpin">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="adjustment">adjustment1</property>
<property name="value">8080</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Anonymous user:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="AnonUserCheck">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="AnonUserEntry">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="AnonUserButton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open user list</property>
<property name="image">image4</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child type="title">
<object class="GtkLabel">
<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">2</property>
<property name="label" translatable="yes">Add repository for publication</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</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">image2</property>
</object>
</child>
<child>
<object class="GtkButton" id="AcceptButton">
<property name="label" translatable="yes">Accept</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image1</property>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

@ -437,7 +437,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<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">The number of consecutie days that systems on the network have not been updated:</property> <property name="label" translatable="yes">The number of consecutive days that systems on the network have not been updated:</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

@ -25,6 +25,29 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<!-- interface-license-type gplv2 --> <!-- interface-license-type gplv2 -->
<!-- interface-name ubl-settings-update --> <!-- interface-name ubl-settings-update -->
<!-- interface-copyright UBGroup --> <!-- interface-copyright UBGroup -->
<object class="GtkListStore" id="FtpList">
<columns>
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name Storage -->
<column type="gchararray"/>
<!-- column-name Repos -->
<column type="gchararray"/>
<!-- column-name Port -->
<column type="gchararray"/>
<!-- column-name User -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0">True</col>
<col id="1" translatable="yes">file:///home/testrepo</col>
<col id="2" translatable="yes">main</col>
<col id="3" translatable="yes">8080</col>
<col id="4" translatable="yes">superadmin</col>
</row>
</data>
</object>
<object class="GtkListStore" id="MirrorList"> <object class="GtkListStore" id="MirrorList">
<columns> <columns>
<!-- column-name Repository --> <!-- column-name Repository -->
@ -131,11 +154,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.settings-symbolic</property> <property name="icon-name">com.ublinux.libublsettingsui-gtk3.settings-symbolic</property>
</object> </object>
<object class="GtkImage" id="image19">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.sync-symbolic</property>
</object>
<object class="GtkImage" id="image2"> <object class="GtkImage" id="image2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.sync-symbolic</property> <property name="icon-name">com.ublinux.libublsettingsui-gtk3.sync-symbolic</property>
</object> </object>
<object class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.increase-symbolic</property>
</object>
<object class="GtkImage" id="image21">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-edit-symbolic</property>
</object>
<object class="GtkImage" id="image22">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.trash-symbolic</property>
</object>
<object class="GtkImage" id="image3"> <object class="GtkImage" id="image3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
@ -1474,6 +1517,245 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="tab-fill">False</property> <property name="tab-fill">False</property>
</packing> </packing>
</child> </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-top">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Setting up publishing of a repository and/or repositories as a local FTP resource</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="foreground" value="#33722f2e7a06"/>
<attribute name="size" value="12288"/>
</attributes>
</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="spacing">5</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="GtkButton" id="FtpUpdateButton">
<property name="width-request">26</property>
<property name="height-request">26</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Update</property>
<property name="image">image19</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="FtpAddButton">
<property name="width-request">26</property>
<property name="height-request">26</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Add</property>
<property name="image">image20</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="FtpEditButton">
<property name="width-request">26</property>
<property name="height-request">26</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Edit</property>
<property name="image">image21</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="FtpRemoveButton">
<property name="width-request">26</property>
<property name="height-request">26</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Remove</property>
<property name="image">image22</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="FtpTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">FtpList</property>
<property name="enable-grid-lines">both</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Enabled</property>
<child>
<object class="GtkCellRendererToggle"/>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="sizing">autosize</property>
<property name="title" translatable="yes">Storage</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Repositories</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Port</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Anonymous user</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">4</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">FTP-publication</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab-fill">False</property>
</packing>
</child>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1713,7 +1995,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</child> </child>
</object> </object>
<packing> <packing>
<property name="position">4</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child type="tab"> <child type="tab">
@ -1724,7 +2006,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="label" translatable="yes">Mirror publication</property> <property name="label" translatable="yes">Mirror publication</property>
</object> </object>
<packing> <packing>
<property name="position">4</property> <property name="position">5</property>
<property name="tab-fill">False</property> <property name="tab-fill">False</property>
</packing> </packing>
</child> </child>

Loading…
Cancel
Save