VirtualBox

Changeset 27044 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 4, 2010 3:51:25 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: new core: VM information dialog again

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp

    r26719 r27044  
    3434#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3535
     36#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     37#include "UIMachineLogic.h"
     38#include "UIMachineWindow.h"
     39#include "UIMachineView.h"
     40#include "UISession.h"
     41#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
     42
    3643VBoxVMInformationDlg::InfoDlgMap VBoxVMInformationDlg::mSelfArray = InfoDlgMap();
    3744
     45#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     46void VBoxVMInformationDlg::createInformationDlg(UIMachineWindow *pMachineWindow)
     47#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    3848void VBoxVMInformationDlg::createInformationDlg (const CSession &aSession, VBoxConsoleView *aConsole)
    39 {
     49#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
     50{
     51#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     52    CMachine machine = pMachineWindow->machineLogic()->uisession()->session().GetMachine();
     53#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    4054    CMachine machine = aSession.GetMachine();
     55#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
    4156    if (mSelfArray.find (machine.GetName()) == mSelfArray.end())
    4257    {
    4358        /* Creating new information dialog if there is no one existing */
     59#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     60        VBoxVMInformationDlg *id = new VBoxVMInformationDlg(pMachineWindow, Qt::Window);
     61        id->centerAccording (pMachineWindow->machineWindow());
     62#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    4463        VBoxVMInformationDlg *id = new VBoxVMInformationDlg (aConsole, aSession, Qt::Window);
    4564        id->centerAccording (aConsole);
     65#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
    4666        connect (vboxGlobal().mainWindow(), SIGNAL (closing()), id, SLOT (close()));
    4767        id->setAttribute (Qt::WA_DeleteOnClose);
     
    5676}
    5777
     78#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     79VBoxVMInformationDlg::VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags)
     80# ifdef Q_WS_MAC
     81    : QIWithRetranslateUI2 <QIMainDialog> (pMachineWindow->machineWindow(), aFlags)
     82# else /* Q_WS_MAC */
     83    : QIWithRetranslateUI2 <QIMainDialog> (0, aFlags)
     84# endif /* Q_WS_MAC */
     85    , mSession (pMachineWindow->session())
     86#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    5887VBoxVMInformationDlg::VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags)
    59 #ifdef Q_WS_MAC
     88# ifdef Q_WS_MAC
    6089    : QIWithRetranslateUI2 <QIMainDialog> (aConsole, aFlags)
    61 #else /* Q_WS_MAC */
     90# else /* Q_WS_MAC */
    6291    : QIWithRetranslateUI2 <QIMainDialog> (0, aFlags)
    63 #endif /* Q_WS_MAC */
    64     , mIsPolished (false)
     92# endif /* Q_WS_MAC */
     93#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
     94#ifndef VBOX_WITH_NEW_RUNTIME_CORE
    6595    , mConsole (aConsole)
    6696    , mSession (aSession)
     97#endif /* !VBOX_WITH_NEW_RUNTIME_CORE */
     98    , mIsPolished (false)
    6799    , mStatTimer (new QTimer (this))
    68100{
     
    95127
    96128    /* Setup handlers */
     129#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     130    connect (pMachineWindow->uisession(), SIGNAL (sigMediumChange(const CMediumAttachment&)), this, SLOT (updateDetails()));
     131    connect (pMachineWindow->uisession(), SIGNAL (sigSharedFolderChange()), this, SLOT (updateDetails()));
     132    /* TODO_NEW_CORE: this is ofc not really right in the mm sense. There are
     133     * more than one screens. */
     134    connect (pMachineWindow->machineView(), SIGNAL (resizeHintDone()), this, SLOT (processStatistics()));
     135#else /* VBOX_WITH_NEW_RUNTIME_CORE */
     136    /* Setup handlers */
     137    connect (mConsole, SIGNAL (mediaDriveChanged (VBoxDefs::MediumType)), this, SLOT (updateDetails()));
     138    connect (mConsole, SIGNAL (sharedFoldersChanged()), this, SLOT (updateDetails()));
     139    connect (mConsole, SIGNAL (resizeHintDone()), this, SLOT (processStatistics()));
     140#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
    97141    connect (mInfoStack, SIGNAL (currentChanged (int)), this, SLOT (onPageChanged (int)));
    98142    connect (&vboxGlobal(), SIGNAL (mediumEnumFinished (const VBoxMediaList &)), this, SLOT (updateDetails()));
    99     connect (mConsole, SIGNAL (mediaDriveChanged (VBoxDefs::MediumType)), this, SLOT (updateDetails()));
    100     connect (mConsole, SIGNAL (sharedFoldersChanged()), this, SLOT (updateDetails()));
    101143    connect (mStatTimer, SIGNAL (timeout()), this, SLOT (processStatistics()));
    102     connect (mConsole, SIGNAL (resizeHintDone()), this, SLOT (processStatistics()));
    103144
    104145    /* Loading language constants */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.h

    r25171 r27044  
    3030
    3131class VBoxConsoleView;
     32class UIMachineWindow;
    3233class QTimer;
    3334
     
    4344    typedef QMap <QString, VBoxVMInformationDlg*> InfoDlgMap;
    4445
     46#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     47    static void createInformationDlg(UIMachineWindow *pMachineWindow);
     48#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    4549    static void createInformationDlg (const CSession &aSession, VBoxConsoleView *aConsole);
     50#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
    4651
    4752protected:
    4853
     54#ifdef VBOX_WITH_NEW_RUNTIME_CORE
     55    VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags);
     56#else /* VBOX_WITH_NEW_RUNTIME_CORE */
    4957    VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags);
     58#endif /* VBOX_WITH_NEW_RUNTIME_CORE */
    5059   ~VBoxVMInformationDlg();
    5160
     
    7584    static InfoDlgMap  mSelfArray;
    7685
     86#ifndef VBOX_WITH_NEW_RUNTIME_CORE
     87    VBoxConsoleView   *mConsole;
     88#endif /* !VBOX_WITH_NEW_RUNTIME_CORE */
     89    CSession           mSession;
    7790    bool               mIsPolished;
    78     VBoxConsoleView   *mConsole;
    79     CSession           mSession;
    8091    QTimer            *mStatTimer;
    8192
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r27012 r27044  
    895895void UIMachineLogic::sltShowInformationDialog()
    896896{
    897     // TODO: Call for singleton information dialog for this machine!
    898     //VBoxVMInformationDlg::createInformationDlg(session());
     897    /* Do not process if window(s) missed! */
     898    if (!isMachineWindowsCreated())
     899        return;
     900
     901    VBoxVMInformationDlg::createInformationDlg(mainMachineWindow());
    899902}
    900903
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r26950 r27044  
    6565
    6666    /* Main getters/setters: */
    67     UISession* uisession() { return m_pSession; }
    68     UIActionsPool* actionsPool() { return m_pActionsPool; }
     67    UISession* uisession() const { return m_pSession; }
     68    UIActionsPool* actionsPool() const { return m_pActionsPool; }
    6969    UIVisualStateType visualStateType() const { return m_visualStateType; }
    7070    QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r27012 r27044  
    103103}
    104104
    105 UISession* UIMachineWindow::uisession()
     105UISession* UIMachineWindow::uisession() const
    106106{
    107107    return machineLogic()->uisession();
    108108}
    109109
    110 CSession& UIMachineWindow::session()
     110CSession& UIMachineWindow::session() const
    111111{
    112112    return uisession()->session();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r27008 r27044  
    5151
    5252    /* Public getters: */
    53     virtual UIMachineLogic* machineLogic() { return m_pMachineLogic; }
    54     virtual QWidget* machineWindow() { return m_pMachineWindow; }
    55     virtual UIMachineView* machineView() { return m_pMachineView; }
     53    virtual UIMachineLogic* machineLogic() const { return m_pMachineLogic; }
     54    virtual QWidget* machineWindow() const { return m_pMachineWindow; }
     55    virtual UIMachineView* machineView() const { return m_pMachineView; }
     56    UISession* uisession() const;
     57    CSession& session() const;
    5658
    5759protected:
     
    6062    UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId);
    6163    virtual ~UIMachineWindow();
    62 
    63     /* Protected wrappers: */
    64     UISession* uisession();
    65     CSession& session();
    6664
    6765    /* Protected getters: */
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