|
|
@ -519,25 +519,6 @@ void MainWindow::event() {
|
|
|
|
QuotasEditWindow->show();
|
|
|
|
QuotasEditWindow->show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string MainWindow::format_str_size(Gtk::SpinButton* spb, Gtk::ComboBoxText* combo_box) {
|
|
|
|
|
|
|
|
string value = "";
|
|
|
|
|
|
|
|
int num = spb->get_value();
|
|
|
|
|
|
|
|
int index = combo_box->get_active_row_number();
|
|
|
|
|
|
|
|
value = to_string(num);
|
|
|
|
|
|
|
|
if (num == 0) {
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
|
|
|
value += "M";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (index == 2) {
|
|
|
|
|
|
|
|
value += "G";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (index == 3) {
|
|
|
|
|
|
|
|
value += "T";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::wrapper_settings_quotas_temp(string save_user_or_group) {
|
|
|
|
void MainWindow::wrapper_settings_quotas_temp(string save_user_or_group) {
|
|
|
|
struct partition_cmd _struct_partition_cmd = this->wrapper_settings_quotas();
|
|
|
|
struct partition_cmd _struct_partition_cmd = this->wrapper_settings_quotas();
|
|
|
|
string device = _struct_partition_cmd.device;
|
|
|
|
string device = _struct_partition_cmd.device;
|
|
|
@ -552,6 +533,7 @@ void MainWindow::wrapper_settings_quotas_temp(string save_user_or_group) {
|
|
|
|
obj_quotas_sys.format_cmd_quotas_ubconfig(_struct_quota);
|
|
|
|
obj_quotas_sys.format_cmd_quotas_ubconfig(_struct_quota);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::save_quotegroupSaveButton() {
|
|
|
|
void MainWindow::save_quotegroupSaveButton() {
|
|
|
|
if (sys_or_ubconfig == "ubconfig") {
|
|
|
|
if (sys_or_ubconfig == "ubconfig") {
|
|
|
|
if (save_user_or_group == "usrquota") {
|
|
|
|
if (save_user_or_group == "usrquota") {
|
|
|
@ -571,22 +553,18 @@ void MainWindow::save_quotegroupSaveButton() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct partition_cmd MainWindow::wrapper_settings_quotas() {
|
|
|
|
struct partition_cmd MainWindow::wrapper_settings_quotas() {
|
|
|
|
string str_parted = quotegroupDeviceCombo->get_active_text();
|
|
|
|
string str_parted = quotegroupDeviceCombo->get_active_text();
|
|
|
|
string value = "";
|
|
|
|
string value = "";
|
|
|
|
if (quotegroupSizeSoftLimitCheck->get_active()) {
|
|
|
|
if (quotegroupSizeSoftLimitCheck->get_active()) {
|
|
|
|
value = format_str_size(quotegroupSizeSoftLimitSpin, quotegroupSizeSoftLimitCombo);
|
|
|
|
value = Utils::format_str_size(quotegroupSizeSoftLimitSpin->get_value(), quotegroupSizeSoftLimitCombo->get_active_row_number());
|
|
|
|
value += ":";
|
|
|
|
value += ":";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
value += "0:";
|
|
|
|
value += "0:";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (quotegroupSizeHardLimitCheck->get_active()) {
|
|
|
|
if (quotegroupSizeHardLimitCheck->get_active()) {
|
|
|
|
value += format_str_size(quotegroupSizeHardLimitSpin, quotegroupSizeHardLimitCombo);
|
|
|
|
value += Utils::format_str_size(quotegroupSizeHardLimitSpin->get_value(), quotegroupSizeHardLimitCombo->get_active_row_number());
|
|
|
|
value += ":";
|
|
|
|
value += ":";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|