diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index 2fda8b5..e3546e8 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -781,6 +781,7 @@ void on_repo_edit(GtkWidget *,main_window *widgets){ yon_char_parsed_free(repos,cur_size); } if (size>1&&!yon_char_is_empty(parsed[1])){ //siglevel + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SignDefaultCheck),0); int cur_size; config_str siglevel = yon_char_parse(parsed[1],&cur_size,","); if (!strcmp(siglevel[0],"Never")){ @@ -1429,6 +1430,25 @@ password_window *yon_password_window_new(){ return window; } +void on_sign_check_toggled(GtkToggleButton *self, repo_add_window *window){ + int status = gtk_toggle_button_get_active(self); + gtk_widget_set_sensitive(window->NeverRadio,!status); + gtk_widget_set_sensitive(window->OptionalRadio,!status); + gtk_widget_set_sensitive(window->RequiredRadio,!status); + gtk_widget_set_sensitive(window->TrustedOnlyRadio,!status); + gtk_widget_set_sensitive(window->TrustAllRadio,!status); + gtk_widget_set_sensitive(window->PackageNeverRadio,!status); + gtk_widget_set_sensitive(window->DatabaseNeverRadio,!status); + gtk_widget_set_sensitive(window->PackageOptionalRadio,!status); + gtk_widget_set_sensitive(window->DatabaseOptionalRadio,!status); + gtk_widget_set_sensitive(window->PackageRequiredRadio,!status); + gtk_widget_set_sensitive(window->DatabaseRequiredRadio,!status); + gtk_widget_set_sensitive(window->PackageTrustedOnlyRadio,!status); + gtk_widget_set_sensitive(window->DatabaseTrustedOnlyRadio,!status); + gtk_widget_set_sensitive(window->PackageTrustAllRadio,!status); + gtk_widget_set_sensitive(window->DatabaseTrustAllRadio,!status); +} + repo_add_window *yon_repo_add_window_new(){ GtkBuilder *builder = gtk_builder_new_from_resource(glade_repo_add_path); repo_add_window *window = malloc(sizeof(repo_add_window)); @@ -1453,6 +1473,7 @@ repo_add_window *yon_repo_add_window_new(){ window->SourceBox = yon_gtk_builder_get_widget(builder,"SourceBox"); window->SourceListBox = yon_gtk_builder_get_widget(builder,"SourceListBox"); window->RepoSourceAddButton = yon_gtk_builder_get_widget(builder,"RepoSourceAddButton"); + window->SignDefaultCheck = yon_gtk_builder_get_widget(builder,"SignDefaultCheck"); window->NeverRadio = yon_gtk_builder_get_widget(builder,"NeverRadio"); window->OptionalRadio = yon_gtk_builder_get_widget(builder,"OptionalRadio"); window->RequiredRadio = yon_gtk_builder_get_widget(builder,"RequiredRadio"); @@ -1478,6 +1499,8 @@ repo_add_window *yon_repo_add_window_new(){ g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableSearchCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableUpdateCheck); g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageSysupgradeCheck); + + g_signal_connect(G_OBJECT(window->SignDefaultCheck),"toggled",G_CALLBACK(on_sign_check_toggled),window); // g_signal_connect(G_OBJECT(window->SourceListBox),"size-allocate",G_CALLBACK(on_scrolled_window_size_allocate),window); gtk_widget_show(window->Window); gtk_label_set_text(GTK_LABEL(window->SignLevelLabel),SIGN_LEVEL_LABEL); diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index 38e95d7..9082b1d 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -168,6 +168,7 @@ typedef struct { GtkWidget *CancelButton; GtkWidget *SignLevelLabel; + GtkWidget *SignDefaultCheck; GtkWidget *NeverRadio; GtkWidget *OptionalRadio; GtkWidget *RequiredRadio; @@ -327,6 +328,8 @@ void on_password_open(GtkWidget *, web_publication_add_window *window); void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window); +void on_sign_check_toggled(GtkToggleButton *self, repo_add_window *window); + password_window *yon_password_window_new(); repo_add_window *yon_repo_add_window_new(); web_publication_add_window *yon_web_publication_add_window_new(); diff --git a/ubl-settings-update-repo-add.glade b/ubl-settings-update-repo-add.glade index 492a475..0b967f5 100644 --- a/ubl-settings-update-repo-add.glade +++ b/ubl-settings-update-repo-add.glade @@ -311,6 +311,21 @@ Configuration - configuration path False vertical 5 + + + Default + True + True + False + True + True + + + False + True + 0 + + True @@ -320,6 +335,7 @@ Configuration - configuration path Never True + False True False Signature verification will not be performed @@ -337,6 +353,7 @@ Configuration - configuration path PackageNever True + False True False For packages only @@ -354,7 +371,7 @@ Configuration - configuration path False True - 0 + 1 @@ -366,6 +383,7 @@ Configuration - configuration path Optional True + False True False Signatures will be checked if present, but unsigned databases and packages will also be accepted @@ -383,6 +401,7 @@ Configuration - configuration path DatabaseNever True + False True False For database only @@ -400,7 +419,7 @@ Configuration - configuration path False True - 1 + 2 @@ -412,6 +431,7 @@ Configuration - configuration path Required True + False True False Signatures will be required for all packages and databases @@ -428,6 +448,7 @@ Configuration - configuration path PackageOptional True + False True False For packages only @@ -445,7 +466,7 @@ Configuration - configuration path False True - 2 + 3 @@ -457,6 +478,7 @@ Configuration - configuration path TrustedOnly True + False True False Signatures will be required for all packages and databases @@ -474,6 +496,7 @@ Configuration - configuration path DatabaseOptional True + False True False For database only @@ -490,7 +513,7 @@ Configuration - configuration path False True - 3 + 4 @@ -502,6 +525,7 @@ Configuration - configuration path TrustAll True + False True False If the signature is verified for packages and the database, it must be in the keyring and be fully trusted @@ -519,6 +543,7 @@ Configuration - configuration path PackageRequired True + False True False For packages only @@ -536,7 +561,7 @@ Configuration - configuration path False True - 4 + 5 @@ -562,6 +587,7 @@ Configuration - configuration path DatabaseRequired True + False True False For database only @@ -579,7 +605,7 @@ Configuration - configuration path False True - 5 + 6 @@ -605,6 +631,7 @@ Configuration - configuration path PackageTrustedOnly True + False True False For packages only @@ -622,7 +649,7 @@ Configuration - configuration path False True - 6 + 7 @@ -648,6 +675,7 @@ Configuration - configuration path DatabaseTrustedOnly True + False True False For database only @@ -665,7 +693,7 @@ Configuration - configuration path False True - 7 + 8 @@ -691,6 +719,7 @@ Configuration - configuration path PackageTrustAll True + False True False If the signature is verified only for packets @@ -708,7 +737,7 @@ Configuration - configuration path False True - 8 + 9 @@ -734,6 +763,7 @@ Configuration - configuration path DatabaseTrustAll True + False True False If the signature is verified only for the database @@ -751,7 +781,7 @@ Configuration - configuration path False True - 9 + 10