From f5f4809531198e7a0f52276fd35a82e80f97a0b8 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 11 May 2023 11:08:39 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D0=B5=D0=B9=20=D0=B8?= =?UTF-8?q?=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- #ubl-settings-diskquota.glade# | 3867 ------------------------------ source/ubl-settings-diskquota.cc | 81 +- source/ubl-settings-diskquota.h | 31 +- source/util.cc | 79 + source/util.h | 4 + ubl-settings-diskquota.glade | 489 ++-- ubl-settings-diskquota.pot | 9 + ubl-settings-diskquota_ru.po | 11 +- 8 files changed, 402 insertions(+), 4169 deletions(-) delete mode 100644 #ubl-settings-diskquota.glade# diff --git a/#ubl-settings-diskquota.glade# b/#ubl-settings-diskquota.glade# deleted file mode 100644 index fbde303..0000000 --- a/#ubl-settings-diskquota.glade# +++ /dev/null @@ -1,3867 +0,0 @@ - - - - - - - - - - - - False - start - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - - - Name - True - True - False - start - 5 - True - - - False - True - 0 - - - - - Quotas - True - True - False - start - True - - - False - True - 1 - - - - - Size - True - True - False - start - True - - - False - True - 2 - - - - - Soft limit (size) - True - True - False - start - True - - - False - True - 3 - - - - - Hard limit (size) - True - True - False - start - True - - - False - True - 4 - - - - - True - False - end - 5 - 5 - True - - - gtk-cancel - True - True - True - center - True - - - False - True - 0 - - - - - gtk-save - True - True - True - center - True - - - False - True - 1 - - - - - False - True - end - 5 - - - - - Hard limit (size) delay - True - True - False - start - True - - - False - True - 5 - - - - - Files - True - True - False - start - True - - - False - True - 7 - - - - - Soft limit (files) - True - True - False - start - True - - - False - True - 8 - - - - - Hard limit (files) - True - True - False - start - True - - - False - True - 9 - - - - - Hard limit (files) delay - True - True - False - start - True - - - False - True - 10 - - - - - - - True - False - True - - - True - False - System quotas - - - - - - - - True - False - 32 - com.ublinux.ubl-settings-diskquota - 5 - - - - - - - - - - - - - Byte - - - Kb - - - Mb - - - Gb - - - Tb - - - - - False - False - True - center - com.ublinux.ubl-settings-diskquota - dialog - True - ubl-settings-diskquota - 1.0 - Copyright © 2022 - 2023, UBSoft LLC - Setting user quotas - https://ublinux.ru/ - Project Home Page - Это приложение распространяется без каких-либо гарантий. -Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. - UBGroup - UBGroup - com.ublinux.ubl-settings-diskquota - True - gpl-2-0 - - - True - False - vertical - 2 - - - False - end - - - False - False - 1 - - - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 2 - System quotas - - - - - - - - - - True - False - - - 90 - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 69 - com.ublinux.ubl-settings-diskquota - - - False - True - 0 - - - - - True - False - - - True - False - - - True - False - vertical - - - 255 - True - False - Configuration of disk quotas parameters for system groups and users - - - - - - - - True - True - 0 - - - - - False - True - 0 - - - - - True - True - 0 - - - - - True - True - 1 - - - - - 5 - 1 - 10 - - - 23 - 1 - 10 - - - 59 - 1 - 10 - - - 100 - 1 - 10 - - - 5 - 1 - 10 - - - 23 - 1 - 10 - - - 59 - 1 - 10 - - - 100 - 1 - 10 - - - 5 - 1 - 10 - - - 23 - 1 - 10 - - - 59 - 1 - 10 - - - 100 - 1 - 10 - - - 5 - 1 - 10 - - - 23 - 1 - 10 - - - 59 - 1 - 10 - - - 100 - 1 - 10 - - - - True - False - False - False - - - True - False - 7 - 7 - Direct control of the file system - True - - - - - True - False - Help - - - - - - True - False - About - True - - - - - - True - False - - - True - False - Load from global configuration - True - - - - - - True - False - Load from local configuration - True - - - - - - True - False - - - True - False - Save to global and local configuration - True - - - - - - True - False - Save to global configuration - True - - - - - - True - False - Save to local configuration - True - - - - - - False - center - com.ublinux.ubl-settings-diskquota - center - - - True - False - vertical - - - True - False - vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 25 - 1 - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - - - 81 - True - False - - - True - False - start - - - -1 - - - - - False - True - 0 - - - - - False - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - True - True - vertical - - - True - True - - - True - False - vertical - - - True - True - liststore1 - - - - - - True - True - 0 - - - - - - - True - False - General settings - - - False - - - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - Device: - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - False - 20 - - - True - False - vertical - True - - - True - False - Excess size delay period - 0 - - - False - True - 0 - - - - - True - False - Excess files delay period - 0 - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalGroupsSizeWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalGroupsFilesWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalGroupsSizeDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalGroupsFilesDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 2 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalGroupsSizeHoursSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalGroupsFilesHoursSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 3 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalGroupsSizeMinutesSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalGroupsFilesMinutesSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 4 - - - - - False - True - 1 - - - - - True - True - liststore1 - - - - - - True - True - 2 - - - - - True - False - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-goto-first - - - False - True - 0 - - - - - True - False - 5 - 5 - Filters - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - False - - - gtk-delete - True - True - True - 5 - 5 - 5 - 5 - True - - - False - True - 0 - - - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-edit - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - Edit - - - False - True - 1 - - - - - - - False - True - 1 - - - - - gtk-add - True - True - True - 5 - 5 - 5 - 5 - True - - - False - True - 2 - - - - - False - True - end - 1 - - - - - False - True - 3 - - - - - 1 - - - - - True - False - Groups - - - 1 - False - - - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - Device: - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - 20 - - - True - False - vertical - True - - - True - False - Excess size delay period - 0 - - - False - True - 0 - - - - - True - False - Excess files delay period - 0 - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 2 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeHoursSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesHourSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 3 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeMinutesSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesMinuteSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 4 - - - - - False - True - 1 - - - - - True - True - liststore1 - - - - - - True - True - 2 - - - - - True - False - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-missing-image - - - False - True - 0 - - - - - True - False - 5 - 5 - Filters - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - False - - - gtk-delete - True - True - True - 5 - 5 - 5 - 5 - True - - - False - True - 0 - - - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-edit - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - Edit - - - False - True - 1 - - - - - - - False - True - 1 - - - - - gtk-add - True - True - True - 5 - 5 - 5 - 5 - True - - - False - True - 2 - - - - - False - True - end - 1 - - - - - False - True - 3 - - - - - 2 - - - - - True - False - Users - - - 2 - False - - - - - True - False - vertical - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - - - True - False - Device: - - - False - True - 0 - - - - - True - False - - - True - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - 20 - - - True - False - vertical - True - - - True - False - Excess size delay period - 0 - - - False - True - 0 - - - - - True - False - Excess files delay period - 0 - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesWeeksSpin - - - False - True - 0 - - - - - True - False - weeks - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesDaysSpin - - - False - True - 0 - - - - - True - False - days - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 2 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeHoursSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesHourSpin - - - False - True - 0 - - - - - True - False - hours - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 3 - - - - - True - False - vertical - 5 - - - True - False - 5 - - - True - True - 0 - generalUsersSizeMinutesSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - 5 - - - True - True - 0 - generalUsersFilesMinuteSpin - - - False - True - 0 - - - - - True - False - minutes - - - False - True - 1 - - - - - False - True - 1 - - - - - False - True - 4 - - - - - False - True - 1 - - - - - True - True - liststore1 - - - - - - True - True - 2 - - - - - False - True - 0 - - - - - True - False - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-missing-image - - - False - True - 0 - - - - - True - False - 5 - 5 - Filters - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - False - - - gtk-delete - True - True - True - 5 - 5 - 5 - True - - - False - True - 0 - - - - - True - True - True - 5 - 5 - 5 - 5 - - - True - False - - - True - False - 5 - 5 - gtk-edit - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - Edit - - - False - True - 1 - - - - - - - False - True - 1 - - - - - gtk-add - True - True - True - 5 - 5 - 5 - 5 - True - - - False - True - 2 - - - - - False - True - end - 1 - - - - - False - True - end - 1 - - - - - 3 - - - - - True - False - Project - - - 3 - False - - - - - True - True - 0 - - - - - False - True - 2 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 2 - UBConfig - Quotas - - - - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 32 - com.ublinux.ubl-settings-diskquota - - - - - True - False - - - True - True - False - True - menuLoad - - - True - False - - - True - False - Load - - - False - True - 0 - - - - - True - False - pan-down-symbolic - - - False - True - 1 - - - - - - - False - True - 0 - - - - - - 2 - - - - - True - False - - - True - True - False - True - menuSave - - - True - False - - - True - False - Save - - - False - True - 0 - - - - - True - False - pan-down-symbolic - - - False - True - 1 - - - - - - - False - True - 0 - - - - - True - True - True - False - True - True - menuAbout - none - - - True - False - open-menu-symbolic - - - - - False - True - 1 - - - - - - end - 3 - - - - - - - - - - - - - vertical - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1000000 - 1 - 10 - - - 1000000 - 1 - 10 - - - 1024 - 1 - 10 - - - 1024 - 1 - 10 - - - False - start - False - - - True - False - 5 - 5 - 5 - 5 - vertical - - - True - False - vertical - - - True - False - - - True - False - Device: - - - False - True - 0 - - - - - True - False - 5 - 5 - - - True - True - 1 - - - - - True - True - 0 - - - - - True - False - - - True - False - Quota use status: - 0 - - - False - True - 0 - - - - - True - False - 5 - 5 - 0 - - - True - True - 1 - - - - - True - True - 1 - - - - - True - False - - - True - False - UserGropProject: - 0 - - - False - True - 0 - - - - - True - False - 5 - 5 - 0 - - - True - True - 1 - - - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Currently using: - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Soft limit - 0 - - - False - True - 1 - - - - - True - False - 5 - - - True - True - False - right - True - - - False - True - 0 - - - - - True - True - quotegroupSizeSoftLimitAdjustment - - - True - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - 2 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Hard limit - 0 - - - False - True - 3 - - - - - True - False - False - 5 - - - True - True - False - right - True - - - False - True - 0 - - - - - True - True - quotegroupSizeHardLimitAdjustment - - - True - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - 4 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Size - - - - - True - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Currently using: - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Soft limit - 0 - - - False - True - 1 - - - - - True - False - 5 - - - True - True - False - right - True - - - False - True - 0 - - - - - True - True - quotegroupFilesSoftLimitAdjustment - - - True - True - 1 - - - - - True - False - files - - - False - True - 2 - - - - - True - True - 2 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Hard limit - 0 - - - False - True - 3 - - - - - True - False - 5 - - - True - True - False - right - True - - - False - True - 0 - - - - - True - True - quotegroupFilesHardLimitAdjustment - - - True - True - 1 - - - - - True - False - files - - - False - True - 2 - - - - - True - True - 4 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Files - - - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - 5 - vertical - True - - - True - False - end - 5 - True - - - gtk-cancel - True - True - True - True - - - False - True - 0 - - - - - gtk-save - True - True - True - True - - - False - True - 1 - - - - - False - True - 0 - - - - - False - True - 2 - - - - - - - True - False - - - True - False - UBConfig - Quotas - - - - - True - False - 32 - com.ublinux.ubl-settings-diskquota - 5 - - - - - - - 1000000 - 1 - 10 - - - 1000000 - 1 - 10 - - - 1024 - 1 - 10 - - - 1024 - 1 - 10 - - - False - start - start - False - 450 - 250 - dialog-question-symbolic - - - True - False - vertical - - - True - False - - - True - False - start - 20 - 20 - dialog-question-symbolic - 5 - - - False - True - 0 - - - - - True - False - vertical - - - True - False - start - 10 - 5 - Would you like to read documentation in the Web? - True - 0 - - - - - - - False - True - 0 - - - - - True - False - start - start - 10 - 10 - You will be redirected to documentation website where documentation is translated and supported by community. - True - 0 - - - - True - True - 1 - - - - - Always redirect to online documentation - True - True - False - end - 10 - True - - - - False - True - 2 - - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 30 - True - - - Cancel - True - True - True - - - - True - True - 0 - - - - - Read Online - True - True - True - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - True - False - True - - - True - False - ubl-settings-datetime - - - - - - - - True - False - 32 - dialog-question-symbolic - - - - - - - 800 - 600 - False - True - True - com.ublinux.ubl-settings-datetime - - - - - - True - False - True - - - True - False - ubl-settings-datetime - - - - - True - False - 32 - com.ublinux.ubl-settings-datetime - 5 - - - - - - diff --git a/source/ubl-settings-diskquota.cc b/source/ubl-settings-diskquota.cc index 4eecfcb..b6034c5 100755 --- a/source/ubl-settings-diskquota.cc +++ b/source/ubl-settings-diskquota.cc @@ -47,16 +47,16 @@ void MainWindow::settings() { ,quotegroupFilesHarLimitLabel); obj_quotas_sys.set_map_gui(map_gui_cfg); obj_quotas_ubconfig.set_map_gui(map_gui_cfg); - filtersNameFilterCheckbox->set_active(true); - filtersQuotasFilterCheckbox->set_active(true); - filtersSizeFilterCheckbox->set_active(true); - filtersSoftSizeFilterCheckbox->set_active(true); - filtersHardSizeFilterCheckbox->set_active(true); - filtersHardSizeDelayFilterCheckbox->set_active(true); - filtersFilesFilterCheckbox->set_active(true); - filtersSoftFilesFilterCheckbox->set_active(true); - filtersHardFilesFilterCheckbox->set_active(true); - filtersHardFilesDelayFilterCheckbox->set_active(true); + chbFilterName->set_active(true); + chbFilterQuotas->set_active(true); + chbFilterSize->set_active(true); + chbFilterSoftLimitSize->set_active(true); + chbFilterHardLimitSize->set_active(true); + chbFilterHardLimitSizeDelay->set_active(true); + chbFilterFiles->set_active(true); + chbFilterSoftLimitFile->set_active(true); + chbFilterHardLimitFile->set_active(true); + chbFilterHardLimitFileDelay->set_active(true); #ifdef WEBKIT_FOUND one = WEBKIT_WEB_VIEW( webkit_web_view_new() ); @@ -228,16 +228,16 @@ void MainWindow::lacalization() { groupsDeviceLabel->set_label(str_device); usersDeviceLabel->set_label(str_device); headLabel->set_label(str_lb_head); - filtersNameFilterCheckbox->set_label(str_name); - filtersQuotasFilterCheckbox->set_label(str_quotas); - filtersSizeFilterCheckbox->set_label(str_size); - filtersSoftSizeFilterCheckbox->set_label(str_soft_limit_size); - filtersHardSizeFilterCheckbox->set_label(str_hard_limit_size); - filtersHardSizeDelayFilterCheckbox->set_label(str_deferring_hard_limit_size); - filtersFilesFilterCheckbox->set_label(str_files); - filtersSoftFilesFilterCheckbox->set_label(str_soft_restriction_files); - filtersHardFilesFilterCheckbox->set_label(str_severe_limitation_files); - filtersHardFilesDelayFilterCheckbox->set_label(str_deferring_limit_files); + chbFilterName->set_label(str_name); + chbFilterQuotas->set_label(str_quotas); + chbFilterSize->set_label(str_size); + chbFilterSoftLimitSize->set_label(str_soft_limit_size); + chbFilterHardLimitSize->set_label(str_hard_limit_size); + chbFilterHardLimitSizeDelay->set_label(str_deferring_hard_limit_size); + chbFilterFiles->set_label(str_files); + chbFilterSoftLimitFile->set_label(str_soft_restriction_files); + chbFilterHardLimitFile->set_label(str_severe_limitation_files); + chbFilterHardLimitFileDelay->set_label(str_deferring_limit_files); quotegroupSizeFrameLabel->set_text(str_size); quotegroupFilesFrameLabel->set_text(str_files); quotegroupSizeCurrentlyLabel->set_text(str_currently_using); @@ -253,7 +253,7 @@ void MainWindow::lacalization() { btnSaveLocalGlob->set_label(save_all); btnSaveGlob->set_label(save_global); btnSaveLocal->set_label(save_local); - lblHeadFiltersWindow->set_label(str_filters); + lblFiltersHead->set_label(str_filters); ProjectTabLabel->set_label(str_projects); usersProjectLabel->set_text(str_device); lblhelpHeader->set_text(read_documentation_web); @@ -266,7 +266,6 @@ void MainWindow::lacalization() { lblSetDevice->set_text(str_device); lblQuotasStatus->set_text(str_quota_status); lblSetUGP->set_text(""); - lblQuotasStatus->set_text(_("Quota use status:")); this->fill_in_pow_memory(quotegroupSizeSoftLimitCombo); this->fill_in_pow_memory(quotegroupSizeHardLimitCombo); @@ -390,17 +389,17 @@ void MainWindow::get_builder() { builder->get_widget("groupsDeviceLabel", groupsDeviceLabel); builder->get_widget("usersDeviceLabel", usersDeviceLabel); builder->get_widget("headLabel", headLabel); - builder->get_widget("FiltersWindow", FiltersWindow); - builder->get_widget("filtersNameFilterCheckbox", filtersNameFilterCheckbox); - builder->get_widget("filtersQuotasFilterCheckbox", filtersQuotasFilterCheckbox); - builder->get_widget("filtersSizeFilterCheckbox", filtersSizeFilterCheckbox); - builder->get_widget("filtersSoftSizeFilterCheckbox", filtersSoftSizeFilterCheckbox); - builder->get_widget("filtersHardSizeFilterCheckbox", filtersHardSizeFilterCheckbox); - builder->get_widget("filtersHardSizeDelayFilterCheckbox", filtersHardSizeDelayFilterCheckbox); - builder->get_widget("filtersFilesFilterCheckbox", filtersFilesFilterCheckbox); - builder->get_widget("filtersSoftFilesFilterCheckbox", filtersSoftFilesFilterCheckbox); - builder->get_widget("filtersHardFilesFilterCheckbox", filtersHardFilesFilterCheckbox); - builder->get_widget("filtersHardFilesDelayFilterCheckbox", filtersHardFilesDelayFilterCheckbox); + builder->get_widget("wndFilters", wndFilters); + builder->get_widget("chbFilterName", chbFilterName); + builder->get_widget("chbFilterQuotas", chbFilterQuotas); + builder->get_widget("chbFilterSize", chbFilterSize); + builder->get_widget("chbFilterSoftLimitSize", chbFilterSoftLimitSize); + builder->get_widget("chbFilterHardLimitSize", chbFilterHardLimitSize); + builder->get_widget("chbFilterHardLimitSizeDelay", chbFilterHardLimitSizeDelay); + builder->get_widget("chbFilterFiles", chbFilterFiles); + builder->get_widget("chbFilterSoftLimitFile", chbFilterSoftLimitFile); + builder->get_widget("chbFilterHardLimitFile", chbFilterHardLimitFile); + builder->get_widget("chbFilterHardLimitFileDelay", chbFilterHardLimitFileDelay); builder->get_widget("btnLoadGlob", btnLoadGlob); builder->get_widget("btnLoadLocal", btnLoadLocal); builder->get_widget("btnSynopsis", btnSynopsis); @@ -423,7 +422,7 @@ void MainWindow::get_builder() { builder->get_widget("QuotasEditWindow", QuotasEditWindow); builder->get_widget("headerAboutTopic", headerAboutTopic); builder->get_widget("lblHeadQuotasEditWindow", lblHeadQuotasEditWindow); - builder->get_widget("lblHeadFiltersWindow", lblHeadFiltersWindow); + builder->get_widget("lblFiltersHead", lblFiltersHead); builder->get_widget("usersDeviceCombo", usersDeviceCombo); builder->get_widget("GroupsTabLabel", GroupsTabLabel); builder->get_widget("generalTabLabel", generalTabLabel); @@ -490,7 +489,7 @@ void MainWindow::get_builder() { builder->get_widget("lblSetUGP", lblSetUGP); builder->get_widget("lblSetNameDevice", lblSetNameDevice); builder->get_widget("lblSetQuotasStatus", lblSetQuotasStatus); - builder->get_widget("lblSetNameUGP", lblSetNameUGP); + builder->get_widget("cmbSetNameUGP", cmbSetNameUGP); builder->get_widget("usersProjectCombo", usersProjectCombo); } @@ -551,7 +550,7 @@ void MainWindow::event() { sigc::bind, struct tv_g_u_p> (sigc::mem_fun( *this, &MainWindow::set_add_tv_g_u_p), row, list_store_groups, obj_tv_g_u_p)); - filtersNameFilterCheckbox->signal_toggled().connect(sigc::mem_fun( *this, + chbFilterName->signal_toggled().connect(sigc::mem_fun( *this, &MainWindow::del_columns)); btnEditGroups->signal_clicked().connect( sigc::bind*, const Gtk::TreeModel::iterator*, bool&> (sigc::mem_fun( *this, @@ -571,7 +570,7 @@ void MainWindow::set_change_gui(Glib::RefPtr* list_store, const if(row) { string name = row[m_columns.name] + ""; lblSetNameDevice->set_text(combo_box->get_active_text()); - lblSetNameUGP->set_text(name); + cmbSetNameUGP->set_active_text(name); QuotasEditWindow->show(); } } @@ -579,17 +578,17 @@ void MainWindow::set_change_gui(Glib::RefPtr* list_store, const } void MainWindow::edit_tree_view_U(Glib::RefPtr* list_store, const Gtk::TreeModel::iterator* iter, bool& flag_validate) { - lblSetUGP->set_text(str_users); + lblSetUGP->set_text(str_user_1); set_change_gui(list_store, iter, flag_validate, usersDeviceCombo); } void MainWindow::edit_tree_view_G(Glib::RefPtr* list_store, const Gtk::TreeModel::iterator* iter, bool& flag_validate) { - lblSetUGP->set_text(str_groups); + lblSetUGP->set_text(str_group_1); set_change_gui(list_store, iter, flag_validate, groupsDeviceCombo); } void MainWindow::edit_tree_view_P(Glib::RefPtr* list_store, const Gtk::TreeModel::iterator* iter, bool& flag_validate) { - lblSetUGP->set_text(str_projects); + lblSetUGP->set_text(str_project_1); set_change_gui(list_store, iter, flag_validate, usersProjectCombo); } void MainWindow::del_columns() { @@ -638,7 +637,7 @@ void MainWindow::mode_switch_quota() { } void MainWindow::filters_show() { - FiltersWindow->show_all(); + wndFilters->show_all(); } void MainWindow::set_data_cfg() { diff --git a/source/ubl-settings-diskquota.h b/source/ubl-settings-diskquota.h index 8fb3938..5856c81 100644 --- a/source/ubl-settings-diskquota.h +++ b/source/ubl-settings-diskquota.h @@ -80,7 +80,6 @@ #define str_currently_using _("Currently using:") #define str_currently_using_space _("Currently using: ") #define str_filters _("Filters") -#define str_projects _("Projects") #define str_quotas _("Quotas") #define str_help_h _("GTK settings disk quota for UBLinux\n" \ "\n" \ @@ -96,6 +95,10 @@ #define str_version _("ubl-settings-diskquota version: ") #define str_user _("User") #define str_group _("Group") +#define str_projects _("Projects") +#define str_user_1 _("User:") +#define str_group_1 _("Group:") +#define str_project_1 _("Projects:") #define str_device_project _("Device\nProject") #define str_quota _("Quota type") #define str_status _("Status") @@ -257,18 +260,18 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Label *groupsDeviceLabel; Gtk::Label *usersDeviceLabel; Gtk::Label *headLabel; - Gtk::Window *FiltersWindow; - Gtk::CheckButton *filtersNameFilterCheckbox; - Gtk::CheckButton *filtersQuotasFilterCheckbox; - Gtk::CheckButton *filtersSizeFilterCheckbox; - Gtk::CheckButton *filtersSoftSizeFilterCheckbox; - Gtk::CheckButton *filtersHardSizeFilterCheckbox; - Gtk::CheckButton *filtersHardSizeDelayFilterCheckbox; + Gtk::Window *wndFilters; + Gtk::CheckButton *chbFilterName; + Gtk::CheckButton *chbFilterQuotas; + Gtk::CheckButton *chbFilterSize; + Gtk::CheckButton *chbFilterSoftLimitSize; + Gtk::CheckButton *chbFilterHardLimitSize; + Gtk::CheckButton *chbFilterHardLimitSizeDelay; Gtk::CheckButton *filtersHardSizeActivationFilterCheckbox; - Gtk::CheckButton *filtersFilesFilterCheckbox; - Gtk::CheckButton *filtersSoftFilesFilterCheckbox; - Gtk::CheckButton *filtersHardFilesFilterCheckbox; - Gtk::CheckButton *filtersHardFilesDelayFilterCheckbox; + Gtk::CheckButton *chbFilterFiles; + Gtk::CheckButton *chbFilterSoftLimitFile; + Gtk::CheckButton *chbFilterHardLimitFile; + Gtk::CheckButton *chbFilterHardLimitFileDelay; Gtk::TreeView *groupsQuotasTree; Gtk::TreeView *usersQuotasTree; Gtk::TreeView *ProjectQuotasTree; @@ -286,7 +289,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Window *QuotasEditWindow; Gtk::Label *headerAboutTopic; Gtk::Label *lblHeadQuotasEditWindow; - Gtk::Label *lblHeadFiltersWindow; + Gtk::Label *lblFiltersHead; Gtk::ComboBoxText *usersDeviceCombo; Gtk::ComboBoxText *groupsDeviceCombo; Gtk::ComboBoxText *generalDeviceCombo; @@ -348,7 +351,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Label* lblSetUGP; Gtk::Label* lblSetNameDevice; Gtk::Label* lblSetQuotasStatus; - Gtk::Label* lblSetNameUGP; + Gtk::ComboBoxText* cmbSetNameUGP; #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; Gtk::Widget *three; diff --git a/source/util.cc b/source/util.cc index dcbdc95..34f622b 100644 --- a/source/util.cc +++ b/source/util.cc @@ -146,4 +146,83 @@ string file_read(string filename) { } return buffer; } + +unsigned short read_uid_min_max(string filename, string search) { + std::string line; + int uid = 0; + string remove_tab = "\t"; + string remove_space = " "; + std::ifstream in(filename); // окрываем файл для чтения + if (in.is_open()){ + while (getline(in, line)){ + try{ + if (line.find(search) != string::npos && (line.find("SYS_"+search) == string::npos)) { + Utils::str_remove(line, search); + Utils::str_remove(line, remove_space); + Utils::str_remove(line, remove_tab); + uid = atoi(line.c_str()); + } + } + catch (int x) { + if (search == "UID_MIN"){ + uid = 1000; + } + else{ + uid = 65534; + } + + } + + } + } + else{ + if (search == "UID_MIN") { + uid = 1000; + } + else{ + uid = 65534; + } + } + in.close(); + return uid; + +} + +vector pars_users() { + unsigned short uid_min = Utils::read_uid_min_max(file_source_login_min_max, "UID_MIN"); + unsigned short uid_max = Utils::read_uid_min_max(file_source_login_min_max, "UID_MAX"); + vector vec_user; + while (true) { + errno = 0; + passwd* entry = getpwent(); + if (!entry) { + if (errno) { + break; + } + break; + } + if ((entry->pw_uid >= uid_min && entry->pw_uid < uid_max) || entry->pw_uid == 0) { + vec_user.push_back(entry->pw_name); + } + } + endpwent(); + return vec_user; +} +vector pars_group() { + vector vec_group; + while (true) { + errno = 0; // so we can distinguish errors from no more entries + passwd* entry = getpwent(); + if (!entry) { + if (errno) { + std::cerr << "Error reading password database\n"; + break; + } + break; + } + vec_group.push_back(entry->pw_name); + } + endpwent(); + return vec_group; +} } \ No newline at end of file diff --git a/source/util.h b/source/util.h index 90aebad..8afa931 100644 --- a/source/util.h +++ b/source/util.h @@ -5,6 +5,7 @@ using namespace std; namespace Utils { +#define file_source_login_min_max "/etc/login.defs" template struct Result{ Type response; @@ -26,5 +27,8 @@ std::vector split(std::string text, char delim); vector pars_users(); int synopsis_show(string str_link); string file_read(string filename); +unsigned short read_uid_min_max(string filename, string search); +vector pars_users(); +vector pars_group(); } #endif \ No newline at end of file diff --git a/ubl-settings-diskquota.glade b/ubl-settings-diskquota.glade index d9c3497..db1973c 100644 --- a/ubl-settings-diskquota.glade +++ b/ubl-settings-diskquota.glade @@ -8,247 +8,6 @@ - - False - start - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - - - Name - True - True - False - start - 5 - True - - - False - True - 0 - - - - - Quotas - True - True - False - start - True - - - False - True - 1 - - - - - Size - True - True - False - start - True - - - False - True - 2 - - - - - Soft limit (size) - True - True - False - start - True - - - False - True - 3 - - - - - Hard limit (size) - True - True - False - start - True - - - False - True - 4 - - - - - True - False - end - 5 - 5 - True - - - gtk-cancel - True - True - True - center - True - - - False - True - 0 - - - - - gtk-save - True - True - True - center - True - - - False - True - 1 - - - - - False - True - end - 5 - - - - - Hard limit (size) delay - True - True - False - start - True - - - False - True - 5 - - - - - Files - True - True - False - start - True - - - False - True - 7 - - - - - Soft limit (files) - True - True - False - start - True - - - False - True - 8 - - - - - Hard limit (files) - True - True - False - start - True - - - False - True - 9 - - - - - Hard limit (files) delay - True - True - False - start - True - - - False - True - 10 - - - - - - - True - False - True - - - True - False - System quotas - - - - - - - - True - False - 32 - com.ublinux.ubl-settings-diskquota - 5 - - - - - @@ -3083,15 +2842,12 @@ - + True False - 5 - 5 - 0 - True + False True 1 @@ -3630,6 +3386,247 @@ 1 10 + + False + start + False + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + + + Name + True + True + False + start + 5 + True + + + False + True + 0 + + + + + Quotas + True + True + False + start + True + + + False + True + 1 + + + + + Size + True + True + False + start + True + + + False + True + 2 + + + + + Soft limit (size) + True + True + False + start + True + + + False + True + 3 + + + + + Hard limit (size) + True + True + False + start + True + + + False + True + 4 + + + + + True + False + end + 5 + 5 + True + + + gtk-cancel + True + True + True + center + True + + + False + True + 0 + + + + + gtk-save + True + True + True + center + True + + + False + True + 1 + + + + + False + True + end + 5 + + + + + Hard limit (size) delay + True + True + False + start + True + + + False + True + 5 + + + + + Files + True + True + False + start + True + + + False + True + 7 + + + + + Soft limit (files) + True + True + False + start + True + + + False + True + 8 + + + + + Hard limit (files) + True + True + False + start + True + + + False + True + 9 + + + + + Hard limit (files) delay + True + True + False + start + True + + + False + True + 10 + + + + + + + True + False + True + + + True + False + System quotas + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-diskquota + 5 + + + + + False start diff --git a/ubl-settings-diskquota.pot b/ubl-settings-diskquota.pot index f05bc83..97c1636 100644 --- a/ubl-settings-diskquota.pot +++ b/ubl-settings-diskquota.pot @@ -17,6 +17,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "User:" +msgstr "" + +msgid "Group:" +msgstr "" + +msgid "Projects:" +msgstr "" + msgid "Kb" msgstr "" diff --git a/ubl-settings-diskquota_ru.po b/ubl-settings-diskquota_ru.po index eb421b8..a8618fc 100644 --- a/ubl-settings-diskquota_ru.po +++ b/ubl-settings-diskquota_ru.po @@ -30,7 +30,7 @@ msgid "Tb" msgstr "Тб" msgid "Quota use status:" -msgstr "Статус использования квот" +msgstr "Статус использования квот:" msgid "Would you like to read documentation in the Web?" msgstr "Вы хотите прочитать справку в Сети?" @@ -163,6 +163,15 @@ msgstr "Пользователь" msgid "Group" msgstr "Группа" +msgid "User:" +msgstr "Пользователь:" + +msgid "Group:" +msgstr "Группа:" + +msgid "Projects:" +msgstr "Проект:" + msgid "Quota type" msgstr "Тип квот"