Changeset 88644 in vbox for trunk/src/VBox
- Timestamp:
- Apr 22, 2021 8:09:38 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r88634 r88644 38 38 #include "UIIconPool.h" 39 39 #include "UIMessageCenter.h" 40 #include "UIVirtualMachineItem.h" 40 41 #include "UIVMLogPage.h" 41 42 #include "UIVMLogViewerWidget.h" … … 53 54 /** Limit the read string size to avoid bloated log viewer pages. */ 54 55 const ULONG uAllowedLogSize = _256M; 56 57 UIVMLogViewerWidget::Machine::Machine(const QUuid &id, const QString &strName) 58 : m_id(id) 59 , m_strName(strName) 60 { 61 } 62 55 63 UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding, 56 64 UIActionPool *pActionPool, … … 121 129 } 122 130 131 void UIVMLogViewerWidget::setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items) 132 { 133 m_machines.clear(); 134 foreach (const UIVirtualMachineItem *item, items) 135 { 136 if (!item) 137 continue; 138 m_machines << Machine(item->id(), item->name()); 139 } 140 updateMachineSelectionMenu(); 141 } 142 123 143 QFont UIVMLogViewerWidget::currentFont() const 124 144 { … … 502 522 m_pMachineSelectionMenu = new QMenu(this); 503 523 m_pCornerButton->setMenu(m_pMachineSelectionMenu); 524 m_pCornerButton->setPopupMode(QToolButton::InstantPopup); 504 525 } 505 526 } … … 688 709 m_pToolBar->updateLayout(); 689 710 #endif 711 m_pCornerButton->setToolTip(tr("Select machines to show their log")); 690 712 } 691 713 … … 932 954 m_visiblePanelsList.back()->setCloseButtonShortCut(QKeySequence(Qt::Key_Escape)); 933 955 } 956 957 void UIVMLogViewerWidget::updateMachineSelectionMenu() 958 { 959 if (!m_pMachineSelectionMenu) 960 { 961 m_pMachineSelectionMenu = new QMenu(this); 962 if (m_pCornerButton) 963 m_pCornerButton->setMenu(m_pMachineSelectionMenu); 964 } 965 m_pMachineSelectionMenu->clear(); 966 967 foreach (const Machine &machine, m_machines) 968 { 969 QAction *pAction = m_pMachineSelectionMenu->addAction(machine.m_strName); 970 pAction->setCheckable(true); 971 pAction->setData(machine.m_id); 972 } 973 } -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
r88634 r88644 44 44 class QIToolBar; 45 45 class QIToolButton; 46 class UIVirtualMachineItem; 46 47 class UIVMLogPage; 47 48 class UIVMLogViewerBookmarksPanel; … … 86 87 /** Defines the @a comMachine whose logs to show. */ 87 88 void setMachine(const CMachine &comMachine); 89 void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items); 88 90 QFont currentFont() const; 89 91 … … 137 139 138 140 private: 139 141 struct Machine 142 { 143 Machine(const QUuid &id, const QString &strName); 144 QUuid m_id; 145 QString m_strName; 146 }; 140 147 /** @name Prepare/Cleanup 141 148 * @{ */ … … 184 191 /** Resets document (of the curent tab) and scrollbar highligthing */ 185 192 void resetHighlighthing(); 186 187 193 void hidePanel(UIDialogPanel* panel); 188 194 void showPanel(UIDialogPanel* panel); 189 190 195 /** Make sure escape key is assigned to only a single widget. This is done by checking 191 196 several things in the following order: … … 194 199 - assigned it to the most recently "unhidden" panel */ 195 200 void manageEscapeShortCut(); 201 void updateMachineSelectionMenu(); 196 202 197 203 /** Holds the widget's embedding type. */ … … 203 209 /** Holds the machine instance. */ 204 210 CMachine m_comMachine; 211 QVector<Machine> m_machines; 205 212 206 213 /** Holds whether the dialog is polished. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r88071 r88644 279 279 m_pPaneDetails->setItems(m_items); 280 280 } 281 /* Update logs pane is it is open: */ 282 if (isToolOpened(UIToolType_Logs)) 283 { 284 AssertPtrReturnVoid(m_pPaneLogViewer); 285 m_pPaneLogViewer->setSelectedVMListItems(m_items); 286 } 281 287 } 282 288
Note:
See TracChangeset
for help on using the changeset viewer.