Merge pull request 'master' (#4) from Igor1/ubl-settings-resourcequota:master into master

Reviewed-on: #4
pull/33/head
Dmitry Razumov 2 years ago
commit afd3457f49

3
.gitignore vendored

@ -3,3 +3,6 @@ ubl-settings-resourcequota.glade~
ubl-settings-resourcequota_ru.po~ ubl-settings-resourcequota_ru.po~
source/ubl-cmake.h source/ubl-cmake.h
ubl-settings-resourcequota ubl-settings-resourcequota
build/
compile
vgcore.*

@ -8,10 +8,13 @@ MAKEFILE_PATH := $(dir $(MAKEFILE_FILEPATH))
CMAKE_COMMAND = cmake CMAKE_COMMAND = cmake
CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source
CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile
#CMAKE_SOURCE_DIR = ./source
#CMAKE_BUILD_DIR = ./compile
DEPENDS = /bin/cmake DEPENDS = /bin/cmake
PREFIX ?= /usr PREFIX ?= /usr
PKGNAME = $(MAKEFILE_DIR) PKGNAME = $(MAKEFILE_DIR)
#PKGNAME = ubl-settings-manager
LATEST_TAG=
default_target: all default_target: all
.PHONY: all init depend debug prepare check build uninstall install clean help .PHONY: all init depend debug prepare check build uninstall install clean help
@ -21,11 +24,11 @@ all: init build
init: init:
@echo "Initialize ..."; \ @echo "Initialize ..."; \
if [ -d ".git" ]; then \ if [ -d ".git" ]; then \
LATEST_TAG=$$(git describe --tags | sed 's/^v//'); \ LATEST_TAG=$$(git describe --tags | sed 's/^v//'|grep -oE "^[0-9]{1,}.[0-9]{1,}"); \
else \ else \
LATEST_TAG="0.0"; \ LATEST_TAG="0.0"; \
fi; \ fi; \
sed -r "s/^(string version_application = ).*/\1\"$${LATEST_TAG}\";/" -i source/${PKGNAME}.h; \ sed -r "s/^(string version_application).*/\1=\"$${LATEST_TAG}\";/" -i source/${PKGNAME}.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}" echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend: depend:
@ -36,15 +39,16 @@ depend:
exit 1; \ exit 1; \
fi; \ fi; \
done; \ done; \
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B${CMAKE_BUILD_DIR} --check-build-system CMakeFiles/Makefile.cmake 1 || exit 1; \
echo "Check depends: OK" echo "Check depends: OK"
# $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
debug: debug: init build
@echo "Debug ..." @echo "Debug ..."; \
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \ $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
# @cc source/my_device.c source/my_device.h source/filters.c source/filters.h source/ubl-cmake.h source/view_edit.h source/view_edit.c source/view_add.h source/view_add.c source/ubl-utils.h source/ubl-utils.c source/ubl-strings.h source/ubl-settings-resourcequota.h source/ubl-settings-resourcequota.c -o ubl-settings-resourcequota `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
fi; \ fi; \
echo "${CMAKE_BUILD_DIR}/${PKGNAME}"; \
cp ${CMAKE_BUILD_DIR}/${PKGNAME} ./; \
echo "Debug: OK" echo "Debug: OK"
prepare: prepare:
@ -88,7 +92,9 @@ uninstall:
@$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}" @$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop" @$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg" @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg"
@$(RM) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}" @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.checked.svg"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.warning.svg"
@$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.${PKGNAME}.policy"
@if [ -z ${DESTDIR} ]; then \ @if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \ update-desktop-database --quiet &>/dev/null || true; \
@ -112,14 +118,12 @@ install: check uninstall
done done
@install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps" @install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg"
@install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.${PKGNAME}.policy"
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}" @install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}"
@install -dm755 "${DESTDIR}/etc/xdg"
@install -dm755 "${DESTDIR}${PREFIX}/share/applications" @install -dm755 "${DESTDIR}${PREFIX}/share/applications"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@install -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images}
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}.glade"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css"
@install -dm755 -d "${DESTDIR}${PREFIX}/share/${PKGNAME}/images"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "${PKGNAME}-banner.png"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.funnel.svg" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.funnel.svg"
@ -129,6 +133,7 @@ install: check uninstall
[ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \ [ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \
fi fi
@echo "Install: OK" @echo "Install: OK"
@sed -r "s/^(string version_application=\"*\").*/string version_application;/" -i source/${PKGNAME}.h; \
clean: clean:
@echo "Clean ..." @echo "Clean ..."
@ -139,6 +144,14 @@ clean:
echo "Clean: OK"; \ echo "Clean: OK"; \
fi fi
up_ver:
@CURRENT=$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2); \
MAJOR=$$(cut -d. -f1 <<< $${CURRENT}); \
MINOR=$$(cut -d. -f2 <<< $${CURRENT}); \
VER="$${MAJOR}.$$(($${MINOR}+1))"; \
sed "s/VERSION *[[:digit:]]*.*/VERSION $${VER}/" -i ${FILE_VERSION}; \
echo "Updated version to VERSION.md: $${CURRENT} to $${VER}"
help: help:
@echo "The following are some of the valid targets for this Makefile:"; \ @echo "The following are some of the valid targets for this Makefile:"; \
echo "... all (the default if no target is provided)"; \ echo "... all (the default if no target is provided)"; \
@ -148,4 +161,5 @@ help:
echo "... compile"; \ echo "... compile"; \
echo "... install"; \ echo "... install"; \
echo "... uninstall"; \ echo "... uninstall"; \
echo "... clean" echo "... clean"; \
echo "... up_ver"

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/ublinux/ui">
<file>ubl-settings-resourcequota.glade</file>
</gresource>
<gresource prefix="/com/ublinux/css">
<file>ubl-settings-resourcequota.css</file>
</gresource>
<gresource prefix="/com/ublinux/images">
<file>ubl-settings-resourcequota-banner.png</file>
</gresource>
</gresources>

@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.23) cmake_minimum_required(VERSION 3.7)
project(ubl-settings-resourcequota) project(ubl-settings-resourcequota)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0) pkg_check_modules(GTK REQUIRED gtk+-3.0)
include_directories(${GTK3_INCLUDE_DIRS}) include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS}) link_directories(${GTK_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER}) add_definitions(${GTK_CFLAGS_OTHER})
pkg_check_modules(VTE291 REQUIRED vte-2.91) pkg_check_modules(VTE291 REQUIRED vte-2.91)
include_directories(${VTE291_INCLUDE_DIRS}) include_directories(${VTE291_INCLUDE_DIRS})
@ -24,7 +24,42 @@ if(WEBKIT_LIBRARIES_FOUND)
add_definitions(${WEBKIT_CFLAGS_OTHER}) add_definitions(${WEBKIT_CFLAGS_OTHER})
endif() endif()
configure_file(ubl-cmake.h.in ubl-cmake.h) configure_file(ubl-cmake.in ubl-cmake.h)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/ubl-cmake.h DESTINATION ./)
set(GRESOURCE_C resources.c)
set(GRESOURCE_XML gresource.xml)
find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED)
add_custom_target(GLADE ubl-settings-resourcequota.glade)
set(DEPENDFILES
../ubl-settings-resourcequota.glade
../gresource.xml
../ubl-settings-resourcequota-banner.png
../ubl-settings-resourcequota.css
)
file(COPY ${DEPENDFILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(
OUTPUT ${GRESOURCE_C}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${GLIB_COMPILE_RESOURCES}
ARGS
--generate-source
--target=${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
${GRESOURCE_XML}
VERBATIM
MAIN_DEPENDENCY ${GRESOURCE_XML}
DEPENDS
${GLADE}
)
add_custom_target(
dummy-resource
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm")
@ -33,6 +68,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection") -fstack-clash-protection -fcf-protection")
set(SOURCE_FILES set(SOURCE_FILES
ubl-settings-resourcequota.c ubl-settings-resourcequota.c
ubl-settings-resourcequota.h ubl-settings-resourcequota.h
@ -47,15 +83,25 @@ set(SOURCE_FILES
ubl-strings.h ubl-strings.h
ubl-utils.h ubl-utils.h
ubl-utils.c ubl-utils.c
ubl-cmake.h) ubl-cmake.h
philos_utils.c
philos_utils.h
${CMAKE_CURRENT_BINARY_DIR}/ubl-cmake.h
)
set(LIBRARIES set(LIBRARIES
${GTK3_LIBRARIES} ${GTK_LIBRARIES}
${WEBKIT_LIBRARIES} ${WEBKIT_LIBRARIES}
${VTE291_LIBRARIES} ${VTE291_LIBRARIES}
pthread) pthread)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C})
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES}) target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR}) target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR})
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
PROPERTIES GENERATED TRUE
)
install(TARGETS ${PROJECT_NAME} DESTINATION bin) install(TARGETS ${PROJECT_NAME} DESTINATION bin)
add_dependencies(${PROJECT_NAME} dummy-resource)

@ -5,7 +5,7 @@ gboolean flag_filters[8];
filters_window *filters_setup_window(char* glade_path){ filters_window *filters_setup_window(char* glade_path){
if (filters_widgets == NULL) { if (filters_widgets == NULL) {
filters_widgets = malloc(sizeof(filters_window)); filters_widgets = malloc(sizeof(filters_window));
GtkBuilder *builder = gtk_builder_new_from_file(glade_path); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
filters_widgets->Window = yon_gtk_builder_get_widget(builder,"wndFilters"); filters_widgets->Window = yon_gtk_builder_get_widget(builder,"wndFilters");
filters_widgets->chbFilterTypeQouota = yon_gtk_builder_get_widget(builder,"chbFilterTypeQouota"); filters_widgets->chbFilterTypeQouota = yon_gtk_builder_get_widget(builder,"chbFilterTypeQouota");
filters_widgets->chbQuotaVolume = yon_gtk_builder_get_widget(builder,"chbQuotaVolume"); filters_widgets->chbQuotaVolume = yon_gtk_builder_get_widget(builder,"chbQuotaVolume");

@ -11,7 +11,7 @@
#include <libintl.h> #include <libintl.h>
#include <getopt.h> #include <getopt.h>
#include <libintl.h> #include <libintl.h>
#include "philos_utils.h"
// Переменные // Переменные
typedef struct { typedef struct {

@ -10,11 +10,10 @@ void device_disk_parsed() {
char* cmd = "lsblk --fs --raw --output PATH,FSTYPE --exclude 7,11,253"; char* cmd = "lsblk --fs --raw --output PATH,FSTYPE --exclude 7,11,253";
int size = 0; int size = 0;
char** responce = yon_config_load(cmd, &size); char** responce = yon_config_load(cmd, &size);
char* disk = NULL;
obj_device_config.size_disk = 0; obj_device_config.size_disk = 0;
char* split_simvol = " "; char* split_simvol = " ";
for (int index = 1; index < size; index++ ) { for (int index = 1; index < size; index++ ) {
disk = yon_char_divide_search(responce[index], "\n", -1); char* disk = yon_char_divide_search(responce[index], "\n", -1);
if (yon_char_find_count(disk, " ") != 0) { if (yon_char_find_count(disk, " ") != 0) {
char* name_disk = yon_char_divide_search(disk, " ", -1); char* name_disk = yon_char_divide_search(disk, " ", -1);
obj_device_config.name_disk = yon_char_parsed_append(obj_device_config.name_disk, &obj_device_config.size_disk, name_disk); obj_device_config.name_disk = yon_char_parsed_append(obj_device_config.name_disk, &obj_device_config.size_disk, name_disk);
@ -25,30 +24,21 @@ void device_disk_parsed() {
obj_device_config.size_disk--; obj_device_config.size_disk--;
obj_device_config.type_dick = yon_char_parsed_append(obj_device_config.type_dick, &obj_device_config.size_disk, ""); obj_device_config.type_dick = yon_char_parsed_append(obj_device_config.type_dick, &obj_device_config.size_disk, "");
obj_device_config.size_disk--; obj_device_config.size_disk--;
char* description_disk = yon_char_unite(name_disk, disk = yon_char_replace(disk," ", "");
if (strlen(disk)!=0) {
char* description_disk = yon_char_unite(name_disk,
split_simvol, split_simvol,
disk, disk,
NULL); NULL);
obj_device_config.description_disk = yon_char_parsed_append(obj_device_config.description_disk, &obj_device_config.size_disk, description_disk); obj_device_config.description_disk = yon_char_parsed_append(obj_device_config.description_disk, &obj_device_config.size_disk, description_disk);
free(description_disk); free(description_disk);
}
free(name_disk); free(name_disk);
} }
else { free(disk);
obj_device_config.name_disk = yon_char_parsed_append(obj_device_config.name_disk, &obj_device_config.size_disk, disk);
obj_device_config.size_disk--;
obj_device_config.file_system = yon_char_parsed_append(obj_device_config.file_system, &obj_device_config.size_disk, "");
obj_device_config.size_disk--;
obj_device_config.mounted = yon_char_parsed_append(obj_device_config.mounted, &obj_device_config.size_disk, "");
obj_device_config.size_disk--;
obj_device_config.type_dick = yon_char_parsed_append(obj_device_config.type_dick, &obj_device_config.size_disk, "");
obj_device_config.size_disk--;
char* description_disk = yon_char_unite(disk,
split_simvol,
NULL);
obj_device_config.description_disk = yon_char_parsed_append(obj_device_config.description_disk, &obj_device_config.size_disk, description_disk);
free(description_disk);
}
} }
philos_free_string_array(&responce, size);
} }
void device_fill_disk(GtkWidget* combo_box_text) { void device_fill_disk(GtkWidget* combo_box_text) {
@ -56,3 +46,5 @@ void device_fill_disk(GtkWidget* combo_box_text) {
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box_text), obj_device_config.description_disk[index]); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box_text), obj_device_config.description_disk[index]);
} }
} }

@ -4,6 +4,7 @@
#include <locale.h> #include <locale.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "philos_utils.h"
typedef struct { typedef struct {
char** name_disk; char** name_disk;
char** file_system; char** file_system;
@ -16,5 +17,8 @@ typedef struct {
void device_disk_parsed(); void device_disk_parsed();
device_config* get_device_cfg(); device_config* get_device_cfg();
void device_fill_disk(GtkWidget* combo_box_text); void device_fill_disk(GtkWidget* combo_box_text);
size_t get_mem_total();
float get_size_pow_memory(size_t size_memory, int size);
size_t get_resurs_total(char* cmd);
#endif #endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,120 @@
#ifndef PHILOS_UTILS_H
#define PHILOS_UTILS_H
#include "ubl-utils.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <pthread.h>
#include <string.h>
#include <dirent.h>
#include <locale.h>
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <vte/vte.h>
#include <pwd.h>
#include <stdbool.h>
#include "my_device.h"
#define catch(x) ExitJmp:if(__HadError)
#define throw(x) {__HadError=true;goto ExitJmp;}
#define file_source_login_min_max "/etc/login.defs"
static char** array_size_pow;
typedef struct {
char** disk_read;
char** disk_write;
int* i_o_limit_read;
int* i_o_limit_write;
int* i_o_limit_read_size;
int* i_o_limit_write_size;
int size;
int size_disk;
} temp_config;
typedef struct {
GtkWidget* Window;
GtkWidget* btnSaveTempSave;
GtkWidget* btnTempCancel;
GtkWidget* entryTempCmd;
GtkWidget* chbTempRead;
GtkWidget* spinTempRead;
GtkWidget* cbtTempRead;
GtkWidget* chbTempWrite;
GtkWidget* spinTempWrite;
GtkWidget* cbtTempWrite;
GtkWidget* chkSoftRestrictionTemp;
GtkWidget* spiSevereRestrictionTemp;
GtkWidget* cmSevereRestrictionTemp;
GtkWidget* chkSevereRestrictionTemp;
GtkWidget* spinSevereRestrictionTemp;
GtkWidget* cmbSevereRestrictionTemp;
GtkWidget* chkPaddingFLTemp;
GtkWidget* spinPaddingFLTemp;
GtkWidget* cmbPaddingFLTemp;
GtkWidget* chkCPULimitTemp;
GtkWidget* spinCPULimitTemp;
GtkWidget* lblCPULimitTemp;
GtkWidget* cbtTempDevice;
GtkWidget* cbxTempQuotaObj;
GtkWidget* cbxTempQuotaLevel2;
GtkWidget* boxBlockGui;
} temp_set_window;
void philos_array_string_remove_char(char*** array, char* str_remove, int size);
void philos_set_pow_size_memory(char* str_find, int** array_size,int index, char** array_size_pow);
void philos_set_size_memory_integer_char(char* str_find, char*** array_data, int index);
void philos_free_string_array(char ***array, int size);
void philos_free_string_array_n3(char ****array, int size);
void philos_free_int_array(int **array, int size);
void philos_free_int_array_n2(int ***array, int size);
config_str philos_list_group(int* size);
unsigned short philos_read_uid_min_max(char* filename, char* search);
config_str philos_list_user(int* size);
char* philos_str_size_pow_byte(GtkWidget *combo_box_text);
char* philos_str_remove(char *str, const char *sub);
void philos_split_size_memory(char* str_value, int* size, char* pow_memory);
char* philos_format_cfg_str_size_memory(char* str_key, int value, int pow_size_memory);
char** philos_str_split(char *parameters, int *size, char *divider);
void philos_array_str_copy(char*** source, char*** copy);
void philos_set_pow_size_memory_device(char* str_find, int** array_size,int index, char** array_size_pow);
void philos_array_int_copy(int** source, int** copy);
char** philos_pars_terminal_systemd_cgls(char* CMD_GET_SLICE_SERVICE, char* str_find, int* size_array_data);
char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int* array_io, int* array_io_pow_size, char** disk, int size);
int philos_check_activ_disk(temp_set_window *widgets, temp_config* _config);
void philos_temp_generate_cmd(temp_set_window *widgets, temp_config* _config);
void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array);
void philos_temp_config_init(temp_config* _config);
void philos_update_device_to_entry(temp_set_window *widgets, temp_config* _config, int flag_check_array);
void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array);
int* philos_int_append(int* array, int* size, int value);
int* remove_element_int_array(int* array, int* size, int item_to_delete);
int** remove_element_int_array_n3(int** array, int* size, int item_to_delete);
char* philos_get_size_bite(GtkWidget* chk_button, GtkWidget* spin, GtkWidget* combo_box_text);
void philos_fill_combo_box_text(GtkWidget *cbt, config_str list_data, int size);
void philos_set_spin_adjustment(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, size_t value);
void philos_set_active_widgets(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, int flag_cpu, char* cmd);
size_t get_resurs_total(char* cmd);
float get_size_pow_memory(size_t size_memory, int size);
void philos_set_active_widgets_device_io(GtkWidget* combo_to_l2,GtkWidget *check, GtkWidget *spin, GtkWidget *combo);
char *yon_char_get_augumented(char *source, char *append);
dictionary *yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data);
char **yon_char_parsed_shrink(char **char_string, int *size, int item_to_delete);
char*** yon_char_parsed_shrink_n3(char ***char_string, int *size, int item_to_delete);
dictionary *yon_dictionary_create_empty();
void yon_terminal_integrated_launch(GtkWidget *terminal, char* command, void *endwork_function, void* endwork_function_argument);
dictionary *yon_dictionary_create_conneced(dictionary *targetdict);
void yon_int_array_append(int **source, int append);
static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data);
int philos_config_save(char *command);
void philos_array_int_pars_to(int** array, int to);
void philos_array_char_pars_to(char*** array, char* to);
int find_null_array(temp_config* _config);
void init_device_disk(temp_config* _config);
#endif

