From 8ea5a9879bcbdbe35a7995a3d0d2fd49b6f95176 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 30 Mar 2026 17:24:53 +0600 Subject: [PATCH] Added debug menu item --- locale/ubinstall-gtk.pot | 4 ++++ locale/ubinstall-gtk_ru.po | 4 ++++ source/ubinstall-gtk-page-switch.c | 2 +- source/ubinstall-gtk-ui-lang.c | 1 + source/ubinstall-gtk.c | 9 +++++++++ source/ubinstall-gtk.h | 7 ++++--- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index e110b2b..9e4bdf8 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -5334,6 +5334,10 @@ msgstr "" msgid "Grant root access" msgstr "" +#: source/libublsettingsui-gtk3.h:675 +msgid "Debug mode" +msgstr "" + #: source/libublsettingsui-gtk3.h:675 msgid "Uncheck all" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 86af129..fed9874 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -5529,6 +5529,10 @@ msgstr "Вьетнамский (Франция)" msgid "Grant root access" msgstr "Предоставить root-доступ" +#: source/libublsettingsui-gtk3.h:675 +msgid "Debug mode" +msgstr "Режим отладки" + #: source/libublsettingsui-gtk3.h:675 msgid "Uncheck all" msgstr "Снять всё" diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 309c587..f41ba7b 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -31,7 +31,7 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_INSTALL_RECOVERY: return yon_recovery_get_next(widgets); break; case YON_PAGE_RECOVERY_GRUB_INSTALL: return main_config.configure_mode?YON_PAGE_CONFIGURE_END:YON_PAGE_RECOVERY_BEGIN; break; case YON_PAGE_RECOVERY_GRUB_UPDATE: return main_config.configure_mode?YON_PAGE_CONFIGURE_END:YON_PAGE_RECOVERY_BEGIN; break; - case YON_PAGE_RECOVERY_OS_ONLY: return main_config.configure_mode?YON_PAGE_CONFIGURE_END:YON_PAGE_RECOVERY_BEGIN; break; + case YON_PAGE_RECOVERY_OS_ONLY: return main_config.configure_mode?YON_PAGE_CONFIGURE_END:YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_RECOVERY_USRDATA_ONLY: return main_config.configure_mode?YON_PAGE_CONFIGURE_END:YON_PAGE_RECOVERY_BEGIN; break; case YON_PAGE_RECOVERY_BEGIN: main_config.save_configured = 1; return YON_PAGE_RECOVERY_PROCESS; break; case YON_PAGE_RECOVERY_PROCESS: return YON_PAGE_RECOVERY_COMPLETION; break; diff --git a/source/ubinstall-gtk-ui-lang.c b/source/ubinstall-gtk-ui-lang.c index a6b4eec..c696acd 100644 --- a/source/ubinstall-gtk-ui-lang.c +++ b/source/ubinstall-gtk-ui-lang.c @@ -306,6 +306,7 @@ void yon_update_translation(main_window *widgets){ list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->DocumentationMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->AboutMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->root_button),"Label")); + list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->debug_button),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->ConfigurationModeMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->EnableVNCMenuItem),"Label")); list = g_slist_append(list,g_object_get_data(G_OBJECT(widgets->EnableRDPMenuItem),"Label")); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index a7c4783..cbe2c8a 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -882,6 +882,15 @@ void yon_main_window_create(main_window *widgets){ gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0); } } + { + widgets->debug_button = yon_debug_button_new(); + GtkWidget *Label = g_object_get_data(G_OBJECT(widgets->debug_button),"Label"); + yon_gtk_widget_set_translation(Label); + gtk_style_context_add_class(gtk_widget_get_style_context(widgets->debug_button),"menuitemmiddle"); + gtk_style_context_remove_class(gtk_widget_get_style_context(widgets->debug_button),"menuitemtop"); + gtk_menu_shell_prepend(GTK_MENU_SHELL(gtk_widget_get_parent(widgets->AboutMenuItem)),widgets->debug_button); + + } { widgets->root_button = yon_root_button_new(main_config.argv,main_config.argc); GtkWidget *Label = g_object_get_data(G_OBJECT(widgets->root_button),"Label"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index c39cdf8..b7989bb 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -287,10 +287,10 @@ layout && /description:/ {\ #define get_localisation_command "ubconfig -ea --source global get [autoinstall] AUTOINSTALL[installer_locale] -- get [autoinstall] AUTOINSTALL['ubconfig set [locale] LANG'] -- get [locale] LANG" -#define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ", parameters, "; nice ubinstall autoinstall --noautoconfig --noinstall_extra", NULL) -#define quick_install_command(path) yon_char_unite("nice ubinstall autoinstall --config='",path,"' --noautoconfig --noinstall_extra", NULL) +#define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ", parameters, "; nice ubinstall autoinstall",main_config.debug_mode?" --debug":""," --noautoconfig --noinstall_extra", NULL) +#define quick_install_command(path) yon_char_unite("nice ubinstall autoinstall",main_config.debug_mode?" --debug":""," --config='",path,"' --noautoconfig --noinstall_extra", NULL) -#define set_user_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] ", parameters, ";nice ubinstall autoconfig install_extra", NULL) +#define set_user_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] ", parameters, ";nice ubinstall autoconfig",main_config.debug_mode?" --debug":""," install_extra", NULL) #define save_additional_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] ", parameters, NULL) #define get_default_password_command "ubconfig --raw --conarg --source default get [users] NOSECUREROOTPASSWD" @@ -844,6 +844,7 @@ typedef struct gboolean slider_stop; GtkWidget *root_button; + GtkWidget *debug_button; } main_window;