Исправлена загрузка данных в таблицы

pull/24/head
Igor Belitskiy 2 years ago
parent 0e8829bf1e
commit b665d4faa0

@ -43,7 +43,8 @@ debug:
@echo "Debug ..."
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
@gcc source/ubl-settings-cmake.h compile/ubl-cmake.h source/ubl-settings-multiseat.c source/ubl-settings-multiseat.h source/ubl-settings-multiseat-strings.h source/ubl-utils.c source/ubl-utils.h -o ubl-settings-multiseat `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
@gcc compile/resources.c compile/ubl-cmake.h source/view_set_disk.h source/view_set_disk.c source/view_check_user_table.c source/view_check_user_table.h source/view_filters.c source/model/vector.c source/model/vector.h source/view_filters.h source/view_temp_u_g_p.c source/view_temp_u_g_p.h source/controler.h source/controler.c source/model/philos_utils.h source/model/philos_utils.c source/model/my_device.h source/model/save.h source/model/save.c source/model/my_device.c source/model/model.h source/model/load.h source/model/load.c source/model/model.c source/ubl-settings-diskquota.c source/ubl-settings-diskquota.h source/ubl-strings.h source/model/ubl-utils.c source/model/ubl-utils.h -o ubl-settings-diskquota `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
fi; \
echo "Debug: OK"

