MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateContent

Method updateContent

src/plugins/core/notify/gui/notificationitemwidget.cpp:120–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void NotificationItemWidgetPrivate::updateContent()
121{
122 msgLabel->setText(entity->message());
123
124 QIcon icon;
125 switch (entity->type()) {
126 case NotificationEntity::Information:
127 icon = QIcon::fromTheme("notification_info");
128 break;
129 case NotificationEntity::Warning:
130 icon = QIcon::fromTheme("notification_warning");
131 break;
132 case NotificationEntity::Error:
133 icon = QIcon::fromTheme("notification_error");
134 break;
135 }
136 iconBtn->setIcon(icon);
137
138 if (entity->actions().isEmpty())
139 actButton->setVisible(false);
140 else
141 actButton->addButtons(entity->actions());
142
143 if (entity->name().isEmpty()) {
144 fromLabel->setVisible(false);
145 } else {
146 QString format(NotificationItemWidget::tr("Source: %1"));
147 fromLabel->setText(format.arg(entity->name()));
148 }
149}
150
151NotificationItemWidget::NotificationItemWidget(QWidget *parent, EntityPtr entity)
152 : QWidget(parent),

Callers 1

setEntityMethod · 0.80

Calls 9

setVisibleMethod · 0.80
addButtonsMethod · 0.80
setTextMethod · 0.45
messageMethod · 0.45
typeMethod · 0.45
setIconMethod · 0.45
isEmptyMethod · 0.45
actionsMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected