Choosement check fixes

pull/120/head
parent fe314ed30c
commit b190d64534
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -157,6 +157,22 @@ void on_add_packages_accept(GtkWidget *self, dictionary *dict){
const char *repo = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepositoryCombo));
const char *arch = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ArchitectureCombo));
if (yon_char_is_empty(storage)||yon_char_is_empty(repo)||yon_char_is_empty(arch)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->StorageCombo);
return;
}
if (yon_char_is_empty(repo)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->RepositoryCombo);
return;
}
if (yon_char_is_empty(arch)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->ArchitectureCombo);
return;
}
const char *repo_sign = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSignCombo));
const char *package_sign = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->PackageSignCombo));
GtkTreeIter iter;
@ -169,6 +185,12 @@ void on_add_packages_accept(GtkWidget *self, dictionary *dict){
yon_char_parsed_add_or_create_if_exists(parsed, &size,path);
}
if (!size){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PACKAGES_REMOVE_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->PackagesTree);
return;
}
char *packages = yon_char_parsed_to_string(parsed,size," ");
char *command = NULL;
if (repo_sign&&package_sign){
@ -220,6 +242,11 @@ void yon_add_window_set_selected(main_window *widgets, repo_add_window *window){
storage = ((arch_struct*)storage_str)->storage_path;
repo = ((arch_struct*)storage_str)->repo_name;
arch = ((arch_struct*)storage_str)->name;
} else if (depth==1){
storage = ((repo_struct*)storage_str)->storage_path;
repo = ((arch_struct*)storage_str)->name;
} else if (depth == 0){
storage = storage_str->path;
}
if (!yon_char_is_empty(storage)) gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->StorageCombo),storage);
while(gtk_events_pending()) gtk_main_iteration();

@ -281,6 +281,11 @@ void yon_move_window_set_selected(main_window *widgets, repo_add_window *window)
storage = ((arch_struct*)storage_str)->storage_path;
repo = ((arch_struct*)storage_str)->repo_name;
arch = ((arch_struct*)storage_str)->name;
} else if (depth==1){
storage = ((repo_struct*)storage_str)->storage_path;
repo = ((arch_struct*)storage_str)->name;
} else if (depth == 0){
storage = storage_str->path;
}
if (!yon_char_is_empty(storage)) gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->MoveSourceStorageEntry),storage);
while(gtk_events_pending()) gtk_main_iteration();

@ -17,7 +17,22 @@ void on_remove_accept(GtkWidget *self, dictionary *dict){
const char *arch = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->ArchitectureCombo));
const char *sign = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSignCombo));
if (!yon_char_is_empty(storage_path)){
if (yon_char_is_empty(storage_path)||yon_char_is_empty(repo)||yon_char_is_empty(arch)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->StorageCombo);
return;
}
if (yon_char_is_empty(repo)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->RepositoryCombo);
return;
}
if (yon_char_is_empty(arch)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->ArchitectureCombo);
return;
}
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(window->PackagesList);
int size;
@ -29,15 +44,17 @@ void on_remove_accept(GtkWidget *self, dictionary *dict){
char *filename = yon_char_divide(target,yon_char_find_last(target,'/'));
yon_char_parsed_add_or_create_if_exists(packages,&size,target);
}
if (size){
if (!size){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PACKAGES_REMOVE_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->PackagesTree);
return;
}
char *final = yon_char_parsed_to_string(packages,size," ");
char *command = remove_packages_command(storage_path,arch,repo,final,sign);
if (system(yon_debug_output("%s\n",command))){
yon_ubl_status_box_render(PACKAGES_REMOVE_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_render(PACKAGES_REMOVE_ERROR_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
} else {
yon_ubl_status_box_render(PACKAGES_REMOVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
}
}
}
gtk_widget_destroy(window->MainWindow);
free(window);

Loading…
Cancel
Save