|
|
|
@ -40,6 +40,11 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
|
|
|
|
gtk_list_store_clear(widgets->ReposList);
|
|
|
|
|
|
|
|
gtk_list_store_clear(widgets->MirrorList);
|
|
|
|
|
|
|
|
gtk_list_store_clear(widgets->UpdateRepoList);
|
|
|
|
|
|
|
|
gtk_list_store_clear(widgets->PublicationList);
|
|
|
|
|
|
|
|
gtk_list_store_clear(widgets->WebPublicationList);
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
char *repo_config = config(REPOSITORY_parameter);
|
|
|
|
char *repo_config = config(REPOSITORY_parameter);
|
|
|
|
if (!yon_char_is_empty(repo_config)){
|
|
|
|
if (!yon_char_is_empty(repo_config)){
|
|
|
|
@ -353,7 +358,7 @@ void on_mirror_configure(GtkWidget *,main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
// main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
repo_add_window *window = yon_dictionary_get_data(dict->first->next,repo_add_window*);
|
|
|
|
repo_add_window *window = yon_dictionary_get_data(dict->first->next,repo_add_window*);
|
|
|
|
|
|
|
|
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck));
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck));
|
|
|
|
@ -363,9 +368,19 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoNameEntry);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoNameEntry);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
char *source_mode = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RepoSourceCombo));
|
|
|
|
char *sources = "";
|
|
|
|
const char *source_path = gtk_entry_get_text(GTK_ENTRY(window->RepoSourceEntry));
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(window->SourceBox));
|
|
|
|
if (yon_char_is_empty(source_path)){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
|
|
|
|
GList *container = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,i)));
|
|
|
|
|
|
|
|
// if (gtk_entry_get_has_frame(GTK_ENTRY(g_list_nth_data(container,0)))){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
char *cur = (char*)gtk_entry_get_text(GTK_ENTRY(g_list_nth_data(container,0)));
|
|
|
|
|
|
|
|
char *temp = yon_char_unite(sources,yon_char_is_empty(sources)?"":",",cur,NULL);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(sources)) free(sources);
|
|
|
|
|
|
|
|
sources = temp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (yon_char_is_empty(sources)){
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoSourceEntry);
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoSourceEntry);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -380,17 +395,17 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
// int usage_level_enable_install = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageEnableInsallCheck));
|
|
|
|
// int usage_level_enable_install = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageEnableInsallCheck));
|
|
|
|
// int usage_level_sysupgrade = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageSysupgradeCheck));
|
|
|
|
// int usage_level_sysupgrade = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageSysupgradeCheck));
|
|
|
|
|
|
|
|
|
|
|
|
char *final = yon_char_unite(source_mode,source_path,";",sign_level_package,",",sign_level_condiition,";",enabled?"":"disable",NULL);
|
|
|
|
char *final = yon_char_unite(sources,";",sign_level_package,",",sign_level_condiition,";",enabled?"":"disable",NULL);
|
|
|
|
|
|
|
|
|
|
|
|
yon_config_register(REPOSITORY(repo_name),REOSITORY_command(repo_name),final);
|
|
|
|
yon_config_register(REPOSITORY(repo_name),REOSITORY_command(repo_name),final);
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
free(window);
|
|
|
|
free(window);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
// main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
web_publication_add_window *window = yon_dictionary_get_data(dict->first->next,web_publication_add_window*);
|
|
|
|
web_publication_add_window *window = yon_dictionary_get_data(dict->first->next,web_publication_add_window*);
|
|
|
|
|
|
|
|
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnablePublishCheck));
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnablePublishCheck));
|
|
|
|
@ -406,13 +421,26 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
char *name = "";
|
|
|
|
char *name = "";
|
|
|
|
char *final = yon_char_unite(enabled?"enable":"disable",":",enable_browser?"listing":"",":",port_enabled?port:"",":",username_check?username:"",username_check?user_password:"",NULL);
|
|
|
|
char *final = yon_char_unite(enabled?"enable":"disable",":",enable_browser?"listing":"",":",port_enabled?port:"",":",username_check?username:"",username_check?user_password:"",NULL);
|
|
|
|
yon_config_register(REPOPUBLIC_WEB_full(name),REPOPUBLIC_WEB_command(name),final);
|
|
|
|
yon_config_register(REPOPUBLIC_WEB_full(name),REPOPUBLIC_WEB_command(name),final);
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_mirror_accept(GtkWidget *,dictionary *){
|
|
|
|
void on_mirror_accept(GtkWidget *,dictionary *dict){
|
|
|
|
// main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
// mirror_add_window *window = yon_dictionary_get_data(dict->first->next,mirror_add_window*);
|
|
|
|
mirror_add_window *window = yon_dictionary_get_data(dict->first->next,mirror_add_window*);
|
|
|
|
// char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
|
|
|
|
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
|
|
|
|
// char *path = (char*)gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
|
|
|
|
char *paths = "";
|
|
|
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(window->PathBox));
|
|
|
|
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
|
|
|
|
GList *container = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,i)));
|
|
|
|
|
|
|
|
char *cur = (char*)gtk_label_get_text(GTK_LABEL(g_list_nth_data(container,1)));
|
|
|
|
|
|
|
|
char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",cur,NULL);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(paths)) free(paths);
|
|
|
|
|
|
|
|
paths = temp;
|
|
|
|
|
|
|
|
g_list_free(container);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free(list);
|
|
|
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full(name),REPOPUBLIC_CACHE_full_command(name),paths);
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_removed(GtkWidget *, GtkWidget *target){
|
|
|
|
void on_mirror_path_removed(GtkWidget *, GtkWidget *target){
|
|
|
|
@ -421,6 +449,21 @@ void on_mirror_path_removed(GtkWidget *, GtkWidget *target){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_edit(GtkWidget*,GtkWidget *target){
|
|
|
|
|
|
|
|
GList *container = gtk_container_get_children(GTK_CONTAINER(target));
|
|
|
|
|
|
|
|
if (gtk_editable_get_editable(GTK_EDITABLE(g_list_nth_data(container,0)))){
|
|
|
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(g_list_nth_data(container,0)),0);
|
|
|
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(g_list_nth_data(container,1)));
|
|
|
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(g_list_nth_data(container,0)),0);
|
|
|
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),edit_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(g_list_nth_data(container,0)),1);
|
|
|
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(g_list_nth_data(container,1)));
|
|
|
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(g_list_nth_data(container,0)),1);
|
|
|
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),accept_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_add(GtkWidget *, mirror_add_window *window){
|
|
|
|
void on_mirror_path_add(GtkWidget *, mirror_add_window *window){
|
|
|
|
const char *target = gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
|
|
|
|
const char *target = gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
|
|
|
|
if (yon_char_is_empty(target)){
|
|
|
|
if (yon_char_is_empty(target)){
|
|
|
|
@ -432,12 +475,30 @@ void on_mirror_path_add(GtkWidget *, mirror_add_window *window){
|
|
|
|
char *full_name = yon_char_unite(type,"@",target,NULL);
|
|
|
|
char *full_name = yon_char_unite(type,"@",target,NULL);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->TypeEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->TypeEntry),"");
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path);
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->PathBox),yon_gtk_builder_get_widget(builder,"PathRemovalBox"),0,0,5);
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->PathBox),yon_gtk_builder_get_widget(builder,"PathRemovalBox"),0,0,2);
|
|
|
|
gtk_label_set_text(GTK_LABEL(gtk_builder_get_object(builder,"PathLabel")),full_name);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),full_name);
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),gtk_builder_get_object(builder,"PathRemovalBox"));
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),gtk_builder_get_object(builder,"PathRemovalBox"));
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),gtk_builder_get_object(builder,"PathRemovalBox"));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_repo_source_add(GtkWidget *, repo_add_window *window){
|
|
|
|
|
|
|
|
const char *target = gtk_entry_get_text(GTK_ENTRY(window->RepoSourceEntry));
|
|
|
|
|
|
|
|
if (yon_char_is_empty(target)){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoSourceEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSourceCombo));
|
|
|
|
|
|
|
|
char *full_name = yon_char_append(type,target);
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->RepoSourceEntry),"");
|
|
|
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path);
|
|
|
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->SourceBox),yon_gtk_builder_get_widget(builder,"PathRemovalBox"),0,0,2);
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),full_name);
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),gtk_builder_get_object(builder,"PathRemovalBox"));
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),gtk_builder_get_object(builder,"PathRemovalBox"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
repo_add_window *yon_repo_add_window_new(){
|
|
|
|
repo_add_window *yon_repo_add_window_new(){
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_repo_add_path);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_repo_add_path);
|
|
|
|
repo_add_window *window = malloc(sizeof(repo_add_window));
|
|
|
|
repo_add_window *window = malloc(sizeof(repo_add_window));
|
|
|
|
@ -458,7 +519,10 @@ repo_add_window *yon_repo_add_window_new(){
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
|
|
|
window->SourceBox = yon_gtk_builder_get_widget(builder,"SourceBox");
|
|
|
|
|
|
|
|
window->RepoSourceAddButton = yon_gtk_builder_get_widget(builder,"RepoSourceAddButton");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepoSourceAddButton),"clicked",G_CALLBACK(on_repo_source_add),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
|
|
@ -539,9 +603,6 @@ mirror_add_window *yon_mirror_add_window_new(){
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
window->PathBox = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
window->PathBox = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
window->PathRemovalBox = yon_gtk_builder_get_widget(builder,"PathRemovalBox");
|
|
|
|
|
|
|
|
window->PathRemoveButton = yon_gtk_builder_get_widget(builder,"PathRemoveButton");
|
|
|
|
|
|
|
|
window->PathLabel = yon_gtk_builder_get_widget(builder,"PathLabel");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_mirror_path_add),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_mirror_path_add),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|