diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index ea829c6..de93cb8 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -63,11 +63,11 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){ switch(gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo))){ case 0: interval = yon_char_unite(!yon_char_is_empty(interval)?interval:"",!yon_char_is_empty(interval)?",":"",int_str,"min",NULL); break; - case 1: interval = yon_char_unite(int_str,"h",NULL); + case 1: interval = yon_char_unite(!yon_char_is_empty(interval)?interval:"",!yon_char_is_empty(interval)?",":"",int_str,"h",NULL); break; - case 2: interval = yon_char_unite(int_str,"d",NULL); + case 2: interval = yon_char_unite(!yon_char_is_empty(interval)?interval:"",!yon_char_is_empty(interval)?",":"",int_str,"d",NULL); break; - case 3: interval = yon_char_unite(int_str,"M",NULL); + case 3: interval = yon_char_unite(!yon_char_is_empty(interval)?interval:"",!yon_char_is_empty(interval)?",":"",int_str,"M",NULL); break; } yon_config_register(AUTOUPDATE_interval,AUTOUPDATE_interval_command,interval); @@ -159,7 +159,8 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){ void yon_load_proceed(YON_CONFIG_TYPE type){ yon_config_clean(); - if (!yon_char_is_empty(config_get_default_command)) + char *default_command = yon_char_unite(config_get_default_command,NULL); + if (!yon_char_is_empty(default_command)) yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); if (type==YON_CONFIG_GLOBAL){ yon_config_load_config(type,config_get_global_command,NULL); @@ -681,6 +682,13 @@ void on_mirror_add(GtkWidget *,main_window *widgets){ } +void on_password_encryption_changed(GtkComboBox *self, password_window *dialog){ + int active = gtk_combo_box_get_active(self); + gtk_widget_set_sensitive(dialog->NoEncriptionCheck,!!active); + if (!active) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->NoEncriptionCheck),0); +} + void on_password_open(GtkWidget *, web_publication_add_window *window){ password_window *dialog = yon_password_window_new(); yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(dialog->PasswordEntry)); @@ -691,6 +699,7 @@ void on_password_open(GtkWidget *, web_publication_add_window *window){ yon_dictionary_add_or_create_if_exists_with_data(dict,"target",window->UserPasswordEntry); g_signal_connect(G_OBJECT(dialog->AcceptButton),"clicked",G_CALLBACK(on_password_accept),dict); g_signal_connect(G_OBJECT(dialog->NoEncriptionCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),dialog->PasswordHashEntry); + g_signal_connect(G_OBJECT(dialog->EncryptionCombo),"changed",G_CALLBACK(on_password_encryption_changed),dialog); } void on_web_publish_remove(GtkWidget *self,main_window *widgets){ @@ -1300,11 +1309,15 @@ void on_password_accept(GtkWidget *,dictionary *dict){ return; } char *encryption = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo)); - - int size; - config_str hash = yon_config_load(!strcmp(encryption,"sha512")?sha512_encrypt_command(password):sha256_encrypt_command(password),&size); - yon_char_remove_last_symbol(hash[0],'\n'); - gtk_entry_set_text(GTK_ENTRY(target),hash[0]); + if (yon_char_is_empty(encryption)){ + gtk_entry_set_text(GTK_ENTRY(target),password); + + } else { + int size; + config_str hash = yon_config_load(yon_debug_output("%s\n",!strcmp(encryption,"sha512")?sha512_encrypt_command(password):sha256_encrypt_command(password)),&size); + yon_char_remove_last_symbol(hash[0],'\n'); + gtk_entry_set_text(GTK_ENTRY(target),hash[0]); + } } gtk_widget_destroy(window->Window); @@ -1737,7 +1750,16 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalSpin); g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->BootCheck); - + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->WebPublicationTree)); + for (unsigned int i=0;iBootCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateIntervalSpin),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateIntervalCombo),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); @@ -1751,12 +1773,6 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->RecieveDBFromNetCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->MirrorPublicCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); - GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->WebPublicationTree)); - for (unsigned int i=0;iMirrorTree)); yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->UpdateRepoTree)); @@ -1765,8 +1781,6 @@ void yon_main_window_complete(main_window *widgets){ yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->WebPublicationTree)); } yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size); - yon_load_proceed(YON_CONFIG_LOCAL); - yon_interface_update(widgets); yon_save_window_set_postsave_function(on_save_done,widgets); } diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h index 5a2490f..3ac3928 100644 --- a/source/ubl-settings-update.h +++ b/source/ubl-settings-update.h @@ -41,14 +41,14 @@ #define LocaleName "ubl-settings-update" #define icon_path "com.ublinux.ubl-settings-update" -#define sha256_encrypt_command(taget) yon_char_unite("echo -n \"",target,"\" | sha256sum | cut -f 1 -d ' '",NULL) -#define sha512_encrypt_command(taget) yon_char_unite("echo -n \"",target,"\" | sha512sum | cut -f 1 -d ' '",NULL) +#define sha256_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha256sum | cut -f 1 -d ' '",NULL) +#define sha512_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha512sum | cut -f 1 -d ' '",NULL) #define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get update REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL) -#define config_get_local_command "ubconfig --source system get update REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]" -#define config_get_global_command "ubconfig --source global get update REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]" -#define config_get_default_command "ubconfig --source global get update AUTOUPDATE[repos]" -#define config_get_command_no_repos(config,target) yon_char_unite("ubconfig --source ",config," get update ",target,NULL) +#define config_get_local_command "ubconfig --source system get update REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL +#define config_get_global_command "ubconfig --source global get update REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL +#define config_get_default_command "ubconfig --source default get update AUTOUPDATE[repos] AUTOUPDATE[interval] AUTOUPDATE[mode]",NULL +#define config_get_command_no_repos(config,target) yon_char_unite("ubconfig --source ",config," get update",target,NULL) #define config_get_global_only_parameters "" #define config_get_local_only_parameters "" @@ -327,6 +327,8 @@ void on_sign_cell_toggled(GtkWidget *, char *path, repo_add_window *window); void on_sign_check_toggled(GtkToggleButton *self, repo_add_window *window); +void on_password_encryption_changed(GtkComboBox *self, password_window *dialog); + 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/source/ubl-strings.h b/source/ubl-strings.h index 81acd31..0e94d38 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -154,6 +154,9 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si #define _LABEL _("Entryption:") #define _LABEL _("Do not encrypt password") #define _LABEL _("Password hash:") + #define _LABEL _("Default (None)") + #define _LABEL _("Encryption:") + #define _LABEL _("Encryption") */ #endif \ No newline at end of file diff --git a/ubl-settings-update-mirror-path-add.glade b/ubl-settings-update-mirror-path-add.glade index 2f7c3f7..e121a6a 100644 --- a/ubl-settings-update-mirror-path-add.glade +++ b/ubl-settings-update-mirror-path-add.glade @@ -26,6 +26,9 @@ True Remove image2 + False @@ -76,6 +79,9 @@ True Edit image1 + False diff --git a/ubl-settings-update-password.glade b/ubl-settings-update-password.glade index d3548a2..aceb9ba 100644 --- a/ubl-settings-update-password.glade +++ b/ubl-settings-update-password.glade @@ -173,7 +173,7 @@ Encryption 0 - Default + Default (None) SHA-512 SHA-256 @@ -212,6 +212,7 @@ Do not encrypt password True + False True False True diff --git a/ubl-settings-update-repo-add.glade b/ubl-settings-update-repo-add.glade index 8409ea9..3de80b9 100644 --- a/ubl-settings-update-repo-add.glade +++ b/ubl-settings-update-repo-add.glade @@ -13,6 +13,93 @@ False com.ublinux.libublsettingsui-gtk3.increase-symbolic + + + + + + + + + + + + False + Never + Signature verification will not be performed + + + False + Optional + Signatures will be verified if present, but unsigned databases and packages will also be accepted + + + True + Required + Signatures will be required for all packages and databases + + + False + TrustedOnly + If signature is verified for packages and database, it must be in the keyring and fully trusted; marginal trust not applicable + + + False + TrustAll + If signature is verified, it must be in keyring, but does not need to have a trust level assigned (e.g. unknown or marginal trust) + + + False + PackageNever + Packages only + + + False + DatabaseNever + Database only + + + False + PackageOptional + Packages only + + + True + DatabaseOptional + Database only + + + False + PackageRequired + Packages only + + + False + DatabaseRequired + Database only + + + False + PackageTrustedOnly + If signature is verified only for packages + + + False + DatabaseTrustedOnly + If signature is verified only for database + + + False + PackageTrustAll + If signature is verified only for packages + + + False + DatabaseTrustAll + If signature is verified only for database + + + 500 300 @@ -123,7 +210,7 @@ False 5 5 - 5 + 3 5 @@ -135,7 +222,6 @@ True False - 3 5 @@ -325,6 +411,8 @@ Configuration - configuration path True True + 3 + 3 in 200 @@ -376,7 +464,7 @@ Configuration - configuration path - False + True True 1 @@ -394,7 +482,7 @@ Configuration - configuration path - False + True True 3 @@ -551,7 +639,7 @@ Configuration - configuration path - True + False True 5 @@ -617,91 +705,4 @@ Configuration - configuration path - - - - - - - - - - - - False - Never - Signature verification will not be performed - - - False - Optional - Signatures will be verified if present, but unsigned databases and packages will also be accepted - - - True - Required - Signatures will be required for all packages and databases - - - False - TrustedOnly - If signature is verified for packages and database, it must be in the keyring and fully trusted; marginal trust not applicable - - - False - TrustAll - If signature is verified, it must be in keyring, but does not need to have a trust level assigned (e.g. unknown or marginal trust) - - - False - PackageNever - Packages only - - - False - DatabaseNever - Database only - - - False - PackageOptional - Packages only - - - True - DatabaseOptional - Database only - - - False - PackageRequired - Packages only - - - False - DatabaseRequired - Database only - - - False - PackageTrustedOnly - If signature is verified only for packages - - - False - DatabaseTrustedOnly - If signature is verified only for database - - - False - PackageTrustAll - If signature is verified only for packages - - - False - DatabaseTrustAll - If signature is verified only for database - - - diff --git a/ubl-settings-update-repo-path-add.glade b/ubl-settings-update-repo-path-add.glade index c3fed8f..07ad7ba 100644 --- a/ubl-settings-update-repo-path-add.glade +++ b/ubl-settings-update-repo-path-add.glade @@ -26,6 +26,9 @@ True Remove image2 + False @@ -78,6 +81,9 @@ True Edit image1 + False diff --git a/ubl-settings-update.pot b/ubl-settings-update.pot index d71078d..685e6a5 100644 --- a/ubl-settings-update.pot +++ b/ubl-settings-update.pot @@ -551,30 +551,42 @@ msgstr "" msgid "Sign level" msgstr "" -#: source/ubl-strings.h:149 +#: source/ubl-strings.h:150 msgid "Description" msgstr "" -#: source/ubl-strings.h:150 +#: source/ubl-strings.h:151 msgid "Password input" msgstr "" -#: source/ubl-strings.h:151 +#: source/ubl-strings.h:152 msgid "Password:" msgstr "" -#: source/ubl-strings.h:152 +#: source/ubl-strings.h:153 msgid "Repeat password:" msgstr "" -#: source/ubl-strings.h:153 +#: source/ubl-strings.h:154 msgid "Entryption:" msgstr "" -#: source/ubl-strings.h:154 +#: source/ubl-strings.h:155 msgid "Do not encrypt password" msgstr "" -#: source/ubl-strings.h:155 +#: source/ubl-strings.h:156 msgid "Password hash:" msgstr "" + +#: source/ubl-strings.h:157 +msgid "Default (None)" +msgstr "" + +#: source/ubl-strings.h:158 +msgid "Encryption:" +msgstr "" + +#: source/ubl-strings.h:159 +msgid "Encryption" +msgstr "" diff --git a/ubl-settings-update_ru.po b/ubl-settings-update_ru.po index 9f31adb..8a654f5 100644 --- a/ubl-settings-update_ru.po +++ b/ubl-settings-update_ru.po @@ -118,7 +118,10 @@ msgstr "" msgid "" "If signature is verified, it must be in keyring, but does not need to have a " "trust level assigned (e.g. unknown or marginal trust)" -msgstr "Если подпись проверена, она должна находиться в связке ключей, но ей не требуется назначать уровень доверия (например, неизвестное или предельное доверие)" +msgstr "" +"Если подпись проверена, она должна находиться в связке ключей, но ей не " +"требуется назначать уровень доверия (например, неизвестное или предельное " +"доверие)" #: source/ubl-strings.h:32 msgid "Packages only" @@ -578,34 +581,46 @@ msgstr "Система" msgid "Sign level" msgstr "Уровень подписи" -#: source/ubl-strings.h:149 +#: source/ubl-strings.h:150 msgid "Description" msgstr "Описание" -#: source/ubl-strings.h:150 +#: source/ubl-strings.h:151 msgid "Password input" msgstr "Ввод пароля" -#: source/ubl-strings.h:151 +#: source/ubl-strings.h:152 msgid "Password:" msgstr "Пароль:" -#: source/ubl-strings.h:152 +#: source/ubl-strings.h:153 msgid "Repeat password:" msgstr "Подтвердите ввод пароля:" -#: source/ubl-strings.h:153 +#: source/ubl-strings.h:154 msgid "Entryption:" msgstr "Алгоритм шифрования пароля:" -#: source/ubl-strings.h:154 +#: source/ubl-strings.h:155 msgid "Do not encrypt password" msgstr "Не шифровать пароль" -#: source/ubl-strings.h:155 +#: source/ubl-strings.h:156 msgid "Password hash:" msgstr "Пароль/Хэш пароля" +#: source/ubl-strings.h:157 +msgid "Default (None)" +msgstr "По умолчанию (Отсутствует)" + +#: source/ubl-strings.h:158 +msgid "Encryption:" +msgstr "Алгоритм шифрования пароля:" + +#: source/ubl-strings.h:159 +msgid "Encryption" +msgstr "Алгоритм шифрования пароля" + msgid "Check system updates at system startup" msgstr "Проверять обновления при загрузке системы"