|
|
|
|
@ -422,7 +422,8 @@ void on_repo_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_repo_accept_clicked),dict);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->RepoNameEntry),target);
|
|
|
|
|
window->name = yon_char_new(target);
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(config(REPOSITORY(target)),&size,";");
|
|
|
|
|
if (size){
|
|
|
|
|
@ -453,10 +454,8 @@ void on_repo_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->RepoSignConditionCombo),siglevel[1]);
|
|
|
|
|
}
|
|
|
|
|
if (size>2&&!yon_char_is_empty(parsed[2])){} //usage
|
|
|
|
|
if (size>3&&!yon_char_is_empty(parsed[3])){ //disable
|
|
|
|
|
if (strcmp(parsed[3],"disable")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnabledCheck),1);
|
|
|
|
|
}
|
|
|
|
|
if (size<3||yon_char_is_empty(parsed[3])||strcmp(parsed[3],"disable")){ //disable
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnabledCheck),1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
@ -493,6 +492,7 @@ void on_web_publish_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
window->name = full_name;
|
|
|
|
|
char *parameter = config(REPOPUBLIC_WEB_full(full_name));
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,":");
|
|
|
|
|
@ -542,6 +542,7 @@ void on_mirror_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)),NULL,&iter);
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->MirrorList),&iter,0,&target,-1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->NameEntry),target);
|
|
|
|
|
window->name = target;
|
|
|
|
|
char *parameter = config(REPOPUBLIC_CACHE_full(target));
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,",");
|
|
|
|
|
@ -581,13 +582,13 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
|
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*);
|
|
|
|
|
|
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck));
|
|
|
|
|
const char *repo_name = gtk_entry_get_text(GTK_ENTRY(window->RepoNameEntry));
|
|
|
|
|
if (yon_char_is_empty(repo_name)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->RepoNameEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck));
|
|
|
|
|
char *sources = "";
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(window->SourceBox));
|
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
|
@ -617,6 +618,9 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
|
|
|
|
|
|
char *final = yon_char_unite(sources,";",sign_level_package,",",sign_level_condiition,";",";",enabled?"":"disable",NULL);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(window->name)&&strcmp(repo_name,window->name)){
|
|
|
|
|
yon_config_remove_by_key(REOSITORY_command(window->name));
|
|
|
|
|
}
|
|
|
|
|
yon_config_register(REPOSITORY(repo_name),REOSITORY_command(repo_name),final);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
@ -663,6 +667,9 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
|
}
|
|
|
|
|
char *final_name = yon_char_is_empty(full_name)||!disabled ? name : yon_char_unite(name,":",full_name,NULL);
|
|
|
|
|
char *final = yon_char_unite(enabled?"enable":"disable",":",enable_browser?"listing":"",":",port_enabled?port:"",":",username_check?username:"",":",username_check?yon_char_is_empty(encryption)? user_password:encryption:"",":",username_check?!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_command(window->name));
|
|
|
|
|
}
|
|
|
|
|
yon_config_register(REPOPUBLIC_WEB_full(final_name),REPOPUBLIC_WEB_command(final_name),final);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
@ -683,6 +690,9 @@ void on_mirror_accept(GtkWidget *,dictionary *dict){
|
|
|
|
|
g_list_free(container);
|
|
|
|
|
}
|
|
|
|
|
g_list_free(list);
|
|
|
|
|
if (!yon_char_is_empty(window->name)&&strcmp(name,window->name)){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full(window->name));
|
|
|
|
|
}
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full(name),REPOPUBLIC_CACHE_full_command(name),paths);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
@ -779,6 +789,7 @@ repo_add_window *yon_repo_add_window_new(){
|
|
|
|
|
window->SourceBox = yon_gtk_builder_get_widget(builder,"SourceBox");
|
|
|
|
|
window->RepoSourceAddButton = yon_gtk_builder_get_widget(builder,"RepoSourceAddButton");
|
|
|
|
|
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepoSourceButton),"clicked",G_CALLBACK(on_file_chooser_open),window->RepoSourceEntry);
|
|
|
|
|
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);
|
|
|
|
|
@ -810,6 +821,7 @@ web_publication_add_window *yon_web_publication_add_window_new(){
|
|
|
|
|
window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
|
|
|
|
|
window->SelectionCellRenderer = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"SelectionCellRenderer"));
|
|
|
|
|
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SelectionCellRenderer),"toggled",G_CALLBACK(on_cell_renderer_toggle_toggled),window->RepositoriesTree);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_file_chooser_open),window->PathEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PathEntry),"changed",G_CALLBACK(on_web_publish_path_changed),window);
|
|
|
|
|
@ -867,6 +879,8 @@ mirror_add_window *yon_mirror_add_window_new(){
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
window->PathBox = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
|
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->TypeButton),"clicked",G_CALLBACK(on_file_chooser_open),window->TypeEntry);
|
|
|
|
|
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);
|
|
|
|
|
|