diff --git a/.gitignore b/.gitignore
index 8879ccd..aa6b482 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@ compile/
*#
terminal-commands/
source/ubl-cmake.h
-vgcore*
\ No newline at end of file
+vgcore*
+.install.sh
\ No newline at end of file
diff --git a/com.ublinux.ubl-settings-diskquota.zoom-symbolic.svg b/com.ublinux.ubl-settings-diskquota.zoom-symbolic.svg
new file mode 100644
index 0000000..c5011ec
--- /dev/null
+++ b/com.ublinux.ubl-settings-diskquota.zoom-symbolic.svg
@@ -0,0 +1,160 @@
+
+
+
+
diff --git a/source/controler.c b/source/controler.c
index 75b8b33..745aa9d 100644
--- a/source/controler.c
+++ b/source/controler.c
@@ -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;iDocumentationMenuItem = 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);
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index b786276..4010889 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -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")
diff --git a/source/view_temp_u_g_p.c b/source/view_temp_u_g_p.c
index cefd227..163b568 100644
--- a/source/view_temp_u_g_p.c
+++ b/source/view_temp_u_g_p.c
@@ -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;
}
}
diff --git a/ubl-settings-diskquota.glade b/ubl-settings-diskquota.glade
index d8aebec..391c518 100644
--- a/ubl-settings-diskquota.glade
+++ b/ubl-settings-diskquota.glade
@@ -379,6 +379,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
process-stop-symbolic