VirtualBox

Changeset 92744 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 3, 2021 6:48:20 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161. We don't need to pass CMachine reference to the logviewer. not anymore.

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  
    4545
    4646UIVMLogViewerDialogFactory::UIVMLogViewerDialogFactory(UIActionPool *pActionPool /* = 0 */,
    47                                                        const CMachine &comMachine /* = CMachine() */)
     47                                                       const QUuid &uMachineId /* = QUuid()*/,
     48                                                       const QString &strMachineName /* = QString() */)
    4849    : m_pActionPool(pActionPool)
    49     , m_comMachine(comMachine)
     50    , m_uMachineId(uMachineId)
     51    , m_strMachineName(strMachineName)
    5052{
    5153}
     
    5355void UIVMLogViewerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
    5456{
    55     pDialog = new UIVMLogViewerDialog(pCenterWidget, m_pActionPool, m_comMachine);
     57    pDialog = new UIVMLogViewerDialog(pCenterWidget, m_pActionPool, m_uMachineId, m_strMachineName);
    5658}
    5759
     
    6163*********************************************************************************************************************************/
    6264
    63 UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine)
     65UIVMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool,
     66                                         const QUuid &uMachineId /* = QUuid()*/,
     67                                         const QString &strMachineName /* = QString() */)
    6468    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
    6569    , m_pActionPool(pActionPool)
    66     , m_comMachine(comMachine)
     70    , m_uMachineId(uMachineId)
    6771    , m_iGeometrySaveTimerId(-1)
     72    , m_strMachineName(strMachineName)
    6873{
    6974}
     
    9297{
    9398    /* 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));
    96101    else
    97102        setWindowTitle(UIVMLogViewerWidget::tr("Log Viewer"));
     
    146151{
    147152    /* 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);
    151154    if (pWidget)
    152155    {
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h

    r89585 r92744  
    5151    /** Constructs Log Viewer factory acquiring additional arguments.
    5252      * @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());
    5556
    5657protected:
     
    6263    /** Holds the action-pool reference. */
    6364    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;
    6668};
    6769
     
    7779      * @param  pCenterWidget  Brings the widget reference to center according to.
    7880      * @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());
    8184    ~UIVMLogViewerDialog();
    8285    void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
     
    123126    /** Holds the action-pool reference. */
    124127    UIActionPool *m_pActionPool;
    125     /** Holds the machine reference. */
    126     CMachine      m_comMachine;
     128    /** Holds the machine id. */
     129    QUuid      m_uMachineId;
    127130    int m_iGeometrySaveTimerId;
     131    QString    m_strMachineName;
    128132};
    129133
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r92743 r92744  
    191191                                         UIActionPool *pActionPool,
    192192                                         bool fShowToolbar /* = true */,
    193                                          const CMachine &comMachine /* = CMachine() */,
     193                                         const QUuid &uMachineId /* = QUuid() */,
    194194                                         QWidget *pParent /* = 0 */)
    195195    : QIWithRetranslateUI<QWidget>(pParent)
     
    215215    prepare();
    216216    restorePanelVisibility();
    217     if (!comMachine.isNull())
    218         setMachines(QVector<QUuid>(1, comMachine.GetId()));
     217    if (!uMachineId.isNull())
     218        setMachines(QVector<QUuid>() << uMachineId);
    219219    connect(&uiCommon(), &UICommon::sigAskToCommitData,
    220220            this, &UIVMLogViewerWidget::sltCommitDataSignalReceived);
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r92743 r92744  
    7373      * @param  pActionPool   Brings the action-pool reference.
    7474      * @param  fShowToolbar  Brings whether we should create/show toolbar.
    75       * @param  comMachine    Brings the machine for which VM Log-Viewer is requested. */
     75      * @param  uMachineId    Brings the machine id for which VM Log-Viewer is requested. */
    7676    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);
    7878    ~UIVMLogViewerWidget();
    7979    /** 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  
    18841884    if (!m_pLogViewerDialog)
    18851885    {
    1886         UIVMLogViewerDialogFactory dialogFactory(actionPool(), CMachine());
     1886        UIVMLogViewerDialogFactory dialogFactory(actionPool(), QUuid());
    18871887        dialogFactory.prepare(m_pLogViewerDialog, this);
    18881888        if (m_pLogViewerDialog)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r92638 r92744  
    24832483
    24842484    QIManagerDialog *pLogViewerDialog;
    2485     UIVMLogViewerDialogFactory dialogFactory(actionPool(), machine());
     2485    UIVMLogViewerDialogFactory dialogFactory(actionPool(), machine().GetId(), machine().GetName());
    24862486    dialogFactory.prepare(pLogViewerDialog, activeMachineWindow());
    24872487    if (pLogViewerDialog)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette