- Timestamp:
- Jul 29, 2021 7:57:29 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145974
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.cpp
r90292 r90388 189 189 if (m_pLabelDetails) 190 190 { 191 m_pLabelDetails->setText(progress()->details());192 191 int iHint = m_pLabelName->minimumSizeHint().width() 193 192 + m_pLayoutUpper->spacing() 194 193 + m_pButtonClose->minimumSizeHint().width(); 195 194 m_pLabelDetails->setMinimumTextWidth(iHint); 195 updateDetails(); 196 196 } 197 197 … … 244 244 /* Update details with error text if any: */ 245 245 if (m_pLabelDetails) 246 { 247 const QString strDetails = progress()->details(); 248 const QString strError = progress()->error(); 249 const QString strFullDetails = strError.isNull() 250 ? strDetails 251 : QString("%1<br>%2").arg(strDetails, strError); 252 m_pLabelDetails->setText(strFullDetails); 253 } 246 updateDetails(); 254 247 } 255 248 … … 257 250 { 258 251 return qobject_cast<UINotificationProgress*>(m_pObject); 252 } 253 254 void UINotificationProgressItem::updateDetails() 255 { 256 AssertPtrReturnVoid(m_pLabelDetails); 257 const QString strDetails = progress()->details(); 258 const QString strError = progress()->error(); 259 const QString strFullDetails = strError.isNull() 260 ? strDetails 261 : QString("%1<br>%2").arg(strDetails, strError); 262 m_pLabelDetails->setText(strFullDetails); 263 if (!strError.isEmpty()) 264 { 265 m_fToggled = true; 266 m_pLabelDetails->setVisible(m_fToggled); 267 } 259 268 } 260 269 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.h
r90290 r90388 104 104 /** Holds the notification-progress this item created for. */ 105 105 UINotificationProgress *progress() const; 106 107 /** Updates details. */ 108 void updateDetails(); 106 109 }; 107 110
Note:
See TracChangeset
for help on using the changeset viewer.