@ -1 +0,0 @@
#cmakedefine WEBKIT_FOUND

@ -0,0 +1 @@
#cmakedefine WEBKIT_FOUND

File diff suppressed because it is too large Load Diff

@ -14,32 +14,41 @@
#include "filters.h" #include "filters.h"
#include "view_edit.h" #include "view_edit.h"
#include "my_device.h" #include "my_device.h"
#include "philos_utils.h"
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h> #include <webkit2/webkit2.h>
#endif #endif
#include "ubl-strings.h" #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/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-resourcequota" #define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-resourcequota"
#define _(String) gettext(String) #define _(String) gettext(String)
#define glade_path "/usr/share/ubl-settings-resourcequota/ui/ubl-settings-resourcequota.glade" #define glade_path "/com/ublinux/ui/ubl-settings-resourcequota.glade"
#define banner_path "/usr/share/ubl-settings-resourcequota/images/ubl-settings-resourcequota-banner.png" #define banner_path "/com/ublinux/images/ubl-settings-resourcequota-banner.png"
#define CssPath "/usr/share/ubl-settings-resourcequota/css/ubl-settings-resourcequota.css" #define CssPath "/com/ublinux/css/ubl-settings-resourcequota.css"
#define LocalePath "/usr/share/locale" #define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-resourcequota" #define LocaleName "ubl-settings-resourcequota"
#define CMD_LOAD_GLOBAL "ubconfig --default --source global get security"
#define CMD_LOAD_SYSTEM "ubconfig --default --source system get security" #define CMD_LOAD_GLOBAL "ubconfig --default --source global get security CGROUP_QUOTA[*]"
typedef char* string; #define CMD_LOAD_SYSTEM "ubconfig --default --source system get security CGROUP_QUOTA[*]"
string version_application = "1.0"; #define CMD_SAVE_GLOBAL "ubconfig --default --target global set security"
#define CMD_SAVE_SYSTEM "ubconfig --default --target system set security"
#define CMD_ALL_SAVE "ubconfig set security "
#define CMD_ALL_REMOVE "ubconfig remove security "
#define CMD_REMOVE_GLOBAL "ubconfig --target global --noexecute remove security "
#define CMD_REMOVE_SYSTEM "ubconfig --target system remove security "
#define CMD_GET_SLICE_SERVICE "systemd-cgls --no-page"
typedef char *string;
string version_application;
static char *local; static char *local;
typedef struct { typedef struct
{
int always_open_documentation; int always_open_documentation;
int win_pos_x; int win_pos_x;
int win_pos_y; int win_pos_y;
@ -62,30 +71,38 @@ typedef struct {
config_str load_system_key; config_str load_system_key;
config_str load_global_key; config_str load_global_key;
config_str cfg_gui_key;
render_data status_render; render_data status_render;
config_str type_quota; config_str type_quota;
config_str quota_volume; config_str quota_volume;
config_str soft_raw_limit; int* soft_raw_limit;
config_str hard_raw_limit; int* hard_raw_limit;
config_str swap; int* swap;
config_str cpu_limit; int* cpu_limit;
config_str i_o_limit_read; int** i_o_limit_read;
config_str i_o_limit_write; int** i_o_limit_write;
config_str* disk_read;
int* type_quota_size; config_str* disk_write;
int* quota_volume_size; config_str array_del_line;
int* soft_raw_limit_size; int size_array_del_line;
int* hard_raw_limit_size;
int* swap_size; int *type_quota_size;
int* cpu_limit_size; int *quota_volume_size;
int* i_o_limit_read_size; int *soft_raw_limit_size;
int* i_o_limit_write_size; int *hard_raw_limit_size;
int *swap_size;
int *cpu_limit_size;
int** i_o_limit_read_size;
int** i_o_limit_write_size;
int size_tree_view; int size_tree_view;
int flag_set_data;
int flag_save;
int flag_load; // flag_load = 0 -> system // flag_load = 1 -> global
} config; } config;
typedef struct { typedef struct
{
GtkWidget *Window; GtkWidget *Window;
GtkTreeViewColumn *tvc0; GtkTreeViewColumn *tvc0;
@ -96,7 +113,7 @@ typedef struct {
GtkTreeViewColumn *tvc5; GtkTreeViewColumn *tvc5;
GtkTreeViewColumn *tvc6; GtkTreeViewColumn *tvc6;
GtkTreeViewColumn *tvc7; GtkTreeViewColumn *tvc7;
GtkWidget *scrollDispatcher;
GtkWidget *btnDelQuotas; GtkWidget *btnDelQuotas;
GtkWidget *cbtMainInfoLevel2; GtkWidget *cbtMainInfoLevel2;
GtkWidget *cbtMainInfo; GtkWidget *cbtMainInfo;
@ -142,8 +159,8 @@ typedef struct {
GtkWidget *AboutMenuItem; GtkWidget *AboutMenuItem;
} main_window; } main_window;
typedef struct
typedef struct { {
GtkWidget *Window; GtkWidget *Window;
GtkWidget *HatText; GtkWidget *HatText;
@ -179,8 +196,25 @@ void tree_view_del_line();
void main_fill_tree_view_after_remove(); void main_fill_tree_view_after_remove();
void load_system_cfg(); void load_system_cfg();
void load_global_cfg(); void load_global_cfg();
void template_cfg(char* cmd); void template_load_cfg(char *cmd);
void str_split_value(char* values, int index); int template_format_str_save(char* source_set_cmd, char* source_remove_cmd);
void set_pow_size(char* str_find, int* array_size, char** array_data, int index); void str_split_value(char *values, int index);
void str_split_key(char* value, int index); void set_size_memory_integer_device(char* str_find, int** array_data, int index);
void fill_tree_view(int start, int size); void set_size_memory_integer(char* str_find, int** array_data, int index);
void set_size_memory_integer_char(char* str_find, char*** array_data, int index);
void set_pow_size_memory(char* str_find, int** array_size, int index);
void str_split_key(char *source_value, int index);
void fill_tree_view(int start, int size, int flag_gui_add);
void clear_array();
void init_cfg_array(int index);
void wrapper_template_save(char *check_flag);
void wrapper_system_save();
void wrapper_global_save();
void wrapper_all_save();
char* template_format_str_remove_save(char* source_remove_cmd);
char* template_format_str_set_save(char* source_set_cmd);
char* save_format_key(int index);
void get_param_io_limit(char** arr_values, int index_start, int size, int index_n1, char *key_find);
char* add_io_str_format_ubconfig(char* key, int** i_o_limit, int** i_o_limit_size, char*** disk_read, int index);
char* format_io_limit_in_tree_view(config_str* disk, int** i_o_limit, int** i_o_limit_size, int index);
gboolean select_page_notebook(GtkNotebook* self, gboolean object, gpointer user_data);

@ -1,6 +1,6 @@
#define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL) #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 settings"),"\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 HELP_LABEL yon_char_unite(_("ubl-settings-resourcequota version:")," ", version_application,"\n",_("CPU and RAM quotas settings"),"\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_LABEL _("CPU and RAM quotas")
#define TITLE_INFO_LABEL _("System resource quota settings management") #define TITLE_INFO_LABEL _("System resource quota settings management")
@ -28,6 +28,11 @@
#define STR_PROCESS _("Process") #define STR_PROCESS _("Process")
#define STR_SLICE _("Slice") #define STR_SLICE _("Slice")
#define STR_KB _("Kb")
#define STR_MB _("Mb")
#define STR_GB _("Gb")
#define STR_TB _("Tb")
#define GLOBAL_LOAD_SUCCESS _("Global configuration loading succseeded.") #define GLOBAL_LOAD_SUCCESS _("Global configuration loading succseeded.")
#define LOCAL_LOAD_SUCCESS _("Local configuration loading succseeded.") #define LOCAL_LOAD_SUCCESS _("Local configuration loading succseeded.")
@ -37,3 +42,7 @@
#define STR_DEL_TABLE _("Quota deleted") #define STR_DEL_TABLE _("Quota deleted")
#define STR_NO_SELECT_TABLE _("Quota deleted") #define STR_NO_SELECT_TABLE _("Quota deleted")
#define STR_QUOTAS_ADD _("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 succseeded.")
#define LOAD_FAILED_LABEL _("Config loading failed")

File diff suppressed because it is too large Load Diff

@ -7,12 +7,12 @@
#include <pthread.h> #include <pthread.h>
#include <string.h> #include <string.h>
#include <dirent.h> #include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <locale.h> #include <locale.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gtk/gtkx.h> #include <gtk/gtkx.h>
#include <vte/vte.h>
#include <pwd.h>
#include <stdbool.h>
#include "ubl-cmake.h" #include "ubl-cmake.h"
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h> #include <webkit2/webkit2.h>
@ -20,38 +20,25 @@
#define DesktopPath "/usr/share/applications/" #define DesktopPath "/usr/share/applications/"
#define for_dictionaries(obj, obj1) for (obj = obj1->first; obj != NULL; obj = obj->next) #define for_dictionaries(obj, obj1) for (obj = obj1->first; obj != NULL; obj = obj->next)
#define new(type) malloc(sizeof(type))
#define new_arr(type,size) malloc(sizeof(type)*size)
#define yon_ubl_set_config_save_data_pointer(command) config_commands.config_save_data = command
#define yon_ubl_load_global_config(command, size_pointer) yon_config_load(command, size_pointer)
#define yon_ubl_load_local_config(command, size_pointer) yon_config_load(command, size_pointer)
#define yon_ubl_save_global_config(command) yon_config_save(command)
#define yon_ubl_save_local_config(command) yon_config_save(command)
#define try bool __HadError=false; #define try bool __HadError=false;
#define catch(x) ExitJmp:if(__HadError) #define catch(x) ExitJmp:if(__HadError)
#define throw(x) {__HadError=true;goto ExitJmp;} #define throw(x) {__HadError=true;goto ExitJmp;}
#define file_source_login_min_max "/etc/login.defs" #define new(type) malloc(sizeof(type))
#define new_arr(type,size) malloc(sizeof(type)*size)
typedef enum typedef enum
{ {
#ifdef __GTK_H__ #ifdef __GTK_H__
DICTIONARY_GTK_WIDGETS_TYPE, DICTIONARY_GTK_WIDGETS_TYPE,
#endif #endif
DICTIONARY_OTHER_TYPE DICTIONARY_OTHER_TYPE=0,
DICTIONARY_CHAR_TYPE,
DICTIONARY_INT_TYPE,
DICTIONARY_BOOL_TYPE,
} DICT_TYPE; } DICT_TYPE;
typedef struct
{
char *command;
int *exitcode;
} thread_output;
typedef struct dictionary typedef struct dictionary
{ {
char *key; char *key;
@ -60,6 +47,7 @@ typedef struct dictionary
struct dictionary *prev; struct dictionary *prev;
struct dictionary *first; struct dictionary *first;
DICT_TYPE data_type; DICT_TYPE data_type;
int flag1;
} dictionary; } dictionary;
typedef struct apps typedef struct apps
@ -74,6 +62,15 @@ typedef struct apps
} apps; } apps;
typedef char** config_str; typedef char** config_str;
static dictionary *__yon__config__strings = NULL;
#define check_config if(__yon__config__strings&&__yon__config__strings->data_type==DICTIONARY_CHAR_TYPE)
#define config(key) yon_config_get_by_key(key)
#define for_config dictionary temp = NULL; for_dictionary(temp,__yon__config__strings)
#define yon_remalloc(pointer, size) (!pointer) ? malloc(size) : realloc(pointer, size)
// dictionary functions // dictionary functions
/**yon_dictionary_get_data(dictionary, type) /**yon_dictionary_get_data(dictionary, type)
@ -87,28 +84,36 @@ typedef char** config_str;
* [type] - тип данных, хранящихся в словаре [dictionary]. * [type] - тип данных, хранящихся в словаре [dictionary].
*/ */
#define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data) #define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data)
#define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) {if (!dict) dict=yon_dictionary_create_with_data(key,data); \
else dict=yon_dictionary_create_with_data_connected(dict,key,data);}
dictionary *yon_dictionary_create_empty(); /**yon_dictionary_add_or_create_if_exists_with_data(dict,key,data)
* [EN]
*
* [RU]
* Добавляет элемент словаря в конец словаря [dict] c ключом [key] и данными [data].
* Если словарь не существует, создаёт его
*/
#define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) {if (!dict) dict=yon_dictionary_new_with_data(key,data); \
else dict=yon_dictionary_append_with_data(dict,key,data);}
dictionary *yon_dictionary_new();
dictionary *yon_dictionary_create_conneced(dictionary *targetdict); dictionary *yon_dictionary_append(dictionary *targetdict);
dictionary *yon_dictionary_get_last(dictionary *dict); dictionary *yon_dictionary_get_last(dictionary *dict);
dictionary *yon_dictionary_switch_places(dictionary *dict, int aim); dictionary *yon_dictionary_swap(dictionary *dict, int aim);
void yon_dictionary_make_first(dictionary *dict); void yon_dictionary_make_first(dictionary *dict);
void yon_dictionary_make_nth(dictionary *dict, int nth); void yon_dictionary_make_nth(dictionary *dict, int nth);
dictionary *yon_dictionary_create_with_data(char *key, void *data); dictionary *yon_dictionary_new_with_data(char *key, void *data);
dictionary *yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data); dictionary *yon_dictionary_append_with_data(dictionary *dict, char *key, void *data);
dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect); dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect);
dictionary *yon_dictionary_find(dictionary **dict, char *key); dictionary *yon_dictionary_get(dictionary **dict, char *key);
dictionary *yon_dictionary_rip(dictionary *dict); dictionary *yon_dictionary_rip(dictionary *dict);
@ -117,8 +122,8 @@ dictionary *yon_dictionary_get_nth(dictionary *dict, int place);
void *yon_dictionary_free_all(dictionary *dictionary,void (data_manipulation)(void*)); void *yon_dictionary_free_all(dictionary *dictionary,void (data_manipulation)(void*));
// char functions // char functions
char* philos_str_remove(char *str, const char *sub);
char *yon_char_get_augumented(char *source, char *append); char *yon_char_append(char *source, char *append);
char *yon_char_new(char *chr); char *yon_char_new(char *chr);
@ -134,13 +139,9 @@ char *yon_char_from_int(int int_to_convert);
char *yon_char_replace(char *source, char *find, char*replace); char *yon_char_replace(char *source, char *find, char*replace);
void philos_split_size_memory(char* str_value, int* size, char* pow_memory);
char **yon_char_parse(char *parameters, int *size, char *divider); char **yon_char_parse(char *parameters, int *size, char *divider);
char** philos_str_split(char *parameters, int *size, char *divider); char **yon_char_parsed_rip(char **char_string, int *size, int item_to_delete);
char **yon_char_parsed_shrink(char **char_string, int *size, int item_to_delete);
int yon_char_parsed_check_exist(char **parameters, int size, char *param); int yon_char_parsed_check_exist(char **parameters, int size, char *param);
@ -148,17 +149,19 @@ int yon_char_find_count(char *source, char *find);
int yon_char_parsed_includes_char_parsed (config_str source, config_str to_check, int source_size, int check_size); int yon_char_parsed_includes_char_parsed (config_str source, config_str to_check, int source_size, int check_size);
config_str yon_char_parsed_new (config_str old, int *old_size, ...); config_str yon_char_parsed_new (int *size, ...);
void yon_char_parsed_copy(config_str *source, config_str *to_copy);
config_str yon_char_parsed_append(config_str parsed, int *size, char *string); config_str yon_char_parsed_append(config_str parsed, int *size, char *string);
// parsing functions
config_str philos_list_user(int* size); int yon_ubl_check_root();
char* philos_str_size_pow_byte(GtkWidget *combo_box_text); char *yon_ubl_root_user_get();
config_str philos_list_group(int* size); // parsing functions
unsigned short philos_read_uid_min_max(char* filename, char* search); config_str philos_list_user(int* size);
apps *yon_apps_scan_and_parse_desktops(int *sizef); apps *yon_apps_scan_and_parse_desktops(int *sizef);
@ -172,30 +175,40 @@ int yon_config_save(char *command);
char *yon_config_get_parameter(config_str parameters, int size, char *param); char *yon_config_get_parameter(config_str parameters, int size, char *param);
char *yon_config_make_save_parameter_with_multiple_arguments(char *parameter_string, char *config_parameter, char *divider); int yon_config_load_register(char *command);
// terminal-using functions int yon_config_remove_by_key(char *key);
int yon_launch_app(char *name); int yon_config_remove_by_data(void *data);
int yon_launch_app_with_arguments(char *name, char *args); int yon_config_remove_element(char *key, char *deleted);
void *yon_config_get_by_key(char *key);
char *yon_config_get_key_by_data(char *data);
int yon_config_set(char *key, void *data);
int yon_launch(thread_output *thread); int yon_config_clean();
int* philos_int_append(int* array, int* size, int value); void yon_config_register(char *key, void *data);
config_str yon_config_get_all();
// terminal-using functions
int yon_launch_app_with_arguments(char *name, char *args);
void yon_launch(char *command);
int* remove_element_int_array(int* array, int* size, int index);
// Gtk functions // Gtk functions
#ifdef __GTK_H__ #ifdef __GTK_H__
#ifdef VTE_TERMINAL #ifdef VTE_TERMINAL
void yon_terminal_integrated_launch(GtkWidget *place_to_show, char* command, void *endwork_function, void* endwork_function_argument);
void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *endwork_function, void* endwork_function_argument);
/**
*
*/
void yon_terminal_integrated_launch(GtkWidget *terminal, char* command, void *endwork_function, void* endwork_function_argument);
char* philos_get_size_bite(GtkWidget* chk_button, GtkWidget* spin, GtkWidget* combo_box_text);
void philos_fill_combo_box_text(GtkWidget *cbt, config_str list_data, int size);
#endif #endif
/**yon_gtk_builder_get_widget(builder, widget_name) /**yon_gtk_builder_get_widget(builder, widget_name)
@ -214,11 +227,13 @@ typedef struct
GtkListStore *List; GtkListStore *List;
} expander_icon_view; } expander_icon_view;
// GtkWidget *yon_gtk_app_chooser_apps_create(); void yon_window_config_setup(GtkWindow *window);
// dictionary *yon_gtk_app_chooser_create(); int yon_window_config_load(char *path);
// expander_icon_view yon_gtk_icon_view_expander_create(GtkWidget *pack, ...); GtkWidget *yon_ubl_menu_item_about_new(char *buttonname);
GtkWidget *yon_ubl_menu_item_documentation_new(char *buttonname);
int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size); int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size);
@ -226,8 +241,9 @@ int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find);
int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment); int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment);
int yon_dictionary_gtk_pack_start_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding); int yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...);
int yon_dictionary_gtk_pack_end_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding);
int yon_dictionary_gtk_pack_end_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...);
@ -311,10 +327,13 @@ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type);
* [imag_path] - путь до картинки, загружаемой в [image] * [imag_path] - путь до картинки, загружаемой в [image]
*/ */
#define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay), GTK_WIDGET(head), GTK_WIDGET(image), (char *)imag_path) #define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay), GTK_WIDGET(head), GTK_WIDGET(image), (char *)imag_path)
#define yon_ubl_header_setup_resource(overlay, head, image, imag_path) _yon_ubl_header_setup_resource(GTK_WIDGET(overlay), GTK_WIDGET(head), GTK_WIDGET(image), (char *)imag_path)
#endif #endif
void _yon_ubl_header_setup(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image, char *image_path); void _yon_ubl_header_setup(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image, char *image_path);
void _yon_ubl_header_setup_resource(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image, char *image_path);
void yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWidget *right_window, int socket_main_id, int socket_left_id, int socket_right_id); void yon_ubl_setup_sockets(GtkWidget *main_window, GtkWidget *left_window, GtkWidget *right_window, int socket_main_id, int socket_left_id, int socket_right_id);
#ifdef WEBKIT_FOUND #ifdef WEBKIT_FOUND

