Changeset 71374 in vbox for trunk/src/VBox
- Timestamp:
- Mar 19, 2018 3:19:12 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r69500 r71374 132 132 QWidget* UIMachine::activeWindow() const 133 133 { 134 if (machineLogic() && machineLogic()->activeMachineWindow())135 return machineLogic()->activeMachineWindow();136 return0;134 return machineLogic() && machineLogic()->activeMachineWindow() 135 ? machineLogic()->activeMachineWindow() 136 : 0; 137 137 } 138 138 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r70723 r71374 196 196 prepareMenu(); 197 197 198 /* Prepare machine 198 /* Prepare machine-window(s): */ 199 199 prepareMachineWindows(); 200 200 … … 236 236 cleanupMenu(); 237 237 238 /* Cleanup machine 238 /* Cleanup machine-window(s): */ 239 239 cleanupMachineWindows(); 240 240 … … 316 316 if (!isMachineWindowsCreated()) 317 317 return 0; 318 /* First machine-window otherwise: */ 319 return machineWindows().first(); 318 319 /* First machine-window by default: */ 320 return machineWindows().value(0); 320 321 } 321 322 322 323 UIMachineWindow* UIMachineLogic::activeMachineWindow() const 323 324 { 324 /* Return null if windows are not created yet: */325 /* Null if machine-window(s) not yet created: */ 325 326 if (!isMachineWindowsCreated()) 326 327 return 0; … … 334 335 } 335 336 336 /* Return main machine window: */337 /* Main machine-window by default: */ 337 338 return mainMachineWindow(); 338 339 } … … 1740 1741 1741 1742 /* Invoke VM information dialog: */ 1742 UIVMInformationDialog::invoke( mainMachineWindow());1743 UIVMInformationDialog::invoke(activeMachineWindow()); 1743 1744 } 1744 1745 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r71368 r71374 260 260 } 261 261 262 void UIMachineWindow::showEvent(QShowEvent *p ShowEvent)263 { 264 /* Call to base 265 QMainWindow::showEvent(p ShowEvent);262 void UIMachineWindow::showEvent(QShowEvent *pEvent) 263 { 264 /* Call to base-class: */ 265 QMainWindow::showEvent(pEvent); 266 266 267 267 /* Update appearance for indicator-pool: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r69500 r71374 36 36 class QCloseEvent; 37 37 class QGridLayout; 38 class QShowEvent; 38 39 class QSpacerItem; 39 40 class UIActionPool; … … 125 126 void retranslateUi(); 126 127 127 /** Show event handler. */128 v oid showEvent(QShowEvent *pShowEvent);128 /** Handles show @a pEvent. */ 129 virtual void showEvent(QShowEvent *pEvent) /* override */; 129 130 130 131 /** Close event handler. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r71368 r71374 167 167 /* Notify user about mouse&keyboard auto-capturing: */ 168 168 if (gEDataManager->autoCaptureEnabled()) 169 popupCenter().remindAboutAutoCapture( machineLogic()->activeMachineWindow());169 popupCenter().remindAboutAutoCapture(activeMachineWindow()); 170 170 171 171 /* Check if we are in teleportation waiting mode. … … 501 501 { 502 502 return mainMachineWindow()->winId(); 503 } 504 505 UIMachineWindow *UISession::activeMachineWindow() const 506 { 507 return machineLogic() ? machineLogic()->activeMachineWindow() : 0; 503 508 } 504 509 … … 1782 1787 /// @todo In case of multi-monitor setup check whether device-pixel-ratio and cursor are screen specific. 1783 1788 /* Get screen-id of main-window: */ 1784 const ulong uScreenID = machineLogic()->activeMachineWindow()->screenId();1789 const ulong uScreenID = activeMachineWindow()->screenId(); 1785 1790 /* Get device-pixel-ratio: */ 1786 1791 const double dDevicePixelRatio = frameBuffer(uScreenID)->devicePixelRatio(); … … 1796 1801 /// @todo In case of multi-monitor setup check whether device-pixel-ratio and cursor are screen specific. 1797 1802 /* Get screen-id of main-window: */ 1798 const ulong uScreenID = machineLogic()->activeMachineWindow()->screenId();1803 const ulong uScreenID = activeMachineWindow()->screenId(); 1799 1804 /* Get device-pixel-ratio: */ 1800 1805 const double dDevicePixelRatio = frameBuffer(uScreenID)->devicePixelRatio(); … … 1908 1913 if (!comVBox.isOk() || comMedium.isNull()) 1909 1914 { 1910 popupCenter().cannotOpenMedium( machineLogic()->activeMachineWindow(), comVBox, enmMediumType, strMediumName);1915 popupCenter().cannotOpenMedium(activeMachineWindow(), comVBox, enmMediumType, strMediumName); 1911 1916 return false; 1912 1917 } … … 1951 1956 if (sStorageSlots.isEmpty()) 1952 1957 { 1953 popupCenter().cannotMountImage( machineLogic()->activeMachineWindow(), machineName(), strMediumName);1958 popupCenter().cannotMountImage(activeMachineWindow(), machineName(), strMediumName); 1954 1959 return false; 1955 1960 } … … 1967 1972 if (!machine().isOk()) 1968 1973 { 1969 msgCenter().cannotRemountMedium(machine(), guiMedium, true /* mount? */, false /* retry? */, mainMachineWindow());1974 msgCenter().cannotRemountMedium(machine(), guiMedium, true /* mount? */, false /* retry? */, activeMachineWindow()); 1970 1975 return false; 1971 1976 } … … 1977 1982 if (!machine().isOk()) 1978 1983 { 1979 popupCenter().cannotSaveMachineSettings( machineLogic()->activeMachineWindow(), machine());1984 popupCenter().cannotSaveMachineSettings(activeMachineWindow(), machine()); 1980 1985 return false; 1981 1986 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r69858 r71374 45 45 class UIMachine; 46 46 class UIMachineLogic; 47 class UIMachineWindow; 47 48 class UIActionPool; 48 49 class CUSBDevice; … … 126 127 QWidget* mainMachineWindow() const; 127 128 WId mainMachineWindowId() const; 129 UIMachineWindow *activeMachineWindow() const; 128 130 QCursor cursor() const { return m_cursor; } 129 131
Note:
See TracChangeset
for help on using the changeset viewer.