From 1226bc0765f7d7d981f2ddede889230edb883a93 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 4 Dec 2025 16:34:51 +0600 Subject: [PATCH 1/2] Config window rename --- source/libublsettingsui-gtk3-config-window.c | 2 +- source/libublsettingsui-gtk3.c | 11 +++++++---- source/libublsettingsui-gtk3.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/libublsettingsui-gtk3-config-window.c b/source/libublsettingsui-gtk3-config-window.c index 5223108..4654c05 100644 --- a/source/libublsettingsui-gtk3-config-window.c +++ b/source/libublsettingsui-gtk3-config-window.c @@ -141,7 +141,7 @@ ubl_settings_window *yon_ubl_settings_window_new(){ // window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); // window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); char *icon_name = yon_char_unite("com.ublinux.",template_app_information.app_tech_name,NULL); - yon_gtk_window_setup(GTK_WINDOW(window->window),NULL,template_app_information.app_title,icon_name,"SETTINGS_WINDOW"); + yon_gtk_window_setup(GTK_WINDOW(window->window),NULL,SETTINGS_TITLE_LABEL,icon_name,"SETTINGS_WINDOW"); g_signal_connect(G_OBJECT(window->window),"delete-event",G_CALLBACK(yon_on_settings_window_accept),window); return window; } diff --git a/source/libublsettingsui-gtk3.c b/source/libublsettingsui-gtk3.c index 8adf85c..b979f4d 100644 --- a/source/libublsettingsui-gtk3.c +++ b/source/libublsettingsui-gtk3.c @@ -447,10 +447,13 @@ int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments if(optarg) template_config->load_socket_id=atoi(optarg); break; - case 'c': char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",template_app_information.app_tech_name,"/",NULL); - struct passwd *user = getpwnam(yon_ubl_root_user_get()); - if (chown(path,user->pw_uid,user->pw_gid)){}; - if (system(remove_config_dir_command)){}; + case 'c': + { + char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",template_app_information.app_tech_name,"/",NULL); + struct passwd *user = getpwnam(yon_ubl_root_user_get()); + if (chown(path,user->pw_uid,user->pw_gid)){}; + if (system(remove_config_dir_command)){}; + } break; case 'd': template_config->debug_mode=1; break; diff --git a/source/libublsettingsui-gtk3.h b/source/libublsettingsui-gtk3.h index c243acf..b74e640 100644 --- a/source/libublsettingsui-gtk3.h +++ b/source/libublsettingsui-gtk3.h @@ -659,7 +659,7 @@ yon_window *yon_window_new(); #define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving") #define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed") #define ROOT_CHECK_LABEL _("Grant root access") - #define SETTINGS_TITLE_LABEL _("Settings") + #define SETTINGS_TITLE_LABEL yon_char_get_localised_from_lib("Settings") #define CONFIG_WINDOW_MENU_LABEL _("Settigs") From b7a8ccb89a4740c1ce05d9e151c6fab16ca8a112 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Fri, 5 Dec 2025 09:51:00 +0600 Subject: [PATCH 2/2] Configuration window is now modal --- libublsettingsui-gtk3-config-window.glade | 1 + source/libublsettingsui-gtk3-config-window.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libublsettingsui-gtk3-config-window.glade b/libublsettingsui-gtk3-config-window.glade index 14a981b..7c1f9dd 100644 --- a/libublsettingsui-gtk3-config-window.glade +++ b/libublsettingsui-gtk3-config-window.glade @@ -7,6 +7,7 @@ 450 176 False + True com.ublinux.libublsettingsui-gtk3 dialog diff --git a/source/libublsettingsui-gtk3-config-window.c b/source/libublsettingsui-gtk3-config-window.c index 4654c05..f6aeb4a 100644 --- a/source/libublsettingsui-gtk3-config-window.c +++ b/source/libublsettingsui-gtk3-config-window.c @@ -140,8 +140,6 @@ ubl_settings_window *yon_ubl_settings_window_new(){ window->WorkZoneBox = yon_gtk_builder_get_widget(builder,"WorkZoneBox"); // window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); // window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); - char *icon_name = yon_char_unite("com.ublinux.",template_app_information.app_tech_name,NULL); - yon_gtk_window_setup(GTK_WINDOW(window->window),NULL,SETTINGS_TITLE_LABEL,icon_name,"SETTINGS_WINDOW"); g_signal_connect(G_OBJECT(window->window),"delete-event",G_CALLBACK(yon_on_settings_window_accept),window); return window; } @@ -154,9 +152,11 @@ struct yon_configuration_custom_parameter { dictionary *__yon_configuration_custom_parameters = NULL; -void __yon_on_ubl_settings_window_open(){ +void __yon_on_ubl_settings_window_open(GtkWidget *self){ if (!__yon_configuration_custom_parameters) return; ubl_settings_window *window = yon_ubl_settings_window_new(); + char *icon_name = yon_char_unite("com.ublinux.",template_app_information.app_tech_name,NULL); + yon_gtk_window_setup(GTK_WINDOW(window->window),GTK_WINDOW(gtk_widget_get_toplevel(self)),SETTINGS_TITLE_LABEL,icon_name,"SETTINGS_WINDOW"); dictionary *current = NULL; for_dictionaries(current,__yon_configuration_custom_parameters){ struct yon_configuration_custom_parameter *parameter = ((struct yon_configuration_custom_parameter*)current->data);