diff --git a/source/ubl-settings-repomanager.c b/source/ubl-settings-repomanager.c index 4198941..9b3b187 100644 --- a/source/ubl-settings-repomanager.c +++ b/source/ubl-settings-repomanager.c @@ -128,7 +128,7 @@ void on_load(){ else if (strstr(p,"Depends On")) packdepends = yon_char_new(steer); } gtk_tree_store_append(main_config.tree_store,&packIter,&iter); - gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,path,3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1); + gtk_tree_store_set(main_config.tree_store,&packIter,0,document_no_edits,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,yon_char_unite(path,"/pool/overlay/",parameter_string,NULL),3,0,4,0,9,packname,10,packver,11,packarch,12,packdepends,-1); } else for (int j=0;j",-1); if (!pack_groups||!(yon_dictionary_get(&pack_groups,pack_sign))){ dictionary *dict = yon_dictionary_new(); - dict->key = pack_status == 1 ? pack_path : yon_char_unite("-f -d ",origin_flagged," -r ",name_flagged," --sign_pkg ", pack_sign," -p $(find ",origin_flagged,"/pool/overlay -name *", pack_code_name,".pkg.tar* -not -name *.sig)"); + dict->key = pack_sign_paths; yon_dictionary_add_or_create_if_exists_with_data(pack_groups,yon_char_new(pack_sign),dict); } else { dictionary *dict = yon_dictionary_new(); - dict->key=pack_code_name; + dict->key = pack_sign_paths; yon_dictionary_add_or_create_if_exists_with_data(pack_groups->data,yon_char_new(pack_sign),dict); } - } else if (pack_status==1){ - add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_code_name,NULL); + } + if (pack_status==1){ + add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_path,NULL); + pack_path = yon_char_unite(origin_flagged,"/pool/overlay/",yon_char_divide(pack_path,yon_char_find_last(pack_path,'/'))); + gtk_tree_store_set(main_config.tree_store,&childIter,2,pack_path,-1); } else if (pack_status==-1){ remove_packages = yon_char_unite(remove_packages ? yon_char_append(remove_packages,",") : "",pack_code_name,NULL); } @@ -257,20 +262,6 @@ void on_save(){ } } if (origin_flagged&&name_flagged){ - if (pack_groups){ - dictionary *dct; - for_dictionaries(dct,pack_groups){ - char *signed_packs=NULL; - dictionary *pck; - for_dictionaries(pck,yon_dictionary_get_data(dct,dictionary*)){ - signed_packs=yon_char_unite(signed_packs ? yon_char_append(signed_packs,","): "" ,pck->key,NULL); - } char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL; - repo_sign_flagged=NULL; - char *sign_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged, sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" , " --sign-pkg ", dct->key, " -p ", signed_packs,NULL); - system(sign_command); - } - - } if (add_packages){ char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL; repo_sign_flagged=NULL; @@ -289,6 +280,21 @@ void on_save(){ if (add_signed_command){/*printf("%s\n",add_signed_command);*/ system(add_signed_command);} if (add_command) {/*printf("%s\n",add_command);*/system(add_command);} if (remove_command) {/*printf("%s\n",remove_command);*/system(remove_command);} + if (pack_groups){ + dictionary *dct; + for_dictionaries(dct,pack_groups){ + char *signed_packs=NULL; + dictionary *pck; + for_dictionaries(pck,yon_dictionary_get_data(dct,dictionary*)){ + signed_packs=yon_char_unite(signed_packs ? yon_char_append(signed_packs,","): "" ,pck->key,NULL); + } char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL; + repo_sign_flagged=NULL; + char *sign_command = yon_char_unite(command, " add -f -d ",origin_flagged," -r ",name_flagged," --sign-pkg ", dct->key," -p $(find ",origin_flagged,"/pool/overlay -name ", signed_packs,")",NULL); + printf("%s\n",sign_command); + system(sign_command); + } + + } } } } @@ -419,7 +425,8 @@ void on_sign_save(GtkWidget *self, dictionary *dict){ repo_sign_window *window = yon_dictionary_get_data(dict->first->next,repo_sign_window*); GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store); if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&model,&iter)){ - gtk_tree_store_set(main_config.tree_store,&iter,13,(char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->KeysCombo)),14,1,-1); + char *key = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->KeysCombo)); + gtk_tree_store_set(main_config.tree_store,&iter,13,key,14,1,-1); } on_tree_selection_changed(self,widgets); on_close_subwindow(self); @@ -434,20 +441,29 @@ void on_repo_sign(GtkWidget *self, main_window *widgets){ window->SaveButton = yon_gtk_builder_get_widget(builder,"repoSignSaveButton"); window->CloseButton = yon_gtk_builder_get_widget(builder,"repoSignCancelButton"); - - int size=0; - config_str ret = yon_config_load(get_gpg_keys_command,&size); - for (int i=0;iKeysCombo),ret[i]); + GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store); + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&model,&iter)){ + if (gtk_tree_store_iter_depth(main_config.tree_store,&iter)==1) + gtk_label_set_text(GTK_LABEL( window->HeaderLabel),yon_char_unite(DIGITAL_SIGNATURE_LABEL," - ",PACKAGE_LABEL,NULL)); + else + gtk_label_set_text(GTK_LABEL( window->HeaderLabel),yon_char_unite(DIGITAL_SIGNATURE_LABEL," - ",REPOSITORY_LABEL,NULL)); + int size=0; + config_str ret = yon_config_load(get_gpg_keys_command,&size); + for (int i=0;iKeysCombo),ret[i]); + } + dictionary *dict = yon_dictionary_new_with_data("",widgets); + dict = yon_dictionary_append_with_data(dict,"",window); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_sign_save),dict); + g_signal_connect(G_OBJECT(window->CloseButton),"clicked", G_CALLBACK(on_close_subwindow),NULL); + + gtk_widget_show(window->Window); + } else { + yon_ubl_status_box_render(SIGN_CHOOSE_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); } - dictionary *dict = yon_dictionary_new_with_data("",widgets); - dict = yon_dictionary_append_with_data(dict,"",window); - g_signal_connect(G_OBJECT(window->SaveButton),"clicked", G_CALLBACK(on_sign_save),dict); - g_signal_connect(G_OBJECT(window->CloseButton),"clicked", G_CALLBACK(on_close_subwindow),NULL); - - gtk_widget_show(window->Window); } void on_repo_configure(GtkWidget *self, main_window *widgets){ @@ -628,7 +644,7 @@ void yon_add_file(main_window *widgets){ } GtkTreeIter *iter = yon_repo_append(widgets,filename,YON_REPO_LINE_FILE_TYPE); gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->RepoTree),gtk_tree_model_get_path(GTK_TREE_MODEL(main_config.tree_store),iter)); - gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),9,packname,10,packver,11,packarch,12,packdepends,-1); + gtk_tree_store_set(main_config.tree_store,iter,0,document_added,1,yon_char_unite(packname,"-",packver,"-",packarch,NULL),2,filename,9,packname,10,packver,11,packarch,12,packdepends,-1); } on_tree_selection_changed(NULL,widgets); @@ -870,6 +886,9 @@ int main(int argc, char *argv[]){ gtk_paned_set_position(GTK_PANED(widgets->MovePaned),400); on_load(); + GtkTreeIter *iter = g_malloc0(sizeof(GtkTreeIter)); + if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.tree_store),iter)) + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),iter); GtkCssProvider *css=gtk_css_provider_new(); gtk_css_provider_load_from_resource(css,CssPath); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), diff --git a/ubl-settings-repomanager.glade b/ubl-settings-repomanager.glade index 95d2f39..48906f7 100644 --- a/ubl-settings-repomanager.glade +++ b/ubl-settings-repomanager.glade @@ -220,6 +220,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + diff --git a/ubl-settings-repomanager_ru.po b/ubl-settings-repomanager_ru.po index 10a78ff..a1a02a9 100644 --- a/ubl-settings-repomanager_ru.po +++ b/ubl-settings-repomanager_ru.po @@ -50,7 +50,6 @@ msgid "Lock this help menu" msgstr "Блокировка вызова справки" #: source/ubl-strings.h:2 -#, fuzzy msgid "Lock configuration saving" msgstr "Блокировка сохранения локальной и глобальной конфигурации" @@ -83,7 +82,6 @@ msgid "Repository management and configuring" msgstr "Настройка параметров и управление репозиториями системы" #: source/ubl-strings.h:8 -#, fuzzy msgid "Operation succeeded" msgstr "Операция завершена" @@ -300,7 +298,6 @@ msgid "Choose repository to delete!" msgstr "Выберите репозиторий для удаления!" #: source/ubl-strings.h:78 -#, fuzzy msgid "Choose repository or package to sign" msgstr "Выберите репозиторий или пакет для подписи" @@ -309,7 +306,6 @@ msgid "Name:" msgstr "Название:" #: source/ubl-strings.h:81 -#, fuzzy msgid "Branches:" msgstr "Ветки:" @@ -322,17 +318,14 @@ msgid "Name must be filled!" msgstr "Введите название!" #: source/ubl-strings.h:84 -#, fuzzy msgid "Choose path for new repository" msgstr "Выбрать расположение нового репозитория" #: source/ubl-strings.h:86 -#, fuzzy msgid "Choose repository folder" msgstr "Выбрать директорию для репозитория" #: source/ubl-strings.h:87 -#, fuzzy msgid "Choose repository" msgstr "Выбрать репозиторий" @@ -341,7 +334,6 @@ msgid "Absent" msgstr "Отсутствует" #: source/ubl-strings.h:90 -#, fuzzy msgid "Dependences:" msgstr "Зависит от:" @@ -350,11 +342,9 @@ msgid "Digital signature" msgstr "Цифровая подпись" #: source/ubl-strings.h:93 -#, fuzzy msgid "package" msgstr "пакет" #: source/ubl-strings.h:94 -#, fuzzy msgid "repository" msgstr "репозиторий" diff --git a/vgcore.36074 b/vgcore.36074 new file mode 100644 index 0000000..b8829ed Binary files /dev/null and b/vgcore.36074 differ