Key creation window fixes

pull/99/head
parent bfd23ed410
commit bb64efad14

@ -873,6 +873,11 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){
const char *email = gtk_entry_get_text(GTK_ENTRY(window->EmailEntry)); const char *email = gtk_entry_get_text(GTK_ENTRY(window->EmailEntry));
char *strength = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->KeyStrengthSpin))); char *strength = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->KeyStrengthSpin)));
const char *comment = gtk_entry_get_text(GTK_ENTRY(window->CommentsEntry)); const char *comment = gtk_entry_get_text(GTK_ENTRY(window->CommentsEntry));
if (!yon_char_is_empty(name)&&strlen(name)<5){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NAME_SHORT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->NameEntry);
return;
}
GtkWidget *highlight_target=NULL; GtkWidget *highlight_target=NULL;
if (yon_char_is_empty(name)){ if (yon_char_is_empty(name)){
highlight_target=window->NameEntry; highlight_target=window->NameEntry;
@ -882,8 +887,6 @@ void on_key_generate_accept(GtkWidget *self, key_creation_window* window){
highlight_target=window->EmailEntry; highlight_target=window->EmailEntry;
} else if (yon_char_is_empty(strength)){ } else if (yon_char_is_empty(strength)){
highlight_target=window->KeyStrengthSpin; highlight_target=window->KeyStrengthSpin;
} else if (yon_char_is_empty(comment)){
highlight_target=window->CommentsEntry;
} }
if (highlight_target){ if (highlight_target){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
@ -939,6 +942,8 @@ key_creation_window *yon_key_creation_window_new(){
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordConfirmationEntry)); yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordConfirmationEntry));
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry)); yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->PasswordEntry));
g_signal_connect(G_OBJECT(window->ExpireCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),window->ExpireButton);
g_signal_connect(G_OBJECT(window->ExpireCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),window->ExpireEntry);
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->ExpireButton),"clicked",G_CALLBACK(on_calendar_open),window); g_signal_connect(G_OBJECT(window->ExpireButton),"clicked",G_CALLBACK(on_calendar_open),window);
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_key_generate_accept),window); g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_key_generate_accept),window);
@ -954,6 +959,7 @@ key_creation_window *yon_key_creation_window_new(){
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->EncryptionCombo),parsed[2],parsed[0]); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(window->EncryptionCombo),parsed[2],parsed[0]);
yon_char_parsed_free(parsed,parsed_size); yon_char_parsed_free(parsed,parsed_size);
} }
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->EncryptionCombo),"RSA");
return window; return window;
} }

@ -165,3 +165,5 @@
#define EMPTY_FOLDER_LABEL _("Folder must contain repositories") #define EMPTY_FOLDER_LABEL _("Folder must contain repositories")
#define FILES_EXIST_LABEL _("Folder must not be empty") #define FILES_EXIST_LABEL _("Folder must not be empty")
#define NAME_SHORT_LABEL _("Name must be 5 or more symbols")

@ -288,6 +288,7 @@
<child> <child>
<object class="GtkEntry" id="ExpireEntry"> <object class="GtkEntry" id="ExpireEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
<packing> <packing>
@ -299,6 +300,7 @@
<child> <child>
<object class="GtkButton" id="ExpireButton"> <object class="GtkButton" id="ExpireButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="image">image1</property> <property name="image">image1</property>

@ -407,7 +407,7 @@ msgstr "Выберите репозиторий или пакет для под
#: source/ubl-strings.h:117 #: source/ubl-strings.h:117
msgid "Name:" msgid "Name:"
msgstr "Название:" msgstr "Имя:"
#: source/ubl-strings.h:118 #: source/ubl-strings.h:118
msgid "Branches:" msgid "Branches:"

Loading…
Cancel
Save