|
|
|
|
@ -91,7 +91,7 @@ file_chooser_window *yon_file_chooser_window_new(){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_filechooser);
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"Window");
|
|
|
|
|
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"webHeaderNameLabel2");
|
|
|
|
|
window->ChooseButton = yon_gtk_builder_get_widget(builder,"ChooseButton");
|
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
|
window->NameEntry = yon_gtk_builder_get_widget(builder,"NameEntry");
|
|
|
|
|
@ -123,18 +123,20 @@ void on_storage_open(GtkWidget *self, storage_config_window *window){
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(window->StoragePathCombo),on_storage_changed,window);
|
|
|
|
|
yon_gtk_combo_box_text_find(window->StoragePathCombo,path);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(window->StoragePathCombo),on_storage_changed,window);
|
|
|
|
|
yon_window_config_add_instant_parameter(path,"storage_info","",YON_TYPE_STRING);
|
|
|
|
|
config_str repos_list = yon_file_list_dirs(path,&repos_size);
|
|
|
|
|
for (int i=0;i<repos_size;i++){
|
|
|
|
|
if (strcmp(repos_list[i],"pool")){
|
|
|
|
|
char *render_name = yon_char_new(repos_list[i]);
|
|
|
|
|
free(yon_char_divide(render_name,yon_char_find_last(render_name,'/')));
|
|
|
|
|
gtk_tree_store_append(window->storages_copy,&itar,&iter);
|
|
|
|
|
gtk_tree_store_set(window->storages_copy,&itar,2,render_name,3,repos_list[i],-1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->AddEntry),render_name);
|
|
|
|
|
on_repo_add(self,window);
|
|
|
|
|
free(render_name);
|
|
|
|
|
} else {
|
|
|
|
|
repos_list = yon_char_parsed_rip(repos_list,&repos_size,i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(repos_list,repos_size);
|
|
|
|
|
yon_window_config_add_instant_parameter(path,"storage_info","",YON_TYPE_STRING);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_storage_config_update(window);
|
|
|
|
|
@ -292,6 +294,9 @@ void on_storage_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
yon_gtk_tree_store_copy_full(window->storages_copy,main_config.tree_store);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),GTK_TREE_MODEL(main_config.tree_store));
|
|
|
|
|
yon_window_config_save_instant();
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->StoragePathCombo),GTK_TREE_MODEL(window->storages_copy),&iter))
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),&iter);
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
yon_ubl_status_box_render(STORAGES_SAVED_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
@ -538,12 +543,14 @@ void on_add_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
yon_char_remove_last_symbol(name[0],'\n');
|
|
|
|
|
if (name_size<=0){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(dialog->StatusBox),PACKAGE_NAME_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
if (!yon_gtk_tree_model_check_exist(GTK_TREE_MODEL(window->PackagesList),&iter,name[0],1)){
|
|
|
|
|
if (name_size<=0){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(dialog->StatusBox),PACKAGE_NAME_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
gtk_list_store_append(window->PackagesList,&itar);
|
|
|
|
|
gtk_list_store_set(window->PackagesList,&itar,1,name[0],2,current,3,1,-1);
|
|
|
|
|
}
|
|
|
|
|
gtk_list_store_append(window->PackagesList,&itar);
|
|
|
|
|
gtk_list_store_set(window->PackagesList,&itar,1,name[0],2,current,3,1,-1);
|
|
|
|
|
yon_char_parsed_free(name,name_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -652,6 +659,9 @@ void on_add_packages_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
gtk_tree_store_clear(widgets->RepoList);
|
|
|
|
|
yon_gtk_tree_store_copy_full(window->tree_copy,widgets->RepoList);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),GTK_TREE_MODEL(widgets->RepoList));
|
|
|
|
|
|
|
|
|
|
yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->ArchitectureCombo),GTK_TREE_MODEL(window->tree_copy),&iter);
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),&iter);
|
|
|
|
|
gtk_widget_destroy(window->MainWindow);
|
|
|
|
|
yon_ubl_status_box_render(PACKAGES_ADD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
@ -782,8 +792,10 @@ void on_move_add_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
yon_char_remove_last_symbol(name[0],'\n');
|
|
|
|
|
gtk_list_store_append(window->PackagesList,&iter);
|
|
|
|
|
gtk_list_store_set(window->PackagesList,&iter,1,name[0],2,path,-1);
|
|
|
|
|
if (!yon_gtk_tree_model_check_exist(GTK_TREE_MODEL(window->PackagesList),&iter,name[0],1)){
|
|
|
|
|
gtk_list_store_append(window->PackagesList,&iter);
|
|
|
|
|
gtk_list_store_set(window->PackagesList,&iter,1,name[0],2,path,-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -852,7 +864,10 @@ void on_move_remove_package(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_move_accept(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
void on_move_accept(GtkWidget *self, 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 size = 0;
|
|
|
|
|
config_str packages = NULL;
|
|
|
|
|
GtkTreeIter iter,itar;
|
|
|
|
|
@ -878,6 +893,13 @@ void on_move_accept(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
yon_debug_output("%s\n",command);
|
|
|
|
|
if (!system(command)){
|
|
|
|
|
yon_ubl_status_box_render(PACKAGES_MOVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),NULL);
|
|
|
|
|
gtk_tree_store_clear(widgets->RepoList);
|
|
|
|
|
yon_gtk_tree_store_copy_full(window->tree_copy,widgets->RepoList);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),GTK_TREE_MODEL(widgets->RepoList));
|
|
|
|
|
|
|
|
|
|
yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->ArchitectureCombo),GTK_TREE_MODEL(window->tree_copy),&iter);
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),&iter);
|
|
|
|
|
on_subwindow_close(window->MainWindow);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -911,6 +933,9 @@ void on_move_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PackageSignCombo),0);
|
|
|
|
|
|
|
|
|
|
gtk_widget_destroy(gtk_widget_get_parent(window->StorageCombo));
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
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->MoveSourceStorageEntry),"changed",G_CALLBACK(on_move_storage_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->MoveSourceRepoEntry),"changed",G_CALLBACK(on_move_repo_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->MoveSourceArchEntry),"changed",G_CALLBACK(on_move_arch_changed),window);
|
|
|
|
|
@ -920,7 +945,7 @@ void on_move_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddPackageButton),"clicked",G_CALLBACK(on_move_add_package),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RemoveButton),"clicked",G_CALLBACK(on_move_remove_package),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_move_accept),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_move_accept),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->MoveSourceRepoEntry),"changed",G_CALLBACK(on_repo_sign_load),window);
|
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
|
}
|
|
|
|
|
@ -961,7 +986,9 @@ void on_remove_arch_selection_changed(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_remove_accept(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
void on_remove_accept(GtkWidget *self, 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*);
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
const char *storage_id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->StorageCombo));
|
|
|
|
|
@ -990,6 +1017,13 @@ void on_remove_accept(GtkWidget *self, repo_add_window *window){
|
|
|
|
|
yon_debug_output("%s\n",command);
|
|
|
|
|
if (!system(command)){
|
|
|
|
|
yon_ubl_status_box_render(PACKAGES_MOVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),NULL);
|
|
|
|
|
gtk_tree_store_clear(widgets->RepoList);
|
|
|
|
|
yon_gtk_tree_store_copy_full(window->tree_copy,widgets->RepoList);
|
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ReposTree),GTK_TREE_MODEL(widgets->RepoList));
|
|
|
|
|
|
|
|
|
|
yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->ArchitectureCombo),GTK_TREE_MODEL(window->tree_copy),&iter);
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),&iter);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_TO_SAVE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
@ -1023,12 +1057,14 @@ void on_remove_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
gtk_widget_hide(gtk_widget_get_parent(window->PackageSignCombo));
|
|
|
|
|
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(window->AddButton),REMOVE_LABEL);
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
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->ArchitectureCombo),"changed",G_CALLBACK(on_arch_chosen),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->StorageCombo),"changed",G_CALLBACK(on_add_target_repo_selection_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepositoryCombo),"changed",G_CALLBACK(on_add_target_arch_selection_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ArchitectureCombo),"changed",G_CALLBACK(on_remove_arch_selection_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_remove_accept),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_remove_accept),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddPackageButton),"clicked",G_CALLBACK(on_remove_add_package),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RemoveButton),"clicked",G_CALLBACK(on_move_remove_package),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepositoryCombo),"changed",G_CALLBACK(on_repo_sign_load),window);
|
|
|
|
|
|