|
|
|
|
@ -308,8 +308,13 @@ void on_storage_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
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))
|
|
|
|
|
const char *id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->StoragePathCombo));
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
yon_ubl_status_box_render(STORAGES_SAVED_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
@ -673,8 +678,13 @@ void on_add_packages_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_destroy(window->MainWindow);
|
|
|
|
|
yon_ubl_status_box_render(PACKAGES_ADD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
@ -734,6 +744,42 @@ repo_add_window *yon_repo_add_window_new(){
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_add_window_set_selected(main_window *widgets, repo_add_window *window){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),NULL,&iter)){
|
|
|
|
|
|
|
|
|
|
char *target = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(widgets->RepoList),&iter);
|
|
|
|
|
int mod = yon_char_count(target,":")+1;
|
|
|
|
|
char *arc=NULL;
|
|
|
|
|
char *repo=NULL;
|
|
|
|
|
char *stor=NULL;
|
|
|
|
|
if (mod ==3){
|
|
|
|
|
arc = yon_char_new(target);
|
|
|
|
|
char *temp = yon_char_new(target);
|
|
|
|
|
repo = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
temp = yon_char_new(repo);
|
|
|
|
|
stor = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
} else if (mod>=2){
|
|
|
|
|
repo = yon_char_new(target);
|
|
|
|
|
char *temp = yon_char_new(target);
|
|
|
|
|
stor = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
} else if (mod>=1){
|
|
|
|
|
stor = yon_char_new(target);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stor)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->StorageCombo),stor);
|
|
|
|
|
if (repo)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->RepositoryCombo),repo);
|
|
|
|
|
if (arc)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->ArchitectureCombo),arc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// main window
|
|
|
|
|
void on_add_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
repo_add_window *window = yon_repo_add_window_new();
|
|
|
|
|
@ -749,6 +795,7 @@ void on_add_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
@ -768,6 +815,7 @@ void on_add_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddPackageButton),"clicked",G_CALLBACK(on_add_package),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RemoveButton),"clicked",G_CALLBACK(on_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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -912,8 +960,13 @@ void on_move_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
on_subwindow_close(window->MainWindow);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -962,6 +1015,37 @@ void on_move_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
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),dict);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->MoveSourceRepoEntry),"changed",G_CALLBACK(on_repo_sign_load),window);
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree)),NULL,&iter)){
|
|
|
|
|
|
|
|
|
|
char *target = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(widgets->RepoList),&iter);
|
|
|
|
|
int mod = yon_char_count(target,":")+1;
|
|
|
|
|
char *arc=NULL;
|
|
|
|
|
char *repo=NULL;
|
|
|
|
|
char *stor=NULL;
|
|
|
|
|
if (mod ==3){
|
|
|
|
|
arc = yon_char_new(target);
|
|
|
|
|
char *temp = yon_char_new(target);
|
|
|
|
|
repo = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
temp = yon_char_new(repo);
|
|
|
|
|
stor = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
} else if (mod>=2){
|
|
|
|
|
repo = yon_char_new(target);
|
|
|
|
|
char *temp = yon_char_new(target);
|
|
|
|
|
stor = yon_char_divide(temp,yon_char_find_last(temp,':'));
|
|
|
|
|
free(temp);
|
|
|
|
|
} else if (mod>=1){
|
|
|
|
|
stor = yon_char_new(target);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stor)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->MoveSourceStorageEntry),stor);
|
|
|
|
|
if (repo)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->MoveSourceRepoEntry),repo);
|
|
|
|
|
if (arc)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->MoveSourceArchEntry),arc);
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1037,8 +1121,13 @@ void on_remove_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NOTHING_TO_SAVE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
@ -1084,6 +1173,7 @@ void on_remove_clicked(GtkWidget *self, main_window *widgets){
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1284,8 +1374,10 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){
|
|
|
|
|
const char *password_confirm = gtk_entry_get_text(GTK_ENTRY(window->PasswordConfirmationEntry));
|
|
|
|
|
int ex_status=0;
|
|
|
|
|
if (yon_char_is_empty(password)&&yon_char_is_empty(password_confirm)){
|
|
|
|
|
yon_debug_output("%s\n",yon_generate_key_no_password_command(type,name,email,strength,comment,expire,password));
|
|
|
|
|
ex_status = system(yon_generate_key_no_password_command(type,name,email,strength,comment,expire,password));
|
|
|
|
|
} else if (!strcmp(password,password_confirm)){
|
|
|
|
|
yon_debug_output("%s\n",yon_generate_key_command(type,name,email,strength,comment,expire,password));
|
|
|
|
|
ex_status = system(yon_generate_key_command(type,name,email,strength,comment,expire,password));
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_INCORRECT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|