Changeset 92431 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 15, 2021 3:46:47 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
r92429 r92431 152 152 , m_pLayoutButtons(0) 153 153 , m_pButtonOpen(0) 154 , m_pButtonToggleSorting(0) 154 155 , m_pButtonKeepFinished(0) 155 156 , m_pButtonRemoveFinished(0) … … 279 280 if (m_pButtonOpen) 280 281 m_pButtonOpen->setToolTip(tr("Open notification center")); 282 if (m_pButtonToggleSorting) 283 m_pButtonToggleSorting->setToolTip(tr("Toggle ascending/descending order")); 281 284 if (m_pButtonKeepFinished) 282 285 m_pButtonKeepFinished->setToolTip(tr("Keep finished progresses")); … … 353 356 } 354 357 358 void UINotificationCenter::sltIssueOrderChange() 359 { 360 const Qt::SortOrder enmSortOrder = m_pButtonToggleSorting->isChecked() 361 ? Qt::AscendingOrder 362 : Qt::DescendingOrder; 363 gEDataManager->setNotificationCenterOrder(enmSortOrder); 364 } 365 355 366 void UINotificationCenter::sltHandleOrderChange() 356 367 { … … 497 508 /* Add stretch: */ 498 509 m_pLayoutButtons->addStretch(1); 510 511 /* Prepare toggle-sorting button: */ 512 m_pButtonToggleSorting = new QIToolButton(this); 513 if (m_pButtonToggleSorting) 514 { 515 m_pButtonToggleSorting->setIcon(UIIconPool::iconSet(":/sort_16px.png")); 516 m_pButtonToggleSorting->setCheckable(true); 517 m_pButtonToggleSorting->setChecked(gEDataManager->notificationCenterOrder() == Qt::AscendingOrder); 518 connect(m_pButtonToggleSorting, &QIToolButton::toggled, this, &UINotificationCenter::sltIssueOrderChange); 519 m_pLayoutButtons->addWidget(m_pButtonToggleSorting); 520 } 499 521 500 522 /* Prepare keep-finished button: */ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h
r92429 r92431 101 101 private slots: 102 102 103 /** Issues order changes. */ 104 void sltIssueOrderChange(); 103 105 /** Handles order changes. */ 104 106 void sltHandleOrderChange(); … … 164 166 /** Holds the open button instance. */ 165 167 QIToolButton *m_pButtonOpen; 168 /** Holds the toggle-sorting button instance. */ 169 QIToolButton *m_pButtonToggleSorting; 166 170 /** Holds the keep-finished button instance. */ 167 171 QIToolButton *m_pButtonKeepFinished;
Note:
See TracChangeset
for help on using the changeset viewer.