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->UsershadowBootCheck=yon_gtk_builder_get_widget(builder,"UsershadowBootCheck");
window->UsershadowShutdownCheck=yon_gtk_builder_get_widget(builder,"UsershadowShutdownCheck"); window->UsershadowShutdownCheck=yon_gtk_builder_get_widget(builder,"UsershadowShutdownCheck");
window->userTitleNameLabel=yon_gtk_builder_get_widget(builder,"userTitleNameLabel"); window->userTitleNameLabel=yon_gtk_builder_get_widget(builder,"userTitleNameLabel");
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
window->expiration_unix=NULL; window->expiration_unix=NULL;
window->last_uid=NULL; window->last_uid=NULL;
@ -238,6 +239,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (found){ 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_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); yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return; return;
} }
} }
@ -246,6 +248,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(uid_string)){ 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_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userUIDEntry); yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return; return;
} }
} }
@ -263,6 +266,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(login)){ 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_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userLoginEntry); yon_ubl_status_highlight_incorrect(window->userLoginEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return; return;
} }
@ -272,6 +276,7 @@ void on_user_save(GtkWidget *self, dictionary *dict){
if (yon_char_is_empty(password)){ 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_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(window->userPasswordEntry); yon_ubl_status_highlight_incorrect(window->userPasswordEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return; return;
} }
} else if (password_active==1){ } 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)); gid = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
if (yon_char_is_empty(gid)){ if (yon_char_is_empty(gid)){
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);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userUIDEntry); yon_ubl_status_highlight_incorrect(window->userUIDEntry);
return; return;
} }
@ -1445,6 +1446,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
if (found){ 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_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); yon_ubl_status_highlight_incorrect(window->userUIDEntry);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
return; return;
} }
} }
@ -1459,6 +1461,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
} }
if (yon_char_is_empty(group_name)){ if (yon_char_is_empty(group_name)){
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);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userLoginEntry); yon_ubl_status_highlight_incorrect(window->userLoginEntry);
return; return;
} }
@ -1466,6 +1469,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
group_users = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry)); group_users = (char*)gtk_entry_get_text(GTK_ENTRY(window->userGroupsEntry));
if (yon_char_is_empty(group_users)){ if (yon_char_is_empty(group_users)){
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);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->MainNotebook),0);
yon_ubl_status_highlight_incorrect(window->userGroupsEntry); yon_ubl_status_highlight_incorrect(window->userGroupsEntry);
return; return;
} }
@ -1495,6 +1499,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
if (yon_char_is_empty(password)){ 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_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); yon_ubl_status_highlight_incorrect(window->PasswordEntry);
return; 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->AdminGroupsButton=yon_gtk_builder_get_widget(builder,"AdminGroupsButton");
window->GroupaddShutdownCheck=yon_gtk_builder_get_widget(builder,"GroupaddShutdownCheck"); window->GroupaddShutdownCheck=yon_gtk_builder_get_widget(builder,"GroupaddShutdownCheck");
window->groupExtraOptionsEntry=yon_gtk_builder_get_widget(builder,"groupExtraOptionsEntry"); window->groupExtraOptionsEntry=yon_gtk_builder_get_widget(builder,"groupExtraOptionsEntry");
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
window->last_gid=NULL; window->last_gid=NULL;
gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),GROUPS_TITLE_LABEL); gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),GROUPS_TITLE_LABEL);

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

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

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

Loading…
Cancel
Save