From 529db522b3947bbfe8fcb650c35a32d1e9cd6ebc Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 24 Oct 2025 16:21:02 +0600 Subject: [PATCH 01/23] Fixed Os cpmponents crash --- source/ubinstall-gtk-components.c | 12 +++++++----- source/ubinstall-gtk.h | 13 +++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index d283a05..e12014d 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -152,10 +152,12 @@ void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *d free(description_full); } -gboolean yon_os_component_insert(os_row *row){ - main_window *widgets = g_object_get_data(G_OBJECT(row->row),"widgets"); +gboolean yon_os_component_insert(struct row_data *row_input){ + os_row *row = yon_os_row_new(); + + main_window *widgets = row_input->widgets; gtk_list_box_insert(GTK_LIST_BOX(widgets->OSSoftwareListBox),row->row,-1); - yon_os_row_setup(row,row->name,row->version,row->tags,row->description); + yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,row_input->description); return G_SOURCE_REMOVE; } @@ -172,12 +174,12 @@ void *yon_os_components_setup(main_window *widgets){ yon_char_remove_last_symbol(base[i],'\n'); int parsed_size; config_str parsed = yon_char_parse(base[i],&parsed_size,";"); - os_row *row = yon_os_row_new(); + struct row_data *row = malloc(sizeof(struct row_data)); row->version = parsed[1]; row->name = parsed[0]; row->tags = yon_char_replace(parsed[2]," ",", "); row->description = parsed[3]; - g_object_set_data(G_OBJECT(row->row),"widgets",widgets); + row->widgets=widgets; g_idle_add((GSourceFunc)yon_os_component_insert,row); } g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 98729f2..cdeb5ea 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -962,6 +962,14 @@ typedef struct { advanced_partition *partition_widgets; } advanced_section; +struct row_data { + main_window *widgets; + char *version; + char *name; + char *tags; + char *description; +}; + void config_init(); main_window *yon_main_window_complete(); @@ -1164,7 +1172,7 @@ void set_locales_list(main_window *widgets); void on_installer_language_changed(GtkWidget *self, main_window *widgets); gboolean on_country_filter(GtkTreeModel *self, GtkTreeIter *iter, main_window *widgets); int yon_char_parsed_compare(const void *a, const void *b); -gboolean yon_os_component_insert(os_row *row); +gboolean yon_os_component_insert(struct row_data *row_input); void *yon_os_components_setup(main_window *widgets); gboolean yon_spinner_switch_off(GtkSpinner *target); void on_advanced_added(GtkWidget *, char *, main_window *); @@ -1188,4 +1196,5 @@ int yon_advanced_section_get_by_part(advanced_partition *part); void yon_advanced_section_remove_by_name(char *part); void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets); int yon_advanced_section_append(advanced_section *section); -gboolean on_format_changed(GtkWidget *self, gboolean state, advanced_partition *part); \ No newline at end of file +gboolean on_format_changed(GtkWidget *self, gboolean state, advanced_partition *part); +int yon_layouts_get(); \ No newline at end of file -- 2.35.1 From d8c1b72e80667877181049dca5b51b7435093978 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 24 Oct 2025 17:12:38 +0600 Subject: [PATCH 02/23] About window fix; Documentation window fix --- source/ubinstall-gtk.c | 132 +++++++++++++++++++++++++++++++++++++++++ source/ubinstall-gtk.h | 3 +- 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index dcb080a..1a98232 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1,6 +1,135 @@ #include "ubinstall-gtk.h" config main_config; +void yon_open_browser(GtkWidget *, char *link){ + GtkWidget *window = yon_ubl_browser_window_open(link,TITLE_LABEL); + if (window) + gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",LocaleName)); +} + +void on_open_documentation_confirmation(GtkWidget *self, char *link){ + if (template_app_information.always_open_documentation==0){ + GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_documentation); + template_documentation_confirmation_window *window = malloc(sizeof(template_documentation_confirmation_window)); + window->Window = yon_gtk_builder_get_widget(builder,"helpConfirmationWindow"); + window->AcceptButton = yon_gtk_builder_get_widget(builder,"ReadHelpButton"); + window->CloseButton = yon_gtk_builder_get_widget(builder,"CancelHelpButton"); + window->HeaderLabel = yon_gtk_builder_get_widget(builder,"webHeaderNameLabel"); + window->AlwaysOpenCheck = yon_gtk_builder_get_widget(builder,"AlwaysOpenDocumentationCheckbox"); + gtk_label_set_text(GTK_LABEL(window->HeaderLabel),TITLE_LABEL); + gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL); + gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",LocaleName)); + gtk_widget_show_all(window->Window); + g_signal_connect(G_OBJECT(window->CloseButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_open_browser),yon_char_new(link)); + g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + + + } else { + yon_open_browser(self,link); + } +} + +/**on_link(GtkWidget *self, char* uri, gpointer user_data) + * [EN] + * Signal for hadnling AboutDialog links. + * Connect to "activate-link" signal. + * [self] is AboutDialog window; + * [uri] is activated link; + * [user_data] is pointer for user data, hasn't used in standard handler; + * [RU] + * Функция для обработки сигнала нажатия на ссылку окна AboutDialog. + * Присоединять к сигналу "activate-link". + * [self] - окно AboutDialog; + * [uri] - ссылка, по которой совершается переход; + * [user_data] - указатель на любые другие данные, не используется в стандартном обработчике; +*/ +void on_link(GtkWidget *self, char* uri, gpointer ){ + gtk_widget_destroy(self); + on_open_documentation_confirmation(self,uri); +} + +void on_about(GtkWidget *, char *version_application){ + GtkBuilder *builder=gtk_builder_new_from_resource(ui_glade_path_about); + GtkWidget *window=yon_gtk_builder_get_widget(builder,"AboutWindow"); + GtkWidget *title=yon_gtk_builder_get_widget(builder,"headerAboutTopic"); + GtkWidget *hideButtonBox=yon_gtk_builder_get_widget(builder,"buttonBoxHide"); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(window),version_application); + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window),TITLE_LABEL); + gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(window),yon_char_append("com.ublinux.",LocaleName)); + gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",LocaleName)); + char *title_str = about_label(TITLE_LABEL); + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(window),LocaleName); + gtk_label_set_text(GTK_LABEL(title),TITLE_LABEL); + g_signal_connect(G_OBJECT(window),"activate-link",G_CALLBACK(on_link),NULL); + gtk_widget_set_visible(hideButtonBox,0); + gtk_widget_destroy(hideButtonBox); + gtk_window_set_title(GTK_WINDOW(window),title_str); + gtk_widget_show(window); +} + +//functions + + +int yon_confirmation_dialog_call(GtkWidget *self,dialog_confirmation_data *data){ + textdomain(template_ui_LocaleName); + GtkWidget *dialog = gtk_dialog_new_with_buttons(TITLE_LABEL,GTK_WINDOW(gtk_widget_get_toplevel(self)),GTK_DIALOG_USE_HEADER_BAR,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL); + textdomain(LocaleName); + gtk_window_set_modal(GTK_WINDOW(dialog),1); + gtk_window_set_icon_name(GTK_WINDOW(dialog),yon_char_append("com.ublinux.",LocaleName)); + gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL); + gtk_widget_set_size_request(dialog,450,-1); + GList *list = gtk_container_get_children(GTK_CONTAINER(gtk_dialog_get_header_bar(GTK_DIALOG(dialog)))); + GtkWidget *image_cancel = gtk_image_new_from_icon_name("com.ublinux.libublsettingsui-gtk3.cancel-symbolic",GTK_ICON_SIZE_BUTTON); + GtkWidget *image_accept = gtk_image_new_from_icon_name("com.ublinux.libublsettingsui-gtk3.accept-symbolic",GTK_ICON_SIZE_BUTTON); + gtk_button_set_image((GtkButton*)g_list_nth_data(list,0),image_cancel); + gtk_button_set_image((GtkButton*)g_list_nth_data(list,1),image_accept); + gtk_style_context_add_class(gtk_widget_get_style_context((GtkWidget*)g_list_nth_data(list,0)),"marginright"); + gtk_style_context_add_class(gtk_widget_get_style_context((GtkWidget*)g_list_nth_data(list,1)),"marginright"); + + g_list_free(list); + GtkWidget *header_label = gtk_label_new(yon_char_is_empty(data->title)?TITLE_LABEL:data->title); + gtk_widget_show(header_label); + PangoAttrList *attributes = pango_attr_list_new(); + PangoAttribute *boldAttr = pango_attr_weight_new(PANGO_WEIGHT_BOLD); + pango_attr_list_insert(attributes, boldAttr); + gtk_label_set_attributes(GTK_LABEL(header_label),attributes); + + GtkWidget *header = gtk_dialog_get_header_bar(GTK_DIALOG(dialog)); + gtk_header_bar_set_custom_title(GTK_HEADER_BAR(header),header_label); + gtk_widget_show(header); + + GtkWidget *image = gtk_image_new_from_icon_name("dialog-question-symbolic",GTK_ICON_SIZE_DIALOG); + gtk_widget_show(image); + gtk_widget_set_margin_start(image,20); + gtk_widget_set_margin_end(image,20); + gtk_widget_set_margin_bottom(image,20); + gtk_widget_set_margin_top(image,20); + + GtkWidget *label = gtk_label_new(""); + gtk_widget_set_margin_end(label,20); + gtk_widget_show(label); + gtk_label_set_line_wrap_mode(GTK_LABEL(label),PANGO_WRAP_WORD); + gtk_label_set_line_wrap(GTK_LABEL(label),1); + gtk_label_set_markup(GTK_LABEL(label),data->action_text); + + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + gtk_widget_show(box); + gtk_box_pack_start(GTK_BOX(box),image,0,0,5); + gtk_box_pack_start(GTK_BOX(box),label,0,0,5); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),box,1,1,5); + + gtk_window_set_default_size(GTK_WINDOW(dialog),450,-1); + + int resp = gtk_dialog_run(GTK_DIALOG(dialog)); + if (resp == GTK_RESPONSE_ACCEPT){ + if (data->function){ + data->function(NULL,data->data); + } + } else resp=0; + gtk_widget_destroy(dialog); + return resp; +} // //functions // void yon_encryption_type_setup(GtkComboBoxText *target){ @@ -933,6 +1062,9 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets); + g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); + g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),widgets); + gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL); { diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index cdeb5ea..70f88be 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1197,4 +1197,5 @@ void yon_advanced_section_remove_by_name(char *part); void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets); int yon_advanced_section_append(advanced_section *section); gboolean on_format_changed(GtkWidget *self, gboolean state, advanced_partition *part); -int yon_layouts_get(); \ No newline at end of file +int yon_layouts_get(); +void on_link(GtkWidget *self, char* uri, gpointer ); \ No newline at end of file -- 2.35.1 From a220aefaaf19030280266a88dc2b824d506dc7a8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 24 Oct 2025 17:26:28 +0600 Subject: [PATCH 03/23] Localisation fixes --- locale/ubinstall-gtk.pot | 4 ++++ locale/ubinstall-gtk_ru.po | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index d3ca4c4..7e4462e 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1168,3 +1168,7 @@ msgstr "" #: source/ubl-strings.h:331 msgid "Skip installation" msgstr "" + +#: source/ubl-strings.h:331 +msgid "Are you sure want to exit and\ninterrupt installation process?" +msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 4843548..29b86da 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -3011,4 +3011,4 @@ msgid "Zulu" msgstr "Зулу" msgid "Zurich" -msgstr "Цюрих" +msgstr "Цюрих" \ No newline at end of file -- 2.35.1 From 9661bca2f8805f99a80e36c4db94f6d6feaa1be6 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 24 Oct 2025 18:23:37 +0600 Subject: [PATCH 04/23] Added --dry-run launch argument --- source/ubinstall-gtk-saving.c | 39 +++++++++++++++++++++-------------- source/ubinstall-gtk.c | 34 ++++++++++++++++++++++++++++-- source/ubinstall-gtk.h | 2 ++ source/ubl-strings.h | 5 +++++ 4 files changed, 63 insertions(+), 17 deletions(-) diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index c59c8b6..710c80f 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -571,25 +571,29 @@ void *on_config_save(void *data){ g_signal_connect(G_OBJECT(widgets->install_info_monitor),"changed",G_CALLBACK(yon_installation_progress_update),widgets); g_object_unref(file_desc); gtk_widget_show(gtk_widget_get_parent(widgets->InstallationProgress)); - char *command = yon_debug_output("%s\n",save_config_command(yon_char_parsed_to_string(parameters,size," "))); - yon_char_parsed_free(parameters,size); - yon_debug_output("%s\n","Entered installation"); - if (system(yon_debug_output("%s\n",command))){ - - gdk_threads_add_idle((GSourceFunc)on_install_error,widgets); + if (!main_config.dry_run){ + char *command = yon_debug_output("%s\n",save_config_command(yon_char_parsed_to_string(parameters,size," "))); + yon_char_parsed_free(parameters,size); + yon_debug_output("%s\n","Entered installation"); + if (system(yon_debug_output("%s\n",command))){ + + gdk_threads_add_idle((GSourceFunc)on_install_error,widgets); + free(command); + g_mutex_lock(&main_config.install_mutex); + main_config.install_complete=1; + g_mutex_unlock(&main_config.install_mutex); + return 0; + }; free(command); g_mutex_lock(&main_config.install_mutex); main_config.install_complete=1; g_mutex_unlock(&main_config.install_mutex); - return 0; - }; - free(command); - g_mutex_lock(&main_config.install_mutex); - main_config.install_complete=1; - g_mutex_unlock(&main_config.install_mutex); - if ((!main_config.save_done)&&main_config.save_configured){ - on_setup_system_configuration(widgets); - on_page_next_clicked(NULL,widgets); + if ((!main_config.save_done)&&main_config.save_configured){ + on_setup_system_configuration(widgets); + on_page_next_clicked(NULL,widgets); + } + } else { + yon_launch("ubconfig --source system get /"); } return 0; } @@ -674,12 +678,17 @@ void *on_setup_system_configuration(void * data){ } + + if (!main_config.dry_run){ char *parameter_string = yon_char_parsed_to_string(all_parameters,size," "); char *command = set_user_config_command(parameter_string); if (system(yon_debug_output("%s\n",command))){}; yon_char_parsed_free(all_parameters,size); free(command); if (parameter_string) free(parameter_string); + } else { + yon_launch("ubconfig --source system get /"); + } } g_idle_add((GSourceFunc)on_install_success,widgets); return NULL; diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 1a98232..272ff51 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -460,6 +460,8 @@ void config_init(){ main_config.config_load_path = NULL; main_config.config_save_path = NULL; yon_packages_init(); + main_config.dry_run=0; + main_config.force_ini=NULL; main_config.network_types = g_hash_table_new(g_str_hash,g_str_equal); main_config.cur_slide=0; } @@ -1165,8 +1167,36 @@ int main(int argc, char *argv[]){ config_init(); config_str unfound = NULL; int size=0; - yon_ubl_connect_config((_template_config*)&main_config); - yon_ubl_setup_arguments(argc,argv,&unfound,&size,NULL); + yon_ubl_connect_config((_template_config*)&main_config); + opterr=0; + yon_ubl_window_init(TITLE_LABEL,"",LocaleName,CssPath,LocaleName,version_application,WIKI_LINK); + yon_ubl_setup_arguments(argc,argv,&unfound,&size,ADDITIONAL_ARGS); + if (size) { + int option_index = 0; + struct option long_options[] = { + {"dry-run", 0, 0, 'D'}, + {"ini", 0, 0, 'I'}, + {NULL, 0, NULL, 0} + }; + + // Сбрасываем optind для повторного прохода + optind = 1; + + // Перебор необработанных аргументов + for (int i = 0; i < size; i++) { + int argument = getopt_long(argc, argv, "DI:", long_options, &option_index); + switch (argument) { + case 'D': + main_config.dry_run = 1; + break; + case 'I': + main_config.force_ini = yon_char_new(optarg); + break; + default: + break; + } + } + } gtk_init(&argc,&argv); main_window *widgets = NULL; widgets = yon_main_window_complete(); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 70f88be..390cd35 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -398,6 +398,8 @@ typedef struct { char *config_load_path; char *config_save_path; unsigned int cur_slide; + gboolean dry_run; + char *force_ini; } config; extern config main_config; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 29b814d..f8016ad 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -6,6 +6,11 @@ #define OPEN_LABEL _("Open") +#define ADDITIONAL_ARGS yon_char_unite(\ + " --dry-run ",_("Dry run; Installation will not start"),"\n",\ + " --ini ", _("Set ini file for configuration mode"),\ +NULL) + #define KEYBOARD_TITLE_LABEL _("Keyboard layout") #define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed") -- 2.35.1 From e8b0acfd962064bee26231315224636a7b074a47 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 27 Oct 2025 10:43:26 +0600 Subject: [PATCH 05/23] Fixed wiki link --- source/ubinstall-gtk-page-switch.c | 6 ++++-- source/ubinstall-gtk.c | 2 +- source/ubinstall-gtk.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 52522d9..e493db7 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -29,13 +29,15 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_RECOVERY_GRUB_UPDATE: return main_config.configure_mode?YON_PAGE_INSTALLATION:YON_PAGE_INSTALLATION_BEGIN; break; case YON_PAGE_RECOVERY_OS_ONLY: return main_config.configure_mode?YON_PAGE_INSTALLATION:YON_PAGE_INSTALLATION_BEGIN; break; case YON_PAGE_RECOVERY_USRDATA_ONLY: return main_config.configure_mode?YON_PAGE_INSTALLATION:YON_PAGE_INSTALLATION_BEGIN; break; - // case YON_PAGE_COMPLETED: + case YON_PAGE_INSTALLATION: break; + case YON_PAGE_CONFIGURE_SAVE: break; + case YON_PAGE_COMPLETED: case YON_PAGE_INSTALL_ERROR: case YON_PAGE_CONFIGURE_END: case YON_PAGE_COMPLETION: on_reboot_accepted(widgets); break; - default:return YON_PAGE_WELCOME; + // default:return YON_PAGE_WELCOME; } return YON_PAGE_WELCOME; } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 272ff51..111db04 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1065,7 +1065,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets); g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); - g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),widgets); + g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL); { diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 390cd35..61bf5ce 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -17,7 +17,7 @@ #endif #include "ubl-strings.h" -#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubinstall-gtk" +#define WIKI_LINK "https://wiki.ublinux.com/Software/Programs_and_utilities/All/ubinstall-gtk" #define _(String) gettext(String) -- 2.35.1 From 453d74312a77bfa2406e017de9e48ea58982ef40 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 27 Oct 2025 15:40:24 +0600 Subject: [PATCH 06/23] Localisation change --- locale/ubinstall-gtk_ru.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 29b86da..589e4e1 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -250,7 +250,7 @@ msgstr "Метка" #: source/ubl-strings.h:62 msgid "Size" -msgstr "Размер" +msgstr "Общий размер" #: source/ubl-strings.h:63 msgid "Free" -- 2.35.1 From c97dccc19aa44368832a7ee6b2b523e69ab5c23d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 27 Oct 2025 15:40:53 +0600 Subject: [PATCH 07/23] Added new launch argument --ini --- source/ubinstall-gtk-saving.c | 8 ++++++++ source/ubinstall-gtk.c | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index 710c80f..df0b3c3 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -58,6 +58,10 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void on_config_local_load(GtkWidget *,main_window *widgets){ + if (!yon_char_is_empty(main_config.force_ini)) { + on_config_custom_load_last(NULL,widgets); + return; + } if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path); main_config.config_load_path = yon_char_new("system"); yon_load_proceed(YON_CONFIG_LOCAL); @@ -66,6 +70,10 @@ void on_config_local_load(GtkWidget *,main_window *widgets){ } void on_config_global_load(GtkWidget *,main_window *widgets){ + if (!yon_char_is_empty(main_config.force_ini)) { + on_config_custom_load_last(NULL,widgets); + return; + } if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path); main_config.config_load_path = yon_char_new("global"); yon_load_proceed(YON_CONFIG_GLOBAL); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 111db04..7683b64 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1130,6 +1130,14 @@ void yon_main_window_create(main_window *widgets){ // locale = setlocale(LC_ALL,NULL); // } // yon_ubl_window_init(TITLE_LABEL,DESCRIPTION_LABEL,locale,CssPath,LocaleName,version_application,WIKI_LINK); + if (main_config.force_ini){ + g_signal_handlers_block_by_func(G_OBJECT(widgets->ConfigurationModeMenuItem),G_CALLBACK(on_configuration_mode_switch),widgets); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widgets->ConfigurationModeMenuItem),1); + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ConfigurationModeMenuItem),G_CALLBACK(on_configuration_mode_switch),widgets); + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + } yon_locale_init(); set_locales_list(widgets); // { @@ -1175,14 +1183,10 @@ int main(int argc, char *argv[]){ int option_index = 0; struct option long_options[] = { {"dry-run", 0, 0, 'D'}, - {"ini", 0, 0, 'I'}, + {"ini", 1, 0, 'I'}, {NULL, 0, NULL, 0} }; - - // Сбрасываем optind для повторного прохода optind = 1; - - // Перебор необработанных аргументов for (int i = 0; i < size; i++) { int argument = getopt_long(argc, argv, "DI:", long_options, &option_index); switch (argument) { @@ -1191,6 +1195,9 @@ int main(int argc, char *argv[]){ break; case 'I': main_config.force_ini = yon_char_new(optarg); + main_config.config_load_path = main_config.force_ini; + main_config.config_save_path = main_config.force_ini; + main_config.configure_mode = 1; break; default: break; -- 2.35.1 From 829babbb01f5f02c8c26fe901d99b219368de71d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 27 Oct 2025 16:00:18 +0600 Subject: [PATCH 08/23] Fixed about window title --- locale/ubinstall-gtk.pot | 4 ++++ locale/ubinstall-gtk_ru.po | 4 ++++ source/ubinstall-gtk.c | 4 ++-- source/ubl-strings.h | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 7e4462e..fef5a1d 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1172,3 +1172,7 @@ msgstr "" #: source/ubl-strings.h:331 msgid "Are you sure want to exit and\ninterrupt installation process?" msgstr "" + +#: source/ubl-strings.h:331 +msgid "About UBLinux installation" +msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 589e4e1..d8fc7ad 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1213,6 +1213,10 @@ msgstr "" "Если не менять тип ФС и не форматировать, все данные на разделе будут " "сохранены." +#: source/ubl-strings.h:331 +msgid "About UBLinux installation" +msgstr "О Программе установки UBLinux" + msgid "Exit" msgstr "Выйти" diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 7683b64..4d4c844 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -58,9 +58,9 @@ void on_about(GtkWidget *, char *version_application){ gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window),TITLE_LABEL); gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(window),yon_char_append("com.ublinux.",LocaleName)); gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",LocaleName)); - char *title_str = about_label(TITLE_LABEL); + char *title_str = ABOUT_TITLE_LABEL; gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(window),LocaleName); - gtk_label_set_text(GTK_LABEL(title),TITLE_LABEL); + gtk_label_set_text(GTK_LABEL(title),ABOUT_TITLE_LABEL); g_signal_connect(G_OBJECT(window),"activate-link",G_CALLBACK(on_link),NULL); gtk_widget_set_visible(hideButtonBox,0); gtk_widget_destroy(hideButtonBox); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index f8016ad..96d92f5 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -222,6 +222,7 @@ NULL) #define PARITY_INVALID_LABEL(target) yon_char_unite(_("Cu"),target,NULL) #define COUNT_INVALID_LABEL(target) yon_char_unite(_("Cues"),target,NULL) +#define ABOUT_TITLE_LABEL _("About UBLinux installation") // #define _LABEL _("New section at") // #define _LABEL _("\"/ublinux-data/\" user data section") // #define _LABEL _("\"/ublinux/\" system section") -- 2.35.1 From d011fff5cfc88bb58b662f96d403c0dd2d00abc9 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 27 Oct 2025 18:12:34 +0600 Subject: [PATCH 09/23] Fixed check box toggling area --- ubinstall-gtk-kernel-row.glade | 2 +- ubinstall-gtk-os-row.glade | 145 ++++++++++++++++----------------- 2 files changed, 71 insertions(+), 76 deletions(-) diff --git a/ubinstall-gtk-kernel-row.glade b/ubinstall-gtk-kernel-row.glade index 1d9ee69..a176e9a 100644 --- a/ubinstall-gtk-kernel-row.glade +++ b/ubinstall-gtk-kernel-row.glade @@ -26,7 +26,7 @@ - False + True True 0 diff --git a/ubinstall-gtk-os-row.glade b/ubinstall-gtk-os-row.glade index b9ff25b..58c5b7e 100644 --- a/ubinstall-gtk-os-row.glade +++ b/ubinstall-gtk-os-row.glade @@ -6,7 +6,7 @@ True False - 11 + 5 True @@ -14,36 +14,73 @@ False True True - - - False - True - 0 - - - - - True - False - 1 - vertical - 1 True False - 7 + 1 + vertical + 1 - + True False - Name - 0 - False - 0 - - - + 7 + + + True + False + Name + 0 + False + 0 + + + + + + False + True + 0 + + + + + True + False + Version + True + 15 + False + 0 + + + False + True + 1 + + + + + True + False + start + 3 + 5 + 2 + + + + + + False + True + 6 + + + False @@ -52,81 +89,39 @@ - + True False - Version - True - 15 - False + 2 + Description 0 + 0 - False + True True + end 1 - + True False - start - 3 - 5 - 2 - - - False True - 6 + 2 - - - - False - True - 0 - - - - - True - False - 2 - Description - 0 - 0 - - True - True - end - 1 - - - - - True - False - - - False - True - 2 - True True - 1 + 0