Changeset 92744 in vbox for trunk/src/VBox
- Timestamp:
- Dec 3, 2021 6:48:20 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp
r92743 r92744 45 45 46 46 UIVMLogViewerDialogFactory::UIVMLogViewerDialogFactory(UIActionPool *pActionPool /* = 0 */, 47 const CMachine &comMachine /* = CMachine() */) 47 const QUuid &uMachineId /* = QUuid()*/, 48 const QString &strMachineName /* = QString() */) 48 49 : m_pActionPool(pActionPool) 49 , m_comMachine(comMachine) 50 , m_uMachineId(uMachineId) 51 , m_strMachineName(strMachineName) 50 52 { 51 53 } … … 53 55 void UIVMLogViewerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 54 56 { 55 pDialog = new UIVMLogViewerDialog(pCenterWidget, m_pActionPool, m_ comMachine);57 pDialog = new UIVMLogViewerDialog(pCenterWidget, m_pActionPool, m_uMachineId, m_strMachineName); 56 58 } 57 59 … … 61 63 *********************************************************************************************************************************/ 62 64 63 UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine) 65 UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, 66 const QUuid &uMachineId /* = QUuid()*/, 67 const QString &strMachineName /* = QString() */) 64 68 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 65 69 , m_pActionPool(pActionPool) 66 , m_ comMachine(comMachine)70 , m_uMachineId(uMachineId) 67 71 , m_iGeometrySaveTimerId(-1) 72 , m_strMachineName(strMachineName) 68 73 { 69 74 } … … 92 97 { 93 98 /* Translate window title: */ 94 if (!m_ comMachine.isNull())95 setWindowTitle(tr("%1 - Log Viewer").arg(m_ comMachine.GetName()));99 if (!m_strMachineName.isEmpty()) 100 setWindowTitle(tr("%1 - Log Viewer").arg(m_strMachineName)); 96 101 else 97 102 setWindowTitle(UIVMLogViewerWidget::tr("Log Viewer")); … … 146 151 { 147 152 /* Create widget: */ 148 UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, m_pActionPool, true /* show toolbar */, m_comMachine, this); 149 /* Release the CMachine reference as we don't need it anymore. Doing it during dtor causes problems since xcom might be gone already: */ 150 m_comMachine.detach(); 153 UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, m_pActionPool, true /* show toolbar */, m_uMachineId, this); 151 154 if (pWidget) 152 155 { -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h
r89585 r92744 51 51 /** Constructs Log Viewer factory acquiring additional arguments. 52 52 * @param pActionPool Brings the action-pool reference. 53 * @param comMachine Brings the machine for which VM Log-Viewer is requested. */ 54 UIVMLogViewerDialogFactory(UIActionPool *pActionPool = 0, const CMachine &comMachine = CMachine()); 53 * @param uMachineId Brings the machine id for which VM Log-Viewer is requested. */ 54 UIVMLogViewerDialogFactory(UIActionPool *pActionPool = 0, const QUuid &uMachineId = QUuid(), 55 const QString &strMachineName = QString()); 55 56 56 57 protected: … … 62 63 /** Holds the action-pool reference. */ 63 64 UIActionPool *m_pActionPool; 64 /** Holds the machine reference. */ 65 CMachine m_comMachine; 65 /** Holds the machine id. */ 66 QUuid m_uMachineId; 67 QString m_strMachineName; 66 68 }; 67 69 … … 77 79 * @param pCenterWidget Brings the widget reference to center according to. 78 80 * @param pActionPool Brings the action-pool reference. 79 * @param comMachine Brings the machine reference. */ 80 UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine); 81 * @param machine id Brings the machine id. */ 82 UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, 83 const QUuid &uMachineId = QUuid(), const QString &strMachineName = QString()); 81 84 ~UIVMLogViewerDialog(); 82 85 void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items); … … 123 126 /** Holds the action-pool reference. */ 124 127 UIActionPool *m_pActionPool; 125 /** Holds the machine reference. */126 CMachine m_comMachine;128 /** Holds the machine id. */ 129 QUuid m_uMachineId; 127 130 int m_iGeometrySaveTimerId; 131 QString m_strMachineName; 128 132 }; 129 133 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r92743 r92744 191 191 UIActionPool *pActionPool, 192 192 bool fShowToolbar /* = true */, 193 const CMachine &comMachine /* = CMachine() */,193 const QUuid &uMachineId /* = QUuid() */, 194 194 QWidget *pParent /* = 0 */) 195 195 : QIWithRetranslateUI<QWidget>(pParent) … … 215 215 prepare(); 216 216 restorePanelVisibility(); 217 if (! comMachine.isNull())218 setMachines(QVector<QUuid>( 1, comMachine.GetId()));217 if (!uMachineId.isNull()) 218 setMachines(QVector<QUuid>() << uMachineId); 219 219 connect(&uiCommon(), &UICommon::sigAskToCommitData, 220 220 this, &UIVMLogViewerWidget::sltCommitDataSignalReceived); -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
r92743 r92744 73 73 * @param pActionPool Brings the action-pool reference. 74 74 * @param fShowToolbar Brings whether we should create/show toolbar. 75 * @param comMachine Brings the machinefor which VM Log-Viewer is requested. */75 * @param uMachineId Brings the machine id for which VM Log-Viewer is requested. */ 76 76 UIVMLogViewerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 77 bool fShowToolbar = true, const CMachine &comMachine = CMachine(), QWidget *pParent = 0);77 bool fShowToolbar = true, const QUuid &uMachineId = QUuid(), QWidget *pParent = 0); 78 78 ~UIVMLogViewerWidget(); 79 79 /** Returns the width of the current log page. return 0 if there is no current log page: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r92638 r92744 1884 1884 if (!m_pLogViewerDialog) 1885 1885 { 1886 UIVMLogViewerDialogFactory dialogFactory(actionPool(), CMachine());1886 UIVMLogViewerDialogFactory dialogFactory(actionPool(), QUuid()); 1887 1887 dialogFactory.prepare(m_pLogViewerDialog, this); 1888 1888 if (m_pLogViewerDialog) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r92638 r92744 2483 2483 2484 2484 QIManagerDialog *pLogViewerDialog; 2485 UIVMLogViewerDialogFactory dialogFactory(actionPool(), machine() );2485 UIVMLogViewerDialogFactory dialogFactory(actionPool(), machine().GetId(), machine().GetName()); 2486 2486 dialogFactory.prepare(pLogViewerDialog, activeMachineWindow()); 2487 2487 if (pLogViewerDialog)
Note:
See TracChangeset
for help on using the changeset viewer.