Changeset 27008 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 4, 2010 9:58:43 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r27007 r27008 127 127 .arg(VBOX_BLEEDING_EDGE); 128 128 #endif 129 }130 131 void UIMachineWindow::sltMediumChange(const CMediumAttachment &attachment)132 {133 KDeviceType type = attachment.GetType();134 if (type == KDeviceType_HardDisk)135 updateAppearanceOf(UIVisualElement_HDStuff);136 if (type == KDeviceType_DVD)137 updateAppearanceOf(UIVisualElement_CDStuff);138 if (type == KDeviceType_Floppy)139 updateAppearanceOf(UIVisualElement_FDStuff);140 }141 142 void UIMachineWindow::sltUSBControllerChange()143 {144 updateAppearanceOf(UIVisualElement_USBStuff);145 }146 147 void UIMachineWindow::sltUSBDeviceStateChange()148 {149 updateAppearanceOf(UIVisualElement_USBStuff);150 }151 152 void UIMachineWindow::sltNetworkAdapterChange()153 {154 updateAppearanceOf(UIVisualElement_NetworkStuff);155 }156 157 void UIMachineWindow::sltSharedFolderChange()158 {159 updateAppearanceOf(UIVisualElement_SharedFolderStuff);160 129 } 161 130 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r27007 r27008 35 35 /* Local forwards */ 36 36 class CSession; 37 class CMediumAttachment;38 37 class UISession; 39 38 class UIMachineLogic; … … 55 54 virtual QWidget* machineWindow() { return m_pMachineWindow; } 56 55 virtual UIMachineView* machineView() { return m_pMachineView; } 57 58 protected slots:59 60 /* Console callback handlers: */61 virtual void sltMediumChange(const CMediumAttachment &attachment);62 virtual void sltUSBControllerChange();63 virtual void sltUSBDeviceStateChange();64 virtual void sltNetworkAdapterChange();65 virtual void sltSharedFolderChange();66 56 67 57 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r27007 r27008 84 84 } 85 85 86 void UIMachineWindowFullscreen::sltMachineStateChanged() 87 { 88 UIMachineWindow::sltMachineStateChanged(); 89 } 90 91 void UIMachineWindowFullscreen::sltMediumChange(const CMediumAttachment &attachment) 92 { 93 KDeviceType type = attachment.GetType(); 94 if (type == KDeviceType_HardDisk) 95 updateAppearanceOf(UIVisualElement_HDStuff); 96 if (type == KDeviceType_DVD) 97 updateAppearanceOf(UIVisualElement_CDStuff); 98 if (type == KDeviceType_Floppy) 99 updateAppearanceOf(UIVisualElement_FDStuff); 100 } 101 102 void UIMachineWindowFullscreen::sltUSBControllerChange() 103 { 104 updateAppearanceOf(UIVisualElement_USBStuff); 105 } 106 107 void UIMachineWindowFullscreen::sltUSBDeviceStateChange() 108 { 109 updateAppearanceOf(UIVisualElement_USBStuff); 110 } 111 112 void UIMachineWindowFullscreen::sltNetworkAdapterChange() 113 { 114 updateAppearanceOf(UIVisualElement_NetworkStuff); 115 } 116 117 void UIMachineWindowFullscreen::sltSharedFolderChange() 118 { 119 updateAppearanceOf(UIVisualElement_SharedFolderStuff); 120 } 121 122 void UIMachineWindowFullscreen::sltTryClose() 123 { 124 UIMachineWindow::sltTryClose(); 125 } 126 127 void UIMachineWindowFullscreen::sltProcessGlobalSettingChange(const char * /* aPublicName */, const char * /* aName */) 128 { 129 } 130 86 131 void UIMachineWindowFullscreen::retranslateUi() 87 132 { … … 97 142 } 98 143 144 void UIMachineWindowFullscreen::updateAppearanceOf(int iElement) 145 { 146 /* Update parent-class window: */ 147 UIMachineWindow::updateAppearanceOf(iElement); 148 } 149 99 150 bool UIMachineWindowFullscreen::event(QEvent *pEvent) 100 151 { 101 152 return QIWithRetranslateUI<QIMainDialog>::event(pEvent); 102 103 153 // TODO_NEW_CORE 104 154 switch (pEvent->type()) … … 109 159 if (!isMaximized()) 110 160 { 111 //m_normalGeometry.setSize(pResizeEvent->size());161 m_normalGeometry.setSize(pResizeEvent->size()); 112 162 #ifdef VBOX_WITH_DEBUGGER_GUI 113 163 // TODO: Update debugger window size! … … 121 171 if (!isMaximized()) 122 172 { 123 //m_normalGeometry.moveTo(geometry().x(), geometry().y());173 m_normalGeometry.moveTo(geometry().x(), geometry().y()); 124 174 #ifdef VBOX_WITH_DEBUGGER_GUI 125 175 // TODO: Update debugger window position! … … 162 212 } 163 213 214 void UIMachineWindowFullscreen::prepareConsoleConnections() 215 { 216 /* Base-class connections: */ 217 UIMachineWindow::prepareConsoleConnections(); 218 219 /* Medium change updater: */ 220 connect(machineLogic()->uisession(), SIGNAL(sigMediumChange(const CMediumAttachment &)), 221 this, SLOT(sltMediumChange(const CMediumAttachment &))); 222 223 /* USB controller change updater: */ 224 connect(machineLogic()->uisession(), SIGNAL(sigUSBControllerChange()), 225 this, SLOT(sltUSBControllerChange())); 226 227 /* USB device state-change updater: */ 228 connect(machineLogic()->uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)), 229 this, SLOT(sltUSBDeviceStateChange())); 230 231 /* Network adapter change updater: */ 232 connect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)), 233 this, SLOT(sltNetworkAdapterChange())); 234 235 /* Shared folder change updater: */ 236 connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()), 237 this, SLOT(sltSharedFolderChange())); 238 } 239 164 240 void UIMachineWindowFullscreen::prepareMenu() 165 241 { … … 204 280 void UIMachineWindowFullscreen::loadWindowSettings() 205 281 { 282 /* Load normal window settings: */ 283 // CMachine machine = session().GetMachine(); 284 206 285 /* Toggle console to manual resize mode. */ 207 286 // m_pMachineView->setMachineWindowResizeIgnored(true); … … 223 302 move(0, 0); 224 303 304 // m_pMachineView->normalizeGeometry(true); 225 305 // ((UIMachineViewFullscreen*)m_pMachineView)->sltPerformGuestResize(maximumSize()); 226 // m_pMachineView->setGuestAutoresizeEnabled(); 306 307 // QRect r = geometry(); 308 /* Load global settings: */ 309 { 310 // VBoxGlobalSettings settings = vboxGlobal().settings(); 311 // menuBar()->setHidden(settings.isFeatureActive("noMenuBar")); 312 } 227 313 } 228 314 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r27007 r27008 40 40 #endif /* Q_WS_MAC */ 41 41 42 /* Local forwards */ 43 class CMediumAttachment; 44 42 45 class UIMachineWindowFullscreen : public QIWithRetranslateUI<QIMainDialog>, public UIMachineWindow 43 46 { … … 50 53 virtual ~UIMachineWindowFullscreen(); 51 54 55 private slots: 56 57 /* Console callback handlers: */ 58 void sltMachineStateChanged(); 59 void sltMediumChange(const CMediumAttachment &attachment); 60 void sltUSBControllerChange(); 61 void sltUSBDeviceStateChange(); 62 void sltNetworkAdapterChange(); 63 void sltSharedFolderChange(); 64 65 /* LED connections: */ 66 void sltProcessGlobalSettingChange(const char *aPublicName, const char *aName); 67 68 /* Close window reimplementation: */ 69 void sltTryClose(); 70 52 71 private: 53 72 54 73 /* Translate routine: */ 55 74 void retranslateUi(); 75 76 /* Update routines: */ 77 void updateAppearanceOf(int aElement); 56 78 57 79 /* Event handlers: */ … … 63 85 64 86 /* Prepare helpers: */ 65 //void prepareConsoleConnections();87 void prepareConsoleConnections(); 66 88 void prepareMenu(); 67 89 void prepareConnections(); … … 76 98 //void cleanupConsoleConnections() {} 77 99 100 /* Other members: */ 101 QRect m_normalGeometry; 102 78 103 /* Factory support: */ 79 104 friend class UIMachineWindow; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r27007 r27008 97 97 } 98 98 99 void UIMachineWindowNormal::sltMachineStateChanged() 100 { 101 UIMachineWindow::sltMachineStateChanged(); 102 } 103 104 void UIMachineWindowNormal::sltMediumChange(const CMediumAttachment &attachment) 105 { 106 KDeviceType type = attachment.GetType(); 107 if (type == KDeviceType_HardDisk) 108 updateAppearanceOf(UIVisualElement_HDStuff); 109 if (type == KDeviceType_DVD) 110 updateAppearanceOf(UIVisualElement_CDStuff); 111 if (type == KDeviceType_Floppy) 112 updateAppearanceOf(UIVisualElement_FDStuff); 113 } 114 115 void UIMachineWindowNormal::sltUSBControllerChange() 116 { 117 updateAppearanceOf(UIVisualElement_USBStuff); 118 } 119 120 void UIMachineWindowNormal::sltUSBDeviceStateChange() 121 { 122 updateAppearanceOf(UIVisualElement_USBStuff); 123 } 124 125 void UIMachineWindowNormal::sltNetworkAdapterChange() 126 { 127 updateAppearanceOf(UIVisualElement_NetworkStuff); 128 } 129 130 void UIMachineWindowNormal::sltSharedFolderChange() 131 { 132 updateAppearanceOf(UIVisualElement_SharedFolderStuff); 133 } 134 99 135 void UIMachineWindowNormal::sltTryClose() 100 136 { … … 285 321 /* Base-class connections: */ 286 322 UIMachineWindow::prepareConsoleConnections(); 323 324 /* Medium change updater: */ 325 connect(machineLogic()->uisession(), SIGNAL(sigMediumChange(const CMediumAttachment &)), 326 this, SLOT(sltMediumChange(const CMediumAttachment &))); 327 328 /* USB controller change updater: */ 329 connect(machineLogic()->uisession(), SIGNAL(sigUSBControllerChange()), 330 this, SLOT(sltUSBControllerChange())); 331 332 /* USB device state-change updater: */ 333 connect(machineLogic()->uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)), 334 this, SLOT(sltUSBDeviceStateChange())); 335 336 /* Network adapter change updater: */ 337 connect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)), 338 this, SLOT(sltNetworkAdapterChange())); 339 340 /* Shared folder change updater: */ 341 connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()), 342 this, SLOT(sltSharedFolderChange())); 287 343 } 288 344 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r27007 r27008 37 37 38 38 /* Local forwards */ 39 class CMediumAttachment; 39 40 class UIIndicatorsPool; 40 41 class QIStateIndicator; … … 51 52 52 53 private slots: 54 55 /* Console callback handlers: */ 56 void sltMachineStateChanged(); 57 void sltMediumChange(const CMediumAttachment &attachment); 58 void sltUSBControllerChange(); 59 void sltUSBDeviceStateChange(); 60 void sltNetworkAdapterChange(); 61 void sltSharedFolderChange(); 53 62 54 63 /* LED connections: */
Note:
See TracChangeset
for help on using the changeset viewer.