@ -1,100 +1,142 @@
#include "view_add.h" #include "view_add.h"
add_window *add_widgets = NULL; temp_set_window *add_widgets = NULL;
temp_config obj_add_config;
temp_config* get_add_config() {
return &obj_add_config;
}
add_window *add_setup_window(char* glade_path) { temp_set_window *add_setup_window(char* glade_path) {
if (add_widgets == NULL) { if (add_widgets == NULL) {
add_widgets = malloc(sizeof(add_window)); add_widgets = malloc(sizeof(temp_set_window));
GtkBuilder *builder = gtk_builder_new_from_file(glade_path); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
add_widgets->Window = yon_gtk_builder_get_widget(builder,"wndQuotasAdding"); add_widgets->Window = yon_gtk_builder_get_widget(builder,"wndQuotasAdding");
add_widgets->btnSaveAddSave = yon_gtk_builder_get_widget(builder,"btnSaveAddSave"); add_widgets->btnSaveTempSave = yon_gtk_builder_get_widget(builder,"btnSaveAddSave");
add_widgets->btnAddCancel = yon_gtk_builder_get_widget(builder,"btnAddCancel"); add_widgets->btnTempCancel = yon_gtk_builder_get_widget(builder,"btnAddCancel");
add_widgets->entryAddCmd = yon_gtk_builder_get_widget(builder,"entryAddCmd"); add_widgets->entryTempCmd = yon_gtk_builder_get_widget(builder,"entryAddCmd");
add_widgets->cbxAddQuotaObj = yon_gtk_builder_get_widget(builder,"cbxAddQuotaObj"); add_widgets->cbxTempQuotaObj = yon_gtk_builder_get_widget(builder,"cbxAddQuotaObj");
add_widgets->cbxAddQuotaLevel2 = yon_gtk_builder_get_widget(builder,"cbxAddQuotaLevel2"); add_widgets->cbxTempQuotaLevel2 = yon_gtk_builder_get_widget(builder,"cbxAddQuotaLevel2");
add_widgets->cbtAddDevice = yon_gtk_builder_get_widget(builder,"cbtAddDevice"); add_widgets->cbtTempDevice = yon_gtk_builder_get_widget(builder,"cbtAddDevice");
add_widgets->lblCPULimitAdd = yon_gtk_builder_get_widget(builder,"lblCPULimitAdd"); add_widgets->lblCPULimitTemp = yon_gtk_builder_get_widget(builder,"lblCPULimitAdd");
add_widgets->spinCPULimitAdd = yon_gtk_builder_get_widget(builder,"spinCPULimitAdd"); add_widgets->spinCPULimitTemp = yon_gtk_builder_get_widget(builder,"spinCPULimitAdd");
add_widgets->chkCPULimitAdd = yon_gtk_builder_get_widget(builder,"chkCPULimitAdd"); add_widgets->chkCPULimitTemp = yon_gtk_builder_get_widget(builder,"chkCPULimitAdd");
add_widgets->chkPaddingFLAdd = yon_gtk_builder_get_widget(builder,"chkPaddingFLAdd"); add_widgets->chkPaddingFLTemp = yon_gtk_builder_get_widget(builder,"chkPaddingFLAdd");
add_widgets->spinPaddingFLAdd = yon_gtk_builder_get_widget(builder,"spinPaddingFLAdd"); add_widgets->spinPaddingFLTemp = yon_gtk_builder_get_widget(builder,"spinPaddingFLAdd");
add_widgets->cmbPaddingFLAdd = yon_gtk_builder_get_widget(builder,"cmbPaddingFLAdd"); add_widgets->cmbPaddingFLTemp = yon_gtk_builder_get_widget(builder,"cmbPaddingFLAdd");
add_widgets->chkSevereRestrictionAdd = yon_gtk_builder_get_widget(builder,"chkSevereRestrictionAdd"); add_widgets->chkSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"chkSevereRestrictionAdd");
add_widgets->spinSevereRestrictionAdd = yon_gtk_builder_get_widget(builder,"spinSevereRestrictionAdd"); add_widgets->spinSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"spinSevereRestrictionAdd");
add_widgets->cmbSevereRestrictionAdd = yon_gtk_builder_get_widget(builder,"cmbSevereRestrictionAdd"); add_widgets->cmbSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"cmbSevereRestrictionAdd");
add_widgets->chkSoftRestrictionAdd = yon_gtk_builder_get_widget(builder,"chkSoftRestrictionAdd"); add_widgets->chkSoftRestrictionTemp = yon_gtk_builder_get_widget(builder,"chkSoftRestrictionAdd");
add_widgets->spiSevereRestrictionAdd = yon_gtk_builder_get_widget(builder,"spiSevereRestrictionAdd"); add_widgets->spiSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"spiSevereRestrictionAdd");
add_widgets->cmSevereRestrictionAdd = yon_gtk_builder_get_widget(builder,"cmSevereRestrictionAdd"); add_widgets->cmSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"cmSevereRestrictionAdd");
add_widgets->chbAddRead = yon_gtk_builder_get_widget(builder,"chbAddRead"); add_widgets->chbTempRead = yon_gtk_builder_get_widget(builder,"chbAddRead");
add_widgets->spinAddRead = yon_gtk_builder_get_widget(builder,"spinAddRead"); add_widgets->spinTempRead = yon_gtk_builder_get_widget(builder,"spinAddRead");
add_widgets->cbtAddRead = yon_gtk_builder_get_widget(builder,"cbtAddRead"); add_widgets->cbtTempRead = yon_gtk_builder_get_widget(builder,"cbtAddRead");
add_widgets->spinAddWrite = yon_gtk_builder_get_widget(builder,"spinAddWrite"); add_widgets->spinTempWrite = yon_gtk_builder_get_widget(builder,"spinAddWrite");
add_widgets->chbAddWrite = yon_gtk_builder_get_widget(builder,"chbAddWrite"); add_widgets->chbTempWrite = yon_gtk_builder_get_widget(builder,"chbAddWrite");
add_widgets->cbtAddWrite = yon_gtk_builder_get_widget(builder,"cbtAddWrite"); add_widgets->cbtTempWrite = yon_gtk_builder_get_widget(builder,"cbtAddWrite");
add_widgets->boxBlockGui = yon_gtk_builder_get_widget(builder,"boxBlockGui");
device_fill_disk(add_widgets->cbtAddDevice); device_fill_disk(add_widgets->cbtTempDevice);
add_event(add_widgets); add_event(add_widgets);
add_init_windows(); add_init_windows();
add_localization(add_widgets); add_localization(add_widgets);
philos_temp_config_init(&obj_add_config);
init_device_disk(&obj_add_config);
} }
return add_widgets; return add_widgets;
} }
void add_init_windows() { void add_init_windows() {
add_set_active_widgets(add_widgets->chkSoftRestrictionAdd, add_widgets->spiSevereRestrictionAdd, add_widgets->cmSevereRestrictionAdd); if (gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxTempQuotaLevel2)) != -1) {
add_set_active_widgets(add_widgets->chkSevereRestrictionAdd, add_widgets->spinSevereRestrictionAdd, add_widgets->cmbSevereRestrictionAdd); gtk_widget_set_sensitive(add_widgets->boxBlockGui, 1);
add_set_active_widgets(add_widgets->chkPaddingFLAdd, add_widgets->spinPaddingFLAdd, add_widgets->cmbPaddingFLAdd); gtk_widget_set_sensitive(add_widgets->btnSaveTempSave, 1);
add_set_active_widgets(add_widgets->chkCPULimitAdd, add_widgets->spinCPULimitAdd, add_widgets->lblCPULimitAdd); philos_set_active_widgets(add_widgets->chkSoftRestrictionTemp, add_widgets->spiSevereRestrictionTemp, add_widgets->cmSevereRestrictionTemp, 0 , CMD_RAW);
add_set_active_widgets(add_widgets->chbAddWrite, add_widgets->spinAddWrite, add_widgets->cbtAddWrite); philos_set_active_widgets(add_widgets->chkSevereRestrictionTemp, add_widgets->spinSevereRestrictionTemp, add_widgets->cmbSevereRestrictionTemp,0 , CMD_RAW);
add_set_active_widgets(add_widgets->chbAddRead, add_widgets->spinAddRead, add_widgets->cbtAddRead); philos_set_active_widgets(add_widgets->chkPaddingFLTemp, add_widgets->spinPaddingFLTemp, add_widgets->cmbPaddingFLTemp,0 , CMD_SWAP);
add_generate_cmd(); philos_set_active_widgets(add_widgets->chkCPULimitTemp, add_widgets->spinCPULimitTemp, add_widgets->lblCPULimitTemp,1 , CMD_CPU);
philos_set_active_widgets_device_io(add_widgets->cbtTempDevice,add_widgets->chbTempWrite, add_widgets->spinTempWrite, add_widgets->cbtTempWrite);
philos_set_active_widgets_device_io(add_widgets->cbtTempDevice,add_widgets->chbTempRead, add_widgets->spinTempRead, add_widgets->cbtTempRead);
}
else {
gtk_widget_set_sensitive(add_widgets->boxBlockGui, 0);
gtk_widget_set_sensitive(add_widgets->btnSaveTempSave, 0);
}
philos_temp_generate_cmd(add_widgets, &obj_add_config);
} }
void add_event(add_window *widgets) { void event_check_io_device() {
g_signal_connect(G_OBJECT(widgets->btnAddCancel),"clicked",G_CALLBACK(add_on_destroy_subwindow),NULL); 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_generate_cmd(add_widgets, &obj_add_config);
}
void combo_box_device() {
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->cbtTempDevice), G_CALLBACK(combo_box_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->cbtTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->cbtTempWrite), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->spinTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->spinTempWrite), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->chbTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_block_by_func(G_OBJECT(add_widgets->chbTempWrite), G_CALLBACK(event_check_io_device), NULL);
philos_update_device_to_entry(add_widgets, &obj_add_config, 0);
philos_update_device_to_entry(add_widgets, &obj_add_config, 1);
add_init_windows();
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->cbtTempDevice), G_CALLBACK(combo_box_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->cbtTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->cbtTempWrite), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->spinTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->spinTempWrite), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->chbTempRead), G_CALLBACK(event_check_io_device), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(add_widgets->chbTempWrite), G_CALLBACK(event_check_io_device), NULL);
}
void add_event(temp_set_window *widgets) {
g_signal_connect(G_OBJECT(widgets->btnTempCancel),"clicked",G_CALLBACK(add_on_destroy_subwindow),NULL);
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(add_destroy), NULL); g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(add_destroy), NULL);
g_signal_connect(G_OBJECT(widgets->chkSoftRestrictionAdd), "toggled", G_CALLBACK(add_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkSoftRestrictionTemp), "toggled", G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkSevereRestrictionAdd), "toggled", G_CALLBACK(add_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkSevereRestrictionTemp), "toggled", G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkPaddingFLAdd), "toggled", G_CALLBACK(add_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkPaddingFLTemp), "toggled", G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkCPULimitAdd), "toggled", G_CALLBACK(add_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkCPULimitTemp), "toggled", G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chbAddRead), "toggled", G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chbAddWrite), "toggled", G_CALLBACK(add_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->cbxTempQuotaObj),"changed",G_CALLBACK(add_update_combo_box), NULL);
g_signal_connect(G_OBJECT(widgets->cbxAddQuotaObj),"changed",G_CALLBACK(add_update_combo_box), NULL); g_signal_connect(G_OBJECT(widgets->cbxTempQuotaLevel2),"changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionAdd),"value-changed",G_CALLBACK(add_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionTemp),"value-changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionAdd),"value-changed",G_CALLBACK(add_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionTemp),"value-changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinPaddingFLAdd),"value-changed",G_CALLBACK(add_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinPaddingFLTemp),"value-changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinCPULimitAdd),"value-changed",G_CALLBACK(add_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinCPULimitTemp),"value-changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinAddRead),"value-changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->spinAddWrite),"value-changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionAdd),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionAdd),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cmbPaddingFLAdd),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cbtAddRead),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cbtAddWrite),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cbtAddDevice),"changed",G_CALLBACK(add_generate_cmd), NULL);
g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionTemp),"changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionTemp),"changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->cmbPaddingFLTemp),"changed",G_CALLBACK(add_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->cbtTempDevice),"changed",G_CALLBACK(combo_box_device), NULL);
g_signal_connect(G_OBJECT(widgets->cbtTempRead),"changed",G_CALLBACK(event_check_io_device), NULL);
g_signal_connect(G_OBJECT(widgets->cbtTempWrite),"changed",G_CALLBACK(event_check_io_device), NULL);
g_signal_connect(G_OBJECT(widgets->spinTempRead),"value-changed",G_CALLBACK(event_check_io_device), NULL);
g_signal_connect(G_OBJECT(widgets->spinTempWrite),"value-changed",G_CALLBACK(event_check_io_device), NULL);
g_signal_connect(G_OBJECT(widgets->chbTempRead), "toggled", G_CALLBACK(event_check_io_device), NULL);
g_signal_connect(G_OBJECT(widgets->chbTempWrite), "toggled", G_CALLBACK(event_check_io_device), NULL);
} }
void add_destroy(GtkWidget *self) { void add_get_systemd_cgls(char* cmd_systemd_cgls) {
add_widgets = NULL; CMD_GET_SLICE_SERVICE = cmd_systemd_cgls;
} }
void add_set_active_widgets(GtkWidget *self, GtkWidget *entry, GtkWidget *label) { void add_destroy(GtkWidget *self) {
gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self)); add_widgets = NULL;
gtk_widget_set_sensitive(entry, active);
gtk_widget_set_sensitive(label, active);
} }
void add_localization(add_window *widgets) { void add_localization(temp_set_window *widgets) {
} }
@ -104,7 +146,7 @@ void add_on_destroy_subwindow(GtkWidget *self) {
} }
add_window *get_widget_add() { temp_set_window *get_widget_add() {
return add_widgets; return add_widgets;
} }
@ -112,18 +154,20 @@ void add_show(GtkWidget *self, char* glade_path) {
if (add_widgets != NULL) { if (add_widgets != NULL) {
add_update_combo_box(); add_update_combo_box();
gtk_widget_show_all(add_widgets->Window); gtk_widget_show_all(add_widgets->Window);
add_init_windows();
} }
else { else {
add_setup_window(glade_path); add_setup_window(glade_path);
add_update_combo_box(); add_update_combo_box();
gtk_widget_show_all(add_widgets->Window); gtk_widget_show_all(add_widgets->Window);
add_init_windows();
} }
} }
char* add_get_select_device_to_level_2() { char* add_get_select_device_to_level_2() {
char* text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(add_widgets->cbxAddQuotaLevel2)); char* text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(add_widgets->cbxTempQuotaLevel2));
if (text != NULL) { int disk_id = gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxTempQuotaLevel2));
if (disk_id >= 0) {
return text; return text;
} }
else { else {
@ -134,76 +178,66 @@ char* add_get_select_device_to_level_2() {
} }
} }
char* add_get_select_device() {
char* text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(add_widgets->cbtAddDevice)); int add_get_soft_size() {
if (text != NULL) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkSoftRestrictionTemp))) {
return text; return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmSevereRestrictionTemp));
} }
else { else {
char* str = (char*)malloc(sizeof(char*)*2); return -3;
str[0] = '-';
str[1] = '\0';
return str;
} }
}
int add_get_read_device_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbtAddRead));
}
int add_get_write_device_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbtAddWrite));
}
int add_get_soft_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmSevereRestrictionAdd));
} }
int add_get_hard_size() { int add_get_hard_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmbSevereRestrictionAdd)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkSevereRestrictionTemp))) {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmbSevereRestrictionTemp));
}
else {
return -3;
}
} }
int add_get_limit_cpu_size() { int add_get_limit_cpu_size() {
return -1; return -1;
} }
int add_get_limit_swap_size() { int add_get_limit_swap_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmbPaddingFLAdd)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkPaddingFLTemp))) {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cmbPaddingFLTemp));
}
else {
return -3;
}
} }
int add_get_quota_object_size() { int add_get_quota_object_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxAddQuotaObj)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkPaddingFLTemp))) {
} return gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxTempQuotaObj));
char* add_get_read_device() { }
return philos_get_size_bite(add_widgets->chbAddRead, add_widgets->spinAddRead, else {
add_widgets->cbtAddRead); return -3;
} }
char* add_get_write_device() {
return philos_get_size_bite(add_widgets->chbAddWrite, add_widgets->spinAddWrite,
add_widgets->cbtAddWrite);
} }
char* add_get_soft() {
return philos_get_size_bite(add_widgets->chkSoftRestrictionAdd, add_widgets->spiSevereRestrictionAdd, int add_get_soft() {
add_widgets->cmSevereRestrictionAdd); return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spiSevereRestrictionTemp));
} }
char* add_get_hard() { int add_get_hard() {
return philos_get_size_bite(add_widgets->chkSevereRestrictionAdd, add_widgets->spinSevereRestrictionAdd, return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinSevereRestrictionTemp));
add_widgets->cmbSevereRestrictionAdd);
} }
char* add_get_limit_cpu() { int add_get_limit_cpu() {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkCPULimitAdd))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkCPULimitTemp))) {
int size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinCPULimitAdd)); return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinCPULimitTemp));
return yon_char_from_int(size_bite);
} }
else { else {
char* str = (char*)malloc(sizeof(char*)*2); return -3;
str[0] = '-';
str[1] = '\0';
return str;
} }
} }
char* add_get_limit_swap() { int add_get_limit_swap() {
return philos_get_size_bite(add_widgets->chkPaddingFLAdd, add_widgets->spinPaddingFLAdd, return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinPaddingFLTemp));
add_widgets->cmbPaddingFLAdd);
} }
char* add_get_quota_object() { char* add_get_quota_object() {
return gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(add_widgets->cbxAddQuotaObj)); return gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(add_widgets->cbxTempQuotaObj));
} }
void add_update_combo_box() { void add_update_combo_box() {
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxAddQuotaObj)); int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbxTempQuotaObj));
char* cmd = NULL; char* cmd = NULL;
config_str fill_cmb_2 = NULL; config_str fill_cmb_2 = NULL;
int size = 0; int size = 0;
@ -212,87 +246,36 @@ void add_update_combo_box() {
} }
else if (menu_id == 1) { else if (menu_id == 1) {
fill_cmb_2 = philos_pars_terminal_systemd_cgls(CMD_GET_SLICE_SERVICE, ".service", &size);
philos_array_string_remove_char(&fill_cmb_2, "\n", size);
} }
else if (menu_id == 2) { else if (menu_id == 2) {
fill_cmb_2 = philos_pars_terminal_systemd_cgls(CMD_GET_SLICE_SERVICE, ".slice", &size);
} philos_array_string_remove_char(&fill_cmb_2, "\n", size);
else if (menu_id == 3) {
} }
if (menu_id >= 0) { if (menu_id >= 0) {
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(add_widgets->cbxAddQuotaLevel2)); gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(add_widgets->cbxTempQuotaLevel2));
philos_fill_combo_box_text(add_widgets->cbxAddQuotaLevel2, fill_cmb_2, size); philos_fill_combo_box_text(add_widgets->cbxTempQuotaLevel2, fill_cmb_2, size);
// yon_terminal_integrated_launch(widgets->vteProcesses, cmd, NULL, NULL);
} }
} }
void add_generate_cmd() {
char* str_cmd = "";
char* split_simvol = g_malloc0(sizeof(char)*2);
int size_bite = 0;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkSoftRestrictionAdd))) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spiSevereRestrictionAdd));
str_cmd = yon_char_unite(str_cmd,
"MemoryHigh=",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(add_widgets->cmSevereRestrictionAdd), NULL);
split_simvol[0] = ',';
split_simvol[1] = '\0';
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkSevereRestrictionAdd))) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinSevereRestrictionAdd));
str_cmd = yon_char_unite(str_cmd, split_simvol,
"MemoryMax=",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(add_widgets->cmbSevereRestrictionAdd), NULL);
split_simvol[0] = ',';
split_simvol[1] = '\0';
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkPaddingFLAdd))) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinPaddingFLAdd));
str_cmd = yon_char_unite(str_cmd, split_simvol,
"MemorySwapMax=",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(add_widgets->cmbPaddingFLAdd), NULL);
split_simvol[0] = ',';
split_simvol[1] = '\0';
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chkCPULimitAdd))) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinCPULimitAdd));
str_cmd = yon_char_unite(str_cmd, split_simvol,
"CPUQuota=",
yon_char_from_int(size_bite),
"\%", NULL);
split_simvol[0] = ',';
split_simvol[1] = '\0';
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chbAddRead))) {
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbtAddDevice));
if (menu_id != -1) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinAddRead));
str_cmd = yon_char_unite(str_cmd, split_simvol,
"IOReadBandwidthMax=\"",
get_device_cfg()->name_disk[menu_id],
" ",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(add_widgets->cbtAddRead),"\"", NULL);
}
split_simvol[0] = ',';
split_simvol[1] = '\0';
} int** add_get_read_device() {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(add_widgets->chbAddWrite))) { return &obj_add_config.i_o_limit_read;
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(add_widgets->cbtAddDevice)); }
if (menu_id != -1) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(add_widgets->spinAddWrite)); int** add_get_read_device_size_pow() {
str_cmd = yon_char_unite(str_cmd, split_simvol, return &obj_add_config.i_o_limit_read_size;
"IOWriteBandwidthMax=\"", }
get_device_cfg()->name_disk[menu_id], int** add_get_write_device() {
" ", return &obj_add_config.i_o_limit_write;
yon_char_from_int(size_bite),
philos_str_size_pow_byte(add_widgets->cbtAddWrite),"\"", NULL);
}
}
gtk_entry_set_text(GTK_ENTRY(add_widgets->entryAddCmd), str_cmd);
free(split_simvol);
} }
int** add_get_write_device_size_pow() {
return &obj_add_config.i_o_limit_write_size;
}
char*** add_get_select_read_device() {
return &obj_add_config.disk_read;
}
char*** add_get_select_write_device() {
return &obj_add_config.disk_write;
}

