Page changing for user and group creation window to the page, where error occured

pull/235/head
Ivan Dmitrievich Yartsev 10 months ago
parent 43775a720b
commit 87c24ac9d2

@ -47,6 +47,7 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
window->UsershadowBootCheck=yon_gtk_builder_get_widget(builder,"UsershadowBootCheck");
window->UsershadowShutdownCheck=yon_gtk_builder_get_widget(builder,"UsershadowShutdownCheck");
window->userTitleNameLabel=yon_gtk_builder_get_widget(builder,"userTitleNameLabel");
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
window->expiration_unix=NULL;
window->last_uid=NULL;
@ -238,6 +239,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (found){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?UID_ALREADY_EXIST_CONFIG_LABEL:UID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return;
}
}
@ -246,6 +248,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(uid_string)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return;
}
}
@ -263,6 +266,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(login)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userLoginEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return;
}
@ -272,6 +276,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(password)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userPasswordEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return;
}
} else if (password_active==1){

@ -1418,6 +1418,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
gid = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
if (yon_char_is_empty(gid)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
return;
}
@ -1445,6 +1446,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
if (found){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),found==1?GID_ALREADY_EXIST_CONFIG_LABEL:GID_ALREADY_EXIST_SYSTEM_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return;
}
}
@ -1459,6 +1461,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
}
if (yon_char_is_empty(group_name)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userLoginEntry);
return;
}
@ -1466,6 +1469,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
group_users = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
if (yon_char_is_empty(group_users)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userGroupsEntry);
return;
}
@ -1495,6 +1499,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
if (yon_char_is_empty(password)){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
return;
}
@ -1578,6 +1583,7 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group
window->AdminGroupsButton=yon_gtk_builder_get_widget(builder,"AdminGroupsButton");
window->GroupaddShutdownCheck=yon_gtk_builder_get_widget(builder,"GroupaddShutdownCheck");
window->groupExtraOptionsEntry=yon_gtk_builder_get_widget(builder,"groupExtraOptionsEntry");
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
window->last_gid=NULL;
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),GROUPS_TITLE_LABEL);

@ -263,6 +263,7 @@ typedef struct{
GtkWidget *AdminGroupsButton;
GtkWidget *GroupaddShutdownCheck;
GtkWidget *groupExtraOptionsEntry;
GtkWidget *MainNotebook;
char *last_gid;
} ubl_settings_usergroups_group_creation_window;
@ -350,6 +351,7 @@ typedef struct{
GtkWidget *UsershadowShutdownCheck;
GtkWidget *userTitleNameLabel;
GtkWidget *userSyncSAMBAPasswordCheck;
GtkWidget *MainNotebook;
char *expiration_unix;

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="ubl-settings-usergroups">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubl-settings-usergroups.css -->
@ -56,7 +56,7 @@
</packing>
</child>
<child>
<object class="GtkNotebook">
<object class="GtkNotebook" id="MainNotebook">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">5</property>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="ubl-settings-usergroups">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubl-settings-usergroups.css -->
@ -86,7 +86,7 @@
</packing>
</child>
<child>
<object class="GtkNotebook">
<object class="GtkNotebook" id="MainNotebook">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>

Loading…
Cancel
Save