@ -68,7 +68,7 @@ void entry_groups_disk(GtkWidget *self,int* flag_update) {
all_config.flag_save = 3;
temp_on_destroy_subwindow(self);
}
int find = fill_tree_view_user_group(&all_config, &cfg_custom_gui.group,"usrquota", 0);
int find = fill_tree_view_user_group(&all_config, &cfg_custom_gui.group,"grpquota", 0);
if (find == 0) {
g_object_ref(cfg_custom_gui.group.liststore);
gtk_list_store_clear(cfg_custom_gui.group.liststore);

@ -31,7 +31,7 @@ void load_template_load_cfg(config_all* _all_config, char* cmd) {
model_null_str_writing(_config);
_config->loaded_keys = yon_char_new(str_key);
load_pars_keys(_config, yon_char_new(str_key), index);
load_pars_values(_config, yon_char_new(str_value), index);
load_pars_values(_config, _all_config,str_key, yon_char_new(str_value), index);
if (strstr(str_key, "prjquota")) {
_all_config->v_project.pfVectorAdd(&_all_config->v_project,_config);
@ -131,16 +131,16 @@ void load_pars_keys_p(config_u_g_p* _config, char* str_key, int index) {
void load_pars_values_status(disk_status* _config, char* key, char* value) {
_config->device = yon_char_new(key);
if (strstr(value,"enable")) {
_config->status = 1;
_config->status = 2;
return;
}
else if (strstr(value,"disable")) {
_config->status = 0;
_config->status = 1;
return;
}
}
void load_pars_values(config_u_g_p* _config, char* str_value, int index) {
void load_pars_values(config_u_g_p* _config, config_all* _all_config, char* str_key, char* str_value, int index) {
int size_array_size_pow = 0;
char** array_size_pow = NULL;
array_size_pow = yon_char_parsed_append(array_size_pow,&size_array_size_pow, STR_KB);
@ -166,6 +166,26 @@ void load_pars_values(config_u_g_p* _config, char* str_value, int index) {
philos_set_size_memory_integer("-", &_config->deferring_size);
philos_set_size_memory_integer("-", &_config->deferring_file);
}
for (int j=0; j < _all_config->v_disk_status.vectorList.total;j++) {
disk_status* config_disk_status = (disk_status*)_all_config->v_disk_status.pfVectorGet(&_all_config->v_disk_status, j);
if (strstr(str_key, config_disk_status->device)){
config_disk_status->deferring_file = _config->deferring_file;
config_disk_status->deferring_size = _config->deferring_size;
}
}
for (int index = 0; index < get_device_vec()->vectorList.total; index++) {
device_config* _config_disk = (device_config*)get_device_vec()->pfVectorGet(get_device_vec(), index);
for (int j=0; j < _all_config->v_disk_status.vectorList.total;j++) {
disk_status* config_disk_status = (disk_status*)_all_config->v_disk_status.pfVectorGet(&_all_config->v_disk_status, j);
if (strstr(config_disk_status->device, _config_disk->name_disk)) {
config_disk_status->device = _config_disk->name_disk;
config_disk_status->fs = _config_disk->file_system;
config_disk_status->mount_point = _config_disk->mounted;
config_disk_status->name = _config_disk->type_dick;
}
}
}
}
else {

@ -1,14 +1,14 @@
#ifndef LOAD_H
#define LOAD_H
#include "ubl-utils.h"
#include "model.h"
#include "philos_utils.h"
#include "my_device.h"
void load_template_load_cfg(config_all* _all_config, char* cmd);
void load_pars_keys(config_u_g_p* _config, char* str_key, int index);
void load_pars_keys_u_g(config_u_g_p* _config, char* str_key, int index);
void load_pars_keys_p(config_u_g_p* _config, char* str_key, int index);
void load_pars_values(config_u_g_p* _config, char* str_value, int index);
void load_pars_values(config_u_g_p* _config, config_all* _all_config, char* str_key, char* str_value, int index);
void load_free_vector(config_all* _all_config,vector* vec_config);
void load_pars_values_status(disk_status* _config, char* key, char* value);
void free_remove_vector(config_all* _all_config, vector* vec_remove);

@ -20,6 +20,16 @@ void view_device_set_index(int _index) {
view_device_index = _index;
}
void view_device_check_activ_disk() {
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(obj_view_device_widgets->DeviceCombo));
if (menu_id == -1) {
gtk_widget_set_sensitive(obj_view_device_widgets->btnSaveTempSave, 0);
}
else {
gtk_widget_set_sensitive(obj_view_device_widgets->btnSaveTempSave, 1);
}
}
view_device_set_window *view_device_setup_window_base(char* __glade_path) {
view_device_glade_path = __glade_path;
if (obj_view_device_widgets == NULL) {
@ -54,6 +64,7 @@ view_device_set_window *view_device_setup_window_custom(view_device_set_window*
gtk_widget_hide(obj_view_device_widgets->DeviceCombo);
}
view_device_fill_gui();
view_device_check_activ_disk();
}
void view_device_show(GtkWidget *self, char* __glade_path) {
@ -71,6 +82,8 @@ void view_device_save() {
view_device_on_destroy_subwindow(obj_view_device_widgets->Window);
}
void view_device_event(view_device_set_window* view_device_view_device_widgets) {
g_signal_connect(G_OBJECT(obj_view_device_widgets->Window), "destroy", G_CALLBACK(view_device_destroy), obj_view_device_widgets->Window);
g_signal_connect(G_OBJECT(obj_view_device_widgets->btnTempCancel),"clicked",G_CALLBACK(view_device_on_destroy_subwindow), NULL);
@ -82,9 +95,11 @@ void view_device_event(view_device_set_window* view_device_view_device_widgets)
g_signal_connect(G_OBJECT(obj_view_device_widgets->spinDaysFile), "value-changed", G_CALLBACK(view_device_update_gui_spin_time), NULL);
g_signal_connect(G_OBJECT(obj_view_device_widgets->spinHoursFile), "value-changed", G_CALLBACK(view_device_update_gui_spin_time), NULL);
g_signal_connect(G_OBJECT(obj_view_device_widgets->spinMinutesFile), "value-changed", G_CALLBACK(view_device_update_gui_spin_time), NULL);
g_signal_connect(G_OBJECT(obj_view_device_widgets->DeviceCombo), "changed", G_CALLBACK(view_device_check_activ_disk), NULL);
}
void view_device_on_destroy_subwindow(GtkWidget *self) {
if (self) {
gtk_widget_destroy(gtk_widget_get_toplevel(self));

Loading…
Cancel
Save