|
|
@ -15,11 +15,9 @@
|
|
|
|
#include "view_edit.h"
|
|
|
|
#include "view_edit.h"
|
|
|
|
#include "my_device.h"
|
|
|
|
#include "my_device.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 WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-resourcequota"
|
|
|
|
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-resourcequota"
|
|
|
@ -30,19 +28,21 @@
|
|
|
|
#define banner_path "/usr/share/ubl-settings-resourcequota/images/ubl-settings-resourcequota-banner.png"
|
|
|
|
#define banner_path "/usr/share/ubl-settings-resourcequota/images/ubl-settings-resourcequota-banner.png"
|
|
|
|
#define CssPath "/usr/share/ubl-settings-resourcequota/css/ubl-settings-resourcequota.css"
|
|
|
|
#define CssPath "/usr/share/ubl-settings-resourcequota/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_GLOBAL "ubconfig --default --source global get security"
|
|
|
|
#define CMD_LOAD_SYSTEM "ubconfig --default --source system get security"
|
|
|
|
#define CMD_LOAD_SYSTEM "ubconfig --default --source system get security"
|
|
|
|
#define CMD_SAVE_GLOBAL "ubconfig --default --source global set security"
|
|
|
|
#define CMD_SAVE_GLOBAL "ubconfig --default --source global set security"
|
|
|
|
#define CMD_SAVE_SYSTEM "ubconfig --default --source system set security"
|
|
|
|
#define CMD_SAVE_SYSTEM "ubconfig --default --source system set security"
|
|
|
|
#define CMD_GET_SLICE_SERVICE "systemd-cgls --no-page"
|
|
|
|
#define CMD_GET_SLICE_SERVICE "systemd-cgls --no-page"
|
|
|
|
typedef char* string;
|
|
|
|
#define CMD_GET_GROUP "cut -d: -f1 /etc/group"
|
|
|
|
|
|
|
|
typedef char *string;
|
|
|
|
string version_application = "";
|
|
|
|
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;
|
|
|
@ -52,7 +52,7 @@ typedef struct {
|
|
|
|
int socket_id;
|
|
|
|
int socket_id;
|
|
|
|
int load_socket_id;
|
|
|
|
int load_socket_id;
|
|
|
|
int save_socket_id;
|
|
|
|
int save_socket_id;
|
|
|
|
|
|
|
|
|
|
|
|
int lock_help;
|
|
|
|
int lock_help;
|
|
|
|
int lock_save_local;
|
|
|
|
int lock_save_local;
|
|
|
|
int lock_save_global;
|
|
|
|
int lock_save_global;
|
|
|
@ -77,21 +77,22 @@ typedef struct {
|
|
|
|
config_str i_o_limit_write;
|
|
|
|
config_str i_o_limit_write;
|
|
|
|
config_str disk;
|
|
|
|
config_str disk;
|
|
|
|
|
|
|
|
|
|
|
|
int* type_quota_size;
|
|
|
|
int *type_quota_size;
|
|
|
|
int* quota_volume_size;
|
|
|
|
int *quota_volume_size;
|
|
|
|
int* soft_raw_limit_size;
|
|
|
|
int *soft_raw_limit_size;
|
|
|
|
int* hard_raw_limit_size;
|
|
|
|
int *hard_raw_limit_size;
|
|
|
|
int* swap_size;
|
|
|
|
int *swap_size;
|
|
|
|
int* cpu_limit_size;
|
|
|
|
int *cpu_limit_size;
|
|
|
|
int* i_o_limit_read_size;
|
|
|
|
int *i_o_limit_read_size;
|
|
|
|
int* i_o_limit_write_size;
|
|
|
|
int *i_o_limit_write_size;
|
|
|
|
int size_tree_view;
|
|
|
|
int size_tree_view;
|
|
|
|
dictionary* load_global_cfg;
|
|
|
|
dictionary *load_global_cfg;
|
|
|
|
dictionary* load_system_cfg;
|
|
|
|
dictionary *load_system_cfg;
|
|
|
|
dictionary* save_cfg_gui;
|
|
|
|
dictionary *save_cfg_gui;
|
|
|
|
} config;
|
|
|
|
} config;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
typedef struct
|
|
|
|
|
|
|
|
{
|
|
|
|
GtkWidget *Window;
|
|
|
|
GtkWidget *Window;
|
|
|
|
|
|
|
|
|
|
|
|
GtkTreeViewColumn *tvc0;
|
|
|
|
GtkTreeViewColumn *tvc0;
|
|
|
@ -148,8 +149,8 @@ typedef struct {
|
|
|
|
GtkWidget *AboutMenuItem;
|
|
|
|
GtkWidget *AboutMenuItem;
|
|
|
|
} main_window;
|
|
|
|
} main_window;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
typedef struct {
|
|
|
|
{
|
|
|
|
GtkWidget *Window;
|
|
|
|
GtkWidget *Window;
|
|
|
|
|
|
|
|
|
|
|
|
GtkWidget *HatText;
|
|
|
|
GtkWidget *HatText;
|
|
|
@ -159,7 +160,7 @@ typedef struct {
|
|
|
|
|
|
|
|
|
|
|
|
GtkWidget *CloseButton;
|
|
|
|
GtkWidget *CloseButton;
|
|
|
|
GtkWidget *AcceptButton;
|
|
|
|
GtkWidget *AcceptButton;
|
|
|
|
|
|
|
|
|
|
|
|
} documentation_confirmation_window;
|
|
|
|
} documentation_confirmation_window;
|
|
|
|
|
|
|
|
|
|
|
|
main_window *setup_window();
|
|
|
|
main_window *setup_window();
|
|
|
@ -185,16 +186,15 @@ 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, dictionary* load_cfg);
|
|
|
|
void template_cfg(char *cmd, dictionary *load_cfg);
|
|
|
|
void str_split_value(char* values, int index);
|
|
|
|
void str_split_value(char *values, int index);
|
|
|
|
void set_pow_size(char* str_find, int** array_size, char*** array_data, int index);
|
|
|
|
void set_pow_size(char *str_find, int **array_size, char ***array_data, int index);
|
|
|
|
void str_split_key(char* source_value, int index);
|
|
|
|
void str_split_key(char *source_value, int index);
|
|
|
|
void fill_tree_view(int start, int size, int flag_gui_add);
|
|
|
|
void fill_tree_view(int start, int size, int flag_gui_add);
|
|
|
|
void clear_array();
|
|
|
|
void clear_array();
|
|
|
|
void init_cfg_array(int index);
|
|
|
|
void init_cfg_array(int index);
|
|
|
|
void wrapper_template_save(char* check_flag);
|
|
|
|
void wrapper_template_save(char *check_flag);
|
|
|
|
void wrapper_system_save();
|
|
|
|
void wrapper_system_save();
|
|
|
|
void wrapper_global_save();
|
|
|
|
void wrapper_global_save();
|
|
|
|
void wrapper_all_save();
|
|
|
|
void wrapper_all_save();
|
|
|
|
void template_format_str_save(dictionary* load_cfg, char* source_cmd);
|
|
|
|
void template_format_str_save(dictionary *load_cfg, char *source_cmd);
|
|
|
|
|
|
|
|
|
|
|
|