Changeset 27044 in vbox for trunk/src/VBox
- Timestamp:
- Mar 4, 2010 3:51:25 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r26719 r27044 34 34 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 35 35 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 36 43 VBoxVMInformationDlg::InfoDlgMap VBoxVMInformationDlg::mSelfArray = InfoDlgMap(); 37 44 45 #ifdef VBOX_WITH_NEW_RUNTIME_CORE 46 void VBoxVMInformationDlg::createInformationDlg(UIMachineWindow *pMachineWindow) 47 #else /* VBOX_WITH_NEW_RUNTIME_CORE */ 38 48 void 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 */ 40 54 CMachine machine = aSession.GetMachine(); 55 #endif /* VBOX_WITH_NEW_RUNTIME_CORE */ 41 56 if (mSelfArray.find (machine.GetName()) == mSelfArray.end()) 42 57 { 43 58 /* 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 */ 44 63 VBoxVMInformationDlg *id = new VBoxVMInformationDlg (aConsole, aSession, Qt::Window); 45 64 id->centerAccording (aConsole); 65 #endif /* VBOX_WITH_NEW_RUNTIME_CORE */ 46 66 connect (vboxGlobal().mainWindow(), SIGNAL (closing()), id, SLOT (close())); 47 67 id->setAttribute (Qt::WA_DeleteOnClose); … … 56 76 } 57 77 78 #ifdef VBOX_WITH_NEW_RUNTIME_CORE 79 VBoxVMInformationDlg::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 */ 58 87 VBoxVMInformationDlg::VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags) 59 # ifdef Q_WS_MAC88 # ifdef Q_WS_MAC 60 89 : QIWithRetranslateUI2 <QIMainDialog> (aConsole, aFlags) 61 # else /* Q_WS_MAC */90 # else /* Q_WS_MAC */ 62 91 : 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 65 95 , mConsole (aConsole) 66 96 , mSession (aSession) 97 #endif /* !VBOX_WITH_NEW_RUNTIME_CORE */ 98 , mIsPolished (false) 67 99 , mStatTimer (new QTimer (this)) 68 100 { … … 95 127 96 128 /* 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 */ 97 141 connect (mInfoStack, SIGNAL (currentChanged (int)), this, SLOT (onPageChanged (int))); 98 142 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()));101 143 connect (mStatTimer, SIGNAL (timeout()), this, SLOT (processStatistics())); 102 connect (mConsole, SIGNAL (resizeHintDone()), this, SLOT (processStatistics()));103 144 104 145 /* Loading language constants */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.h
r25171 r27044 30 30 31 31 class VBoxConsoleView; 32 class UIMachineWindow; 32 33 class QTimer; 33 34 … … 43 44 typedef QMap <QString, VBoxVMInformationDlg*> InfoDlgMap; 44 45 46 #ifdef VBOX_WITH_NEW_RUNTIME_CORE 47 static void createInformationDlg(UIMachineWindow *pMachineWindow); 48 #else /* VBOX_WITH_NEW_RUNTIME_CORE */ 45 49 static void createInformationDlg (const CSession &aSession, VBoxConsoleView *aConsole); 50 #endif /* VBOX_WITH_NEW_RUNTIME_CORE */ 46 51 47 52 protected: 48 53 54 #ifdef VBOX_WITH_NEW_RUNTIME_CORE 55 VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags); 56 #else /* VBOX_WITH_NEW_RUNTIME_CORE */ 49 57 VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags); 58 #endif /* VBOX_WITH_NEW_RUNTIME_CORE */ 50 59 ~VBoxVMInformationDlg(); 51 60 … … 75 84 static InfoDlgMap mSelfArray; 76 85 86 #ifndef VBOX_WITH_NEW_RUNTIME_CORE 87 VBoxConsoleView *mConsole; 88 #endif /* !VBOX_WITH_NEW_RUNTIME_CORE */ 89 CSession mSession; 77 90 bool mIsPolished; 78 VBoxConsoleView *mConsole;79 CSession mSession;80 91 QTimer *mStatTimer; 81 92 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r27012 r27044 895 895 void UIMachineLogic::sltShowInformationDialog() 896 896 { 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()); 899 902 } 900 903 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r26950 r27044 65 65 66 66 /* 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; } 69 69 UIVisualStateType visualStateType() const { return m_visualStateType; } 70 70 QList<UIMachineWindow*>& machineWindows() { return m_machineWindowsList; } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r27012 r27044 103 103 } 104 104 105 UISession* UIMachineWindow::uisession() 105 UISession* UIMachineWindow::uisession() const 106 106 { 107 107 return machineLogic()->uisession(); 108 108 } 109 109 110 CSession& UIMachineWindow::session() 110 CSession& UIMachineWindow::session() const 111 111 { 112 112 return uisession()->session(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r27008 r27044 51 51 52 52 /* 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; 56 58 57 59 protected: … … 60 62 UIMachineWindow(UIMachineLogic *pMachineLogic, ulong uScreenId); 61 63 virtual ~UIMachineWindow(); 62 63 /* Protected wrappers: */64 UISession* uisession();65 CSession& session();66 64 67 65 /* Protected getters: */
Note:
See TracChangeset
for help on using the changeset viewer.