diff --git a/src/adldap/ad_defines.h b/src/adldap/ad_defines.h index 1f6794ad..54b06770 100644 --- a/src/adldap/ad_defines.h +++ b/src/adldap/ad_defines.h @@ -238,6 +238,7 @@ enum SystemFlagsBit { #define OBJECT_CATEGORY_PERSON "Person" #define OBJECT_CATEGORY_GROUP "Group" #define OBJECT_CATEGORY_OU "Organizational-Unit" +#define OBJECT_CATEGORY_COMPUTER "Computer" #define LOCKOUT_UNLOCKED_VALUE "0" diff --git a/src/admc/console_impls/object_impl.cpp b/src/admc/console_impls/object_impl.cpp index 874a30ff..ef57023d 100755 --- a/src/admc/console_impls/object_impl.cpp +++ b/src/admc/console_impls/object_impl.cpp @@ -1198,8 +1198,16 @@ void ObjectImpl::set_disabled(const bool disabled) { for (const QModelIndex &index : index_list) { QStandardItem *item = target_console->get_item(index); item->setData(disabled, ObjectRole_AccountDisabled); - const QIcon icon = disabled ? g_icon_manager->get_icon_for_type(ItemIconType_Person_Blocked) : + const QString category= dn_get_name(item->data(ObjectRole_ObjectCategory).toString()); + QIcon icon; + if (category == OBJECT_CATEGORY_PERSON) { + icon = disabled ? g_icon_manager->get_icon_for_type(ItemIconType_Person_Blocked) : g_icon_manager->get_icon_for_type(ItemIconType_Person_Clean); + } + else if (category == OBJECT_CATEGORY_COMPUTER) { + icon = disabled ? g_icon_manager->get_icon_for_type(ItemIconType_Computer_Blocked) : + g_icon_manager->get_icon_for_type(ItemIconType_Computer_Clean); + } item->setIcon(icon); } } @@ -1858,6 +1866,12 @@ void console_object_item_load_icon(QStandardItem *item, bool disabled) { item->setIcon(icon); return; } + else if (category == OBJECT_CATEGORY_COMPUTER) { + icon = disabled ? g_icon_manager->get_icon_for_type(ItemIconType_Computer_Blocked) : + g_icon_manager->get_icon_for_type(ItemIconType_Computer_Clean); + item->setIcon(icon); + return; + } icon = g_icon_manager->get_object_icon(category); item->setIcon(icon); } diff --git a/src/admc/icon_manager/icon_manager.cpp b/src/admc/icon_manager/icon_manager.cpp index 425c5a76..3e1e1b7d 100644 --- a/src/admc/icon_manager/icon_manager.cpp +++ b/src/admc/icon_manager/icon_manager.cpp @@ -55,6 +55,9 @@ void IconManager::init() type_index_icons_array[ItemIconType_Person_Blocked] = overlay_scope_item_icon(type_index_icons_array[ItemIconType_Person_Clean], QIcon::fromTheme("dialog-error"), QSize(8, 8), QPoint(8, 8)); type_index_icons_array[ItemIconType_Site_Clean] = QIcon::fromTheme("go-home"); + type_index_icons_array[ItemIconType_Computer_Clean] = get_object_icon("Computer"); + type_index_icons_array[ItemIconType_Computer_Blocked] = overlay_scope_item_icon(type_index_icons_array[ItemIconType_Computer_Clean], + QIcon::fromTheme("dialog-error"), QSize(8, 8), QPoint(8, 8)); } QIcon IconManager::overlay_scope_item_icon(const QIcon &clean_icon, const QIcon &overlay_icon, IconOverlayPosition position) const diff --git a/src/admc/icon_manager/icon_manager.h b/src/admc/icon_manager/icon_manager.h index c9f2c365..cccdd351 100644 --- a/src/admc/icon_manager/icon_manager.h +++ b/src/admc/icon_manager/icon_manager.h @@ -23,6 +23,8 @@ enum ItemIconType { // ItemIconType_Container_Clean, // ItemIconType_Configuration, // ItemIconType_Settings, + ItemIconType_Computer_Clean, + ItemIconType_Computer_Blocked, ItemIconType_LAST };