|
|
|
@ -19,6 +19,7 @@ void on_move_storage_changed(GtkWidget *self, repo_add_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_move_repo_changed(GtkWidget *self, repo_add_window *window){
|
|
|
|
void on_move_repo_changed(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
|
|
|
if (gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveSourceArchEntry))) return;
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->MoveTargetArchEntry));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->MoveTargetArchEntry));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->MoveSourceArchEntry));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(window->MoveSourceArchEntry));
|
|
|
|
GtkWidget *check_repo = NULL;
|
|
|
|
GtkWidget *check_repo = NULL;
|
|
|
|
@ -49,6 +50,13 @@ void on_move_repo_changed(GtkWidget *self, repo_add_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(current_repo_selection)||!yon_char_is_empty(check_repo_selection)){
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->MoveSourceArchEntry,1);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->MoveTargetArchEntry,1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->MoveSourceArchEntry,0);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->MoveTargetArchEntry,0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -176,7 +184,26 @@ void on_move_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
const char *source_repo = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveSourceRepoEntry));
|
|
|
|
const char *source_repo = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveSourceRepoEntry));
|
|
|
|
const char *target_repo = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveTargetRepoEntry));
|
|
|
|
const char *target_repo = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveTargetRepoEntry));
|
|
|
|
const char *arch = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveSourceArchEntry));
|
|
|
|
const char *arch = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->MoveSourceArchEntry));
|
|
|
|
|
|
|
|
if (yon_char_is_empty(storage)){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->MoveSourceStorageEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (yon_char_is_empty(source_repo)){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->MoveSourceRepoEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (yon_char_is_empty(target_repo)){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->MoveTargetRepoEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (yon_char_is_empty(arch)) {
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->MoveSourceArchEntry);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
const char *repo_sign = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSignCombo));
|
|
|
|
const char *repo_sign = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSignCombo));
|
|
|
|
if (!yon_char_is_empty(storage)&&!yon_char_is_empty(source_repo)&&!yon_char_is_empty(target_repo)&&!yon_char_is_empty(arch)){
|
|
|
|
if (!yon_char_is_empty(storage)&&!yon_char_is_empty(source_repo)&&!yon_char_is_empty(target_repo)&&!yon_char_is_empty(arch)){
|
|
|
|
|
|
|
|
|
|
|
|
@ -237,22 +264,12 @@ void yon_move_window_set_selected(main_window *widgets, repo_add_window *window)
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),NULL,&iter)){
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),NULL,&iter)){
|
|
|
|
int depth = gtk_tree_store_iter_depth(widgets->RepoList,&iter);
|
|
|
|
int depth = gtk_tree_store_iter_depth(widgets->RepoList,&iter);
|
|
|
|
char *storage=NULL, *repo=NULL, *arch=NULL;
|
|
|
|
char *storage=NULL, *repo=NULL, *arch=NULL;
|
|
|
|
switch (depth){
|
|
|
|
storage_struct *storage_str;
|
|
|
|
case 0: //storage
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&iter,7,&storage_str,-1);
|
|
|
|
{
|
|
|
|
if (depth==2){
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&iter,3,&storage,-1);
|
|
|
|
storage = ((arch_struct*)storage_str)->storage_path;
|
|
|
|
}break;
|
|
|
|
repo = ((arch_struct*)storage_str)->repo_name;
|
|
|
|
case 1: //repo
|
|
|
|
arch = ((arch_struct*)storage_str)->name;
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&iter,2,&repo,-1);
|
|
|
|
|
|
|
|
gtk_tree_model_iter_parent(GTK_TREE_MODEL(widgets->RepoList),&itar, &iter);
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&itar,3,&storage,-1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: //arch
|
|
|
|
|
|
|
|
gtk_tree_model_iter_parent(GTK_TREE_MODEL(widgets->RepoList),&itar, &iter);
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&itar,2,&repo,-1);
|
|
|
|
|
|
|
|
gtk_tree_model_iter_parent(GTK_TREE_MODEL(widgets->RepoList),&itor, &itar);
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RepoList),&itor,3,&storage,-1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(storage)) gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->MoveSourceStorageEntry),storage);
|
|
|
|
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();
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|