@ -12,70 +12,49 @@
#include <getopt.h> #include <getopt.h>
#include <libintl.h> #include <libintl.h>
#include "my_device.h" #include "my_device.h"
#include "philos_utils.h"
// Переменные
typedef struct {
GtkWidget* Window;
GtkWidget* btnSaveAddSave;
GtkWidget* btnAddCancel;
GtkWidget* entryAddCmd; #define CMD_CPU "lscpu | grep \"CPU(s):\" |grep -oE \"[0-9]{1,}\""
GtkWidget* chbAddRead; #define CMD_SWAP "grep '^Swap' /proc/meminfo | grep \"SwapTotal\" |grep -oE \"[0-9]{1,}\""
GtkWidget* spinAddRead; #define CMD_RAW "cat /proc/meminfo | grep \"MemTotal\" |grep -oE \"[0-9]{1,}\""
GtkWidget* cbtAddRead;
GtkWidget* chbAddWrite; static char* CMD_GET_GROUP;
GtkWidget* spinAddWrite; static char* CMD_GET_SLICE_SERVICE;
GtkWidget* cbtAddWrite;
GtkWidget* chkSoftRestrictionAdd;
GtkWidget* spiSevereRestrictionAdd;
GtkWidget* cmSevereRestrictionAdd;
GtkWidget* chkSevereRestrictionAdd; temp_set_window *add_setup_window(char* glade_path);
GtkWidget* spinSevereRestrictionAdd; void add_event(temp_set_window *widgets);
GtkWidget* cmbSevereRestrictionAdd; void add_localization(temp_set_window *widgets);
GtkWidget* chkPaddingFLAdd;
GtkWidget* spinPaddingFLAdd;
GtkWidget* cmbPaddingFLAdd;
GtkWidget* chkCPULimitAdd;
GtkWidget* spinCPULimitAdd;
GtkWidget* lblCPULimitAdd;
GtkWidget* cbtAddDevice;
GtkWidget* cbxAddQuotaObj;
GtkWidget* cbxAddQuotaLevel2;
} add_window;
// Функции
add_window *add_setup_window(char* glade_path);
void add_event(add_window *widgets);
void add_localization(add_window *widgets);
void add_on_destroy_subwindow(GtkWidget *self); void add_on_destroy_subwindow(GtkWidget *self);
add_window *get_widget_add(); temp_set_window *get_widget_add();
void add_show(GtkWidget *self, char* glade_path); void add_show(GtkWidget *self, char* glade_path);
void add_destroy(GtkWidget *self); void add_destroy(GtkWidget *self);
void add_set_active_widgets(GtkWidget *self, GtkWidget *entry, GtkWidget *label); void add_set_active_widgets(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, int flag_cpu, char* cmd);
void add_init_windows(); void add_init_windows();
void add_update_combo_box(); void add_update_combo_box();
char* add_get_select_device(); char*** add_get_select_read_device();
char* add_get_read_device(); int** add_get_read_device();
char* add_get_write_device(); int** add_get_write_device();
char* add_get_soft(); int add_get_soft();
char* add_get_hard(); int add_get_hard();
char* add_get_limit_cpu(); int add_get_limit_cpu();
char* add_get_limit_swap(); int add_get_limit_swap();
char* add_get_quota_object(); char* add_get_quota_object();
char*** add_get_select_write_device();
int add_get_read_device_size(); char*** add_get_select_read_device();
int add_get_write_device_size(); void combo_box_device();
int** add_get_write_device_size_pow();
int** add_get_read_device_size_pow();
int add_get_soft_size(); int add_get_soft_size();
int add_get_hard_size(); int add_get_hard_size();
int add_get_limit_cpu_size(); int add_get_limit_cpu_size();
int add_get_limit_swap_size(); int add_get_limit_swap_size();
int add_get_quota_object_size(); int add_get_quota_object_size();
temp_config* get_add_config();
void add_set_active_widgets_device_io(GtkWidget *check, GtkWidget *spin, GtkWidget *combo);
void add_get_cmd_group(char* cmd_get_group);
char* add_get_select_device_to_level_2(); char* add_get_select_device_to_level_2();
void add_generate_cmd(); void add_get_systemd_cgls(char* cmd_systemd_cgls);
void add_set_spin_adjustment(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, size_t value);
#endif #endif

