From 0eabddc3680588833accd5ce352b9a68d360ffb6 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Fri, 30 Jan 2026 17:10:23 +0600 Subject: [PATCH 1/4] Fixed documentation dialog double call fix --- source/ubl-settings-resourcequota.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index ba5390c..52e1119 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -1291,7 +1291,7 @@ void yon_main_window_complete(main_window *widgets){ // yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING); /* Signal connection | Присоединение сигналов */ - g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); + // g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); g_signal_connect(G_OBJECT(widgets->FiltersButton),"clicked",G_CALLBACK(on_filters_opened),widgets); g_signal_connect(G_OBJECT(widgets->InformationButton),"clicked",G_CALLBACK(on_information),widgets); g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_remove),widgets); From d91f54740e0bf9127db439dcb0975aa1a62bc4e5 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Fri, 30 Jan 2026 17:11:01 +0600 Subject: [PATCH 2/4] Fixed documentation dialog double call fix --- source/ubl-settings-resourcequota.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index 52e1119..0501bfb 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -1291,7 +1291,6 @@ void yon_main_window_complete(main_window *widgets){ // yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING); /* Signal connection | Присоединение сигналов */ - // g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); g_signal_connect(G_OBJECT(widgets->FiltersButton),"clicked",G_CALLBACK(on_filters_opened),widgets); g_signal_connect(G_OBJECT(widgets->InformationButton),"clicked",G_CALLBACK(on_information),widgets); g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_remove),widgets); From 20118d2fc3bb5f838172b44f5351109705130ab8 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 2 Feb 2026 09:40:38 +0600 Subject: [PATCH 3/4] Wiki link changes --- locale/ubl-settings-resourcequota.pot | 2 +- locale/ubl-settings-resourcequota_ru.po | 4 +- source/ubl-settings-resourcequota.c | 162 ++++++++++++------------ source/ubl-settings-resourcequota.h | 1 - source/ubl-strings.h | 31 +---- ubl-settings-resourcequota.desktop | 0 6 files changed, 84 insertions(+), 116 deletions(-) mode change 100644 => 100755 ubl-settings-resourcequota.desktop diff --git a/locale/ubl-settings-resourcequota.pot b/locale/ubl-settings-resourcequota.pot index 19cb3d7..6ce036d 100644 --- a/locale/ubl-settings-resourcequota.pot +++ b/locale/ubl-settings-resourcequota.pot @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: source/ubl-strings.h:1 -msgid "Version:" +msgid "https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-resourcequota" msgstr "" #: source/ubl-strings.h:2 diff --git a/locale/ubl-settings-resourcequota_ru.po b/locale/ubl-settings-resourcequota_ru.po index af8c679..5de75e8 100644 --- a/locale/ubl-settings-resourcequota_ru.po +++ b/locale/ubl-settings-resourcequota_ru.po @@ -18,8 +18,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: source/ubl-strings.h:1 -msgid "Version:" -msgstr "Версия:" +msgid "https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-resourcequota" +msgstr "https://wiki.ublinux.com/ru/software/programs_and_utilities/all/ubl-settings-resourcequota" #: source/ubl-strings.h:2 #, fuzzy diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index 0501bfb..cde9afb 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -1260,88 +1260,86 @@ void yon_main_window_complete(main_window *widgets){ gtk_box_pack_start(GTK_BOX(widgets->InterfaceBox),yon_gtk_builder_get_widget(builder,"BoxMain"),1,1,0); // Custom widgets configuration { - - widgets->FiltersButton = yon_gtk_builder_get_widget(builder,"FiltersButton"); - widgets->InformationButton = yon_gtk_builder_get_widget(builder,"InformationButton"); - widgets->RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); - widgets->EditButton = yon_gtk_builder_get_widget(builder,"EditButton"); - widgets->AddButton = yon_gtk_builder_get_widget(builder,"AddButton"); - - widgets->MainTree = yon_gtk_builder_get_widget(builder,"QuotasTreeView"); - widgets->MainNotebook = yon_gtk_builder_get_widget(builder,"MainNotebook"); - - widgets->DispatcherUpdateCheck = yon_gtk_builder_get_widget(builder,"DispatcherUpdateCheck"); - widgets->DispatcherUpdateSpin = yon_gtk_builder_get_widget(builder,"DispatcherUpdateSpin"); - widgets->DispatcherUpdateButton = yon_gtk_builder_get_widget(builder,"DispatcherUpdateButton"); - widgets->DispatcherTerminal = yon_gtk_builder_get_widget(builder,"DispatcherTerminal"); - - widgets->ShowAllCheck = yon_gtk_builder_get_widget(builder,"ShowAllCheck"); - widgets->ShowCoreCheck = yon_gtk_builder_get_widget(builder,"ShowCoreCheck"); - widgets->ProcessesUpdateButton = yon_gtk_builder_get_widget(builder,"ProcessesUpdateButton"); - widgets->ProcessesTerminal = yon_gtk_builder_get_widget(builder,"ProcessesTerminal"); - - widgets->TargetTypeCombo = yon_gtk_builder_get_widget(builder,"TargetTypeCombo"); - widgets->TargetCombo = yon_gtk_builder_get_widget(builder,"TargetCombo"); - widgets->InformationUpdateButton = yon_gtk_builder_get_widget(builder,"InformationUpdateButton"); - widgets->InformationTerminal = yon_gtk_builder_get_widget(builder,"InformationTerminal"); - - main_config.list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore")); - - /* Widget registration for config monitoring | Регистрация виджетов для мониторинга конфига */ - // yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING); - - /* Signal connection | Присоединение сигналов */ - g_signal_connect(G_OBJECT(widgets->FiltersButton),"clicked",G_CALLBACK(on_filters_opened),widgets); - g_signal_connect(G_OBJECT(widgets->InformationButton),"clicked",G_CALLBACK(on_information),widgets); - g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_remove),widgets); - g_signal_connect(G_OBJECT(widgets->EditButton),"clicked",G_CALLBACK(on_edit_open),widgets); - g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_add_open),widgets); - g_signal_connect(G_OBJECT(widgets->MainNotebook),"switch-page",G_CALLBACK(on_tab_changed),widgets); - g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->DispatcherUpdateSpin); - g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->DispatcherUpdateButton); - g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(on_dispatcher_update),widgets); - g_signal_connect(G_OBJECT(widgets->DispatcherUpdateSpin),"output",G_CALLBACK(on_dispatcher_update),widgets); - g_signal_connect(G_OBJECT(widgets->DispatcherUpdateButton),"clicked",G_CALLBACK(on_dispatcher_update),widgets); - g_signal_connect(G_OBJECT(widgets->ShowAllCheck),"toggled",G_CALLBACK(on_processes_update),widgets); - g_signal_connect(G_OBJECT(widgets->ShowCoreCheck),"toggled",G_CALLBACK(on_processes_update),widgets); - g_signal_connect(G_OBJECT(widgets->TargetTypeCombo),"changed",G_CALLBACK(on_info_target_type_switched),widgets); - g_signal_connect(G_OBJECT(widgets->TargetCombo),"changed",G_CALLBACK(on_information_chosen_changed),widgets); - g_signal_connect(G_OBJECT(widgets->ProcessesUpdateButton),"clicked",G_CALLBACK(on_processes_update),widgets); - g_signal_connect(G_OBJECT(widgets->InformationUpdateButton),"clicked",G_CALLBACK(on_information_update),widgets); - - g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_global_local_save),widgets); - g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets); - g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets); - g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(on_config_custom_save),widgets); - - g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets); - g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); - g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets); - - - on_dispatcher_update(NULL,widgets); - on_processes_update(NULL,widgets); - yon_window_config_add_listener(widgets->DispatcherUpdateCheck,"DispatcherAutoupdate","active",YON_TYPE_BOOLEAN); - yon_window_config_add_listener(widgets->ShowAllCheck,"ProcessShowAll","active",YON_TYPE_BOOLEAN); - yon_window_config_add_listener(widgets->ShowCoreCheck,"ProcessShowCore","active",YON_TYPE_BOOLEAN); - yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->MainTree)); - GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->MainTree)); - for (guint i=0;iTargetTypeCombo,widgets); + widgets->FiltersButton = yon_gtk_builder_get_widget(builder,"FiltersButton"); + widgets->InformationButton = yon_gtk_builder_get_widget(builder,"InformationButton"); + widgets->RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); + widgets->EditButton = yon_gtk_builder_get_widget(builder,"EditButton"); + widgets->AddButton = yon_gtk_builder_get_widget(builder,"AddButton"); + + widgets->MainTree = yon_gtk_builder_get_widget(builder,"QuotasTreeView"); + widgets->MainNotebook = yon_gtk_builder_get_widget(builder,"MainNotebook"); + + widgets->DispatcherUpdateCheck = yon_gtk_builder_get_widget(builder,"DispatcherUpdateCheck"); + widgets->DispatcherUpdateSpin = yon_gtk_builder_get_widget(builder,"DispatcherUpdateSpin"); + widgets->DispatcherUpdateButton = yon_gtk_builder_get_widget(builder,"DispatcherUpdateButton"); + widgets->DispatcherTerminal = yon_gtk_builder_get_widget(builder,"DispatcherTerminal"); + + widgets->ShowAllCheck = yon_gtk_builder_get_widget(builder,"ShowAllCheck"); + widgets->ShowCoreCheck = yon_gtk_builder_get_widget(builder,"ShowCoreCheck"); + widgets->ProcessesUpdateButton = yon_gtk_builder_get_widget(builder,"ProcessesUpdateButton"); + widgets->ProcessesTerminal = yon_gtk_builder_get_widget(builder,"ProcessesTerminal"); + + widgets->TargetTypeCombo = yon_gtk_builder_get_widget(builder,"TargetTypeCombo"); + widgets->TargetCombo = yon_gtk_builder_get_widget(builder,"TargetCombo"); + widgets->InformationUpdateButton = yon_gtk_builder_get_widget(builder,"InformationUpdateButton"); + widgets->InformationTerminal = yon_gtk_builder_get_widget(builder,"InformationTerminal"); + + main_config.list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore")); + + /* Widget registration for config monitoring | Регистрация виджетов для мониторинга конфига */ + // yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING); + + /* Signal connection | Присоединение сигналов */ + g_signal_connect(G_OBJECT(widgets->FiltersButton),"clicked",G_CALLBACK(on_filters_opened),widgets); + g_signal_connect(G_OBJECT(widgets->InformationButton),"clicked",G_CALLBACK(on_information),widgets); + g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_remove),widgets); + g_signal_connect(G_OBJECT(widgets->EditButton),"clicked",G_CALLBACK(on_edit_open),widgets); + g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_add_open),widgets); + g_signal_connect(G_OBJECT(widgets->MainNotebook),"switch-page",G_CALLBACK(on_tab_changed),widgets); + g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->DispatcherUpdateSpin); + g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->DispatcherUpdateButton); + g_signal_connect(G_OBJECT(widgets->DispatcherUpdateCheck),"toggled",G_CALLBACK(on_dispatcher_update),widgets); + g_signal_connect(G_OBJECT(widgets->DispatcherUpdateSpin),"output",G_CALLBACK(on_dispatcher_update),widgets); + g_signal_connect(G_OBJECT(widgets->DispatcherUpdateButton),"clicked",G_CALLBACK(on_dispatcher_update),widgets); + g_signal_connect(G_OBJECT(widgets->ShowAllCheck),"toggled",G_CALLBACK(on_processes_update),widgets); + g_signal_connect(G_OBJECT(widgets->ShowCoreCheck),"toggled",G_CALLBACK(on_processes_update),widgets); + g_signal_connect(G_OBJECT(widgets->TargetTypeCombo),"changed",G_CALLBACK(on_info_target_type_switched),widgets); + g_signal_connect(G_OBJECT(widgets->TargetCombo),"changed",G_CALLBACK(on_information_chosen_changed),widgets); + g_signal_connect(G_OBJECT(widgets->ProcessesUpdateButton),"clicked",G_CALLBACK(on_processes_update),widgets); + g_signal_connect(G_OBJECT(widgets->InformationUpdateButton),"clicked",G_CALLBACK(on_information_update),widgets); + + g_signal_connect(G_OBJECT(widgets->SaveMenuItem),"activate",G_CALLBACK(on_config_global_local_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(on_config_custom_save),widgets); + + g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets); + g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); + g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets); + + on_dispatcher_update(NULL,widgets); + on_processes_update(NULL,widgets); + yon_window_config_add_listener(widgets->DispatcherUpdateCheck,"DispatcherAutoupdate","active",YON_TYPE_BOOLEAN); + yon_window_config_add_listener(widgets->ShowAllCheck,"ProcessShowAll","active",YON_TYPE_BOOLEAN); + yon_window_config_add_listener(widgets->ShowCoreCheck,"ProcessShowCore","active",YON_TYPE_BOOLEAN); + yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->MainTree)); + GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->MainTree)); + for (guint i=0;iTargetTypeCombo,widgets); } on_config_local_load(NULL,widgets); yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size); diff --git a/source/ubl-settings-resourcequota.h b/source/ubl-settings-resourcequota.h index 50e4d2c..6a978c1 100644 --- a/source/ubl-settings-resourcequota.h +++ b/source/ubl-settings-resourcequota.h @@ -18,7 +18,6 @@ #endif #include "ubl-strings.h" #define config_path yon_char_unite("/home/",yon_ubl_root_user_get(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) -#define WIKI_LINK "https://wiki.ublinux.ru/software/programs_and_utilities/all/ubl-settings-resourcequota" #define _(String) gettext(String) diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 10d10e1..9560223 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -1,29 +1,6 @@ -// #define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL) -// #define HELP_LABEL yon_char_unite(_("ubl-settings-resourcequota version:")," ", version_application,"\n",_("CPU and RAM quotas"),"\n",_("Usage:"), " ubl-settings-resourcequota ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL) -// #define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked") #define TITLE_LABEL _("CPU and RAM quotas") #define TITLE_INFO_LABEL _("Configuring CPU and RAM quota settings for groups and users of the system") - -// #define SUCCESS_LABEL _("Operation succeeded") -// #define ABOUT_LABEL _("About") -// #define DOCUMENTATION_LABEL _("Documentation") -// #define SAVE_LOCAL_LABEL _("Save to local configuration") -// #define SAVE_GLOBAL_LABEL _("Save to global configuration") -// #define SAVE_CONFIGURATION_LABEL _("Save configuration") -// #define SAVE_LABEL _("Save") -// #define LOAD_LOCAL_LABEL _("Load local configuration") -// #define LOAD_GLOBAL_LABEL _("Load global configuration") -// #define LOAD_LABEL _("Load") -// #define LOAD_LABEL _("Load") - -// #define CANCEL_LABEL _("Cancel") - -// #define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?") -// #define HELP_INFO_LABEL _("You will be redirected to documentation website, where documentation is\ntranslated and supported by community.") -// #define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation") -// #define OPEN_HELP_LABEL _("Open documentation") -// #define PROJECT_HOME_LABEL _("Project homepage") -// #define NOTHING_CHOSEN_LABEL _("Nothing were chosen") +#define WIKI_LINK _("https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-resourcequota") #define STR_USER _("User") #define STR_GROUP _("Group") @@ -38,16 +15,11 @@ #define GLOBAL_LOAD_SUCCESS _("Global configuration loading succeeded.") #define LOCAL_LOAD_SUCCESS _("Local configuration loading succeeded.") -// #define GLOBAL_LOCAL_SAVE_SUCCESS _("Local and global configuration saving succeeded.") -// #define GLOBAL_SAVE_SUCCESS _("Global configuration saving succeeded.") -// #define LOCAL_SAVE_SUCCESS _("Local configuration saving succeeded.") #define STR_DEL_TABLE _("Quota deleted") #define STR_NO_SELECT_TABLE _("Quota deleted") #define STR_QUOTAS_ADD _("Quota deleted") #define ALL_SAVE_SUCCESS _("Save configuration") #define MESS_NOTHING_SAVE _("Nothing to save!") -// #define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succeeded.") -// #define LOAD_FAILED_LABEL _("Config loading failed") #define LIST_QUOTAS_LABEL _("Quotas list") #define DISPATCHER_LABEL _("Dispatcher") @@ -70,7 +42,6 @@ #define CPU_LIMIT_LABEL _("CPU limit (%)") #define READ_LIMIT_LABEL _("I/O limit (read)") #define WRITE_LIMIT_LABEL _("I/O limit (write)") -// #define ACCEPT_LABEL _("Accept") #define FILTERS_LABEL _("Filters") #define INFORMATION_LABEL _("Information") diff --git a/ubl-settings-resourcequota.desktop b/ubl-settings-resourcequota.desktop old mode 100644 new mode 100755 From ea393dd28dc157b0b7e6e77a8dfef591fdf81b11 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 2 Feb 2026 17:44:52 +0600 Subject: [PATCH 4/4] Fixed crash --- source/ubl-settings-resourcequota.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index cde9afb..823260d 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -835,7 +835,9 @@ void on_quotas_edit(GtkWidget *self, dictionary *windows){ if (dict->data&&yon_dictionary_get_data(dict,device_limits*)->read) read_devices = yon_char_unite(read_devices?read_devices:"","",dict->key," ",yon_dictionary_get_data(dict,device_limits*)->read,"\n",NULL); } - if (read_devices[strlen(read_devices)-1]=='\n') read_devices[strlen(read_devices)-1]='\0'; + if (!yon_char_is_empty(read_devices)){ + yon_char_remove_last_symbol(read_devices,'\n'); + } read_limit = yon_char_unite(read_limit?read_limit:"",read_devices,NULL); @@ -845,7 +847,9 @@ void on_quotas_edit(GtkWidget *self, dictionary *windows){ if (dict->data&&yon_dictionary_get_data(dict,device_limits*)->write) write_devices = yon_char_unite(write_devices?write_devices:"","",dict->key," ",yon_dictionary_get_data(dict,device_limits*)->write,"\n",NULL); } - if (write_devices[strlen(write_devices)-1]=='\n') write_devices[strlen(write_devices)-1]='\0'; + if (!yon_char_is_empty(write_devices)){ + yon_char_remove_last_symbol(write_devices,'\n'); + } write_limit = yon_char_unite(write_limit?write_limit:"",write_devices,NULL); gtk_list_store_set(main_config.list,&iter,1,target,2,soft,3,hard,4,paging,5,cpu,6,read_limit,7,write_limit,8,string,-1); yon_config_register(CGROUP_QUOTA(target),CGROUP_QUOTA_comd(target),(char*)string);