diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 5cc1408..b94d67d 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -27,7 +27,7 @@ void on_save_done(main_window *, config_str output, int size){ } -void yon_save_interface(main_window *widgets){ +void yon_save_interface( main_window *widgets){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck))){ yon_config_register(AUTOUPDATE,AUTOUPDATE_command,"enable"); } else { @@ -61,11 +61,11 @@ void yon_save_interface(main_window *widgets){ case 3: interval = yon_char_unite(int_str,"M",NULL); break; } - yon_config_register(AUTOUPDATE,AUTOUPDATE_command,interval); + yon_config_register(AUTOUPDATE_interval,AUTOUPDATE_interval_command,interval); } - if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->UpdateRepoListCombo))){ + if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UpdateRepoListCheck))){ yon_config_remove_by_key(AUTOUPDATE_repos); } else { char *repos = ""; @@ -112,7 +112,7 @@ void yon_save_interface(main_window *widgets){ } } - if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->PublicationCombo))){ + if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->PublicationCheck))){ yon_config_remove_by_key(REPOPUBLIC_NET_parameter); } else { char *repos = ""; @@ -175,6 +175,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ char *command = yon_config_get_custom_command(path); yon_config_load_config(type,command,NULL); } + yon_config_set_ignore(AUTOUPDATE_timestamp); } void yon_interface_update(main_window *widgets){ @@ -241,13 +242,9 @@ void yon_interface_update(main_window *widgets){ { int repos_size; config_str publish_repos = yon_config_load(get_publication_list_command,&repos_size); - for (int i=0;iPublicationList,&iter); - gtk_list_store_set(widgets->PublicationList,&iter,0,1,1,publish_repos[i],-1); - } char *publish = config(REPOPUBLIC_NET_parameter); if (publish) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PublicationCheck),1); int cur_size; config_str parsed = yon_char_parse(publish,&cur_size,","); if (cur_size){ @@ -261,14 +258,23 @@ void yon_interface_update(main_window *widgets){ } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RecieveDBFromNetCheck),0); } + for (int i=0;iPublicationList,&iter); + gtk_list_store_set(widgets->PublicationList,&iter,1,publish_repos[i],0,!(cur_size-2)||(cur_size-2&&yon_char_parsed_check_exist(parsed,cur_size,publish_repos[i])>-1)?1:0,-1); + } if (cur_size>2){ for (int i=2;iPublicationList,&iter); - gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1); + if (yon_char_parsed_check_exist(publish_repos,repos_size,parsed[i])==-1){ + gtk_list_store_append(widgets->PublicationList,&iter); + gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1); + } } } yon_char_parsed_free(parsed,cur_size); } + } else { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PublicationCheck),1); } } { @@ -323,6 +329,11 @@ void yon_interface_update(main_window *widgets){ int repos_size; config_str overall_repos = yon_config_load(get_publication_list_command,&repos_size); char *autoupdate_repos = config(AUTOUPDATE_repos); + if (autoupdate_repos){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateRepoListCheck),1); + } else { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateRepoListCheck),0); + } if (repos_size){ int parsed_size; GtkTreeIter iter; @@ -330,31 +341,22 @@ void yon_interface_update(main_window *widgets){ for (int i=0;iUpdateRepoList),&iter); - gtk_list_store_set(widgets->UpdateRepoList,&iter,1,overall_repos[i],0,!parsed_size||(parsed_size&&yon_char_parsed_check_exist(overall_repos,repos_size,overall_repos[i])>-1)?1:0,-1); + gtk_list_store_set(widgets->UpdateRepoList,&iter,1,overall_repos[i],0,!parsed_size||(parsed_size&&yon_char_parsed_check_exist(parsed,parsed_size,overall_repos[i])>-1)?1:0,-1); } yon_char_parsed_free(parsed,parsed_size); } autoupdate_config = config(AUTOUPDATE_interval); if (!yon_char_is_empty(autoupdate_config)){ - if (!strcmp(autoupdate_config,"boot")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0); - } else { if (strstr(autoupdate_config,"min")){ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0); } else if (autoupdate_config[strlen(autoupdate_config)-1]=='h'){ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),2); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),1); } else if (autoupdate_config[strlen(autoupdate_config)-1]=='d'){ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),3); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),2); } else if (autoupdate_config[strlen(autoupdate_config)-1]=='M'){ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),4); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),3); } gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(autoupdate_config)); - } - } - - char *timestamp = config("AUTOUPDATE[timestamp]"); - if (!yon_char_is_empty(timestamp)){ - gtk_label_set_text(GTK_LABEL(widgets->HeadLabel),timestamp); } } @@ -686,19 +688,19 @@ void on_mirror_remove_accept(GtkWidget *, main_window *widgets){ void on_repositories_remove_accept(GtkWidget *, main_window *widgets){ GtkTreeModel *model=NULL; GtkTreeIter iter; - if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepositoriesTree)),&model,&iter)) { + if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepositoriesTree)),&model,&iter)) { return; } char *repo; gtk_tree_model_get(model,&iter,1,&repo,-1); - yon_config_remove_by_key(repo); + yon_config_remove_by_key(REPOSITORY(repo)); yon_interface_update(widgets); } void on_repo_edit(GtkWidget *,main_window *widgets){ repo_add_window *window = yon_repo_add_window_new(); - yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"add_repo_window"); - + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),EDIT_REPO_LABEL,icon_path,"add_repo_window"); + gtk_label_set_text(GTK_LABEL(window->HeadLabel),EDIT_REPO_LABEL); GtkTreeIter iter; char *target; gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepositoriesTree)),NULL,&iter); @@ -722,12 +724,10 @@ void on_repo_edit(GtkWidget *,main_window *widgets){ yon_ubl_status_highlight_incorrect(window->RepoSourceEntry); return; } - char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSourceCombo)); - char *full_name = yon_char_append(type,target); gtk_entry_set_text(GTK_ENTRY(window->RepoSourceEntry),""); GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path); gtk_box_pack_start(GTK_BOX(window->SourceBox),yon_gtk_builder_get_widget(builder,"PathRemovalBox"),0,0,2); - gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),full_name); + gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder,"PathEntry")),target); g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),gtk_builder_get_object(builder,"PathRemovalBox")); g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),gtk_builder_get_object(builder,"PathRemovalBox")); } @@ -926,9 +926,6 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){ GList *list = gtk_container_get_children(GTK_CONTAINER(window->SourceBox)); for (guint i=0;iUsageDefaultCheck)); - // int usage_level_enable_update = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageEnableUpdateCheck)); - // int usage_level_enable_search = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageEnableSearchCheck)); - // int usage_level_enable_install = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageEnableInsallCheck)); - // int usage_level_sysupgrade = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsageSysupgradeCheck)); - char *final = yon_char_unite(sources,";",sign_level_package,",",sign_level_condiition,";",";",enabled?"":"disable",NULL); if (!yon_char_is_empty(window->name)&&strcmp(repo_name,window->name)){ @@ -1457,7 +1448,7 @@ void yon_main_window_complete(main_window *widgets){ widgets->UpdateIntervalSpin = yon_gtk_builder_get_widget(builder,"UpdateIntervalSpin"); widgets->UpdateToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"UpdateToggleCell")); widgets->UpdateIntervalCombo = yon_gtk_builder_get_widget(builder,"UpdateIntervalCombo"); - widgets->UpdateRepoListCombo = yon_gtk_builder_get_widget(builder,"UpdateRepoListCombo"); + widgets->UpdateRepoListCheck = yon_gtk_builder_get_widget(builder,"UpdateRepoListCheck"); widgets->UpdateRepoTree = yon_gtk_builder_get_widget(builder,"UpdateRepoTree"); widgets->RepositoriesRepoListConfigurationCheck = yon_gtk_builder_get_widget(builder,"RepositoriesRepoListConfigurationCheck"); widgets->RepositoriesDisableSystemReposCheck = yon_gtk_builder_get_widget(builder,"RepositoriesDisableSystemReposCheck"); @@ -1473,7 +1464,7 @@ void yon_main_window_complete(main_window *widgets){ widgets->PublicationTree = yon_gtk_builder_get_widget(builder,"PublicationTree"); widgets->PublicationUpdateButton = yon_gtk_builder_get_widget(builder,"PublicationUpdateButton"); widgets->PublicationToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"PublicationToggleCell")); - widgets->PublicationCombo = yon_gtk_builder_get_widget(builder,"PublicationCombo"); + widgets->PublicationCheck = yon_gtk_builder_get_widget(builder,"PublicationCheck"); widgets->WebPublicationUpdateButton = yon_gtk_builder_get_widget(builder,"WebPublicationUpdateButton"); widgets->WebPublicationAddButton = yon_gtk_builder_get_widget(builder,"WebPublicationAddButton"); widgets->WebPublicationEditButton = yon_gtk_builder_get_widget(builder,"WebPublicationEditButton"); @@ -1525,6 +1516,10 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->UpdateToggleCell),"toggled",G_CALLBACK(on_toggle_cell_toggled),widgets->UpdateRepoList); g_signal_connect(G_OBJECT(widgets->PublicationToggleCell),"toggled",G_CALLBACK(on_toggle_cell_toggled),widgets->PublicationList); + g_signal_connect(G_OBJECT(widgets->UpdateRepoListCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->UpdateRepoTree); + g_signal_connect(G_OBJECT(widgets->PublicationCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->PublicationTree); + g_signal_connect(G_OBJECT(widgets->PublicationCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->PublicationUpdateButton); + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->WebPublicationTree)); for (unsigned int i=0;i - + @@ -15,6 +15,7 @@ 500 + 300 False True com.ublinux.ubl-settings-repomanager diff --git a/ubl-settings-update.glade b/ubl-settings-update.glade index bb10805..524c01f 100644 --- a/ubl-settings-update.glade +++ b/ubl-settings-update.glade @@ -393,31 +393,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. False 5 - + + Repositories list True - False - Repositories list: + True + False + True False True - 0 - - - - - True - False - 0 - - Default - Choose - - - - True - True - 1 + 2 @@ -435,6 +421,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True + False True UpdateRepoList @@ -520,6 +507,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False Repository connection configuration + True 0 @@ -863,7 +851,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - Repository connection configuration + Setting up a connection to a distributed repository network and publishing your repositories + True 0 @@ -925,15 +914,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. vertical 5 - + True False 5 - + + Repositories list True - False - Repositories list: + True + False + True False @@ -941,22 +932,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0 - - - True - False - 0 - - All repositories - Choose - - - - True - True - 1 - - False @@ -978,6 +953,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True + False True True Update @@ -1007,6 +983,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True + False True PublicationList @@ -1102,7 +1079,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - Repository connection configuration + Setting up publication of storage and/or repositories as a local WEB resource + True 0 @@ -1420,7 +1398,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - Repository connection configuration + Setting up publication of a lazy mirror of connected repositories as a local WEB resource + True 0 diff --git a/ubl-settings-update.pot b/ubl-settings-update.pot index 4f187f7..b80675a 100644 --- a/ubl-settings-update.pot +++ b/ubl-settings-update.pot @@ -37,6 +37,10 @@ msgstr "" msgid "Add repository" msgstr "" +#: source/ubl-strings.h:8 +msgid "Edit repository" +msgstr "" + #: source/ubl-strings.h:9 msgid "Are you sure want to remove repository?" msgstr "" @@ -122,7 +126,7 @@ msgid "Repositories from which the update will occur" msgstr "" #: source/ubl-strings.h:32 source/ubl-strings.h:54 -msgid "Repositories list:" +msgid "Repositories list" msgstr "" #: source/ubl-strings.h:33 @@ -185,11 +189,16 @@ msgstr "" msgid "Usage level" msgstr "" -#: source/ubl-strings.h:49 source/ubl-strings.h:50 source/ubl-strings.h:59 -#: source/ubl-strings.h:68 +#: source/ubl-strings.h:49 msgid "Repository connection configuration" msgstr "" +#: source/ubl-strings.h:50 +msgid "" +"Setting up a connection to a distributed repository network and publishing " +"your repositories" +msgstr "" + #: source/ubl-strings.h:51 msgid "Connect and publish" msgstr "" @@ -214,6 +223,11 @@ msgstr "" msgid "Repository name" msgstr "" +#: source/ubl-strings.h:59 +msgid "" +"Setting up publication of storage and/or repositories as a local WEB resource" +msgstr "" + #: source/ubl-strings.h:60 source/ubl-strings.h:102 msgid "Authorization parameters" msgstr "" @@ -246,6 +260,12 @@ msgstr "" msgid "Password/Password hash" msgstr "" +#: source/ubl-strings.h:68 +msgid "" +"Setting up publication of a lazy mirror of connected repositories as a local " +"WEB resource" +msgstr "" + #: source/ubl-strings.h:69 msgid "Publish lazy mirror" msgstr "" diff --git a/ubl-settings-update_ru.po b/ubl-settings-update_ru.po index 54c62c6..912e281 100644 --- a/ubl-settings-update_ru.po +++ b/ubl-settings-update_ru.po @@ -35,7 +35,11 @@ msgstr "" #: source/ubl-strings.h:8 msgid "Add repository" -msgstr "Добавить репозиторий" +msgstr "Добавление репозитория" + +#: source/ubl-strings.h:8 +msgid "Edit repository" +msgstr "Редактировать репозиторий" #: source/ubl-strings.h:9 msgid "Are you sure want to remove repository?" @@ -88,7 +92,7 @@ msgstr "Обновлять только модули" #: source/ubl-strings.h:23 msgid "Update everything in the order of the specified repositories" -msgstr "Обновлять всё в порядке репозиториев" +msgstr "Обновлять всё в порядке указанных репозиториев" #: source/ubl-strings.h:24 msgid "Update mode:" @@ -123,8 +127,8 @@ msgid "Repositories from which the update will occur" msgstr "Репозитории с которых будет происходить обновление" #: source/ubl-strings.h:32 source/ubl-strings.h:54 -msgid "Repositories list:" -msgstr "Список репозиториев:" +msgid "Repositories list" +msgstr "Список репозиториев" #: source/ubl-strings.h:33 msgid "Default" @@ -140,11 +144,11 @@ msgstr "Выбран" #: source/ubl-strings.h:36 msgid "Repository" -msgstr "Репозитории" +msgstr "Репозиторий" #: source/ubl-strings.h:37 msgid "Manage repository list" -msgstr "Управление списка репозиториев" +msgstr "Управление списком репозиториев" #: source/ubl-strings.h:38 msgid "Disable system repositories" @@ -186,14 +190,19 @@ msgstr "Уровень подписи" msgid "Usage level" msgstr "Уровень использования" -#: source/ubl-strings.h:49 source/ubl-strings.h:50 source/ubl-strings.h:59 -#: source/ubl-strings.h:68 +#: source/ubl-strings.h:49 msgid "Repository connection configuration" msgstr "Настройки подключения репозитория" +#: source/ubl-strings.h:50 +msgid "" +"Setting up a connection to a distributed repository network and publishing " +"your repositories" +msgstr "Настройки подключения к распределённой сети репозиториев и публикация своих репозиториев" + #: source/ubl-strings.h:51 msgid "Connect and publish" -msgstr "подключиться и опубликовать" +msgstr "Подключиться и опубликовать" #: source/ubl-strings.h:52 msgid "Recieve DB packages from shared network" @@ -215,6 +224,12 @@ msgstr "Принять" msgid "Repository name" msgstr "Имя репозитория" +#: source/ubl-strings.h:59 +#, fuzzy +msgid "" +"Setting up publication of storage and/or repositories as a local WEB resource" +msgstr "Настройка публикации хранилища и/или репозиториев в виде локального WEB ресурса" + #: source/ubl-strings.h:60 source/ubl-strings.h:102 msgid "Authorization parameters" msgstr "Параметры авторизации" @@ -237,7 +252,7 @@ msgstr "Порт" #: source/ubl-strings.h:65 msgid "Name" -msgstr "Имя" +msgstr "Имя пользователя" #: source/ubl-strings.h:66 msgid "Password/Hash type" @@ -247,6 +262,12 @@ msgstr "Пароль/Тип хэша" msgid "Password/Password hash" msgstr "Пароль/Хэш пароля" +#: source/ubl-strings.h:68 +msgid "" +"Setting up publication of a lazy mirror of connected repositories as a local " +"WEB resource" +msgstr "Настройка публикации ленивого зеркала подключенных репозиториев в виде локального WEB ресурса" + #: source/ubl-strings.h:69 msgid "Publish lazy mirror" msgstr "Опубликовать ленивое зеркало" @@ -265,7 +286,7 @@ msgstr "Настроить" #: source/ubl-strings.h:73 msgid "Mirror publish configuration" -msgstr "Конфигурация публикации ленивого зеркала" +msgstr "Параметры публикации зеркала" #: source/ubl-strings.h:74 msgid "Service port:" @@ -273,7 +294,7 @@ msgstr "Порт сервиса:" #: source/ubl-strings.h:75 msgid "Cache directory:" -msgstr "Каталог хэша:" +msgstr "Каталог кеша:" #: source/ubl-strings.h:76 msgid "Duration of inactivity (in seconds):" @@ -300,7 +321,7 @@ msgid "" "The number of consecutie days that systems on the network have not been " "updated:" msgstr "" -"Количество дней подряд, в течение которых не обновляется системы в сети:" +"Количество дней подряд, в течение которых не обновляются системы в сети:" #: source/ubl-strings.h:82 msgid "The number of consecutive days wthout an update requested:" @@ -345,7 +366,7 @@ msgstr "Уровень подписи:" #: source/ubl-strings.h:92 msgid "Enable repository update" -msgstr "Включить обновления для этого репозитория" +msgstr "Включать обновления для этого репозитория" #: source/ubl-strings.h:93 msgid "Enable repository search" @@ -362,7 +383,7 @@ msgid "" "Allow this repository to be a valid source of packages when running --" "sysupgrade" msgstr "" -"Позволять этому репозиторию быть действительным источником пакетов при " +"Позволить этому репозиторию быть действительным источником пакетов при " "выполнении --sysupgrade" #: source/ubl-strings.h:96 @@ -375,7 +396,7 @@ msgstr "Включить публикацию локального репози #: source/ubl-strings.h:98 msgid "Path to publication directory:" -msgstr "Путь до каталога побликации:" +msgstr "Хранилище:" #: source/ubl-strings.h:99 msgid "Port:"