From 161133fc9b4a92e8015ea96cfb61eeaa6482e56b Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 6 Jul 2023 17:44:08 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20spin=20=D1=82=D0=B5=D1=80=D0=BC=D0=B8=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-resourcequota.c | 25 ++++++++++++++----------- source/view_add.c | 2 -- ubl-settings-resourcequota.glade | 1 + 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index e4c31e1..7776967 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -209,11 +209,14 @@ main_window *setup_window(){ void main_update_dispatcher() { int second = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->spinUpdateDispatcher)); - char* str_second = yon_char_from_int(second); - char *cmd = yon_char_get_augumented("systemd-cgtop -d ", str_second); - yon_terminal_integrated_launch(widgets->vteDispatcher, cmd, NULL, NULL); - free(str_second); - free(cmd); + if (second>0) { + char* str_second = yon_char_from_int(second); + char *cmd = yon_char_get_augumented("systemd-cgtop -d ", str_second); + yon_terminal_integrated_launch(widgets->vteDispatcher, cmd, NULL, NULL); + free(str_second); + free(cmd); + } + } void main_update_processes() { @@ -438,14 +441,12 @@ void str_split_value(char* values, int index) { } init_cfg_array(index); char* value_i = NULL; - for (int index_1 = 0; index_1 < size; index_1++) { + int index_1 = 0; + for (index_1=0; index_1 < size; index_1++) { value = yon_char_new(arr_values[index_1]); key = yon_char_divide_search(value, "=", -1); - if (yon_char_find_count(key, "IOReadBandwidthMax") != 0) { - get_param_io_limit(arr_values, index_1, size,index, "IOReadBandwidthMax"); - } - if (yon_char_find_count(key, "IOWriteBandwidthMax") != 0) { - get_param_io_limit(arr_values, index_1, size,index, "IOWriteBandwidthMax"); + if (strstr(key, "IOReadBandwidthMax") || strstr(key, "IOWriteBandwidthMax")) { + break; } if (yon_char_find_count(key, "MemoryHigh") != 0) { philos_set_pow_size_memory(yon_char_new(value), &main_config.soft_raw_limit_size, index, array_size_pow); @@ -464,6 +465,8 @@ void str_split_value(char* values, int index) { set_size_memory_integer(yon_char_new(value), &main_config.cpu_limit, index); } } + get_param_io_limit(arr_values, index_1, size,index, "IOReadBandwidthMax"); + get_param_io_limit(arr_values, index_1, size,index, "IOWriteBandwidthMax"); } diff --git a/source/view_add.c b/source/view_add.c index 228dbdf..f9e7628 100644 --- a/source/view_add.c +++ b/source/view_add.c @@ -75,8 +75,6 @@ void event_check_io_device() { add_init_windows(); philos_temp_add_disk(add_widgets, &obj_add_config, 0); philos_temp_add_disk(add_widgets, &obj_add_config, 1); - //philos_temp_del_disk(add_widgets, &obj_add_config, 0); - //philos_temp_del_disk(add_widgets, &obj_add_config, 1); philos_temp_generate_cmd(add_widgets, &obj_add_config); } diff --git a/ubl-settings-resourcequota.glade b/ubl-settings-resourcequota.glade index 8a29fb4..658900c 100644 --- a/ubl-settings-resourcequota.glade +++ b/ubl-settings-resourcequota.glade @@ -2377,6 +2377,7 @@ + 1 10000 1 1