diff --git a/.gitignore b/.gitignore index aa381cb..80133a6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ source/ubl-cmake.h .BUILD.md .updatebuild.sh .install.sh -*vgcore* \ No newline at end of file +*vgcore* diff --git a/source/ubl-settings-repomanager.c b/source/ubl-settings-repomanager.c index c6bf903..0992a84 100644 --- a/source/ubl-settings-repomanager.c +++ b/source/ubl-settings-repomanager.c @@ -100,15 +100,19 @@ void on_about(){ void on_load(){ gsize size=0; + gsize sigsize=0; config_str repos = yon_window_config_get_section("repos",&size); + config_str signatures = yon_window_config_get_section("signatures",&sigsize); gtk_tree_store_clear(main_config.tree_store); for (int i=0;i",-1); - if (repostatus == 1) gtk_tree_store_set(main_config.tree_store,&iter,0,folder_no_edits,3,0,-1); else if (repostatus == -1){ system(yon_char_unite("rm -rfd ",origin_flagged,NULL)); @@ -221,6 +230,9 @@ void on_save(){ yon_char_divide(pack_sign_paths,yon_char_find_last(pack_sign_paths,'/')); packnames = yon_char_unite(packnames ? yon_char_append(packnames," "):"",pack_sign_paths,NULL); if (pack_sign&&pack_signed==1){ + char *package_full_name = yon_char_new(pack_path); + yon_char_divide(package_full_name,yon_char_find_last(package_full_name,'/')); + yon_window_config_add_custom_parameter(package_full_name,"signatures",yon_char_new(pack_sign),YON_TYPE_STRING); yon_char_divide_search(pack_sign,"<",-1); pack_sign=yon_char_divide_search(pack_sign,">",-1); if (!pack_groups||!(yon_dictionary_get(&pack_groups,pack_sign))){ @@ -234,9 +246,11 @@ void on_save(){ } } 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,'/'))); + add_packages = yon_char_unite(add_packages ? yon_char_append(add_packages,",") : "",pack_path,NULL); + yon_char_divide(pack_path,yon_char_find_last(pack_path,'/')); + pack_path = yon_char_unite(origin_flagged,"/pool/overlay/",pack_path,NULL); gtk_tree_store_set(main_config.tree_store,&childIter,2,pack_path,-1); + repostatus=1; } else if (pack_status==-1){ remove_packages = yon_char_unite(remove_packages ? yon_char_append(remove_packages,",") : "",pack_code_name,NULL); } @@ -262,12 +276,10 @@ void on_save(){ if (origin_flagged&&name_flagged){ if (add_packages){ char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL; - repo_sign_flagged=NULL; add_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged, sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" ," -p ", add_packages,NULL); } if (remove_packages){ char *sign_check = repo_sign_flagged ? yon_char_new(repo_sign_flagged) : NULL; - repo_sign_flagged=NULL; remove_command = yon_char_unite(command, " remove -d \"",origin_flagged,"\" -r \"",name_flagged, sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" , " -p ", remove_packages,NULL); } if (repostatus == 1){ @@ -275,11 +287,11 @@ void on_save(){ } if (!add_packages&&!signed_packages&&!remove_packages&&repostatus==1) add_command = yon_char_unite(command, " add -d \"",origin_flagged,"\" -r \"",name_flagged,sign_flagged ? yon_char_append("\" --sign-repo ",sign_flagged):"\"" ,NULL); - if (add_signed_command){/*printf("%s\n",add_signed_command);*/ system(add_signed_command); + if (add_signed_command){ system(add_signed_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} - if (add_command) {/*printf("%s\n",add_command);*/system(add_command); + if (add_command) { system(add_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} - if (remove_command) {/*printf("%s\n",remove_command);*/system(remove_command); + if (remove_command) { system(remove_command); yon_ubl_status_box_render(OPERATION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);} if (pack_groups){ dictionary *dct; @@ -288,16 +300,20 @@ void on_save(){ 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); } } + if (repo_sign_flagged){ + char *repo_sign_command = yon_char_unite(command, " add -f -d ",origin_flagged, " -r ", name_flagged, " --sign-repo ", repo_sign_flagged ,NULL); + yon_window_config_add_custom_parameter(yon_char_unite(origin_flagged,NULL),"signatures",repo_sign_flagged_full,YON_TYPE_STRING); + system(repo_sign_command); + } } } + yon_ubl_status_box_render(SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } void on_search(GtkCellEditable *self, main_window *widgets){ @@ -363,6 +379,18 @@ void on_tree_selection_changed(GtkWidget *self,main_window *widgets){ gtk_widget_set_visible(widgets->ArchitectureBox,1); gtk_widget_set_visible(widgets->SignatureBox,1); } + } else { + gtk_widget_set_sensitive(widgets->CreateButton,1); + gtk_widget_set_sensitive(widgets->LoadFromLocalButton,1); + gtk_widget_set_sensitive(widgets->ConfigureButton,0); + gtk_widget_set_sensitive(widgets->DeleteButton,0); + gtk_widget_set_sensitive(widgets->AddPackageButton,0); + gtk_widget_set_sensitive(widgets->RemovePackageButton,0); + gtk_widget_set_visible(widgets->NameBox,0); + gtk_widget_set_visible(widgets->DependenceBox,0); + gtk_widget_set_visible(widgets->VersionBox,0); + gtk_widget_set_visible(widgets->ArchitectureBox,0); + gtk_widget_set_visible(widgets->SignatureBox,0); } } @@ -441,6 +469,7 @@ void on_repo_sign(GtkWidget *self, main_window *widgets){ window->CloseButton = yon_gtk_builder_get_widget(builder,"repoSignCancelButton"); GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store); GtkTreeIter iter; + gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); 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)); @@ -512,6 +541,7 @@ void on_repo_load_local(GtkWidget *self, main_window *widgets){ gtk_file_filter_add_pattern(file_filter,"*db.tar.gz"); gtk_file_filter_set_name(file_filter, "*db.tar.gz"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(chooser),file_filter); + gtk_window_set_icon_name(GTK_WINDOW(chooser),"com.ublinux.ubl-settings-repomanager"); int res = gtk_dialog_run(GTK_DIALOG(chooser)); if (res==GTK_RESPONSE_ACCEPT){ @@ -561,7 +591,7 @@ GtkTreeIter *yon_repo_append(main_window *widgets, char *name, YON_REPO_LINE_TYP } else if (type==YON_REPO_LINE_REPO_TYPE){ gtk_tree_store_append(main_config.tree_store,&iter,NULL); - gtk_tree_store_set(main_config.tree_store,&iter,0, folder_no_edits, 1, name_short,2,name,3,1,4,fls,-1); + gtk_tree_store_set(main_config.tree_store,&iter,0, folder_no_edits, 1, name_short,2,name,3,1,4,fls,9,name_short,-1); retIter = gtk_tree_iter_copy(&iter); gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&iter); } else { @@ -626,6 +656,7 @@ void yon_add_file(main_window *widgets){ gtk_file_filter_add_pattern(file_filter,"*"); gtk_file_filter_set_name(file_filter,"All"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(chooser),file_filter); + gtk_window_set_icon_name(GTK_WINDOW(chooser),"com.ublinux.ubl-settings-repomanager"); int res = gtk_dialog_run(GTK_DIALOG(chooser)); if (res==GTK_RESPONSE_ACCEPT){ char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)); @@ -817,10 +848,11 @@ int main(int argc, char *argv[]){ {"socket-ext-id", 1,0, 'e'}, {"socket-trd-id", 1,0, 't'}, {"debug", 0,0, 'd'}, + {"clean-config", 0,0, 'c'}, { NULL, 0, NULL, 0 } }; for (int i=0;iFalse False 450 - dialog-question-symbolic + com.ublinux.ubl-settings-repomanager True diff --git a/ubl-settings-repomanager.pot b/ubl-settings-repomanager.pot index 059b661..1aa4de1 100644 --- a/ubl-settings-repomanager.pot +++ b/ubl-settings-repomanager.pot @@ -154,7 +154,7 @@ msgid "Repository data has been loaded successfully" msgstr "" #: source/ubl-strings.h:33 -msgid "Saving has succseeded" +msgid "Saving has succeeded" msgstr "" #: source/ubl-strings.h:35 diff --git a/ubl-settings-repomanager_ru.po b/ubl-settings-repomanager_ru.po index 3ef037e..702bbf7 100644 --- a/ubl-settings-repomanager_ru.po +++ b/ubl-settings-repomanager_ru.po @@ -159,7 +159,7 @@ msgstr "Информация о пакетах успешно загружена #: source/ubl-strings.h:33 #, fuzzy -msgid "Saving has succseeded" +msgid "Saving has succeeded" msgstr "Успешно сохранено" #: source/ubl-strings.h:35