|
|
|
|
@ -738,19 +738,31 @@ void on_repo_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
int cur_size;
|
|
|
|
|
config_str repos = yon_char_parse(parsed[0],&cur_size,",");
|
|
|
|
|
for (int i=0;i<cur_size;i++){
|
|
|
|
|
char *target = repos[i];
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
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")),target);
|
|
|
|
|
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"));
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_repo_path_add_path);
|
|
|
|
|
|
|
|
|
|
path_section *section = malloc(sizeof(path_section));
|
|
|
|
|
section->PathRemovalBox = yon_gtk_builder_get_widget(builder,"PathRemovalBox");
|
|
|
|
|
section->PathEditButton = yon_gtk_builder_get_widget(builder,"PathEditButton");
|
|
|
|
|
section->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
|
section->PathRemoveButton = yon_gtk_builder_get_widget(builder,"PathRemoveButton");
|
|
|
|
|
section->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo");
|
|
|
|
|
section->edits=0;
|
|
|
|
|
|
|
|
|
|
if (strstr(repos[i],"@")){
|
|
|
|
|
char *type = yon_char_divide_search(repos[i],"@",-1);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(section->TypeCombo),type);
|
|
|
|
|
free(type);
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(section->TypeCombo),4);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(window->sections,(char*)target,section);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(section->PathEntry),repos[i]);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->SourceBox),section->PathRemovalBox,0,0,2);
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),window);
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(repos,cur_size);
|
|
|
|
|
}
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){ //siglevel
|
|
|
|
|
int cur_size;
|
|
|
|
|
@ -908,18 +920,25 @@ void on_mirror_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,",");
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
char *target = parsed[i];
|
|
|
|
|
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->TypeEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->TypeEntry),"");
|
|
|
|
|
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,2);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),target);
|
|
|
|
|
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_object_unref(G_OBJECT(builder));
|
|
|
|
|
|
|
|
|
|
path_section *section = malloc(sizeof(path_section));
|
|
|
|
|
section->PathRemovalBox = yon_gtk_builder_get_widget(builder,"PathRemovalBox");
|
|
|
|
|
section->PathEditButton = yon_gtk_builder_get_widget(builder,"PathEditButton");
|
|
|
|
|
section->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
|
section->PathRemoveButton = yon_gtk_builder_get_widget(builder,"PathRemoveButton");
|
|
|
|
|
section->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo");
|
|
|
|
|
section->edits=0;
|
|
|
|
|
|
|
|
|
|
char *type = yon_char_divide_search(parsed[i],"@",-1);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(section->TypeCombo),type);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(window->sections,(char*)target,section);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(section->PathEntry),parsed[i]);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->PathBox),section->PathRemovalBox,0,0,2);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),window);
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
@ -998,8 +1017,8 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
|
char *sources = "";
|
|
|
|
|
dictionary *dact = NULL;
|
|
|
|
|
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 *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 *temp = yon_char_unite(sources,!yon_char_is_empty(sources)?",":"",cur,NULL);
|
|
|
|
|
if (!yon_char_is_empty(sources)) free(sources);
|
|
|
|
|
sources = temp;
|
|
|
|
|
@ -1295,14 +1314,12 @@ void on_mirror_path_edit(GtkWidget *self,mirror_add_window *window){
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(((path_section*)dict->data)->PathEntry),0);
|
|
|
|
|
gtk_widget_set_sensitive(((path_section*)dict->data)->TypeCombo,0);
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(((path_section*)dict->data)->PathEditButton));
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(((path_section*)dict->data)->PathEntry),0);
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),edit_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
} else {
|
|
|
|
|
((path_section*)dict->data)->edits=0;
|
|
|
|
|
gtk_widget_set_sensitive(((path_section*)dict->data)->TypeCombo,1);
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(((path_section*)dict->data)->PathEntry),1);
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(((path_section*)dict->data)->PathEditButton));
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(((path_section*)dict->data)->PathEntry),1);
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),accept_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|