Fixed double warning window

pull/81/head
Ivan Yartsev 2 years ago
parent c405a3a998
commit af52f391c2

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

Loading…
Cancel
Save