Исправлен дизайн

pull/24/head
Igor Belitskiy 2 years ago
parent 6efc8461f4
commit e7721e0056

@ -100,7 +100,6 @@ void load_pars_keys_p(config_u_g_p* _config, char* str_key, int index) {
char** arr_keys = philos_str_split(yon_char_new(str_key), &size_point, ":");
_config->type_arr = yon_char_new(arr_keys[0]);
int size_users = 0;
printf("%d users\n", yon_char_find_count(str_key, ":"));
if (yon_char_find_count(str_key, ":") == 2) {
_config->UNIX_file = yon_char_new(arr_keys[1]);
int size_comma = 0;

@ -1,5 +1,18 @@
#include "model.h"
size_t check_null(size_t num) {
if (num == 0) {
return -1;
}
return num;
}
char* check_null_to_str(size_t num) {
if (num == 0) {
return yon_char_new("-");
}
return philos_char_from_size_t(num);
}
void model_clear_cfg(config_u_g_p* _config) {
free(_config->quota);
@ -90,12 +103,12 @@ int fill_tree_view_project(config_all* all_config,hotebook* widget , char* str_f
1,format_actors(&_config->actors),
2,_config->quota,
3,_config->size_memory,
4,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
5,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
4,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
5,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
6,deferring_size,
7,_config->files,
8,yon_char_from_int(_config->soft_restriction_file),
9,yon_char_from_int(_config->severe_limitation_file),
8,check_null_to_str(_config->soft_restriction_file),
9,check_null_to_str(_config->severe_limitation_file),
10,deferring_file,
-1);
@ -135,12 +148,12 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
0,format_actors(&_config->actors),
1,_config->quota,
2,_config->size_memory,
3,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
4,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
3,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
4,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
5,deferring_size,
6,_config->files,
7,yon_char_from_int(_config->soft_restriction_file),
8,yon_char_from_int(_config->severe_limitation_file),
7,check_null_to_str(_config->soft_restriction_file),
8,check_null_to_str(_config->severe_limitation_file),
9,deferring_file,
-1);
}
@ -154,7 +167,7 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
char* wrapper_str_time(size_t seconds) {
me_time t;
if (seconds!=-1) {
if (seconds>0) {
t = time_convert(seconds);
t.str_time = yon_char_unite(yon_char_from_int(t.weeks),WEEKS,
yon_char_from_int(t.days), DAYS,
@ -226,11 +239,11 @@ int fill_tree_view_generate(vector* vec_fill, vector* vec_status_disk, char* str
0,pars_status_generate(vec_status_disk,_config->UNIX_file),
1,quota_type(str_fill),
2,_config->UNIX_file,
6,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
7,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
6,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
7,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
8,deferring_size,
9,yon_char_from_int(_config->soft_restriction_file),
10,yon_char_from_int(_config->severe_limitation_file),
9,check_null_to_str(_config->soft_restriction_file),
10,check_null_to_str(_config->severe_limitation_file),
11,deferring_file,
-1);
}
@ -239,3 +252,4 @@ int fill_tree_view_generate(vector* vec_fill, vector* vec_status_disk, char* str
return 1;
}

@ -724,7 +724,6 @@ void yon_int_array_append(int **source, int append){
*/
int philos_config_save(char *command)
{
puts(command);
FILE *output = popen(command, "r");
return 1;
}

@ -882,25 +882,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="quotegroupSizeCurrentlyLabel1">
<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="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="label" translatable="yes">Usage:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="quotegroupSizeSoftLimitLabel1">
<property name="visible">True</property>
@ -1122,25 +1103,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="quotegroupFilesCurrentlyLabel1">
<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="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="label" translatable="yes">Usage:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="quotegroupFilesSoftLimitLabel1">
<property name="visible">True</property>
@ -1980,8 +1942,8 @@ translated and supported by community.</property>
<property name="width-request">800</property>
<property name="height-request">600</property>
<property name="can-focus">False</property>
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="default-width">760</property>
<property name="default-height">560</property>
<property name="icon-name">com.ublinux.ubl-settings-diskquota</property>
<child>
<object class="GtkBox" id="plugBox">
@ -2330,6 +2292,16 @@ limit
<property name="tab-fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -2914,21 +2886,10 @@ limit
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkTreeView" id="usersQuotasTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vadjustment">adjustment29</property>
<property name="model">liststoreUser</property>
<property name="search-column">0</property>
<child internal-child="selection">
@ -3070,10 +3031,6 @@ limit
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@ -3249,6 +3206,10 @@ limit
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
@ -3264,6 +3225,16 @@ limit
<property name="tab-fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -3356,6 +3327,7 @@ limit
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="label" translatable="yes">Excess size delay period</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
@ -3848,38 +3820,15 @@ limit
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkTreeView" id="groupsQuotasTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vadjustment">adjustment30</property>
<property name="model">liststoreGroups</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Name</property>
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Quotas</property>
@ -4004,10 +3953,6 @@ limit
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@ -4183,6 +4128,10 @@ limit
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
@ -4192,12 +4141,23 @@ limit
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Groups</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab-fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -4714,24 +4674,13 @@ limit
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkTreeView" id="ProjectQuotasTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vadjustment">adjustment31</property>
<property name="model">liststoreProject</property>
<property name="search-column">0</property>
<child internal-child="selection">
@ -4886,10 +4835,6 @@ limit
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@ -5065,6 +5010,10 @@ limit
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>

Loading…
Cancel
Save