Changed sources logic at repo window; changed types logic at mirror window

pull/59/head
parent 9e6e6fbff2
commit 1e5002078a

@ -1036,7 +1036,7 @@ 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*);
if (!window->sections) { if (!window->sections&&yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(window->RepoSourceEntry)))) {
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); 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->SourceListBox)); yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(window->SourceListBox));
return; return;
@ -1050,6 +1050,7 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck)); int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnabledCheck));
char *sources = ""; char *sources = "";
dictionary *dact = NULL; dictionary *dact = NULL;
if (window->sections){
for_dictionaries (dact, window->sections){ for_dictionaries (dact, window->sections){
char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(((path_section*)dact->data)->TypeCombo)); char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(((path_section*)dact->data)->TypeCombo));
char *cur = yon_char_unite(type?type:"",type?"@":"",(char*)gtk_entry_get_text(GTK_ENTRY(((path_section*)dact->data)->PathEntry)),NULL); char *cur = yon_char_unite(type?type:"",type?"@":"",(char*)gtk_entry_get_text(GTK_ENTRY(((path_section*)dact->data)->PathEntry)),NULL);
@ -1057,6 +1058,15 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
if (!yon_char_is_empty(sources)) free(sources); if (!yon_char_is_empty(sources)) free(sources);
sources = temp; sources = temp;
} }
}
char *source_main = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepoSourceEntry));
if (!yon_char_is_empty(source_main)) {
char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSourceCombo));
source_main = yon_char_unite(type?type:"",type?"@":"",source_main,NULL);
char *temp = yon_char_unite(sources,!yon_char_is_empty(sources)?",":"",source_main,NULL);
if (!yon_char_is_empty(sources)) free(sources);
sources = temp;
}
if (yon_char_is_empty(sources)){ 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);
@ -1200,21 +1210,30 @@ void on_web_publish_accept(GtkWidget *, dictionary *dict){
void on_mirror_accept(GtkWidget *,dictionary *dict){ 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*);
if (!window->sections) { if (!window->sections&&yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(window->TypeEntry)))) {
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); 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(gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent((window->PathBox)))))); yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent((window->PathBox))))));
return; return;
} }
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry)); char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
char *paths = ""; char *paths = "";
if (window->sections){
dictionary *dact = NULL; dictionary *dact = NULL;
for_dictionaries (dact, window->sections){ for_dictionaries (dact, window->sections){
char *cur = yon_char_unite(gtk_combo_box_get_active_id(GTK_COMBO_BOX(((path_section*)dact->data)->TypeCombo)),"@",(char*)gtk_entry_get_text(GTK_ENTRY(((path_section*)dact->data)->PathEntry)),NULL); char *cur = yon_char_unite(gtk_combo_box_get_active_id(GTK_COMBO_BOX(((path_section*)dact->data)->TypeCombo)),"@",(char*)gtk_entry_get_text(GTK_ENTRY(((path_section*)dact->data)->PathEntry)),NULL);
char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",cur,NULL); char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",cur,NULL);
if (!yon_char_is_empty(paths)) free(paths); if (!yon_char_is_empty(paths)) free(paths);
paths = temp; paths = temp;
} }
}
char *source_main = (char*)gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
if (!yon_char_is_empty(source_main)) {
char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->TypeCombo));
source_main = yon_char_unite(type?type:"",type?"@":"",source_main,NULL);
char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",source_main,NULL);
if (!yon_char_is_empty(paths)) free(paths);
paths = temp;
}
if (!yon_char_is_empty(window->name)&&strcmp(name,window->name)){ if (!yon_char_is_empty(window->name)&&strcmp(name,window->name)){
yon_config_remove_by_key(REPOPUBLIC_CACHE_full(window->name)); yon_config_remove_by_key(REPOPUBLIC_CACHE_full(window->name));
} }

Loading…
Cancel
Save