@ -1,76 +1,80 @@
#include "view_edit.h" #include "view_edit.h"
edit_window *edit_widgets = NULL; temp_set_window *edit_widgets = NULL;
temp_config obj_edit_config;
edit_window *edit_setup_window(char* glade_path){ temp_config* get_edit_config() {
return &obj_edit_config;
}
temp_set_window *edit_setup_window(char* glade_path){
if (edit_widgets == NULL) { if (edit_widgets == NULL) {
edit_widgets = malloc(sizeof(edit_window)); edit_widgets = malloc(sizeof(temp_set_window));
GtkBuilder *builder = gtk_builder_new_from_file(glade_path); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
edit_widgets->Window = yon_gtk_builder_get_widget(builder,"wndQuotasEdit"); edit_widgets->Window = yon_gtk_builder_get_widget(builder,"wndQuotasEdit");
edit_widgets->btnEditCancel = yon_gtk_builder_get_widget(builder,"btnEditCancel"); edit_widgets->btnTempCancel = yon_gtk_builder_get_widget(builder,"btnEditCancel");
edit_widgets->btnSaveEditSave = yon_gtk_builder_get_widget(builder,"btnSaveEditSave"); edit_widgets->btnSaveTempSave = yon_gtk_builder_get_widget(builder,"btnSaveEditSave");
edit_widgets->cbtEditDevice = yon_gtk_builder_get_widget(builder,"cbtEditDevice"); edit_widgets->cbtTempDevice = yon_gtk_builder_get_widget(builder,"cbtEditDevice");
edit_widgets->lblCPULimitEdit = yon_gtk_builder_get_widget(builder,"lblCPULimitEdit"); edit_widgets->lblCPULimitTemp = yon_gtk_builder_get_widget(builder,"lblCPULimitEdit");
edit_widgets->spinCPULimitEdit = yon_gtk_builder_get_widget(builder,"spinCPULimitEdit"); edit_widgets->spinCPULimitTemp = yon_gtk_builder_get_widget(builder,"spinCPULimitEdit");
edit_widgets->chkCPULimitEdit = yon_gtk_builder_get_widget(builder,"chkCPULimitEdit"); edit_widgets->chkCPULimitTemp = yon_gtk_builder_get_widget(builder,"chkCPULimitEdit");
edit_widgets->chkPaddingFLEdit = yon_gtk_builder_get_widget(builder,"chkPaddingFLEdit"); edit_widgets->chkPaddingFLTemp = yon_gtk_builder_get_widget(builder,"chkPaddingFLEdit");
edit_widgets->spinPaddingFLEdit = yon_gtk_builder_get_widget(builder,"spinPaddingFLEdit"); edit_widgets->spinPaddingFLTemp = yon_gtk_builder_get_widget(builder,"spinPaddingFLEdit");
edit_widgets->cmbPaddingFLEdit = yon_gtk_builder_get_widget(builder,"cmbPaddingFLEdit"); edit_widgets->cmbPaddingFLTemp = yon_gtk_builder_get_widget(builder,"cmbPaddingFLEdit");
edit_widgets->chkSevereRestrictionEdit = yon_gtk_builder_get_widget(builder,"chkSevereRestrictionEdit"); edit_widgets->chkSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"chkSevereRestrictionEdit");
edit_widgets->spinSevereRestrictionEdit = yon_gtk_builder_get_widget(builder,"spinSevereRestrictionEdit"); edit_widgets->spinSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"spinSevereRestrictionEdit");
edit_widgets->cmbSevereRestrictionEdit = yon_gtk_builder_get_widget(builder,"cmbSevereRestrictionEdit"); edit_widgets->cmbSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"cmbSevereRestrictionEdit");
edit_widgets->chkSoftRestrictionEdit = yon_gtk_builder_get_widget(builder,"chkSoftRestrictionEdit"); edit_widgets->chkSoftRestrictionTemp = yon_gtk_builder_get_widget(builder,"chkSoftRestrictionEdit");
edit_widgets->spiSevereRestrictionEdit = yon_gtk_builder_get_widget(builder,"spiSevereRestrictionEdit"); edit_widgets->spiSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"spiSevereRestrictionEdit");
edit_widgets->cmSevereRestrictionEdit = yon_gtk_builder_get_widget(builder,"cmSevereRestrictionEdit"); edit_widgets->cmSevereRestrictionTemp = yon_gtk_builder_get_widget(builder,"cmSevereRestrictionEdit");
edit_widgets->chbEditRead = yon_gtk_builder_get_widget(builder,"chbEditRead"); edit_widgets->chbTempRead = yon_gtk_builder_get_widget(builder,"chbEditRead");
edit_widgets->spinEditRead = yon_gtk_builder_get_widget(builder,"spinEditRead"); edit_widgets->spinTempRead = yon_gtk_builder_get_widget(builder,"spinEditRead");
edit_widgets->cbtEditRead = yon_gtk_builder_get_widget(builder,"cbtEditRead"); edit_widgets->cbtTempRead = yon_gtk_builder_get_widget(builder,"cbtEditRead");
edit_widgets->spinEditWrite = yon_gtk_builder_get_widget(builder,"spinEditWrite"); edit_widgets->spinTempWrite = yon_gtk_builder_get_widget(builder,"spinEditWrite");
edit_widgets->chbEditWrite = yon_gtk_builder_get_widget(builder,"chbEditWrite"); edit_widgets->chbTempWrite = yon_gtk_builder_get_widget(builder,"chbEditWrite");
edit_widgets->cbtEditWrite = yon_gtk_builder_get_widget(builder,"cbtEditWrite"); edit_widgets->cbtTempWrite = yon_gtk_builder_get_widget(builder,"cbtEditWrite");
edit_widgets->entryEditCmd = yon_gtk_builder_get_widget(builder,"entryEditCmd"); edit_widgets->entryTempCmd = yon_gtk_builder_get_widget(builder,"entryEditCmd");
device_fill_disk(edit_widgets->cbtEditDevice); device_fill_disk(edit_widgets->cbtTempDevice);
edit_event(edit_widgets);
edit_localization(edit_widgets); edit_localization(edit_widgets);
philos_temp_config_init(&obj_edit_config);
} }
return edit_widgets; return edit_widgets;
} }
void edit_event(edit_window *widgets) { void edit_event(temp_set_window *widgets) {
g_signal_connect(G_OBJECT(widgets->btnEditCancel),"clicked",G_CALLBACK(edit_on_hide_subwindow),NULL); g_signal_connect(G_OBJECT(widgets->btnTempCancel),"clicked",G_CALLBACK(edit_on_hide_subwindow),NULL);
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(edit_destroy), NULL); g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(edit_destroy), NULL);
g_signal_connect(G_OBJECT(widgets->chkSoftRestrictionEdit), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkSoftRestrictionTemp), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkSevereRestrictionEdit), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkSevereRestrictionTemp), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkPaddingFLEdit), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkPaddingFLTemp), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chkCPULimitEdit), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chkCPULimitTemp), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chbEditRead), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chbTempRead), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->chbEditWrite), "toggled", G_CALLBACK(edit_init_windows), NULL); g_signal_connect(G_OBJECT(widgets->chbTempWrite), "toggled", G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionEdit),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionEdit),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinPaddingFLEdit),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinPaddingFLTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinCPULimitEdit),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinCPULimitTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
g_signal_connect(G_OBJECT(widgets->spinEditRead),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinTempRead),"value-changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->spinEditWrite),"value-changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->spinTempWrite),"value-changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionEdit),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionEdit),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cmbPaddingFLEdit),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cmbPaddingFLTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cbtEditRead),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cbtTempRead),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cbtEditWrite),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cbtTempWrite),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_connect(G_OBJECT(widgets->cbtEditDevice),"changed",G_CALLBACK(edit_generate_cmd), NULL); g_signal_connect(G_OBJECT(widgets->cbtTempDevice),"changed",G_CALLBACK(combo_box_device_edit), NULL);
} }
void edit_destroy(GtkWidget *self) { void edit_destroy(GtkWidget *self) {
edit_widgets = NULL; edit_widgets = NULL;
} }
void edit_localization(edit_window *widgets) { void edit_localization(temp_set_window *widgets) {
} }
@ -79,7 +83,7 @@ void edit_on_hide_subwindow(GtkWidget *self) {
edit_widgets = NULL; edit_widgets = NULL;
} }
edit_window *get_widget_edit() { temp_set_window *get_widget_edit() {
return edit_widgets; return edit_widgets;
} }
@ -93,206 +97,213 @@ void edit_show(GtkWidget *self, char* glade_path) {
} }
} }
void wrapper_edit_init_windows_size_memory() {
philos_temp_add_disk(edit_widgets, &obj_edit_config, 0);
philos_temp_add_disk(edit_widgets, &obj_edit_config, 1);
edit_init_windows();
}
void edit_init_windows() { void edit_init_windows() {
edit_generate_cmd(); philos_set_active_widgets(edit_widgets->chkSoftRestrictionTemp, edit_widgets->spiSevereRestrictionTemp, edit_widgets->cmSevereRestrictionTemp,0 ,CMD_RAW);
edit_set_active_widgets(edit_widgets->chkSoftRestrictionEdit, edit_widgets->spiSevereRestrictionEdit, edit_widgets->cmSevereRestrictionEdit); philos_set_active_widgets(edit_widgets->chkSevereRestrictionTemp, edit_widgets->spinSevereRestrictionTemp, edit_widgets->cmbSevereRestrictionTemp,0 , CMD_RAW);
edit_set_active_widgets(edit_widgets->chkSevereRestrictionEdit, edit_widgets->spinSevereRestrictionEdit, edit_widgets->cmbSevereRestrictionEdit); philos_set_active_widgets(edit_widgets->chkPaddingFLTemp, edit_widgets->spinPaddingFLTemp, edit_widgets->cmbPaddingFLTemp,0 , CMD_SWAP);
edit_set_active_widgets(edit_widgets->chkPaddingFLEdit, edit_widgets->spinPaddingFLEdit, edit_widgets->cmbPaddingFLEdit); philos_set_active_widgets(edit_widgets->chkCPULimitTemp, edit_widgets->spinCPULimitTemp, edit_widgets->lblCPULimitTemp,1 ,CMD_CPU);
edit_set_active_widgets(edit_widgets->chkCPULimitEdit, edit_widgets->spinCPULimitEdit, edit_widgets->lblCPULimitEdit); philos_set_active_widgets_device_io(edit_widgets->cbtTempDevice,edit_widgets->chbTempWrite, edit_widgets->spinTempWrite, edit_widgets->cbtTempWrite);
edit_set_active_widgets(edit_widgets->chbEditWrite, edit_widgets->spinEditWrite, edit_widgets->cbtEditWrite); philos_set_active_widgets_device_io(edit_widgets->cbtTempDevice,edit_widgets->chbTempRead, edit_widgets->spinTempRead, edit_widgets->cbtTempRead);
edit_set_active_widgets(edit_widgets->chbEditRead, edit_widgets->spinEditRead, edit_widgets->cbtEditRead); philos_temp_generate_cmd(edit_widgets, &obj_edit_config);
} }
void edit_set_active_widgets(GtkWidget *self, GtkWidget *entry, GtkWidget *label) { void combo_box_device_edit() {
gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self)); g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->cbtTempDevice), G_CALLBACK(combo_box_device_edit), NULL);
gtk_widget_set_sensitive(entry, active); g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->cbtTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
gtk_widget_set_sensitive(label, active); g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->cbtTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->spinTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->spinTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->chbTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->chbTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
philos_update_device_to_entry(edit_widgets, &obj_edit_config, 0);
philos_update_device_to_entry(edit_widgets, &obj_edit_config, 1);
edit_init_windows();
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempDevice), G_CALLBACK(combo_box_device_edit), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->spinTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->spinTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->chbTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->chbTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
} }
char* edit_get_select_device() { int edit_get_soft_size() {
char* text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(edit_widgets->cbtEditDevice)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkSoftRestrictionTemp))) {
if (text != NULL) { return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmSevereRestrictionTemp));
return text;
} }
else { else {
char* str = (char*)malloc(sizeof(char*)*2); return -3;
str[0] = '-';
str[1] = '\0';
return str;
} }
}
int edit_get_read_device_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cbtEditRead));
}
int edit_get_write_device_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cbtEditWrite));
}
int edit_get_soft_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmSevereRestrictionEdit));
} }
int edit_get_hard_size() { int edit_get_hard_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmbSevereRestrictionEdit)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkSevereRestrictionTemp))) {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmbSevereRestrictionTemp));
}
else {
return -3;
}
} }
int edit_get_limit_cpu_size() { int edit_get_limit_cpu_size() {
return -1; return -1;
} }
int edit_get_limit_swap_size() { int edit_get_limit_swap_size() {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmbPaddingFLEdit)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkPaddingFLTemp))) {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cmbPaddingFLTemp));
}
else {
return -3;
}
}
int edit_get_quota_object_size() {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkPaddingFLTemp))) {
return gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cbxTempQuotaObj));
}
else {
return -3;
}
} }
char* edit_get_read_device() { int** edit_get_read_device() {
return philos_get_size_bite(edit_widgets->chbEditRead, edit_widgets->spinEditRead, return &obj_edit_config.i_o_limit_read;
edit_widgets->cbtEditRead); }
} int** edit_get_read_device_size_pow() {
char* edit_get_write_device() { return &obj_edit_config.i_o_limit_read_size;
return philos_get_size_bite(edit_widgets->chbEditWrite, edit_widgets->spinEditWrite, }
edit_widgets->cbtEditWrite); int** edit_get_write_device() {
} return &obj_edit_config.i_o_limit_write;
char* edit_get_soft() { }
return philos_get_size_bite(edit_widgets->chkSoftRestrictionEdit, edit_widgets->spiSevereRestrictionEdit, int** edit_get_write_device_size_pow() {
edit_widgets->cmSevereRestrictionEdit); return &obj_edit_config.i_o_limit_write_size;
} }
char* edit_get_hard() { char*** edit_get_select_write_device() {
return philos_get_size_bite(edit_widgets->chkSevereRestrictionEdit, edit_widgets->spinSevereRestrictionEdit, return &obj_edit_config.disk_write;
edit_widgets->cmbSevereRestrictionEdit); }
} char*** edit_get_select_read_device() {
char* edit_get_limit_cpu() { return &obj_edit_config.disk_read;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkCPULimitEdit))) { }
int size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinCPULimitEdit)); int edit_get_soft() {
return yon_char_from_int(size_bite); return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spiSevereRestrictionTemp));
}
int edit_get_hard() {
return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinSevereRestrictionTemp));
}
int edit_get_limit_cpu() {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkCPULimitTemp))) {
return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinCPULimitTemp));
} }
else { else {
char* str = (char*)malloc(sizeof(char*)*2); return -3;
str[0] = '-';
str[1] = '\0';
return str;
} }
} }
char* edit_get_limit_swap() { int edit_get_limit_swap() {
return philos_get_size_bite(edit_widgets->chkPaddingFLEdit, edit_widgets->spinPaddingFLEdit, return gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinPaddingFLTemp));
edit_widgets->cmbPaddingFLEdit);
} }
// ================================================================= void edit_set_select_read_device(char*** str_value) {
void edit_set_select_device(char* str_value, int pow_mem) { if (str_value) {
puts(str_value); if ((*str_value)) {
} yon_char_parsed_copy(&obj_edit_config.disk_read, str_value);
void edit_set_read_device(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chbEditRead,
edit_widgets->spinEditRead,
edit_widgets->cbtEditRead);
}
void edit_set_write_device(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chbEditWrite,
edit_widgets->spinEditWrite,
edit_widgets->cbtEditWrite);
}
void edit_set_soft(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chkSoftRestrictionEdit,
edit_widgets->spiSevereRestrictionEdit,
edit_widgets->cmSevereRestrictionEdit);
}
void edit_set_hard(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chkSevereRestrictionEdit,
edit_widgets->spinSevereRestrictionEdit,
edit_widgets->cmbSevereRestrictionEdit);
}
void edit_set_limit_cpu(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chkCPULimitEdit,
edit_widgets->spinCPULimitEdit,
edit_widgets->lblCPULimitEdit);
}
void edit_set_limit_swap(char* str_value, int pow_mem) {
edit_temp_set(str_value,pow_mem, edit_widgets->chkPaddingFLEdit,
edit_widgets->spinPaddingFLEdit,
edit_widgets->cmbPaddingFLEdit);
}
void edit_temp_set(char* str_value, int pow_mem, GtkWidget* cheek, GtkWidget* spin, GtkWidget* combo_box_text) {
char* search = "-";
char* mem_size_pow = yon_char_new(str_value);
if (yon_char_find_count(mem_size_pow, search) == 0) {
int value = atoi(yon_char_divide_search(mem_size_pow, " ", -1));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cheek), 1);
if (combo_box_text != NULL) {
// Todo: add code
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box_text), pow_mem);
} }
} }
else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cheek), 0);
}
} }
void edit_generate_cmd() { void edit_set_select_write_device(char*** str_value) {
char* str_cmd = ""; if (str_value) {
char* split_simvol = g_malloc0(sizeof(char)*2); if ((*str_value)) {
int size_bite = 0; yon_char_parsed_copy(&obj_edit_config.disk_write, str_value);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkSoftRestrictionEdit))) { }
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spiSevereRestrictionEdit));
str_cmd = yon_char_unite(str_cmd,
"MemoryHigh=",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(edit_widgets->cmSevereRestrictionEdit), NULL);
split_simvol[0] = ',';
split_simvol[1] = '\0';
} }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkSevereRestrictionEdit))) { }
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinSevereRestrictionEdit)); int set_template_gui_device(int flag_check_array) {
str_cmd = yon_char_unite(str_cmd, split_simvol, int index = -1;
"MemoryMax=", if (flag_check_array==0) {
yon_char_from_int(size_bite), index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, obj_edit_config.disk_read[0]);
philos_str_size_pow_byte(edit_widgets->cmbSevereRestrictionEdit), NULL); gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
split_simvol[0] = ','; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempRead), 1);
split_simvol[1] = '\0'; edit_temp_set(obj_edit_config.i_o_limit_read[0],
obj_edit_config.i_o_limit_read_size[0], edit_widgets->chbTempRead,
edit_widgets->spinTempRead,
edit_widgets->cbtTempRead);
} }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkPaddingFLEdit))) { else if (flag_check_array==1) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinPaddingFLEdit)); index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, obj_edit_config.disk_write[0]);
str_cmd = yon_char_unite(str_cmd, split_simvol, gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
"MemorySwapMax=", gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
yon_char_from_int(size_bite), edit_temp_set(obj_edit_config.i_o_limit_write[0],
philos_str_size_pow_byte(edit_widgets->cmbPaddingFLEdit), NULL); obj_edit_config.i_o_limit_write_size[0],
split_simvol[0] = ','; edit_widgets->chbTempWrite,
split_simvol[1] = '\0'; edit_widgets->spinTempWrite,
edit_widgets->cbtTempWrite);
} }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chkCPULimitEdit))) { return index;
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinCPULimitEdit)); }
str_cmd = yon_char_unite(str_cmd, split_simvol, void set_gui_device() {
"CPUQuota=", int flag = -1;
yon_char_from_int(size_bite), if (obj_edit_config.disk_read) {
"\%", NULL); if (obj_edit_config.disk_read[0] != NULL && strstr(obj_edit_config.disk_read[0], "-") == NULL) {
split_simvol[0] = ','; flag = set_template_gui_device(0);
split_simvol[1] = '\0'; }
} }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chbEditRead))) { if (obj_edit_config.disk_write) {
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cbtEditDevice)); if (obj_edit_config.disk_write[0] != NULL && strstr(obj_edit_config.disk_write[0], "-") == NULL) {
if (menu_id != -1) { flag = set_template_gui_device(1);
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinEditRead));
str_cmd = yon_char_unite(str_cmd, split_simvol,
"IOReadBandwidthMax=\"",
get_device_cfg()->name_disk[menu_id],
" ",
yon_char_from_int(size_bite),
philos_str_size_pow_byte(edit_widgets->cbtEditRead),"\"", NULL);
} }
split_simvol[0] = ',';
split_simvol[1] = '\0';
} }
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(edit_widgets->chbEditWrite))) { }
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(edit_widgets->cbtEditDevice)); void edit_set_read_device(int* str_value, int* pow_mem) {
if (menu_id != -1) { if (str_value && pow_mem) {
size_bite = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(edit_widgets->spinEditWrite)); philos_array_int_copy(&obj_edit_config.i_o_limit_read, &str_value);
str_cmd = yon_char_unite(str_cmd, split_simvol, philos_array_int_copy(&obj_edit_config.i_o_limit_read_size, &pow_mem);
"IOWriteBandwidthMax=\"", }
get_device_cfg()->name_disk[menu_id], }
" ", void edit_set_write_device(int* str_value, int* pow_mem) {
yon_char_from_int(size_bite), if (str_value && pow_mem) {
philos_str_size_pow_byte(edit_widgets->cbtEditWrite),"\"", NULL); philos_array_int_copy(&obj_edit_config.i_o_limit_write, &str_value);
philos_array_int_copy(&obj_edit_config.i_o_limit_write_size, &pow_mem);
}
}
void edit_set_size_arrays(size_t size_array) {
obj_edit_config.size_disk = size_array;
}
void edit_set_soft(int value, int pow_mem) {
edit_temp_set(value,pow_mem, edit_widgets->chkSoftRestrictionTemp,
edit_widgets->spiSevereRestrictionTemp,
edit_widgets->cmSevereRestrictionTemp);
}
void edit_set_hard(int value, int pow_mem) {
edit_temp_set(value,pow_mem, edit_widgets->chkSevereRestrictionTemp,
edit_widgets->spinSevereRestrictionTemp,
edit_widgets->cmbSevereRestrictionTemp);
}
void edit_set_limit_cpu(int value, int pow_mem) {
edit_temp_set(value,pow_mem, edit_widgets->chkCPULimitTemp,
edit_widgets->spinCPULimitTemp,
NULL);
}
void edit_set_limit_swap(int value, int pow_mem) {
edit_temp_set(value,pow_mem, edit_widgets->chkPaddingFLTemp,
edit_widgets->spinPaddingFLTemp,
edit_widgets->cmbPaddingFLTemp);
}
void edit_temp_set(int value, int pow_mem, GtkWidget* cheek, GtkWidget* spin, GtkWidget* combo_box_text) {
if (pow_mem>=-1 && value>=0) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cheek), 1);
if (combo_box_text) {
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box_text), pow_mem);
} }
} }
gtk_entry_set_text(GTK_ENTRY(edit_widgets->entryEditCmd), str_cmd); else {
free(split_simvol); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cheek), 0);
}
} }

