Merge pull request 'master' (#81) from YanTheKaller/ubl-settings-diskquota:master into master

Reviewed-on: #81
pull/92/head^2 v2.2
Dmitry Razumov 2 years ago
commit e0d1319b99

3
.gitignore vendored

@ -6,4 +6,5 @@ compile/
*#
terminal-commands/
source/ubl-cmake.h
vgcore*
vgcore*
.install.sh

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.48.1 r9760"
version="1.0"
sodipodi:docname="zoom-fit.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs4">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective18" />
<linearGradient
id="StandardGradient"
gradientTransform="matrix(1.0022346,0,0,1.0022346,-2.7263793e-3,-3.4274669e-3)"
x1="8.3667202"
y1="1.0011907"
x2="8.3667202"
y2="14.839209"
gradientUnits="userSpaceOnUse">
<stop
style="stop-color:#000000;stop-opacity:0.86274511;"
offset="0"
id="stop3292" />
<stop
style="stop-color:#000000;stop-opacity:0.47058824;"
offset="1"
id="stop3294" />
</linearGradient>
<inkscape:perspective
id="perspective3648"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#StandardGradient"
id="linearGradient3626"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0022346,0,0,1.0022346,-20.002726,-0.00342747)"
x1="8.3667202"
y1="1.0011907"
x2="8.3667202"
y2="14.839209" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3633">
<path
style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
d="m -20,0 0,16 16,0 0,-16 -16,0 z m 6.03125,1 c 1.284136,0 2.583434,0.518602 3.5625,1.5 1.550185,1.5538805 1.873026,3.8766945 0.96875,5.75 -0.02944,0.062991 -0.492783,1.0685426 0,1.5625 0.298906,0.299618 0.66775,0.19791 1.125,0.65625 l 3.03125,3.0625 c 0.00872,0.01101 0.600029,0.617291 0,1.21875 -0.59772,0.599143 -1.18433,-0.0032 -1.1875,0 l -3.0625,-3.0625 c -0.45725,-0.45834 -0.357345,-0.856632 -0.65625,-1.15625 -0.402987,-0.403942 -1.16538,-0.182596 -1.46875,-0.0625 -0.04854,0.02556 -0.10707,0.0699 -0.15625,0.09375 -1.868852,0.90643 -4.168562,0.585131 -5.71875,-0.96875 -1.958131,-1.9627964 -1.95813,-5.1309536 0,-7.09375 0.979065,-0.9813981 2.278363,-1.5 3.5625,-1.5 z m 0,1.28125 c -2.076912,0 -3.749999,1.6993902 -3.75,3.78125 0,2.0818599 1.673088,3.7500002 3.75,3.75 2.076911,0 3.75,-1.6681403 3.75,-3.75 0,-2.0818599 -1.673089,-3.7812501 -3.75,-3.78125 z"
id="path3635" />
</clipPath>
<linearGradient
inkscape:collect="always"
xlink:href="#StandardGradient"
id="linearGradient5450"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0022346,0,0,1.0022346,-0.00272638,-0.00342747)"
x1="8.3667202"
y1="1.0011907"
x2="8.3667202"
y2="14.839209" />
<linearGradient
inkscape:collect="always"
xlink:href="#StandardGradient"
id="linearGradient5454"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0022346,0,0,1.0022346,-0.00272638,-0.00342747)"
x1="8.3667202"
y1="1.0011907"
x2="8.3667202"
y2="14.839209" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#9a9a9a"
borderopacity="1"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="24.785766"
inkscape:cx="1.7734833"
inkscape:cy="9.6679286"
inkscape:document-units="px"
inkscape:current-layer="layer3"
showgrid="true"
inkscape:showpageshadow="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1028"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="1">
<sodipodi:guide
orientation="1,0"
position="0,112"
id="guide2383" />
<sodipodi:guide
orientation="0,1"
position="26.278146,128"
id="guide2385" />
<sodipodi:guide
orientation="1,0"
position="128,54.082119"
id="guide2387" />
<sodipodi:guide
orientation="0,1"
position="78.156291,0"
id="guide2389" />
<inkscape:grid
type="xygrid"
id="grid3672"
visible="true"
enabled="true" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Cross"
style="display:inline">
<path
style="fill:#bebebe;fill-opacity:1;stroke:none;display:inline"
d="m 6.0346439,0.456963 c -1.4236033,0 -2.8640143,0.5749259 -3.9494135,1.662911 -2.17079758,2.1759704 -2.17079809,5.6882127 0,7.8641827 1.7185494,1.7226453 4.2680247,2.0788393 6.3398481,1.0739643 0.054521,-0.02644 0.1194082,-0.07559 0.1732199,-0.103932 0.3363183,-0.133139 1.1815124,-0.378525 1.6282666,0.06929 0.331369,0.33216 0.220613,0.773709 0.727524,1.281828 l 3.395109,3.395109 c 0.0035,-0.0035 0.653835,0.664216 1.316472,0 0.665196,-0.666781 0.0097,-1.338905 0,-1.351115 l -3.360466,-3.395109 c -0.506911,-0.50812 -0.915814,-0.395365 -1.247183,-0.727524 -0.546303,-0.5476049 -0.03264,-1.6623665 0,-1.732199 C 12.060508,6.4176092 11.702604,3.8425172 9.9840571,2.119874 8.8986578,1.031889 7.4582474,0.456963 6.0346439,0.456963 z m 0,1.4204031 c 2.3024792,-10e-8 4.1572781,1.8839564 4.1572781,4.1919215 0,2.3079648 -1.8547987,4.1572774 -4.1572781,4.1572774 -2.3024792,0 -4.1572774,-1.8493124 -4.1572774,-4.1572774 7e-7,-2.307965 1.8547983,-4.1919215 4.1572774,-4.1919215 z"
id="path3007"
inkscape:connector-curvature="0"
inkscape:transform-center-x="-2.2103061"
inkscape:transform-center-y="2.2258551" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -299,6 +299,11 @@ void device_remove() {
}
void device_update(){
device_device_config_free(get_device_vec());
vector_init(get_device_vec());
}
void user_remove() {
if (note_selected == 0) {
GtkTreeIter iter;
@ -469,6 +474,7 @@ void control_event(main_window* _config_main_gui, custom_window* _config_custom_
g_signal_connect(G_OBJECT(_config_custom_gui->device.btnEdit), "clicked", G_CALLBACK(wrapper_edit_view_device_show), glade_path);
g_signal_connect(G_OBJECT(_config_custom_gui->device.btnAdd), "clicked", G_CALLBACK(wrapper_add_view_device_show), glade_path);
g_signal_connect(G_OBJECT(_config_custom_gui->device.btnDel),"clicked",G_CALLBACK(device_remove), glade_path);
g_signal_connect(G_OBJECT(_config_custom_gui->device.Update),"clicked",G_CALLBACK(device_disk_parsed), NULL);
}
@ -504,10 +510,11 @@ int main(int argc, char *argv[]){
{"socket-ext-id", 1,0, 'e'},
{"socket-trd-id", 1,0, 't'},
{"debug", 0,0, 'd'},
{"clean-config", 0,0, 'c'},
{ NULL, 0, NULL, 0 }
};
for (int i=0;i<argc;i++){
int argument=getopt_long(argc,argv,"hVvs:e:t:d",long_options,&option_index);
int argument=getopt_long(argc,argv,"hVvs:e:t:dc",long_options,&option_index);
switch(argument){
case 'h':
show_help=1;
@ -529,6 +536,8 @@ int main(int argc, char *argv[]){
if(optarg)
main_config.load_socket_id=atoi(optarg);
break;
case 'c': rmdir(yon_char_unite(yon_ubl_user_get_home_directory(),"/",LocaleName,"/",LocaleName,".conf",NULL));
break;
case 1:
main_config.lock_help=1;
break;
@ -595,5 +604,34 @@ int main(int argc, char *argv[]){
tree_view_select_group(NULL);
tree_view_select_project(NULL);
tree_view_select_device(NULL);
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.treeViewGeneral));
for (int i = 0; i < g_list_length(list); i++){
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.device.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.user.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.group.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.project.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
gtk_main();
}

@ -87,6 +87,7 @@ typedef struct {
GtkWidget* btnEdit;
GtkWidget* btnDel;
GtkWidget* btnFilter;
GtkWidget* Update;
GtkWidget* lblSetNameDevice;
} hotebook;
typedef struct {

@ -1709,6 +1709,11 @@ int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find){
} return -1;
}
void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column){
int width= gtk_tree_view_column_get_width(column);
gtk_tree_view_column_set_min_width(column,width);
}
/**yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...)
* [EN]
*

@ -262,6 +262,8 @@ int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size);
int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find);
void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column);
int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment);
int yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...);

@ -172,6 +172,7 @@ main_window *setup_window(main_window* widgets, custom_window* custom_widgets){
widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); // yon_gtk_builder_get_widget(builder,"DocumentationMenuItem");
widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL); // yon_gtk_builder_get_widget(builder,"AboutMenuItem");
gtk_window_set_title(GTK_WINDOW(widgets->Window),TITLE_LABEL);
GtkWidget *menu = yon_gtk_builder_get_widget(builder,"menu2");
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem);
@ -236,35 +237,41 @@ custom_window *setup_window_custom(custom_window* custom_widgets, GtkBuilder *bu
custom_widgets->device.btnAdd = yon_gtk_builder_get_widget(builder,"btnAddDevice");
custom_widgets->device.btnDel = yon_gtk_builder_get_widget(builder,"btnDelDevice");
custom_widgets->device.tree_view = yon_gtk_builder_get_widget(builder,"DeviceQuotasTree");
custom_widgets->device.Update = yon_gtk_builder_get_widget(builder,"btnUpdateDevices");
custom_widgets->device.liststore = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststoreDevice"));
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->treeViewGeneral));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("general_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->device.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("device_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->user.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("user_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->group.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("group_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->project.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("project_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
g_list_free(list);

@ -93,7 +93,7 @@
#define STR_ERROR_PROJECT_NAME_ENTER_VALUE _("Project name required field")
#define STR_ERROR_LIST_USER_NULL _("The list of users is empty")
#define STR_ERROR_NO_SELECTED_DISK _("To save, you need to select a disk")
#define STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES _("Insert at leat one value before saving")
#define STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES _("Insert at least one value before saving")
#define STR_ERROR_PATH_IS_DISK_FALSE _("The selected directory is not located on the target device")
#define ADD_LABEL _("Add")

@ -601,23 +601,27 @@ int check_save() {
char* value3 = (char*)gtk_entry_get_text(GTK_ENTRY(temp_widgets->quotegroupFilesSoftLimitSpin));
char* value4 = (char*)gtk_entry_get_text(GTK_ENTRY(temp_widgets->quotegroupFilesHardLimitSpin));
int menu_id = 0;
if (strcmp(set_add_edit, "add")==0) {
menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(temp_widgets->UserDeviceCombo));
if (menu_id == -1) {
show_warning_no_fill(STR_ERROR_NO_SELECTED_DISK);
}
if (strcmp(gtk_entry_get_text(GTK_ENTRY(temp_widgets->entryUser)),"")==0){
show_warning_no_fill(STR_ERROR_LIST_USER_NULL);
return 0;
}
if (!active1 && !active2 && !active3 && !active4) {
else if (!active1 && !active2 && !active3 && !active4) {
show_warning_no_fill(STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES);
return 0;
}
if (menu_id == -1 || ((!strcmp(value1, "0") || !strcmp(value1, "")) && active1)
else if (menu_id == -1 || ((!strcmp(value1, "0") || !strcmp(value1, "")) && active1)
|| ((!strcmp(value2, "0") || !strcmp(value2, "")) && active2)
|| ((!strcmp(value3, "0") || !strcmp(value3, "")) && active3)
|| ((!strcmp(value4, "0") || !strcmp(value4, "")) && active4)) {
show_warning_no_fill(STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES);
return 0;
}
else if (strcmp(set_add_edit, "add")==0) {
menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(temp_widgets->UserDeviceCombo));
if (menu_id == -1) {
show_warning_no_fill(STR_ERROR_NO_SELECTED_DISK);
}
}
return 1;
}
@ -684,7 +688,6 @@ int wrapper_check_save() {
if (check_save()) {
return 1;
}
show_warning_no_fill(STR_ERROR_LIST_USER_NULL);
return 0;
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save