From 38cefd2a9b3d65fdb56f54c335fb643037099ed4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 12:20:07 +0600 Subject: [PATCH] Localisation update; Fixed password entries sensitiveness --- source/ubinstall-gtk.c | 48 ++++++++++++++++++++++++++++++++++++++++++ source/ubl-strings.h | 11 +++++----- ubinstall-gtk.glade | 16 ++++++-------- ubinstall-gtk.pot | 10 ++++----- ubinstall-gtk_ru.po | 16 +++++++------- 5 files changed, 74 insertions(+), 27 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 14bb299..579468a 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -17,6 +17,50 @@ void on_autohostname_check(GtkWidget *, main_window *widgets){ } } +void yon_password_set_sensitive_from_toggle(GtkWidget *self, main_window *widgets); +void yon_password_set_sensitive_from_toggle(GtkWidget *self, main_window *widgets){ + GtkWidget *combo = NULL; + GtkWidget *entry = NULL; + if (self == widgets->PasswordSensitiveCheck){ + combo = widgets->PasswordCombo; + entry = widgets->PasswordEntry; + } else { + combo = widgets->AdminPasswordCombo; + entry = widgets->AdminPasswordEntry; + } + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self))){ + gtk_widget_set_sensitive(combo,1); + if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo))){ + gtk_widget_set_sensitive(entry,1); + } else { + gtk_widget_set_sensitive(entry,0); + } + } else { + gtk_widget_set_sensitive(combo,0); + gtk_widget_set_sensitive(entry,0); + + } +} + +void yon_password_combo_set_sensitive(GtkWidget *self, main_window *widgets); +void yon_password_combo_set_sensitive(GtkWidget *self, main_window *widgets){ + GtkWidget *entry = NULL; + GtkWidget *toggle = NULL; + if (self == widgets->PasswordCombo){ + entry = widgets->PasswordEntry; + toggle = widgets->PasswordSensitiveCheck; + } else if (self == widgets->AdminPasswordCombo){ + entry = widgets->AdminPasswordEntry; + toggle = widgets->RootPasswordSensitiveCheck; + } + if (gtk_combo_box_get_active(GTK_COMBO_BOX(self))&>k_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle))){ + gtk_widget_set_sensitive(entry,1); + } else { + gtk_widget_set_sensitive(entry,0); + + } +} + void on_autohostname_sensitiveness_check(GtkWidget *, main_window *widgets){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck))){ gtk_widget_set_sensitive(widgets->AutoHostnameCheck,1); @@ -2200,6 +2244,10 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(on_autohostname_check),widgets); g_signal_connect(G_OBJECT(widgets->HotnameEntry),"changed",G_CALLBACK(on_hostname_entry_changed),widgets); + g_signal_connect(G_OBJECT(widgets->PasswordCombo),"changed",G_CALLBACK(yon_password_combo_set_sensitive),widgets); + g_signal_connect(G_OBJECT(widgets->AdminPasswordCombo),"changed",G_CALLBACK(yon_password_combo_set_sensitive),widgets); + g_signal_connect(G_OBJECT(widgets->RootPasswordSensitiveCheck),"toggled",G_CALLBACK(yon_password_set_sensitive_from_toggle),widgets); + g_signal_connect(G_OBJECT(widgets->PasswordSensitiveCheck),"toggled",G_CALLBACK(yon_password_set_sensitive_from_toggle),widgets); gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0); gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index a3927ec..b635372 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -41,15 +41,16 @@ #define LAYOUT_CHANGING_LABEL _("Layout changing:") #define DEFAUL_LAYOUT_LABEL _("Default layout (ru)") #define DEFINE_LABEL _("Define") -#define ACCOUNT_NAME_LABEL _("Your account name:") -#define LOGIN__LABEL _("Login:") -#define PASSWORD__LABEL _("Password") +#define SETTINGS_LABEL _("Settings") +#define ACCOUNT_NAME_LABEL _("Administrator name:") +#define LOGIN__LABEL _("Administrator login:") +#define PASSWORD__LABEL _("Administrator password:") #define DEFAULT_LABEL _("Default") #define SET_PASSWORD_LABEL _("Set a password") #define DO_NOT_SET_PASSWORD_LABEL _("Do no set a password") #define AUTOMATIC_LOGIN_LABEL _("Automatic login without password prompt") -#define ADMIN_PASSWORD_LABEL _("Administrator password (root):") -#define COMPUTER_NAME_LABEL _("Computer name:") +#define ADMIN_PASSWORD_LABEL _("User root password:") +#define COMPUTER_NAME_LABEL _("Host name:") #define AUTOMATICALLY_LABEL _("Automatically") #define USER_LABEL _("User") #define COMPLETION_LABEL _("Completion") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index cf85e90..ca47ef4 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2256,7 +2256,7 @@ and help you install UBLinux on your computer True False - User + Settings @@ -2314,7 +2314,7 @@ and help you install UBLinux on your computer True False - Your account name: + Administrator name: 0 @@ -2362,7 +2362,7 @@ and help you install UBLinux on your computer True False - Login: + Administrator login: 0 @@ -2405,12 +2405,11 @@ and help you install UBLinux on your computer False False True - True False - Password + Administrator password: 0 @@ -2518,12 +2517,11 @@ and help you install UBLinux on your computer False False True - True False - Administrator password (root): + User root password: 0 @@ -2601,7 +2599,7 @@ and help you install UBLinux on your computer True False - Computer name: + Host name: 0 @@ -2617,7 +2615,7 @@ and help you install UBLinux on your computer True False True - ubstation + ublinux-install True diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 6054adf..463cd86 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -208,15 +208,15 @@ msgid "Define" msgstr "" #: source/ubl-strings.h:41 -msgid "Your account name:" +msgid "Administrator name:" msgstr "" #: source/ubl-strings.h:42 -msgid "Login:" +msgid "Administrator login:" msgstr "" #: source/ubl-strings.h:43 -msgid "Password" +msgid "Administrator password:" msgstr "" #: source/ubl-strings.h:44 @@ -236,11 +236,11 @@ msgid "Automatic login without password prompt" msgstr "" #: source/ubl-strings.h:48 -msgid "Administrator password (root):" +msgid "User root password:" msgstr "" #: source/ubl-strings.h:49 -msgid "Computer name:" +msgid "Host name:" msgstr "" #: source/ubl-strings.h:50 diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index 285dfed..51c9d5b 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -219,16 +219,16 @@ msgid "Define" msgstr "Задать" #: source/ubl-strings.h:41 -msgid "Your account name:" -msgstr "Имя аккаунта:" +msgid "Administrator name:" +msgstr "Имя администратора:" #: source/ubl-strings.h:42 -msgid "Login:" -msgstr "Логин:" +msgid "Administrator login:" +msgstr "Логин администратора:" #: source/ubl-strings.h:43 -msgid "Password" -msgstr "Пароль" +msgid "Administrator password:" +msgstr "Пароль администратора:" #: source/ubl-strings.h:44 msgid "Default" @@ -247,8 +247,8 @@ msgid "Automatic login without password prompt" msgstr "Автоматический вход в систему без запроса пароля" #: source/ubl-strings.h:48 -msgid "Administrator password (root):" -msgstr "Пароль администратора (root):" +msgid "User root password:" +msgstr "Пароль пользователя root:" #: source/ubl-strings.h:49 msgid "Computer name:"