@ -12,72 +12,53 @@
#include <getopt.h> #include <getopt.h>
#include <libintl.h> #include <libintl.h>
#include "my_device.h" #include "my_device.h"
#include "philos_utils.h"
// Переменные #define CMD_CPU "lscpu | grep \"CPU(s):\" |grep -oE \"[0-9]{1,}\""
typedef struct { #define CMD_SWAP "grep '^Swap' /proc/meminfo | grep \"SwapTotal\" |grep -oE \"[0-9]{1,}\""
GtkWidget* Window; #define CMD_RAW "cat /proc/meminfo | grep \"MemTotal\" |grep -oE \"[0-9]{1,}\""
GtkWidget* btnSaveEditSave;
GtkWidget* btnEditCancel;
GtkWidget* entryEditCmd;
GtkWidget* chbEditRead;
GtkWidget* spinEditRead;
GtkWidget* cbtEditRead;
GtkWidget* chbEditWrite;
GtkWidget* spinEditWrite;
GtkWidget* cbtEditWrite;
GtkWidget* chkSoftRestrictionEdit;
GtkWidget* spiSevereRestrictionEdit;
GtkWidget* cmSevereRestrictionEdit;
GtkWidget* chkSevereRestrictionEdit;
GtkWidget* spinSevereRestrictionEdit;
GtkWidget* cmbSevereRestrictionEdit;
GtkWidget* chkPaddingFLEdit;
GtkWidget* spinPaddingFLEdit;
GtkWidget* cmbPaddingFLEdit;
GtkWidget* chkCPULimitEdit;
GtkWidget* spinCPULimitEdit;
GtkWidget* lblCPULimitEdit;
GtkWidget* cbtEditDevice;
} edit_window;
// Функции // Функции
edit_window *edit_setup_window(char* glade_path); temp_set_window *edit_setup_window(char* glade_path);
void edit_event(edit_window *widgets); void edit_event(temp_set_window *widgets);
void edit_localization(edit_window *widgets); void edit_localization(temp_set_window *widgets);
void edit_on_hide_subwindow(GtkWidget *self); void edit_on_hide_subwindow(GtkWidget *self);
edit_window *get_widget_edit(); temp_set_window *get_widget_edit();
void combo_box_device_edit();
void edit_show(GtkWidget *self, char* glade_path); void edit_show(GtkWidget *self, char* glade_path);
void edit_destroy(GtkWidget *self); void edit_destroy(GtkWidget *self);
void edit_init_windows(); void edit_init_windows();
void edit_set_active_widgets(GtkWidget *self, GtkWidget *entry, GtkWidget *label); void wrapper_edit_init_windows_size_memory();
char* edit_get_select_device(); void edit_set_active_widgets(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, int flag_cpu, char* cmd);
char* edit_get_read_device(); char*** edit_get_select_read_device();
char* edit_get_write_device(); char*** edit_get_select_write_device();
char* edit_get_soft(); int** edit_get_read_device();
char* edit_get_hard(); int** edit_get_write_device();
char* edit_get_limit_cpu(); int edit_get_soft();
char* edit_get_limit_swap(); int edit_get_hard();
void edit_generate_cmd(); int edit_get_limit_cpu();
int edit_get_limit_swap();
void wrapper_edit_show(); void wrapper_edit_show();
void edit_set_select_device(char* str_value, int pow_mem); void edit_set_select_write_device(char*** str_value);
void edit_set_read_device(char* str_value, int pow_mem); void edit_set_select_read_device(char*** str_value);
void edit_set_write_device(char* str_value, int pow_mem); void edit_set_read_device(int* str_value, int* pow_mem);
void edit_set_soft(char* str_value, int pow_mem); void edit_set_write_device(int* str_value, int* pow_mem);
void edit_set_hard(char* str_value, int pow_mem); void edit_set_soft(int value, int pow_mem);
void edit_set_limit_cpu(char* str_value, int pow_mem); void edit_set_hard(int value, int pow_mem);
void edit_set_limit_swap(char* str_value, int pow_mem); void edit_set_limit_cpu(int value, int pow_mem);
void edit_temp_set(char* str_value, int pow_mem, GtkWidget* cheek, GtkWidget* spin, GtkWidget* combo_box_text); void edit_set_limit_swap(int value, int pow_mem);
void edit_temp_set(int value, int pow_mem, GtkWidget* cheek, GtkWidget* spin, GtkWidget* combo_box_text);
int** edit_get_read_device_size_pow();
int** edit_get_write_device_size_pow();
int edit_get_read_device_size(); void edit_set_size_arrays(size_t size_array);
int edit_get_write_device_size();
int edit_get_soft_size(); int edit_get_soft_size();
int edit_get_hard_size(); int edit_get_hard_size();
int edit_get_limit_cpu_size(); int edit_get_limit_cpu_size();
int edit_get_limit_swap_size(); int edit_get_limit_swap_size();
void edit_config_init();
void set_gui_device();
temp_config* get_edit_config();
void edit_set_active_widgets_device_io(GtkWidget *check, GtkWidget *spin, GtkWidget *combo);
void edit_set_spin_adjustment(GtkWidget *check, GtkWidget *spin, GtkWidget *combo, size_t value);
#endif #endif

