You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
8.0 KiB
134 lines
8.0 KiB
// #include "ubl-settings-repomanager.h"
|
|
|
|
|
|
// void on_remove_arch_selection_changed(GtkWidget *self, repo_add_window *window){
|
|
// if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ArchitectureCombo))==-1){
|
|
// gtk_widget_set_sensitive(window->AddPackageButton,0);
|
|
// } else {
|
|
// gtk_widget_set_sensitive(window->AddPackageButton,1);
|
|
// }
|
|
// }
|
|
|
|
// 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));
|
|
// char *storage_path;
|
|
// char *repo = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RepositoryCombo));
|
|
// char *arch = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->ArchitectureCombo));
|
|
|
|
// if (!yon_char_is_empty(storage_id)){
|
|
// gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->tree_copy),&iter,storage_id);
|
|
// gtk_tree_model_get(GTK_TREE_MODEL(window->tree_copy),&iter,3,&storage_path,-1);
|
|
// int size=0;
|
|
// config_str packages=NULL;
|
|
// for_iter(GTK_TREE_MODEL(window->PackagesList),&iter){
|
|
// char *target;
|
|
// gtk_tree_model_get(GTK_TREE_MODEL(window->PackagesList),&iter,1,&target,-1);
|
|
// yon_char_parsed_add_or_create_if_exists(packages,&size,target);
|
|
// }
|
|
// if (size){
|
|
// char *sign = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSignCombo));
|
|
// char *command;
|
|
// if (yon_char_is_empty(sign)){
|
|
// command = yon_delete_packages_command(storage_path,arch,repo,yon_char_parsed_to_string(packages,size," "));
|
|
// } else {
|
|
// command = yon_delete_packages_sign_command(storage_path,arch,repo,sign,yon_char_parsed_to_string(packages,size," "));
|
|
// }
|
|
// yon_debug_output("%s\n",command);
|
|
// if (!system(command)){
|
|
// yon_ubl_status_box_render(PACKAGES_REMOVE_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));
|
|
|
|
// const char *id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ArchitectureCombo));
|
|
// if (!yon_char_is_empty(id)){
|
|
// gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(widgets->RepoList),&iter,id);
|
|
// gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->ReposTree),gtk_tree_path_new_from_string(id));
|
|
// gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),&iter);
|
|
// on_main_tree_selection_changed(NULL,widgets);
|
|
// }
|
|
// }
|
|
// yon_config_load_update(widgets);
|
|
// } else {
|
|
// yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
// return;
|
|
// }
|
|
// }else {
|
|
// yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
// return;
|
|
// }
|
|
// gtk_widget_destroy(window->MainWindow);
|
|
// }
|
|
|
|
// void on_remove_add_package(GtkWidget *self, repo_add_window *window){
|
|
// if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ArchitectureCombo))>-1){
|
|
// file_chooser_window *dialog = yon_file_chooser_new();
|
|
// yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->MainWindow),CHOSE_PACKAGES_TITLE_LABEL,icon_path,"ChooseMoveFileChooserWindow");
|
|
// gtk_label_set_text(GTK_LABEL(dialog->HeadLabel),CHOSE_PACKAGES_TITLE_LABEL);
|
|
// GtkFileFilter *filter = gtk_file_filter_new();
|
|
// gtk_file_filter_add_pattern(filter,"*.pkg.tar*[^.sig]");
|
|
// gtk_file_filter_set_name(filter,"*.pkg.tar.*");
|
|
// gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog->FileChooserWidget),filter);
|
|
// GtkTreeIter iter,itar;
|
|
// yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->ArchitectureCombo),GTK_TREE_MODEL(window->tree_copy),&iter);
|
|
// char *target;
|
|
// int temp_size=0;
|
|
// gtk_tree_model_get(GTK_TREE_MODEL(window->tree_copy),&iter,3,&target,-1);
|
|
// yon_gtk_tree_iter_get_from_combo_box_id(GTK_COMBO_BOX(window->ArchitectureCombo),GTK_TREE_MODEL(window->tree_copy),&itar);
|
|
// gtk_tree_model_get(GTK_TREE_MODEL(window->tree_copy),&itar,3,&dialog->root_path,-1);
|
|
// gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog->FileChooserWidget),target);
|
|
|
|
// dictionary *dict = NULL;
|
|
// yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
// yon_dictionary_add_or_create_if_exists_with_data(dict,"dialog",dialog);
|
|
|
|
// g_signal_connect(G_OBJECT(dialog->FileChooserWidget),"current-folder-changed",G_CALLBACK(on_folder_changed),dialog);
|
|
// g_signal_connect(G_OBJECT(dialog->ChooseButton),"clicked",G_CALLBACK(on_move_add_accept),dict);
|
|
// g_signal_connect(G_OBJECT(dialog->FileChooserWidget),"file-activated",G_CALLBACK(on_file_chooser_file_activate),dict);
|
|
// gtk_widget_show(dialog->Window);
|
|
// }
|
|
// }
|
|
|
|
|
|
// repo_add_window *on_remove_clicked(GtkWidget *self, main_window *widgets){
|
|
// repo_add_window *window = yon_repo_add_window_new();
|
|
// yon_gtk_window_setup(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->Window),REMOVE_PACKAGES_TITLE_LABEL,icon_path,"add-repo-window");
|
|
// gtk_label_set_text(GTK_LABEL(window->HeadLabel),REMOVE_PACKAGES_TITLE_LABEL);
|
|
// GtkTreeIter iter;
|
|
// for_iter (window->tree_copy,&iter){
|
|
// char *current;
|
|
// gtk_tree_model_get(GTK_TREE_MODEL(window->tree_copy),&iter,3,¤t,-1);
|
|
// if (!yon_char_is_empty(current)){
|
|
// char *path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(window->tree_copy),&iter);
|
|
// gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->StorageCombo),path,current);
|
|
// }
|
|
// }
|
|
// gtk_label_set_text(GTK_LABEL(window->PackagesToAddLabel),REMOVE_PACKAGES_LABEL);
|
|
// yon_sign_list_update();
|
|
// yon_combo_box_text_set_signs(GTK_COMBO_BOX_TEXT(window->RepoSignCombo));
|
|
// yon_combo_box_text_set_signs(GTK_COMBO_BOX_TEXT(window->PackageSignCombo));
|
|
// gtk_combo_box_set_active(GTK_COMBO_BOX(window->RepoSignCombo),0);
|
|
|
|
// 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),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);
|
|
// yon_add_window_set_selected(widgets,window);
|
|
// gtk_widget_show(window->MainWindow);
|
|
// return window;
|
|
// }
|