From 98dab018a4bcad686893746d15918751f79aacf8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 20 Dec 2023 11:48:21 +0600 Subject: [PATCH] Russian localisation, saving and loading --- source/CMakeLists.txt | 20 +- source/ubl-settings-usergroups.c | 203 +++++++++++++++--- source/ubl-settings-usergroups.h | 4 + source/ubl-strings.h | 42 +++- ...tings-usergroups-additional-settings.glade | 3 +- ubl-settings-usergroups-group-creation.glade | 7 +- ubl-settings-usergroups-group.glade | 3 +- ubl-settings-usergroups-password.glade | 180 +++++++++------- ubl-settings-usergroups-system.glade | 4 +- ubl-settings-usergroups-user.glade | 5 +- ubl-settings-usergroups.desktop | 2 +- ubl-settings-usergroups.glade | 98 ++++----- ubl-settings-usergroups.pot | 176 +++++++++++++-- ubl-settings-usergroups_ru.po | 187 ++++++++++++++-- 14 files changed, 725 insertions(+), 209 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 3e6ddde..ffaa9fd 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,11 +8,6 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) -pkg_check_modules(VTE291 REQUIRED vte-2.91) -include_directories(${VTE291_INCLUDE_DIRS}) -link_directories(${VTE291_LIBRARY_DIRS}) -add_definitions(${VTE291_CFLAGS_OTHER}) - find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) option(WEBKIT_FOUND "No" OFF) @@ -84,8 +79,6 @@ set(SOURCE_FILES set(LIBRARIES ${GTK_LIBRARIES} - ${WEBKIT_LIBRARIES} - ${VTE291_LIBRARIES} ublsettings ublsettings-gtk3 ublsettingsui-gtk3 @@ -94,6 +87,19 @@ set(LIBRARIES add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}) target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES}) + +list(FIND LIBRARIES "vte-2.91" VTE_FOUND_INDEX) +list(FIND LIBRARIES "webkit" WEBKIT_FOUND_INDEX) + +if(NOT VTE_FOUND_INDEX EQUAL -1) + message(STATUS "Библиотека VTE не добавлена в target_link_libraries()") + add_definitions(-DVTE_INCLUDE) +endif() + +if(NOT WEBKIT_FOUND_INDEX EQUAL -1) + add_definitions(-DWEBKIT_INCLUDE) +endif() + target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR}) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C} diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 19f77ae..90df422 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -5,23 +5,87 @@ config main_config; //functions int yon_load_proceed(YON_CONFIG_TYPE type){ - if (yon_config_load_register(type,"logging","",NULL)){ - return 1; + if (yon_config_load_register(type,"users","DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL)){ + return 1; } + return 0; -} +} + +void yon_interface_update(main_window *widgets){ + gtk_list_store_clear(widgets->UsersList); + gtk_list_store_clear(widgets->GroupsList); + int size; + GtkTreeIter iter; + config_str users = yon_config_get_all_by_key("USERADD",&size); + if (users){ + for (int i=0;iUsersList,&iter); + int parameters_size; + config_str parameters = yon_char_parse(users[i],¶meters_size,":"); + free(yon_char_divide(parameters[0],7)); + char *login = yon_char_divide_search(parameters[i],"\"",-1); + login[strlen(login)-2]='\0'; + gtk_list_store_set(widgets->UsersList,&iter, + 2,login, + 3,parameters_size>0?parameters[0]:"", + 1,parameters_size>1?parameters[1]:"", + 4,parameters_size>2?parameters[2]:"", + 5,parameters_size>3?parameters[3]:"", + 6,parameters_size>4?parameters[4]:"", + 7,parameters_size>5?ENDRYPTED_LABEL:DEFAULT_USER_LABEL, + -1); + if(parameters) + free(parameters); + } + free(users); + } + config_str groups = yon_config_get_all_by_key("GROUPADD",&size); + if (groups){ + for (int i=0;iGroupsList,&iter); + int parameters_size; + config_str parameters = yon_char_parse(groups[i],¶meters_size,":"); + free(yon_char_divide(parameters[0],8)); + char *login = yon_char_divide_search(parameters[i],"\"",-1); + login[strlen(login)-2]='\0'; + gtk_list_store_set(widgets->GroupsList,&iter, + 1,login, + 0,parameters_size>1?parameters[1]:"", + 2,parameters_size>0?parameters[0]:"", + 3,parameters_size>2?parameters[2]:"", + 4,parameters_size>3?ENDRYPTED_LABEL:DEFAULT_USER_LABEL, + -1); + if(parameters) + free(parameters); + + } + } +} + +void on_config_local_load(GtkWidget *self, main_window *widgets){ + yon_load_proceed(YON_CONFIG_LOCAL); + main_config.load_mode=1; + yon_interface_update(widgets); +} + +void on_config_global_load(GtkWidget *self, main_window *widgets){ + yon_load_proceed(YON_CONFIG_GLOBAL); + main_config.load_mode=0; + yon_interface_update(widgets); +} void on_config_save(){ - yon_save_proceed(NULL,YON_CONFIG_BOTH,"logging", "",NULL); + yon_save_proceed(NULL,YON_CONFIG_BOTH,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL); } void on_config_global_save(){ - yon_save_proceed("global",YON_CONFIG_GLOBAL,"logging", "",NULL); + yon_save_proceed("global",YON_CONFIG_GLOBAL,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL); } void on_config_local_save(){ - yon_save_proceed("system",YON_CONFIG_LOCAL,"logging", "",NULL); + yon_save_proceed("system",YON_CONFIG_LOCAL,"users", "DEFAULTPASSWD DEFAULTROOTPASSWD DEFAULTUSER HASHPASSWD USERGROUPS ADDADM USERADD[*] USERSHADOW[*] GROUPADD[*]",NULL); } void on_password_combo_changed(GtkComboBox *self, GtkWidget *target){ @@ -102,8 +166,15 @@ void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target){ } -void on_password_change(GtkWidget *self, GtkEntry *output_target){ +void on_password_change(GtkWidget *self, dictionary *entry_dict){ + GtkComboBox *combo = yon_dictionary_get_data(entry_dict->first,GtkComboBox*); + GtkEntry *output_target = yon_dictionary_get_data(entry_dict->first->next,GtkEntry*); ubl_settings_usergroups_password_window *window = yon_ubl_settings_usergroups_password_new(); + int active = gtk_combo_box_get_active(combo); + if (active == 2) + gtk_widget_hide(window->HashBox); + else if (active==3) + gtk_widget_hide(window->PasswordBox); dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); yon_dictionary_add_or_create_if_exists_with_data(dict,"target",output_target); @@ -122,7 +193,7 @@ void on_additional_settings_clicked(GtkWidget *self, GtkEntry *output_target){ } void on_expiration_clicked(GtkWidget *self, GtkEntry *output_target){ - + } // standard functions @@ -196,8 +267,15 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_additional_settings_save),window); - g_signal_connect(G_OBJECT(window->DefaultPasswordButton),"clicked",G_CALLBACK(on_password_change),window->DefaultPasswordEntry); - g_signal_connect(G_OBJECT(window->RootPasswordButton),"clicked",G_CALLBACK(on_password_change),window->RootPasswordEntry); + dictionary *default_dict=NULL; + yon_dictionary_add_or_create_if_exists_with_data(default_dict,"combo",window->DefaultPasswordCombo); + yon_dictionary_add_or_create_if_exists_with_data(default_dict,"entry",window->DefaultPasswordEntry); + + dictionary *root_dict=NULL; + yon_dictionary_add_or_create_if_exists_with_data(root_dict,"combo",window->RootPasswordCombo); + yon_dictionary_add_or_create_if_exists_with_data(root_dict,"entry",window->RootPasswordEntry); + g_signal_connect(G_OBJECT(window->DefaultPasswordButton),"clicked",G_CALLBACK(on_password_change),default_dict); + g_signal_connect(G_OBJECT(window->RootPasswordButton),"clicked",G_CALLBACK(on_password_change),root_dict); g_signal_connect(G_OBJECT(window->RootPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->RootPasswordButton); g_signal_connect(G_OBJECT(window->DefaultPasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->DefaultPasswordButton); @@ -305,12 +383,15 @@ ubl_settings_usergroups_group_creation_window *yon_ubl_settings_usergroups_group window->PasswordEntry=yon_gtk_builder_get_widget(builder,"PasswordEntry"); window->ChangePasswordButton=yon_gtk_builder_get_widget(builder,"ChangePasswordButton"); - g_signal_connect(G_OBJECT(window->UnuniqueGIDCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userLoginEntry); - g_signal_connect(G_OBJECT(window->ChangePasswordButton),"clicked",G_CALLBACK(on_password_change),window->PasswordEntry); + gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),TITLE_LABEL); + dictionary *entry_dict=NULL; + yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->PasswordCombo); + yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->PasswordEntry); + g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry); + g_signal_connect(G_OBJECT(window->ChangePasswordButton),"clicked",G_CALLBACK(on_password_change),entry_dict); g_signal_connect(G_OBJECT(window->PasswordCombo),"changed",G_CALLBACK(on_password_combo_changed),window->ChangePasswordButton); - g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry); g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); - g_signal_connect(G_OBJECT(window->UserAdditionalGroupsButton),"clicked",G_CALLBACK(on_user_choose),window); + g_signal_connect(G_OBJECT(window->UserAdditionalGroupsButton),"clicked",G_CALLBACK(on_user_choose),window->userGroupsEntry); return window; } @@ -418,16 +499,30 @@ void on_password_changed(GtkEntry *self, ubl_settings_usergroups_password_window void on_password_accept(GtkWidget *self, dictionary *dict){ ubl_settings_usergroups_password_window *window = yon_dictionary_get_data(dict->first,ubl_settings_usergroups_password_window*); GtkEntry *entry = yon_dictionary_get_data(dict->first->next,GtkEntry*); - char *pasted_hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry)); - if (yon_char_is_empty(pasted_hash)){ + if (gtk_widget_get_visible(window->HashBox)){ + char *pasted_hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry)); + if (yon_char_is_empty(pasted_hash)){ + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } else { + gtk_entry_set_text(entry,pasted_hash); + } + } else { char *password = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry))); - char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); + if (yon_char_is_empty(password)){ + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } + char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); if (!strcmp(password,password_check)){ char *passwd_hash = g_malloc0(101); FILE *fl = popen(password_hash_get_command(password),"r"); fgets(passwd_hash,100,fl); if (passwd_hash[strlen(passwd_hash)-1]=='\n') passwd_hash[strlen(passwd_hash)-1]='\0'; gtk_entry_set_text(entry,passwd_hash); + } else { + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + return; } } on_subwindow_close(self); @@ -441,6 +536,8 @@ ubl_settings_usergroups_password_window *yon_ubl_settings_usergroups_password_ne window->PasswordEntry=yon_gtk_builder_get_widget(builder,"PasswordEntry"); window->RepeatPasswordEntry=yon_gtk_builder_get_widget(builder,"RepeatPasswordEntry"); window->PasswordHashEntry=yon_gtk_builder_get_widget(builder,"PasswordHashEntry"); + window->HashBox=yon_gtk_builder_get_widget(builder,"HashBox"); + window->PasswordBox=yon_gtk_builder_get_widget(builder,"PasswordBox"); window->UserCancelButton=yon_gtk_builder_get_widget(builder,"UserCancelButton"); window->UserOkButton=yon_gtk_builder_get_widget(builder,"UserOkButton"); @@ -633,9 +730,11 @@ void on_user_save(GtkWidget *self, dictionary *dict){ extra_options=(char*)gtk_entry_get_text(GTK_ENTRY(window->userExtraOptionsEntry)); - time_t t = time(NULL); - struct tm tm = *localtime(&t); - password_changed_date = yon_char_unite(yon_char_from_int(tm.tm_mday),".",yon_char_from_int(tm.tm_mon+1),".",yon_char_from_int(1900+tm.tm_year),NULL); + if (window->old_password&&strcmp(window->old_password,password)){ + time_t t = time(NULL); + struct tm tm = *localtime(&t); + password_changed_date = yon_char_unite(yon_char_from_int(tm.tm_mday),".",yon_char_from_int(tm.tm_mon+1),".",yon_char_from_int(1900+tm.tm_year),NULL); + } char *shadow_string = NULL; shadow_string = yon_char_unite(yon_char_return_if_exist(password_changed_date,""), @@ -705,11 +804,15 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){ window->UserCancelButton=yon_gtk_builder_get_widget(builder,"UserCancelButton"); window->UserOkButton=yon_gtk_builder_get_widget(builder,"UserOkButton"); + window->old_password=NULL; + dictionary *entry_dict = NULL; + yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->userPasswordCombo); + yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->userPasswordEntry); g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry); g_signal_connect(G_OBJECT(window->userHomeButton),"clicked",G_CALLBACK(on_filechooser_open),window->userHomeEntry); g_signal_connect(G_OBJECT(window->UserGroupsButton),"clicked",G_CALLBACK(on_groups_clicked),window->userGroupsEntry); - g_signal_connect(G_OBJECT(window->userPasswordButton),"clicked",G_CALLBACK(on_password_change),window->userPasswordEntry); + g_signal_connect(G_OBJECT(window->userPasswordButton),"clicked",G_CALLBACK(on_password_change),entry_dict); g_signal_connect(G_OBJECT(window->userAdditionalGroupsButton),"clicked",G_CALLBACK(on_groups_multiple_clicked),window->userAdditionalGroupsEntry); g_signal_connect(G_OBJECT(window->userPasswordExpirationButton),"clicked",G_CALLBACK(on_expiration_clicked),window->userPasswordExpirationEntry); g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry); @@ -764,7 +867,9 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ char *name; gtk_tree_model_get(GTK_TREE_MODEL(widgets->UsersList),&iter,2,&name,-1); char *parameter_string = yon_config_get_by_key(USERADD(name)); - int parsed_size; + int parsed_size=0; + if (parameter_string[0]=='\"') yon_char_divide(parameter_string,0); + if (parameter_string[strlen(parameter_string)-1]=='\"') parameter_string[strlen(parameter_string)-1]='\0'; config_str parameters = yon_char_parse(parameter_string,&parsed_size,":"); gtk_entry_set_text(GTK_ENTRY(window->userLoginEntry), name); gtk_entry_set_text(GTK_ENTRY(window->userUserNameEntry), parsed_size>0?parameters[0]:""); @@ -809,6 +914,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ } // gtk_entry_set_text(GTK_ENTRY(window->), parsed_size>4?parameters[4]:""); } + window->old_password=parameters[5]; gtk_entry_set_text(GTK_ENTRY(window->userPasswordEntry), parsed_size>5?parameters[5]:""); free(parameters); parameters=yon_char_parse(yon_config_get_by_key(USERSHADOW(name)),&parsed_size,":"); @@ -829,6 +935,47 @@ void on_main_edit(GtkWidget *self, main_window *widgets){ yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); g_signal_connect(G_OBJECT(window->UserOkButton),"clicked",G_CALLBACK(on_group_save),dict); + char *name; + gtk_tree_model_get(model,&iter,1,&name,-1); + char *config_string = yon_config_get_by_key(GROUPADD(name)); + if (!yon_char_is_empty(config_string)){ + if (config_string[0]=='\"') yon_char_divide(config_string,0); + if (config_string[strlen(config_string)-1]=='\"') config_string[strlen(config_string)-1]='\0'; + int size; + config_str parsed = yon_char_parse(config_string,&size,":"); + gtk_entry_set_text(GTK_ENTRY(window->userLoginEntry),name); + gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),size>1?parsed[0]:""); + if (size>1){ + if (!strcmp(parsed[1],"")||!strcmp(parsed[1],"x")) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),1); + else + gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry),parsed[1]); + } + if (size>2&&!yon_char_is_empty(parsed[2])){ + int parsed_size=0; + config_str substring = yon_char_parse(parsed[2],&parsed_size," "); + for (int i=0;iUnuniqueGIDCheck),1); + } else if (!strcmp(substring[i],"--system")||!strcmp(substring[i],"-r")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SystemGroupCheck),1); + } + } + } + free(substring); + } + if (size>3){ + if (strcmp(parsed[3],"")&&strcmp(parsed[3],"x")){ + gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),parsed[3]); + gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),3); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(window->PasswordCombo),1); + } + } + } else { + yon_ubl_status_box_render(LOADING_FAILED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + } gtk_window_set_transient_for(GTK_WINDOW(window->CreateGroupWindow),GTK_WINDOW(widgets->Window)); gtk_widget_show(window->CreateGroupWindow); @@ -866,11 +1013,11 @@ void config_init(){ main_config.save_socket_id=-1; main_config.load_socket_id=-1; main_config.lock_help=0; - main_config.lock_help=0; main_config.lock_load_global=0; main_config.lock_save_global=0; main_config.lock_save_local=0; main_config.groups_size=0; + main_config.load_mode=1; main_config.groups = yon_file_open(groups_path,&main_config.groups_size); } @@ -924,9 +1071,12 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_save),widgets); g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets); g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets); - - gtk_widget_show(widgets->Window); + g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets); + g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); + yon_load_proceed(YON_CONFIG_LOCAL); + yon_interface_update((main_window*)widgets); + } int main(int argc, char *argv[]){ @@ -1010,6 +1160,5 @@ int main(int argc, char *argv[]){ yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK); template_main_window *widgets = yon_ubl_window_setup(); yon_main_window_complete((main_window*)widgets); - yon_load_proceed(YON_CONFIG_LOCAL); - gtk_main(); + gtk_main(); } \ No newline at end of file diff --git a/source/ubl-settings-usergroups.h b/source/ubl-settings-usergroups.h index f0359c3..ca5ce0f 100644 --- a/source/ubl-settings-usergroups.h +++ b/source/ubl-settings-usergroups.h @@ -181,6 +181,8 @@ typedef struct{ GtkWidget *PasswordEntry; GtkWidget *RepeatPasswordEntry; GtkWidget *PasswordHashEntry; + GtkWidget *HashBox; + GtkWidget *PasswordBox; } ubl_settings_usergroups_password_window; typedef struct{ @@ -226,6 +228,8 @@ typedef struct{ GtkWidget *userExtraOptionsEntry; GtkWidget *UserCancelButton; GtkWidget *UserOkButton; + + char *old_password; } ubl_settings_usergroups_user_window; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 684a255..8a04bb9 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -39,12 +39,21 @@ #define GROUPS_USERS_LABEL _("Group users") #define GROUPS_LABEL _("Groups") +#define INSPECT_SYSTEM_LABEL _("Inspect users and groups in system") +#define ADDITIONAL_SETTINGS_LABEL _("Additional settings") +#define SHARED_GROUPS_SETTINGS_LABEL _("Shared groups configuration") +#define CREATE_NEW_LABEL _("Create new") +#define EDIT_LABEL _("Edit") +#define REMOVE_LABEL _("Remove") +#define UPDATE_LABEL _("Update users and groups") + //ubl-settings-usergroups-additional-settings.glade +#define ADDITIONAL_SETTINGS_TITLE_LABEL _("Users and groups - additional settings") +#define NO_PASSWORD_LABEL _("No password required") #define SET_PASSWORD_LABEL _("Set a password") #define ENDRYPTED_LABEL _("Endrypted password") #define MD5_LABEL "md5" #define YESCRYPT_LABEL "yescrypt" -#define NO_PASSWORD_LABEL _("No password required") #define SCRYPT_LABEL "scrypt" #define BF_LABEL "bf" #define BCRYPT_LABEL "bcrypt" @@ -58,14 +67,19 @@ #define ACCEPT_LABEL _("Accept") //ubl-settings-usergroups-group-creation.glade +#define GROUP_TITLE_LABEL _("Users and groups - group configuration") +#define GROUP_ID_LABEL _("Group id:") +#define GROUP_CREATION_NAME_LABEL _("Group name:") +#define GROUP_USERS_LABEL _("Group users:") #define AUTOMATICALLY_LABEL _("Automatically") -#define LOGIN_GROUP_LABEL _("login") +#define LOGIN_GROUP_LABEL _("Login") #define CREATE_GROUP_UNUNIQUE_LABEL _("Create group with ununique GID") #define CREATE_SYSTEM_GROUP_LABEL _("Create system group") #define ENCRYPTED_PASSWORD_LABEL _("Encrypted password") #define ADDITIONAL_CONFIGURATION_LABEL _("Additional configuration") //ubl-settings-usergroups-group.glade +#define GROUPS_TITLE_LABEL _("Users and groups - groups") #define ADM_LABEL "adm" #define AUDIO_LABEL "audio" #define AUTOLIGIN_LABEL "autologin" @@ -79,6 +93,7 @@ #define COLORD_LABEL "colord" //ubl-settings-usergroups-system.glade +#define INSPECTOR_TITLE_LABEL _("Users and groups - system users and groups") #define BLOCKED_LABEL _("Blocked") #define USERNAME_LABEL _("Username") #define PRIMARY_GROUP_LABEL _("Primary group") @@ -89,5 +104,26 @@ #define GROUP_LABEL _("Group") //ubl-settings-usergroups-user.glade +#define USER_TITLE_LABEL _("Users and groups - user configuration") #define SET_LABEL _("Set") -#define EMPTY_IMPORTANT_LABEL _("Empty important field") \ No newline at end of file +#define EMPTY_IMPORTANT_LABEL _("Empty important field") +#define LOADING_FAILED_LABEL _("Loading has failed") +#define LOGIN_NAME_LABEL _("Login name") +#define ADDITIONAL_GROUPS_LABEL _("Additional groups:") +#define PASSWORD_SECTION_LABEL _("Password configuration") +#define PASSWORD_CHANGE_DATA_LABEL _("Password has been changed:") +#define EXPIRATION_DATE_LABEL _("expiration date:") +#define PASSWORD_MIN_INTERVAL_LABEL _("Password change interval: minimum") +#define PASSWORD_MAX_INTERVAL_LABEL _("days, maximum") +#define DAYS_LABEL _("days") +#define DAYS_WARNING_LABEL _("Days until warning") +#define DAYS_ACTIVITY_LABEL _("Days without activity") +#define FORCE_CONFIGURE_LABEL _("Force change at next login") +#define USER_SHELL_LABEL _("User shell") +#define HOME_DIR_LABEL _("Home directory") +#define DONT_SET_LABEL _("Don't set") +#define CREATE_SYSTEM_USER_LABEL _("Create system user") +#define CREATE_UNUNIQUE_LABEL _("Create user with ununique (repeating) UID") +#define DO_NOT_CHECK_LABEL _("Do not check login for compliance with character rules") +#define TEMPORARY_DEACTIVATION_LABEL _("Temporary deactivation") +#define SAVE_LABEL _("Save") \ No newline at end of file diff --git a/ubl-settings-usergroups-additional-settings.glade b/ubl-settings-usergroups-additional-settings.glade index 0dba5a6..28670dd 100644 --- a/ubl-settings-usergroups-additional-settings.glade +++ b/ubl-settings-usergroups-additional-settings.glade @@ -23,11 +23,10 @@ False com.ublinux.ubl-settings-usergroups.edit-symbolic - + 600 350 False - False True com.ublinux.ubl-settings-usergroups diff --git a/ubl-settings-usergroups-group-creation.glade b/ubl-settings-usergroups-group-creation.glade index 3d1a328..e852c66 100644 --- a/ubl-settings-usergroups-group-creation.glade +++ b/ubl-settings-usergroups-group-creation.glade @@ -23,9 +23,8 @@ False com.ublinux.ubl-settings-usergroups.accept-symbolic - + False - False True 450 com.ublinux.ubl-settings-usergroups @@ -236,7 +235,7 @@ - Save + Accept True True True @@ -346,6 +345,7 @@ True + False True False * @@ -361,6 +361,7 @@ True + False True True image2 diff --git a/ubl-settings-usergroups-group.glade b/ubl-settings-usergroups-group.glade index b04bc10..48784f1 100644 --- a/ubl-settings-usergroups-group.glade +++ b/ubl-settings-usergroups-group.glade @@ -13,11 +13,10 @@ False com.ublinux.ubl-settings-usergroups.accept-symbolic - + 250 385 False - False True com.ublinux.ubl-settings-usergroups diff --git a/ubl-settings-usergroups-password.glade b/ubl-settings-usergroups-password.glade index fcd4258..1fcc102 100644 --- a/ubl-settings-usergroups-password.glade +++ b/ubl-settings-usergroups-password.glade @@ -13,7 +13,7 @@ False com.ublinux.ubl-settings-usergroups.accept-symbolic - + False False True @@ -102,33 +102,46 @@ vertical 5 - + True False + vertical 5 - + True False - Parrword: - 0 - - - False - True - 0 - - - - - True - True - False - * - True - com.ublinux.ubl-settings-usergroups.view-symbolic - ******** - password + 5 + + + True + False + Parrword: + 0 + + + False + True + 0 + + + + + True + True + False + * + True + com.ublinux.ubl-settings-usergroups.view-symbolic + ******** + password + + + True + True + 1 + + True @@ -136,77 +149,65 @@ 1 - - - True - True - 0 - - - - - True - False - 5 - + True False - Repeat password: - 0 - - - False - True - 0 - - - - - True - True - False - * - True - com.ublinux.ubl-settings-usergroups.view-symbolic - ******** - password + 5 + + + True + False + Repeat password: + 0 + + + False + True + 0 + + + + + True + True + False + * + True + com.ublinux.ubl-settings-usergroups.view-symbolic + ******** + password + + + True + True + 1 + + True True - 1 + 2 - - True - True - 1 - - - - - True - False - False True - 2 + 1 - + True False + vertical 5 - + True False - Password hash: - 0 False @@ -215,12 +216,37 @@ - + True - True - False - * - com.ublinux.ubl-settings-usergroups.view-symbolic + False + 5 + + + True + False + Password hash: + 0 + + + False + True + 0 + + + + + True + True + False + * + com.ublinux.ubl-settings-usergroups.view-symbolic + + + True + True + 1 + + True @@ -230,7 +256,7 @@ - True + False True 3 diff --git a/ubl-settings-usergroups-system.glade b/ubl-settings-usergroups-system.glade index 8404a6d..facfde8 100644 --- a/ubl-settings-usergroups-system.glade +++ b/ubl-settings-usergroups-system.glade @@ -15,11 +15,11 @@ - + 800 600 False - False + True com.ublinux.ubl-settings-usergroups diff --git a/ubl-settings-usergroups-user.glade b/ubl-settings-usergroups-user.glade index 935fe26..e0e8f79 100644 --- a/ubl-settings-usergroups-user.glade +++ b/ubl-settings-usergroups-user.glade @@ -59,10 +59,9 @@ False com.ublinux.ubl-settings-usergroups.cancel-symbolic - + 500 False - False True com.ublinux.ubl-settings-usergroups @@ -75,6 +74,7 @@ True False + vertical @@ -468,6 +468,7 @@ True + False True diff --git a/ubl-settings-usergroups.desktop b/ubl-settings-usergroups.desktop index e192dfd..3fb651c 100644 --- a/ubl-settings-usergroups.desktop +++ b/ubl-settings-usergroups.desktop @@ -12,4 +12,4 @@ Icon=com.ublinux.ubl-settings-usergroups Terminal=false X-XfcePluggable=true X-UBLPluggable=true -Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-Personal-Settings; +Categories=XFCE;GTK;Settings;DesktopSettings;X-UBL-SettingsManager;X-UBL-Personal-Settings; diff --git a/ubl-settings-usergroups.glade b/ubl-settings-usergroups.glade index c7b056e..b9980df 100644 --- a/ubl-settings-usergroups.glade +++ b/ubl-settings-usergroups.glade @@ -33,62 +33,36 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - - - - - - - - - + - + - - - + - - - + - + - - - - - - - - - + - + - + - + - - - + - - - + - + + + - - @@ -149,6 +123,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True True True + Inspect users and groups in system image12