From 725dc803a59327f44cffd6a0e312331fb519fd50 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 2 Jun 2025 04:02:50 +0000 Subject: [PATCH] Design changes --- locale/ubl-settings-resourcequota.pot | 4 + locale/ubl-settings-resourcequota_ru.po | 4 + source/ubl-settings-resourcequota.c | 6 +- source/ubl-settings-resourcequota.h | 1 + source/ubl-strings.h | 2 +- ubl-settings-resourcequota-quota.glade | 1243 ++++++++++++----------- 6 files changed, 661 insertions(+), 599 deletions(-) diff --git a/locale/ubl-settings-resourcequota.pot b/locale/ubl-settings-resourcequota.pot index e6c9622..a8fe212 100644 --- a/locale/ubl-settings-resourcequota.pot +++ b/locale/ubl-settings-resourcequota.pot @@ -406,3 +406,7 @@ msgstr "" #: source/ubl-strings.h:103 msgid "Manual input (for advanced users)" msgstr "" + +#: source/ubl-strings.h:103 +msgid "Current quota has no parameters" +msgstr "" diff --git a/locale/ubl-settings-resourcequota_ru.po b/locale/ubl-settings-resourcequota_ru.po index 8c1aff1..5d35a28 100644 --- a/locale/ubl-settings-resourcequota_ru.po +++ b/locale/ubl-settings-resourcequota_ru.po @@ -433,3 +433,7 @@ msgstr "Применить изменения лимита операций" #: source/ubl-strings.h:103 msgid "Manual input (for advanced users)" msgstr "Ручной ввод (для опытных пользователей)" + +#: source/ubl-strings.h:103 +msgid "Current quota has no parameters" +msgstr "Для текущей квоты не было задано ни одного параметра" diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index df5c11f..a2992bc 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -292,7 +292,7 @@ void on_quotas_save(GtkWidget *self, dictionary *windows){ // main_window *widgets = yon_dictionary_get_data(windows->first->next,main_window*); GtkTreeIter iter; if (!strcmp(gtk_entry_get_text(GTK_ENTRY(window->ManualInputEntry)),"")){ - yon_ubl_status_box_render(OPERATION_FAILED_EMPTY_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),OPERATION_FAILED_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return; } const char *string = gtk_entry_get_text(GTK_ENTRY(window->ManualInputEntry)); @@ -673,6 +673,7 @@ void on_add_open(GtkWidget *, main_window *widgets){ window->Window = yon_gtk_builder_get_widget(builder,"QuotasWindow"); window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); window->BlockUiBox = yon_gtk_builder_get_widget(builder,"BlockUiBox"); window->TargetTypeCombo = yon_gtk_builder_get_widget(builder,"TargetTypeCombo"); window->AddQuotaTargetBox = yon_gtk_builder_get_widget(builder,"AddQuotaTargetBox"); @@ -859,7 +860,7 @@ void on_quotas_edit(GtkWidget *self, dictionary *windows){ main_window *widgets = yon_dictionary_get_data(windows->first->next,main_window*); GtkTreeIter iter; if (!strcmp(gtk_entry_get_text(GTK_ENTRY(window->ManualInputEntry)),"")){ - yon_ubl_status_box_render(OPERATION_FAILED_EMPTY_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),OPERATION_FAILED_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return; } if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){ @@ -931,6 +932,7 @@ void on_edit_open(GtkWidget *, main_window *widgets){ window->Window = yon_gtk_builder_get_widget(builder,"QuotasWindow"); window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); window->BlockUiBox = yon_gtk_builder_get_widget(builder,"BlockUiBox"); window->TargetTypeCombo = yon_gtk_builder_get_widget(builder,"TargetTypeCombo"); window->AddQuotaTargetBox = yon_gtk_builder_get_widget(builder,"AddQuotaTargetBox"); diff --git a/source/ubl-settings-resourcequota.h b/source/ubl-settings-resourcequota.h index b44c827..1146aed 100644 --- a/source/ubl-settings-resourcequota.h +++ b/source/ubl-settings-resourcequota.h @@ -129,6 +129,7 @@ typedef struct { GtkWidget *Window; GtkWidget *TitleLabel; + GtkWidget *StatusBox; GtkWidget *BlockUiBox; GtkWidget *EditQuotaTargetBox; GtkWidget *AddQuotaTargetBox; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index c9fdef0..cce41ae 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -87,7 +87,7 @@ #define VIEW_PROPERTIES_LABEL _("View properties for") -#define ADDING_LABEL _("CPU and RAM quotas - Adding") +#define ADDING_LABEL _("Add") #define EDITING_LABEL _("CPU and RAM quotas - Editing") #define QUOTA_OBJ_LABEL _("Quota object:") #define RAM_LABEL _("RAM limit") diff --git a/ubl-settings-resourcequota-quota.glade b/ubl-settings-resourcequota-quota.glade index 4708587..5c7443f 100644 --- a/ubl-settings-resourcequota-quota.glade +++ b/ubl-settings-resourcequota-quota.glade @@ -3,40 +3,6 @@ - - 1 - 10 - - - 1 - 10 - - - 1 - 10 - - - 1 - 10 - - - 1 - 10 - - - 1 - 10 - - - True - False - process-stop-symbolic - - - True - False - emblem-ok-symbolic - False start @@ -47,28 +13,88 @@ True False - 5 - 5 - 5 - 5 vertical 5 + + + True + False + vertical + 3 + + + + + + True + True + 0 + + True False + 5 + 5 + 5 + 5 + 5 vertical 5 - + True False + vertical 5 - + True False - Quota object: + 5 + + + True + False + Quota object: + + + False + True + 0 + + + + + 100 + True + False + 0 + 0 + + User + Process + Slice + + + + True + True + 1 + + + + + True + False + + + False + True + 2 + + False @@ -77,136 +103,291 @@ - - 100 - True - False - 0 - 0 - - User - Process - Slice - - - - True - True - 1 - - - - - True + False + 5 + + + True + False + Quota object: + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + False True - 2 + 1 False True - 0 + 1 - + + True + False False + vertical 5 - - True - False - Quota object: - - - False - True - 0 - - - - + True False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + + + True + False + start + 5 + + + True + False + start + vertical + 5 + + + True + False + Soft restriction + 0 + + + False + True + 0 + + + + + True + False + 5 + + + True + True + False + True + + + False + True + 0 + + + + + True + False + True + 7 + 1 + adjustment3 + 1 + + + False + True + 1 + + + + + True + False + False + 0 + 0 + + Kb + Mb + Gb + Tb + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + start + vertical + 5 + + + True + False + Hard restriction + 0 + + + False + True + 0 + + + + + True + False + 5 + + + True + True + False + True + + + False + True + 0 + + + + + True + False + True + 7 + 1 + adjustment4 + 1 + + + False + True + 1 + + + + + True + False + False + 0 + 0 + + Kb + Mb + Gb + Tb + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + + + + + True + False + RAM limit + + False True - 1 + 0 - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - False - vertical - 5 - - - True - False - 0.019999999552965164 - in - + True False - 5 - 5 - 5 + 5 - + True False - start - 5 + 0.019999999552965164 + in - + True False - start - vertical - 5 - - - True - False - Soft restriction - 0 - - - False - True - 0 - - + 5 + 5 + 5 True False 5 - + True True False @@ -219,13 +400,14 @@ - + True False True 7 - 0 - adjustment3 + 1 + adjustment5 + 1 False @@ -234,7 +416,7 @@ - + True False False @@ -254,46 +436,43 @@ - - False - True - 1 - - - True - True - 0 - + + + True + False + Paging file limit + + + + + False + True + 0 + + + + + True + False + 0.019999999552965164 + in - + True False - start - vertical - 5 - - - True - False - Hard restriction - 0 - - - False - True - 0 - - + 5 + 5 + 5 - + True False 5 - + True True False @@ -306,13 +485,14 @@ - + True False True 7 - 0 - adjustment4 + 1 + adjustment6 + 1 False @@ -321,18 +501,10 @@ - + True - False False - 0 - 0 - - Kb - Mb - Gb - Tb - + % False @@ -341,281 +513,59 @@ - - False - True - 1 - - - True - True - 1 - - - - - - - - True - False - RAM limit - - - - - False - True - 0 - - - - - True - False - 5 - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - + + True False - 5 - - - True - True - False - True - - - False - True - 0 - - - - - True - False - True - 7 - 0 - adjustment5 - - - False - True - 1 - - - - - True - False - False - 0 - 0 - - Kb - Mb - Gb - Tb - - - - False - True - 2 - - + CPU limit - - - - True - False - Paging file limit - + + True + True + 1 + False True - 0 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - - - True - False - 5 - - - True - True - False - True - - - False - True - 0 - - - - - True - False - True - 7 - 0 - adjustment6 - - - False - True - 1 - - - - - True - False - % - - - False - True - 2 - - - - - - - - - True - False - CPU limit - - - - - True - True 1 - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - + True - False - 5 - 5 - 5 - - - True - False - vertical - 5 - - - True - False - 5 - - - True - False - Device: - 0 - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - False - True - 0 - - + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 True False - start + vertical 5 - + True False - vertical 5 True False - Read + Device: 0 @@ -625,70 +575,19 @@ - + True False - start - 5 - - - True - False - True - False - True - - - False - True - 0 - - - - - True - False - True - 7 - 0 - adjustment1 - - - False - True - 1 - - - - - True - False - False - 0 - 0 - - Kb - Mb - Gb - Tb - - - - False - True - 2 - - - False + True True 1 - True + False True 0 @@ -697,21 +596,92 @@ True False - vertical + start 5 - + True False - 5 - 5 - 5 - 5 - Write - 0 + vertical + 5 + + + True + False + Read + 0 + + + False + True + 0 + + + + + True + False + start + 5 + + + True + False + True + False + True + + + False + True + 0 + + + + + True + False + True + 7 + 0 + adjustment1 + + + False + True + 1 + + + + + True + False + False + 0 + 0 + + Kb + Mb + Gb + Tb + + + + False + True + 2 + + + + + False + True + 1 + + - False + True True 0 @@ -720,15 +690,18 @@ True False - start + vertical 5 - + True - False - True - False - True + False + 5 + 5 + 5 + 5 + Write + 0 False @@ -737,71 +710,133 @@ - - True - False - True - 7 - 0 - adjustment2 - - - False - True - 1 - - - - + True - False False - 0 - 0 - - Kb - Mb - Gb - Tb - + start + 5 + + + True + False + True + False + True + + + False + True + 0 + + + + + True + False + True + 7 + 0 + adjustment2 + + + False + True + 1 + + + + + True + False + False + 0 + 0 + + Kb + Mb + Gb + Tb + + + + False + True + 2 + + False True - 2 + 1 - False + True True 1 - True + False True 1 - - False - True - 1 - + + + True + False + Input/Output limit of block devices + + + + False + True + 2 + - - + + True False - Input/Output limit of block devices + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + + + True + True + + + + + + + True + False + Manual input (for advanced users) + + + + False + True + 3 + @@ -811,32 +846,50 @@ - + True False - 0.019999999552965164 - in + 5 - + True False - 5 - 5 - 5 - - - True - True - - + + False + True + 0 + - - + + + Cancel True - False - Manual input (for advanced users) + True + True + image1 + + + False + True + end + 1 + + + + + Save + True + True + True + image2 + + False + True + end + 1 + @@ -852,59 +905,6 @@ 1 - - - True - False - 5 - - - True - False - - - False - True - 0 - - - - - Cancel - True - True - True - image1 - - - False - True - end - 1 - - - - - Save - True - True - True - image2 - - - False - True - end - 1 - - - - - False - True - 3 - - @@ -941,4 +941,55 @@ + + 1 + 1 + 1 + 1 + 10 + + + 1 + 1 + 1 + 1 + 10 + + + 1 + 1 + 1 + 1 + 10 + + + 1 + 1 + 1 + 1 + 10 + + + 1 + 1 + 1 + 1 + 10 + + + 1 + 1 + 1 + 10 + + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic +