Changeset 89606 in vbox
- Timestamp:
- Jun 10, 2021 3:37:31 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r89605 r89606 67 67 68 68 //UILogTabCloseButton(QWidget *pParent, const QUuid &uMachineId, const QString &strMachineName); 69 UILogTabCloseButton(QWidget *pParent = 0)69 UILogTabCloseButton(QWidget *pParent, const QUuid &uMachineId) 70 70 : QIToolButton(pParent) 71 , m_uMachineId(uMachineId) 71 72 { 72 73 setAutoRaise(true); … … 74 75 } 75 76 77 const QUuid &machineId() const 78 { 79 return m_uMachineId; 80 } 81 76 82 protected: 77 83 84 QUuid m_uMachineId; 78 85 }; 79 86 /********************************************************************************************************************************* … … 305 312 { 306 313 pTabBar->setTabData(i, true); 307 UILogTabCloseButton *pCloseButton = new UILogTabCloseButton; 308 pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png")); 309 310 pTabBar->setTabButton(i, QTabBar::RightSide, pCloseButton); 311 connect(pCloseButton, &UILogTabCloseButton::clicked, this, &UIVMLogViewerWidget::sltTabCloseButtonClick); 314 UIVMLogTab *pTab = logTab(i); 315 if (pTab) 316 { 317 UILogTabCloseButton *pCloseButton = new UILogTabCloseButton(0, pTab->machineId()); 318 pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png")); 319 pTabBar->setTabButton(i, QTabBar::RightSide, pCloseButton); 320 connect(pCloseButton, &UILogTabCloseButton::clicked, this, &UIVMLogViewerWidget::sltTabCloseButtonClick); 321 } 312 322 } 313 323 else … … 676 686 void UIVMLogViewerWidget::sltTabCloseButtonClick() 677 687 { 678 printf("UIVMLogViewerWidget::sltTabCloseButtonClick\n"); 688 UILogTabCloseButton *pButton = qobject_cast<UILogTabCloseButton*>(sender()); 689 if (!pButton) 690 return; 691 if (pButton->machineId().isNull()) 692 return; 693 QVector<QUuid> list; 694 list << pButton->machineId(); 695 removeLogViewerPages(list); 679 696 } 680 697
Note:
See TracChangeset
for help on using the changeset viewer.