Changeset 92429 in vbox
- Timestamp:
- Nov 15, 2021 2:25:27 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.cpp
r92400 r92429 151 151 , m_pLayoutMain(0) 152 152 , m_pLayoutButtons(0) 153 , m_p OpenButton(0)154 , m_p KeepButton(0)155 , m_p RemoveFinishedButton(0)153 , m_pButtonOpen(0) 154 , m_pButtonKeepFinished(0) 155 , m_pButtonRemoveFinished(0) 156 156 , m_pLayoutItems(0) 157 157 , m_pStateMachineSliding(0) … … 192 192 { 193 193 /* Open if center isn't opened yet: */ 194 if (!m_p OpenButton->isChecked())195 m_p OpenButton->animateClick();194 if (!m_pButtonOpen->isChecked()) 195 m_pButtonOpen->animateClick(); 196 196 } 197 197 … … 212 212 213 213 /* If object is critical and center isn't opened yet: */ 214 if (!m_p OpenButton->isChecked() && fCritical)214 if (!m_pButtonOpen->isChecked() && fCritical) 215 215 { 216 216 /* We should delay progresses for a bit: */ … … 277 277 void UINotificationCenter::retranslateUi() 278 278 { 279 if (m_p OpenButton)280 m_p OpenButton->setToolTip(tr("Open notification center"));281 if (m_p KeepButton)282 m_p KeepButton->setToolTip(tr("Keep finished progresses"));283 if (m_p RemoveFinishedButton)284 m_p RemoveFinishedButton->setToolTip(tr("Delete finished notifications"));279 if (m_pButtonOpen) 280 m_pButtonOpen->setToolTip(tr("Open notification center")); 281 if (m_pButtonKeepFinished) 282 m_pButtonKeepFinished->setToolTip(tr("Keep finished progresses")); 283 if (m_pButtonRemoveFinished) 284 m_pButtonRemoveFinished->setToolTip(tr("Delete finished notifications")); 285 285 } 286 286 … … 388 388 389 389 /* Check whether we really closed: */ 390 if (m_p OpenButton->isChecked())390 if (m_pButtonOpen->isChecked()) 391 391 return; 392 392 … … 395 395 return; 396 396 397 /* Toggle open -button: */398 m_p OpenButton->animateClick();397 /* Toggle open button: */ 398 m_pButtonOpen->animateClick(); 399 399 } 400 400 … … 423 423 /* Hide and slide away if there are no notifications to show: */ 424 424 setHidden(m_pModel->ids().isEmpty()); 425 if (m_pModel->ids().isEmpty() && m_p OpenButton->isChecked())426 m_p OpenButton->toggle();425 if (m_pModel->ids().isEmpty() && m_pButtonOpen->isChecked()) 426 m_pButtonOpen->toggle(); 427 427 } 428 428 … … 485 485 m_pLayoutButtons->setContentsMargins(0, 0, 0, 0); 486 486 487 /* Prepare open -button: */488 m_p OpenButton = new QIToolButton(this);489 if (m_p OpenButton)487 /* Prepare open button: */ 488 m_pButtonOpen = new QIToolButton(this); 489 if (m_pButtonOpen) 490 490 { 491 m_p OpenButton->setIcon(UIIconPool::iconSet(":/reset_warnings_16px.png"));492 m_p OpenButton->setCheckable(true);493 connect(m_p OpenButton, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleOpenButtonToggled);494 m_pLayoutButtons->addWidget(m_p OpenButton);491 m_pButtonOpen->setIcon(UIIconPool::iconSet(":/reset_warnings_16px.png")); 492 m_pButtonOpen->setCheckable(true); 493 connect(m_pButtonOpen, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleOpenButtonToggled); 494 m_pLayoutButtons->addWidget(m_pButtonOpen); 495 495 } 496 496 … … 498 498 m_pLayoutButtons->addStretch(1); 499 499 500 /* Prepare keep- button: */501 m_p KeepButton= new QIToolButton(this);502 if (m_p KeepButton)500 /* Prepare keep-finished button: */ 501 m_pButtonKeepFinished = new QIToolButton(this); 502 if (m_pButtonKeepFinished) 503 503 { 504 m_p KeepButton->setIcon(UIIconPool::iconSet(":/pin_16px.png"));505 m_p KeepButton->setCheckable(true);506 m_p KeepButton->setChecked(gEDataManager->keepSuccessfullNotificationProgresses());507 connect(m_p KeepButton, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleKeepButtonToggled);508 m_pLayoutButtons->addWidget(m_p KeepButton);504 m_pButtonKeepFinished->setIcon(UIIconPool::iconSet(":/pin_16px.png")); 505 m_pButtonKeepFinished->setCheckable(true); 506 m_pButtonKeepFinished->setChecked(gEDataManager->keepSuccessfullNotificationProgresses()); 507 connect(m_pButtonKeepFinished, &QIToolButton::toggled, this, &UINotificationCenter::sltHandleKeepButtonToggled); 508 m_pLayoutButtons->addWidget(m_pButtonKeepFinished); 509 509 } 510 510 511 /* Prepare remove-finished -button: */512 m_p RemoveFinishedButton= new QIToolButton(this);513 if (m_p RemoveFinishedButton)511 /* Prepare remove-finished button: */ 512 m_pButtonRemoveFinished = new QIToolButton(this); 513 if (m_pButtonRemoveFinished) 514 514 { 515 m_p RemoveFinishedButton->setIcon(UIIconPool::iconSet(":/edata_remove_16px_x3.png"));516 connect(m_p RemoveFinishedButton, &QIToolButton::clicked, this, &UINotificationCenter::sltHandleRemoveFinishedButtonClicked);517 m_pLayoutButtons->addWidget(m_p RemoveFinishedButton);515 m_pButtonRemoveFinished->setIcon(UIIconPool::iconSet(":/edata_remove_16px_x3.png")); 516 connect(m_pButtonRemoveFinished, &QIToolButton::clicked, this, &UINotificationCenter::sltHandleRemoveFinishedButtonClicked); 517 m_pLayoutButtons->addWidget(m_pButtonRemoveFinished); 518 518 } 519 519 … … 729 729 int iL, iT, iR, iB; 730 730 m_pLayoutMain->getContentsMargins(&iL, &iT, &iR, &iB); 731 const int iMinimumButtonWidth = m_p OpenButton->minimumSizeHint().width() + iL + iR;731 const int iMinimumButtonWidth = m_pButtonOpen->minimumSizeHint().width() + iL + iR; 732 732 733 733 /* Make sure we have some default width if there is no contents: */ … … 744 744 QRegion region; 745 745 if (!m_iAnimatedValue) 746 region += QRect(m_p OpenButton->mapToParent(QPoint(0, 0)), m_pOpenButton->size());746 region += QRect(m_pButtonOpen->mapToParent(QPoint(0, 0)), m_pButtonOpen->size()); 747 747 setMask(region); 748 748 } -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h
r92400 r92429 162 162 /** Holds the buttons layout instance. */ 163 163 QHBoxLayout *m_pLayoutButtons; 164 /** Holds the open -button instance. */165 QIToolButton *m_p OpenButton;166 /** Holds the keep- button instance. */167 QIToolButton *m_p KeepButton;168 /** Holds the remove-finished -button instance. */169 QIToolButton *m_p RemoveFinishedButton;164 /** Holds the open button instance. */ 165 QIToolButton *m_pButtonOpen; 166 /** Holds the keep-finished button instance. */ 167 QIToolButton *m_pButtonKeepFinished; 168 /** Holds the remove-finished button instance. */ 169 QIToolButton *m_pButtonRemoveFinished; 170 170 /** Holds the items layout instance. */ 171 171 QVBoxLayout *m_pLayoutItems;
Note:
See TracChangeset
for help on using the changeset viewer.