1
0
mirror of https://github.com/altlinux/admc.git synced 2025-01-20 10:04:05 +03:00

Warning message after critical policy deletion attempt is clarified.

For not critical policies warning messages popup without clarification.
This commit is contained in:
Semyon Knyazev 2022-12-30 01:15:47 +04:00 committed by Evgeny Sinelnikov
parent 92f2df3d31
commit 83e8feb2b6

View File

@ -598,8 +598,21 @@ void console_policy_delete(const QList<ConsoleWidget *> &console_list, PolicyRes
g_status->log_messages(ad);
if (!not_deleted_dn_list.isEmpty()) {
QString message = (not_deleted_dn_list.size() == 1) ? PolicyImpl::tr("Failed to delete group policy") :
PolicyImpl::tr("Failed to delete some group policies");
QString message;
if (not_deleted_dn_list.size() == 1) {
message = PolicyImpl::tr("Failed to delete group policy");
AdObject not_deleted_object = ad.search_object(not_deleted_dn_list.first());
if (!not_deleted_object.is_empty() && not_deleted_object.get_bool("isCriticalSystemObject"))
message += PolicyImpl::tr(": this is a critical policy");
} else {
message = PolicyImpl::tr("Failed to delete the following group policies: \n");
for (QString not_deleted_dn : not_deleted_dn_list) {
AdObject not_deleted_object = ad.search_object(not_deleted_dn);
message += '\n' + not_deleted_object.get_string("displayName");
if (not_deleted_object.get_bool("isCriticalSystemObject"))
message += PolicyImpl::tr(" (critical policy)");
}
}
QMessageBox::warning(console_list[0], "", message);
}
}