From 2025dea7b834f123832d8678343067f920c94ff2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 31 Jul 2024 18:06:30 +0600 Subject: [PATCH 01/10] Test fix for RAM --- source/ubinstall-gtk.c | 94 ++++++------ source/ubinstall-gtk.h | 2 +- ubinstall-gtk.glade | 316 ++++++++++++----------------------------- 3 files changed, 143 insertions(+), 269 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 205ef12..00012c7 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -778,31 +778,37 @@ void on_configuration_mode_switch(GtkWidget *self){ main_config.configure_mode = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self)); } +int cur_slide=0; + int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled); -int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled){ - - int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - yon_debug_output("width: %s\n",yon_char_from_int(width)); - yon_debug_output("height: %s\n\n",yon_char_from_int(height)); - int newImgWidthDef = (width <= 217) ? width : width - 30; - int newImgHeightDef = (height <= 120) ? height : height - 217; - GdkPixbuf *pixBuf = pixbuf_unscaled; - int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); - if (newImgHeight > newImgHeightDef) { - newImgHeight = newImgHeightDef; - newImgWidthDef = newImgWidthDef; - } - int newImageWidth = (int)(gdk_pixbuf_get_width(pixBuf) / ((double) gdk_pixbuf_get_height(pixBuf) / newImgHeight)); - GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixBuf, abs(newImageWidth), abs(newImgHeight), GDK_INTERP_BILINEAR); - gtk_image_set_from_pixbuf(target, scaledPixBuf); +int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled) { + int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); + int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); + + int newImgWidthDef = (width <= 217) ? width : width - 30; + int newImgHeightDef = (height <= 120) ? height : height - 217; + + int originalWidth = gdk_pixbuf_get_width(pixbuf_unscaled); + int originalHeight = gdk_pixbuf_get_height(pixbuf_unscaled); + int newImgHeight = (int)(originalHeight / ((double) originalWidth / newImgWidthDef)); + + if (newImgHeight > newImgHeightDef) { + newImgHeight = newImgHeightDef; + newImgWidthDef = (int)(originalWidth / ((double) originalHeight / newImgHeight)); + } + int newImageWidth = (int)(originalWidth / ((double) originalHeight / newImgHeight)); + + GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixbuf_unscaled, newImageWidth, newImgHeight, GDK_INTERP_BILINEAR); + gtk_image_set_from_pixbuf(target, scaledPixBuf); + + g_object_unref(scaledPixBuf); // Освобождаем память, занятую скалированным изображением return 1; } void on_region_resized(GtkWidget *,main_window *widgets); void on_region_resized(GtkWidget *,main_window *widgets){ - yon_image_resize_from_container(GTK_IMAGE(widgets->SlidesImage), widgets->slides_original); + yon_image_resize_from_container(GTK_IMAGE(widgets->SlidesImage), widgets->slides_original[cur_slide]); yon_image_resize_from_container(GTK_IMAGE(widgets->RegionImage), widgets->regions_original); yon_image_resize_from_container(GTK_IMAGE(widgets->KeyboardImage), widgets->keyboard_original); } @@ -821,35 +827,32 @@ void yon_switch_page_render(main_window *widgets, int page){ GList *list = gtk_container_get_children(parent); for (guint i=0;islides_original); - widgets->slides_original = gdk_pixbuf_new_from_resource_at_scale(target[cur_slide],600,400,1,NULL); if (size) yon_char_parsed_free(target,size); - GtkWidget *parent = gtk_widget_get_parent(widgets->SlidesImage); - gtk_widget_destroy(widgets->SlidesImage); - widgets->SlidesImage = gtk_image_new(); - gtk_container_add(GTK_CONTAINER(parent),widgets->SlidesImage); - gtk_widget_show(widgets->SlidesImage); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),widgets->slides_original); + // GtkWidget *parent = gtk_widget_get_parent(widgets->SlidesImage); + // gtk_widget_destroy(widgets->SlidesImage); + // widgets->SlidesImage = gtk_image_new(); + // gtk_container_add(GTK_CONTAINER(parent),widgets->SlidesImage); + // gtk_widget_show(widgets->SlidesImage); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),widgets->slides_original[cur_slide]); gtk_widget_queue_draw(widgets->SlidesImage); if (cur_slideHostnameSensitiveCheck),"toggled",G_CALLBACK(on_autohostname_sensitiveness_check),widgets); 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->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets); + g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets); gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0); @@ -2217,15 +2221,21 @@ main_window *yon_main_window_complete(){ yon_char_parsed_free(parsed,size); } + config_str slides = yon_char_parsed_new(&size,slide_repeat_path); widgets->regions_original = gdk_pixbuf_new_from_resource(regions_path,NULL); widgets->keyboard_original = gdk_pixbuf_new_from_resource(keyboard_path,NULL); - widgets->slides_original = gdk_pixbuf_new_from_resource(slide_0_path,NULL); + widgets->slides_original = malloc(sizeof(GdkPixbuf*)*size); + widgets->slides_original[0] = gdk_pixbuf_new_from_resource(slide_0_path,NULL); + for (int i=1;islides_original[i] = gdk_pixbuf_new_from_resource(slides[i-1],NULL); + } + yon_char_parsed_free(slides,size); int width = gdk_pixbuf_get_width(widgets->regions_original); int height = gdk_pixbuf_get_height(widgets->regions_original); widgets->region_height_mult = (float)height/width; gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->RegionImage),gdk_pixbuf_scale_simple(widgets->regions_original,600,400,GDK_INTERP_BILINEAR)); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->KeyboardImage),gdk_pixbuf_scale_simple(widgets->keyboard_original,600,400,GDK_INTERP_BILINEAR)); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),gdk_pixbuf_scale_simple(widgets->slides_original,600,400,GDK_INTERP_BILINEAR)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),gdk_pixbuf_scale_simple(widgets->slides_original[0],600,400,GDK_INTERP_BILINEAR)); GtkTreeIter iter; gtk_list_store_clear(widgets->LanguagesList); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 9ae3adb..cade5bc 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -352,7 +352,7 @@ typedef struct { GdkPixbuf *regions_original; GdkPixbuf *keyboard_original; - GdkPixbuf *slides_original; + GdkPixbuf **slides_original; float region_height_mult; GtkWidget *RegionSensitiveCheck; diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index efdf931..cf85e90 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1601,7 +1601,11 @@ and help you install UBLinux on your computer - + + True + False + Region: + @@ -1621,18 +1625,6 @@ and help you install UBLinux on your computer False 15 5 - - - True - False - Region: - - - False - True - 0 - - True @@ -1730,7 +1722,11 @@ and help you install UBLinux on your computer - + + True + False + Available languages in the system: + @@ -1739,18 +1735,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Available languages in the system: - - - False - True - 1 - - True @@ -1801,7 +1785,11 @@ and help you install UBLinux on your computer True - + + True + False + Language: + @@ -1810,18 +1798,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Language: - - - False - True - 1 - - True @@ -1938,7 +1914,11 @@ and help you install UBLinux on your computer True - + + True + False + Keyboard model: + @@ -1947,18 +1927,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Keyboard model: - - - False - True - 1 - - True @@ -1996,7 +1964,11 @@ and help you install UBLinux on your computer True - + + True + False + Layout changing: + @@ -2005,18 +1977,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Layout changing: - - - False - True - 1 - - True @@ -2351,7 +2311,12 @@ and help you install UBLinux on your computer True - + + True + False + Your account name: + 0 + @@ -2360,19 +2325,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Your account name: - 0 - - - False - True - 1 - - True @@ -2407,7 +2359,12 @@ and help you install UBLinux on your computer True - + + True + False + Login: + 0 + @@ -2416,19 +2373,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Login: - 0 - - - False - True - 1 - - True @@ -2463,7 +2407,12 @@ and help you install UBLinux on your computer True - + + True + False + Password + 0 + @@ -2472,19 +2421,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Password - 0 - - - False - True - 1 - - True @@ -2584,7 +2520,12 @@ and help you install UBLinux on your computer True - + + True + False + Administrator password (root): + 0 + @@ -2593,19 +2534,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Administrator password (root): - 0 - - - False - True - 1 - - True @@ -2670,7 +2598,12 @@ and help you install UBLinux on your computer False True - + + True + False + Computer name: + 0 + @@ -2679,19 +2612,6 @@ and help you install UBLinux on your computer 0 - - - True - False - Computer name: - 0 - - - False - True - 1 - - True @@ -3172,7 +3092,11 @@ or continue working in the UBLinux Live environment. True - + + True + False + Choose file system type for the section: + @@ -3181,18 +3105,6 @@ or continue working in the UBLinux Live environment. 0 - - - True - False - Choose file system type for the section: - - - False - True - 1 - - True @@ -3238,7 +3150,11 @@ or continue working in the UBLinux Live environment. True - + + True + False + Section name: + @@ -3247,18 +3163,6 @@ or continue working in the UBLinux Live environment. 0 - - - True - False - Section name: - - - False - True - 1 - - True @@ -3696,7 +3600,11 @@ installed. - + + True + False + Specify the size of the new partition for UBLinux OS: + @@ -3705,18 +3613,6 @@ installed. 0 - - - True - False - Specify the size of the new partition for UBLinux OS: - - - False - True - 1 - - True @@ -3779,7 +3675,11 @@ installed. True - + + True + False + Choose file system type for the section: + @@ -3788,18 +3688,6 @@ installed. 0 - - - True - False - Choose file system type for the section: - - - False - True - 1 - - True @@ -3861,7 +3749,11 @@ installed. True - + + True + False + Section name: + @@ -3870,18 +3762,6 @@ installed. 0 - - - True - False - Section name: - - - False - True - 1 - - True @@ -4313,7 +4193,11 @@ installed. True - + + True + False + Choose file system type for the section: + @@ -4322,18 +4206,6 @@ installed. 0 - - - True - False - Choose file system type for the section: - - - False - True - 1 - - True @@ -4395,7 +4267,11 @@ installed. True - + + True + False + Section name: + @@ -4404,18 +4280,6 @@ installed. 0 - - - True - False - Section name: - - - False - True - 1 - - True -- 2.35.1 From 01a402fbe26e52ec7016aff061cb9dd42a808061 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 10:11:06 +0600 Subject: [PATCH 02/10] RAM usage fix --- source/ubinstall-gtk.c | 73 ++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 00012c7..14bb299 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -847,14 +847,9 @@ gboolean on_image_slide(void *data){ config_str target = yon_char_parsed_new(&size,slide_repeat_path); if (size) yon_char_parsed_free(target,size); - // GtkWidget *parent = gtk_widget_get_parent(widgets->SlidesImage); - // gtk_widget_destroy(widgets->SlidesImage); - // widgets->SlidesImage = gtk_image_new(); - // gtk_container_add(GTK_CONTAINER(parent),widgets->SlidesImage); - // gtk_widget_show(widgets->SlidesImage); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),widgets->slides_original[cur_slide]); gtk_widget_queue_draw(widgets->SlidesImage); - if (cur_slideNotebook),YON_PAGE_INSTALL_ERROR); - // yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),INSTALLATION_ERROR,5,BACKGROUND_IMAGE_FAIL_TYPE); }; free(command); main_config.install_thread=NULL; @@ -895,48 +889,50 @@ void *on_config_save(void *data){ } gboolean yon_installation_progress_update(void *data); -gboolean yon_installation_progress_update(void *data){ +gboolean yon_installation_progress_update(void *data) { main_window *widgets = (main_window*)data; - // while (gtk_events_pending()) gtk_main_iteration(); int size; - while (main_config.log_progress_buzy){ - // while (gtk_events_pending()) gtk_main_iteration(); - }; - main_config.log_progress_buzy=1; - config_str text = yon_file_open(progress_path,&size); - main_config.log_progress_buzy=0; - if (size){ - if (!yon_char_is_empty(text[size-1])&&text[size-1][0]=='('){ - char * current_copy = yon_char_new(text[size-1]); - char *percentage = yon_char_divide_search(current_copy,")",-1); - yon_char_parsed_free(text,size); - free(yon_char_divide(current_copy,0)); - free(yon_char_divide(percentage,0)); - if (strcmp(percentage,"#pb")){ - double fraction = atof(percentage); - gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),0); - gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),""); + + while (main_config.log_progress_buzy) { + while (gtk_events_pending()) gtk_main_iteration(); + } + main_config.log_progress_buzy = 1; + config_str text = yon_file_open(progress_path, &size); + main_config.log_progress_buzy = 0; + + if (size) { + if (!yon_char_is_empty(text[size-1]) && text[size-1][0] == '(') { + char *current_copy = yon_char_new(text[size-1]); + char *percentage = yon_char_divide_search(current_copy, ")", -1); + yon_char_parsed_free(text, size); + + if (strcmp(percentage, "#pb")) { + double fraction = atof(percentage); + gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel), current_copy); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress), fraction / 100); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress), 0); + gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel), ""); } else { gtk_widget_show(gtk_widget_get_parent(widgets->PackageInstallationProgress)); - - int size; - config_str parsed = yon_char_parse(current_copy,&size," "); - double fraction = atof(parsed[2])/100; - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction); - gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," ")); - yon_char_parsed_free(parsed,size); + + config_str parsed = yon_char_parse(current_copy, &size, " "); + if (size >= 3) { + double fraction = atof(parsed[2]) / 100; + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress), fraction); + gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel), yon_char_parsed_to_string(parsed, size, " ")); + } + yon_char_parsed_free(parsed, size); } + free(current_copy); free(percentage); } } - - if (main_config.install_thread){ + + if (main_config.install_thread) { return 1; } else { - gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),""); + gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel), ""); return 0; } } @@ -2203,7 +2199,6 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->HostnameSensitiveCheck),"toggled",G_CALLBACK(on_autohostname_sensitiveness_check),widgets); 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->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets); gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0); -- 2.35.1 From 40d0bdd400a24bf69d17c321b2c8562bf89a2a60 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 10:21:43 +0600 Subject: [PATCH 03/10] Fixed title of languae window --- ubinstall-gtk-language.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubinstall-gtk-language.glade b/ubinstall-gtk-language.glade index d9d5636..22cdb91 100644 --- a/ubinstall-gtk-language.glade +++ b/ubinstall-gtk-language.glade @@ -123,7 +123,7 @@ True False - Available languages ​​in the system + Available languages in the system -- 2.35.1 From da5999ce4c0fc5de3737489f4def12eed803557b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 10:23:24 +0600 Subject: [PATCH 04/10] Fixed title of layouts window --- ubinstall-gtk-keyboard.glade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubinstall-gtk-keyboard.glade b/ubinstall-gtk-keyboard.glade index 8ca6152..baebf96 100644 --- a/ubinstall-gtk-keyboard.glade +++ b/ubinstall-gtk-keyboard.glade @@ -1,7 +1,8 @@ - + + 200 400 -- 2.35.1 From 38cefd2a9b3d65fdb56f54c335fb643037099ed4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 12:20:07 +0600 Subject: [PATCH 05/10] 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:" -- 2.35.1 From 78f3da39d4da021b72925482823c20a9e15f3f9e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 12:35:45 +0600 Subject: [PATCH 06/10] Hostname placeholder changes for auto check --- source/ubinstall-gtk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 579468a..dba21a2 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -12,8 +12,10 @@ void on_autohostname_check(GtkWidget *, main_window *widgets){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck),1); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck))){ gtk_widget_set_sensitive(widgets->HotnameEntry,0); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->HotnameEntry),"auto"); }else{ gtk_widget_set_sensitive(widgets->HotnameEntry,1); + gtk_entry_set_placeholder_text(GTK_ENTRY(widgets->HotnameEntry),"ublinux-install"); } } -- 2.35.1 From 369db3ff7ebe557517a148589afe3a5bd96b1f05 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 14:24:53 +0600 Subject: [PATCH 07/10] Height of device trees are lowered --- ubinstall-gtk.glade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index ca47ef4..6affc93 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2996,7 +2996,7 @@ or continue working in the UBLinux Live environment. True True in - 128 + 70 True @@ -3399,7 +3399,7 @@ installed. True True in - 128 + 70 True @@ -3997,7 +3997,7 @@ installed. True True in - 128 + 70 True -- 2.35.1 From 6176b8260d6b8207500240ed30b5f6055bb170bc Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 14:27:29 +0600 Subject: [PATCH 08/10] Height of device trees are lowered --- ubinstall-gtk.glade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 6affc93..212a88c 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2996,7 +2996,7 @@ or continue working in the UBLinux Live environment. True True in - 70 + 105 True @@ -3399,7 +3399,7 @@ installed. True True in - 70 + 105 True @@ -3997,7 +3997,7 @@ installed. True True in - 70 + 105 True -- 2.35.1 From 1265c5c9e34bb00e96ab8129f4f37d8c55359b23 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 14:37:47 +0600 Subject: [PATCH 09/10] Localisation changes --- source/ubl-strings.h | 3 ++- ubinstall-gtk.glade | 2 +- ubinstall-gtk.pot | 9 +++++++++ ubinstall-gtk_ru.po | 9 +++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index b635372..af88e3f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -163,4 +163,5 @@ #define CONFIGURATION_SAVE_HEAD_LABEL _("Configuration has been saved") #define CONFIGURATION_SAVE_LABEL _("You can safely exit configurator or return and create new configuration file.") -#define SCROLL_TO_END_LABEL _("Scroll to the end") \ No newline at end of file +#define SCROLL_TO_END_LABEL _("Scroll to the end") +#define ADMINISTRATOR_LABEL _("Administrator") \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 212a88c..84844c9 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2330,7 +2330,7 @@ and help you install UBLinux on your computer True False True - Super Admin + Administrator diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 463cd86..2613fe9 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -595,6 +595,15 @@ msgstr "" msgid "You can safely exit configurator or return and create new configuration file." msgstr "" +msgid "Scroll to the end" +msgstr "" + +msgid "Settings" +msgstr "" + +msgid "Administrator" +msgstr "" + msgid "Afrikaans" msgstr "" diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index 51c9d5b..7868c70 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -620,6 +620,15 @@ msgid "" "You can safely exit configurator or return and create new configuration file." msgstr "Вы можете выйти из настройки конфигурации или настроить другой файл конфигурации." +msgid "Scroll to the end" +msgstr "Прокрутить до конца" + +msgid "Settings" +msgstr "Настройки" + +msgid "Administrator" +msgstr "Администратор" + msgid "Afrikaans" msgstr "Африканский" -- 2.35.1 From 5800caf82e631fb5eebc2ef6830fe1fd5172d978 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 1 Aug 2024 17:52:15 +0600 Subject: [PATCH 10/10] Test standard values --- source/ubinstall-gtk.c | 17 ++++++++++------- source/ubl-strings.h | 3 ++- ubinstall-gtk.glade | 3 +-- ubinstall-gtk.pot | 3 +++ ubinstall-gtk_ru.po | 3 +++ 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index dba21a2..23a699e 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -367,22 +367,19 @@ void yon_interface_update(main_window *widgets){ if (!yon_char_is_empty(region)){ gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),"Europe"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RegionSensitiveCheck),0); } if (!yon_char_is_empty(zone)){ gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),"Moscow"); } char *language = config(lang_parameter); if (!yon_char_is_empty(language)){ - int feasf = gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); - if (feasf){ - printf("fsa\n"); - }; + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); } else { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MainLanguageSensitiveCheck),0); @@ -421,7 +418,13 @@ void yon_interface_update(main_window *widgets){ } } else { for_iter(widgets->LayoutList,&iter){ + char *id; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,0,&id,-1); + if (!strcmp(id,"ru")||!strcmp(id,"us")){ + gtk_tree_store_set(widgets->LayoutList,&iter,3,1,-1); + } else { gtk_tree_store_set((widgets->LayoutList),&iter,3,0,-1); + } } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LayoutSensitiveCheck),0); } @@ -746,7 +749,7 @@ void on_language_window_accept(GtkWidget *,dictionary *dict){ if (status) yon_char_parsed_add_or_create_if_exists(parsed,&size,current); } - char *final = yon_char_parsed_to_string(parsed,size,", "); + char *final = yon_char_parsed_to_string(parsed,size,"; "); gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),final); free(final); yon_char_parsed_free(parsed,size); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index af88e3f..d38a92d 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -164,4 +164,5 @@ #define CONFIGURATION_SAVE_LABEL _("You can safely exit configurator or return and create new configuration file.") #define SCROLL_TO_END_LABEL _("Scroll to the end") -#define ADMINISTRATOR_LABEL _("Administrator") \ No newline at end of file +#define ADMINISTRATOR_LABEL _("Administrator") +#define DEFAULT_LOCALES_LABEL _("English, U.S.A.; Russian, Russia") \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 84844c9..f520ce8 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1630,7 +1630,6 @@ and help you install UBLinux on your computer True False False - False @@ -1668,7 +1667,6 @@ and help you install UBLinux on your computer True False False - False @@ -1740,6 +1738,7 @@ and help you install UBLinux on your computer True False False + English, U.S.A.; Russian, Russia diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 2613fe9..eb83854 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -604,6 +604,9 @@ msgstr "" msgid "Administrator" msgstr "" +msgid "English, U.S.A.; Russian, Russia" +msgstr "" + msgid "Afrikaans" msgstr "" diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index 7868c70..9148dd4 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -629,6 +629,9 @@ msgstr "Настройки" msgid "Administrator" msgstr "Администратор" +msgid "English, U.S.A.; Russian, Russia" +msgstr "Английский, США; Русский, Россия" + msgid "Afrikaans" msgstr "Африканский" -- 2.35.1