@ -51,68 +51,93 @@
} }
.menu:hover >* { .menu:hover >* {
border-color:alpha(@theme_text_color, 0.01); border-color:alpha(@theme_text_color, 0.01);
} }.menuitembottom{
.menuitembottom{ margin-top:0px;
margin-top:0px; margin-bottom:3px;
margin-bottom:3px; border-color:inherit;
} border-left-width:inherit;
.menuitemmiddle{ border-right-width:inherit;
margin-top:0px; }
margin-bottom:0px; .menuitemmiddle{
} margin-top:0px;
margin-bottom:0px;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemtop{ .menuitemtop{
margin-bottom:0px; margin-bottom:0px;
} border-color:inherit;
.menuitemtop *{ border-top-width:inherit;
margin:2px 2px 0 2px; border-left-width:inherit;
padding: 5px 10px 3px 5px; border-right-width:inherit;
} }
.menuitemmiddle *{ .menuitemtop *{
margin:0 2px 0 2px; margin:2px 2px 0 2px;
padding: 3px 10px 3px 5px; padding-top:2px;
} padding-bottom:2px;
.menuitembottom *{ /* padding: 5px 0px 3px 5px; */
margin:0 2px 2px 2px; border:transparent;
padding: 3px 10px 5px 5px; }
} .menuitemmiddle *{
.menuitemtop:hover { margin:0 2px 0 2px;
background:@theme_bg_color; padding-top:2px;
border-color:inherit; padding-bottom:2px;
border-left-width:inherit; /* padding: 3px 0px 3px 5px; */
border-right-width:inherit; border:transparent;
} }
.menuitemmiddle:hover { .menuitembottom *{
background:@theme_bg_color; margin:0 2px 2px 2px;
border-color:inherit; padding-top:2px;
border-left-width:inherit; padding-bottom:2px;
border-right-width:inherit; /* padding: 3px 0px 5px 5px; */
} }
.menuitembottom:hover { .menuitemtop:hover {
background:@theme_bg_color; background:@theme_bg_color;
border-color:inherit; border-color:inherit;
border-left-width:inherit; border-top-width:inherit;
border-right-width:inherit; border-left-width:inherit;
border-right-width:inherit;
}
.menuitemmiddle:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitembottom:hover {
background:@theme_bg_color;
border-color:inherit;
border-bottom-width:0px;
border-left-width:inherit;
border-right-width:inherit;
} }
.menuitemtop:hover* { .menuitemtop:hover* {
margin:2px 2px 0 2px; margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px; padding-top:2px;
background:@theme_selected_bg_color; padding-bottom:2px;
border-radius:2px; /* padding: 5px 0 3px 5px; */
} background:@theme_selected_bg_color;
.menuitemmiddle:hover* { border-radius:2px;
margin:0 2px 0 2px; }
padding: 3px 10px 3px 5px; .menuitemmiddle:hover* {
background:@theme_selected_bg_color; margin:0 2px 0px 2px;
border-radius:2px; padding-top:2px;
} padding-bottom:2px;
.menuitembottom:hover* { /* padding: 3px 0px 3px 5px; */
margin:0 2px 2px 2px; background:@theme_selected_bg_color;
padding: 3px 10px 5px 5px; border-radius:2px;
background:@theme_selected_bg_color; }
border-radius:2px; .menuitembottom:hover* {
} margin:0 2px 2px 2px;
padding-top:2px;
padding-bottom:2px;
/* padding: 3px 0px 5px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.workingbg, #workingbg { .workingbg, #workingbg {
background-color:@theme_base_color; background-color:@theme_base_color;

@ -7,7 +7,7 @@ GenericName[ru]=Квоты процессора и ОЗУ
Comment=Configuring CPU and RAM quota settings for groups and users of the system Comment=Configuring CPU and RAM quota settings for groups and users of the system
Comment[ru]=Настройка параметров квот процессорного времени и ОЗУ для групп и пользователей системы Comment[ru]=Настройка параметров квот процессорного времени и ОЗУ для групп и пользователей системы
Type=Application Type=Application
Exec=ubl-settings-resourcequota Exec=pkexec ubl-settings-resourcequota
Icon=com.ublinux.ubl-settings-resourcequota Icon=com.ublinux.ubl-settings-resourcequota
Terminal=false Terminal=false
X-XfcePluggable=true X-XfcePluggable=true

@ -72,6 +72,7 @@
<object class="GtkBox" id="HeaderBox"> <object class="GtkBox" id="HeaderBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">center</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="width-request">90</property> <property name="width-request">90</property>
@ -83,7 +84,7 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
<property name="pixel-size">69</property> <property name="pixel-size">64</property>
<property name="icon-name">com.ublinux.ubl-settings-resourcequota</property> <property name="icon-name">com.ublinux.ubl-settings-resourcequota</property>
</object> </object>
<packing> <packing>
@ -133,6 +134,8 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="margin-right">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Configuring CPU and RAM quota settings for groups and users of the system</property> <property name="label" translatable="yes">Configuring CPU and RAM quota settings for groups and users of the system</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
@ -172,49 +175,32 @@
</packing> </packing>
</child> </child>
</object> </object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="a1">
<property name="lower">1</property>
<property name="upper">1000</property>
<property name="value">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property> <property name="upper">100</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment3"> <object class="GtkAdjustment" id="a2">
<property name="upper">100</property> <property name="upper">100</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment4"> <object class="GtkAdjustment" id="a3">
<property name="upper">1023</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment5">
<property name="upper">100</property> <property name="upper">100</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment6"> <object class="GtkAdjustment" id="a4">
<property name="upper">1023</property> <property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment7">
<property name="upper">1023</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment8"> <object class="GtkAdjustment" id="a5">
<property name="upper">100</property> <property name="upper">100</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkAdjustment" id="adjustment9"> <object class="GtkAdjustment" id="a6">
<property name="upper">100</property> <property name="upper">100</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
@ -223,6 +209,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="icon-name">com.ublinux.ubl-settings-resourcequota</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -271,7 +258,6 @@
<property name="active-id">0</property> <property name="active-id">0</property>
<items> <items>
<item translatable="yes">User</item> <item translatable="yes">User</item>
<item translatable="yes">Group</item>
<item translatable="yes">Process</item> <item translatable="yes">Process</item>
<item translatable="yes">Slice</item> <item translatable="yes">Slice</item>
</items> </items>
@ -307,7 +293,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox"> <object class="GtkBox" id="boxBlockGui">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
@ -327,7 +313,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -372,9 +358,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -392,7 +375,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment4</property> <property name="width-chars">7</property>
<property name="adjustment">a1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -479,9 +463,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -499,7 +480,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment6</property> <property name="width-chars">7</property>
<property name="adjustment">a2</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -590,7 +572,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -607,9 +589,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -627,7 +606,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment7</property> <property name="width-chars">7</property>
<property name="adjustment">a3</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -679,7 +659,7 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
@ -700,7 +680,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox" id="lblCPULimit"> <object class="GtkBox" id="lblCPULimit">
<property name="visible">True</property> <property name="visible">True</property>
@ -717,9 +697,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -737,7 +714,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment5</property> <property name="width-chars">7</property>
<property name="adjustment">a4</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -810,7 +788,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -904,12 +882,9 @@
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">4</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -927,7 +902,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment8</property> <property name="width-chars">7</property>
<property name="adjustment">a5</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1014,9 +990,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1034,7 +1007,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment9</property> <property name="width-chars">7</property>
<property name="adjustment">a6</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1128,7 +1102,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkEntry" id="entryAddCmd"> <object class="GtkEntry" id="entryAddCmd">
<property name="visible">True</property> <property name="visible">True</property>
@ -1325,6 +1299,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="icon-name">com.ublinux.ubl-settings-resourcequota</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1420,7 +1395,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1465,9 +1440,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1485,7 +1457,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment4</property> <property name="width-chars">7</property>
<property name="adjustment">a1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1572,9 +1545,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1592,7 +1562,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment6</property> <property name="width-chars">7</property>
<property name="adjustment">a2</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1683,7 +1654,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1700,9 +1671,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1720,7 +1688,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment7</property> <property name="width-chars">7</property>
<property name="adjustment">a3</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1772,7 +1741,7 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
@ -1793,7 +1762,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1810,9 +1779,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1830,7 +1796,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment5</property> <property name="width-chars">7</property>
<property name="adjustment">a4</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1903,7 +1870,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -1935,6 +1902,7 @@
<child> <child>
<object class="GtkComboBoxText" id="cbtEditDevice"> <object class="GtkComboBoxText" id="cbtEditDevice">
<property name="visible">True</property> <property name="visible">True</property>
<property name="app-paintable">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">5</property> <property name="margin-left">5</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
@ -1997,12 +1965,9 @@
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">4</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2020,7 +1985,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment9</property> <property name="width-chars">7</property>
<property name="adjustment">a5</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2107,9 +2073,6 @@
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2127,7 +2090,8 @@
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment8</property> <property name="width-chars">7</property>
<property name="adjustment">a6</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2221,7 +2185,7 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="left-padding">12</property> <property name="left-padding">5</property>
<child> <child>
<object class="GtkEntry" id="entryEditCmd"> <object class="GtkEntry" id="entryEditCmd">
<property name="visible">True</property> <property name="visible">True</property>
@ -2414,44 +2378,37 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkImage" id="image1"> <object class="GtkAdjustment" id="adjustDisp">
<property name="visible">True</property> <property name="lower">1</property>
<property name="can-focus">False</property> <property name="upper">10000</property>
<property name="icon-name">dialog-information-symbolic</property> <property name="value">1</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object> </object>
<object class="GtkImage" id="image2"> <object class="GtkAdjustment" id="adjustment1">
<property name="visible">True</property> <property name="upper">100</property>
<property name="can-focus">False</property> <property name="step-increment">1</property>
<property name="icon-name">dialog-question-symbolic</property> <property name="page-increment">10</property>
</object> </object>
<object class="GtkMenu" id="menuAbout"> <object class="GtkAdjustment" id="adjustment2">
<property name="visible">True</property> <property name="upper">100</property>
<property name="can-focus">False</property> <property name="step-increment">1</property>
<property name="reserve-toggle-size">False</property> <property name="page-increment">10</property>
<child> </object>
<object class="GtkImageMenuItem" id="DocumentationMenuItem"> <object class="GtkAdjustment" id="adjustment3">
<property name="label" translatable="yes">imagemenuitem</property> <property name="upper">100</property>
<property name="visible">True</property> <property name="step-increment">1</property>
<property name="can-focus">False</property> <property name="page-increment">10</property>
<property name="image">image2</property> </object>
<property name="use-stock">False</property> <object class="GtkAdjustment" id="adjustment4">
<style> <property name="upper">100</property>
<class name="menuitemtop"/> <property name="step-increment">1</property>
</style> <property name="page-increment">10</property>
</object> </object>
</child> <object class="GtkAdjustment" id="adjustment5">
<child> <property name="upper">100</property>
<object class="GtkImageMenuItem" id="AboutMenuItem"> <property name="step-increment">1</property>
<property name="label" translatable="yes">imagemenuitem</property> <property name="page-increment">10</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="image">image1</property>
<property name="use-stock">False</property>
<style>
<class name="menuitembottom"/>
</style>
</object>
</child>
</object> </object>
<object class="GtkImage" id="image8"> <object class="GtkImage" id="image8">
<property name="visible">True</property> <property name="visible">True</property>
@ -2676,6 +2633,12 @@ translated and supported by community.</property>
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkMenu" id="menuAbout">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="take-focus">False</property>
<property name="reserve-toggle-size">False</property>
</object>
<object class="GtkMenu" id="menuLoad"> <object class="GtkMenu" id="menuLoad">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
@ -2725,7 +2688,6 @@ translated and supported by community.</property>
<object class="GtkMenuItem" id="SaveLocalConfigurationMenuItem"> <object class="GtkMenuItem" id="SaveLocalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="use-underline">True</property>
<style> <style>
<class name="menuitembottom"/> <class name="menuitembottom"/>
</style> </style>
@ -2736,6 +2698,7 @@ translated and supported by community.</property>
<property name="width-request">640</property> <property name="width-request">640</property>
<property name="height-request">500</property> <property name="height-request">500</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="window-position">center</property>
<property name="default-width">700</property> <property name="default-width">700</property>
<property name="default-height">500</property> <property name="default-height">500</property>
<property name="icon-name">com.ublinux.ubl-settings-resourcequota</property> <property name="icon-name">com.ublinux.ubl-settings-resourcequota</property>
@ -2783,6 +2746,8 @@ translated and supported by community.</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
<attribute name="foreground" value="#4d4d4d4d4d4d"/> <attribute name="foreground" value="#4d4d4d4d4d4d"/>
@ -2883,6 +2848,7 @@ translated and supported by community.</property>
<object class="GtkTreeView" id="treeViewMain"> <object class="GtkTreeView" id="treeViewMain">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="vadjustment">adjustment5</property>
<property name="model">liststore</property> <property name="model">liststore</property>
<property name="search-column">0</property> <property name="search-column">0</property>
<child internal-child="selection"> <child internal-child="selection">
@ -2890,10 +2856,14 @@ translated and supported by community.</property>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc0"> <object class="GtkTreeViewColumn" id="tvc0">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Type quota</property> <property name="title" translatable="yes">Type quota</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">0</attribute> <attribute name="text">0</attribute>
</attributes> </attributes>
@ -2902,11 +2872,15 @@ translated and supported by community.</property>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc1"> <object class="GtkTreeViewColumn" id="tvc1">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Quota <property name="title" translatable="yes">Quota
object</property> object</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">1</attribute> <attribute name="text">1</attribute>
</attributes> </attributes>
@ -2915,11 +2889,15 @@ object</property>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc2"> <object class="GtkTreeViewColumn" id="tvc2">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Soft RAM limit, <property name="title" translatable="yes">Soft RAM limit,
(volume)</property> (volume)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">2</attribute> <attribute name="text">2</attribute>
</attributes> </attributes>
@ -2928,11 +2906,15 @@ object</property>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc3"> <object class="GtkTreeViewColumn" id="tvc3">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Hard RAM limit, <property name="title" translatable="yes">Hard RAM limit,
(volume)</property> (volume)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">3</attribute> <attribute name="text">3</attribute>
</attributes> </attributes>
@ -2941,12 +2923,16 @@ object</property>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc4"> <object class="GtkTreeViewColumn" id="tvc4">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">Swap file <property name="title" translatable="yes">Swap file
limit limit
(volume)</property> (volume)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">4</attribute> <attribute name="text">4</attribute>
</attributes> </attributes>
@ -2955,11 +2941,15 @@ limit
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc5"> <object class="GtkTreeViewColumn" id="tvc5">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">CPU limit <property name="title" translatable="yes">CPU limit
(%)</property> (%)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
</object>
<attributes> <attributes>
<attribute name="text">5</attribute> <attribute name="text">5</attribute>
</attributes> </attributes>
@ -2968,12 +2958,17 @@ limit
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc6"> <object class="GtkTreeViewColumn" id="tvc6">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">I/O <property name="title" translatable="yes">I/O
limit limit
(read)</property> (read)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">100</property>
</object>
<attributes> <attributes>
<attribute name="text">6</attribute> <attribute name="text">6</attribute>
</attributes> </attributes>
@ -2982,12 +2977,17 @@ limit
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvc7"> <object class="GtkTreeViewColumn" id="tvc7">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="title" translatable="yes">I/O <property name="title" translatable="yes">I/O
limit limit
(write)</property> (write)</property>
<property name="expand">True</property> <property name="expand">True</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">100</property>
</object>
<attributes> <attributes>
<attribute name="text">7</attribute> <attribute name="text">7</attribute>
</attributes> </attributes>
@ -3332,7 +3332,9 @@ limit
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="adjustment">adjustment1</property> <property name="width-chars">6</property>
<property name="text" translatable="yes">1</property>
<property name="adjustment">adjustDisp</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -3370,10 +3372,38 @@ limit
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<child> <child>
<object class="GtkImage"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">reload</property> <property name="halign">center</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">emblem-synchronizing-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Update</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
@ -3400,7 +3430,7 @@ limit
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="hscroll-policy">natural</property> <property name="hscroll-policy">natural</property>
<property name="vadjustment">adjustment3</property> <property name="vadjustment">adjustment1</property>
<property name="vscroll-policy">natural</property> <property name="vscroll-policy">natural</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="scroll-on-keystroke">True</property> <property name="scroll-on-keystroke">True</property>
@ -3413,11 +3443,11 @@ limit
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkScrollbar"> <object class="GtkScrollbar" id="scrollDispatcher">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment3</property> <property name="adjustment">adjustment1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -3604,7 +3634,6 @@ limit
<property name="active-id">0</property> <property name="active-id">0</property>
<items> <items>
<item translatable="yes">User</item> <item translatable="yes">User</item>
<item translatable="yes">Group</item>
<item translatable="yes">Process</item> <item translatable="yes">Process</item>
<item translatable="yes">Slice</item> <item translatable="yes">Slice</item>
</items> </items>
@ -3697,6 +3726,12 @@ limit
<property name="tab-fill">False</property> <property name="tab-fill">False</property>
</packing> </packing>
</child> </child>
<child type="action-start">
<placeholder/>
</child>
<child type="action-end">
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -3766,7 +3801,7 @@ limit
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuButton" id="btnSaveCfg"> <object class="GtkMenuButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="focus-on-click">False</property> <property name="focus-on-click">False</property>
@ -3909,6 +3944,7 @@ limit
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="icon-name">com.ublinux.ubl-settings-resourcequota</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -3932,7 +3968,7 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -3947,7 +3983,7 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -3962,7 +3998,22 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">4</property> <property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chbHardLimit">
<property name="label" translatable="yes">Hard RAM limit, (volume)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="halign">start</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -3975,12 +4026,44 @@ limit
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<object class="GtkButton" id="btnFiltersCancel"> <object class="GtkButton" id="btnFiltersCancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="use-stock">True</property> <child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="stock">gtk-stop</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Cancel</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -3990,12 +4073,44 @@ limit
</child> </child>
<child> <child>
<object class="GtkButton" id="btnFiltersSave"> <object class="GtkButton" id="btnFiltersSave">
<property name="label">gtk-save</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="use-stock">True</property> <child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="stock">gtk-save</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="label" translatable="yes">Save</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -4011,21 +4126,6 @@ limit
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="chbHardLimit">
<property name="label" translatable="yes">Hard RAM limit, (volume)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="halign">start</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child> <child>
<object class="GtkCheckButton" id="chbSwapFileLimit"> <object class="GtkCheckButton" id="chbSwapFileLimit">
<property name="label" translatable="yes">Swap file limit (volume)</property> <property name="label" translatable="yes">Swap file limit (volume)</property>
@ -4038,7 +4138,7 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">7</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -4053,12 +4153,12 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">8</property> <property name="position">6</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="chbIOLimitWrite"> <object class="GtkCheckButton" id="chbIOLimitRead">
<property name="label" translatable="yes">I/O limit (write)</property> <property name="label" translatable="yes">I/O limit (read)</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
@ -4068,12 +4168,12 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">8</property> <property name="position">7</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="chbIOLimitRead"> <object class="GtkCheckButton" id="chbIOLimitWrite">
<property name="label" translatable="yes">I/O limit (read)</property> <property name="label" translatable="yes">I/O limit (write)</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
@ -4083,7 +4183,7 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">9</property> <property name="position">8</property>
</packing> </packing>
</child> </child>
</object> </object>

@ -17,6 +17,20 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
msgid "Update"
msgstr ""
msgid ""
"Warning! Application was launched without root - root-dependent actions are "
"locked"
msgstr ""
msgid "Config loading failed"
msgstr ""
msgid "Remove"
msgstr ""
msgid "User" msgid "User"
msgstr "" msgstr ""

@ -20,6 +20,20 @@ msgstr ""
#: source/ubl-strings.h:8 #: source/ubl-strings.h:8
#: source/ubl-strings.h:1 #: source/ubl-strings.h:1
msgid "Update"
msgstr "Обновить"
msgid "Open documentation"
msgstr "Прочитать справку"
msgid "Config loading failed"
msgstr "Не удалось загрузить конфигурацию"
msgid ""
"Warning! Application was launched without root - root-dependent actions are "
"locked"
msgstr "Внимание! Приложение было запущено без прав суперпользователя - действия, требующие их наличия заблокированы"
msgid "Quota deleted" msgid "Quota deleted"
msgstr "Квота удалена" msgstr "Квота удалена"
@ -129,7 +143,7 @@ msgid "Type quota"
msgstr "Тип квоты" msgstr "Тип квоты"
msgid "Quota volume" msgid "Quota volume"
msgstr "Объем квотирования" msgstr "Объект квотирования"
msgid "Soft RAM limit, (volume)" msgid "Soft RAM limit, (volume)"
msgstr "Мягкий лимит ОЗУ, (объём)" msgstr "Мягкий лимит ОЗУ, (объём)"
@ -138,7 +152,7 @@ msgid "Hard RAM limit, (volume)"
msgstr "Жёсткий лимит ОЗУ, (объём)" msgstr "Жёсткий лимит ОЗУ, (объём)"
msgid "Swap file limit (volume)" msgid "Swap file limit (volume)"
msgstr "Лимит файлов подкачки (объём)" msgstr "Лимит файла подкачки (объём)"
msgid "CPU limit (%)" msgid "CPU limit (%)"
msgstr "Лимит ЦПУ (%)" msgstr "Лимит ЦПУ (%)"
@ -250,6 +264,9 @@ msgstr "Сохранить глобальную конфигурацию"
msgid "Global configuration write error" msgid "Global configuration write error"
msgstr "Сохранить глобальную конфигурацию" msgstr "Сохранить глобальную конфигурацию"
msgid "Remove"
msgstr "Удалить"
msgid "Nothing to save!" msgid "Nothing to save!"
msgstr "Нечего сохранять!" msgstr "Нечего сохранять!"

Loading…
Cancel
Save