Changeset 27028 in vbox for trunk/src/VBox
- Timestamp:
- Mar 4, 2010 1:56:17 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r26950 r27028 1027 1027 } 1028 1028 1029 int VBoxProblemReporter::cannotEnterSeamlessMode() 1030 { 1031 return message(mainMachineWindowShown(), Error, 1032 tr ("<p>Can not switch the guest display to seamless mode. You " 1033 "have more virtual screens configured than physical screens are " 1034 "attached to your host.</p><p>Please either lower the virtual " 1035 "screens in your VM configuration or attach additional screens " 1036 "to your host.</p>"), 1037 0, /* aAutoConfirmId */ 1038 QIMessageBox::Ok | QIMessageBox::Default); 1039 } 1040 1029 1041 bool VBoxProblemReporter::confirmMachineDeletion (const CMachine &machine) 1030 1042 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r26950 r27028 228 228 229 229 int cannotEnterFullscreenMode(); 230 int cannotEnterSeamlessMode(); 230 231 231 232 bool confirmMachineDeletion (const CMachine &machine); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r27015 r27028 23 23 24 24 /* Global includes */ 25 #include <QMenu>26 25 #include <QDesktopWidget> 27 26 … … 35 34 #include "UIMachineLogicFullscreen.h" 36 35 #include "UIMachineWindow.h" 37 #include "UIMachineView.h"38 36 39 37 #include "VBoxUtils.h" … … 53 51 { 54 52 /* Cleanup machine window: */ 55 cleanupMachineWindow ();53 cleanupMachineWindows(); 56 54 57 55 /* Cleanup action related stuff */ … … 89 87 ULONG guestBpp = console.GetDisplay().GetBitsPerPixel(); 90 88 ULONG64 usedBits = 0; 91 for (int i = 0; i < cGuestScreens; ++ i)89 for (int i = 0; i < cGuestScreens; ++ i) 92 90 { 93 91 // TODO_NEW_CORE: really take the screen geometry into account the … … 153 151 } 154 152 155 void UIMachineLogicFullscreen::sltPrepareNetworkAdaptersMenu()156 {157 QMenu *menu = qobject_cast<QMenu*>(sender());158 AssertMsg(menu, ("This slot should be called only on Network Adapters menu show!\n"));159 menu->clear();160 menu->addAction(actionsPool()->action(UIActionIndex_Simple_NetworkAdaptersDialog));161 }162 163 void UIMachineLogicFullscreen::sltPrepareSharedFoldersMenu()164 {165 QMenu *menu = qobject_cast<QMenu*>(sender());166 AssertMsg(menu, ("This slot should be called only on Shared Folders menu show!\n"));167 menu->clear();168 menu->addAction(actionsPool()->action(UIActionIndex_Simple_SharedFoldersDialog));169 }170 171 void UIMachineLogicFullscreen::sltPrepareMouseIntegrationMenu()172 {173 QMenu *menu = qobject_cast<QMenu*>(sender());174 AssertMsg(menu, ("This slot should be called only on Mouse Integration Menu show!\n"));175 menu->clear();176 menu->addAction(actionsPool()->action(UIActionIndex_Toggle_MouseIntegration));177 }178 179 153 void UIMachineLogicFullscreen::prepareActionGroups() 180 154 { 155 /* Base class action groups: */ 181 156 UIMachineLogic::prepareActionGroups(); 182 157 183 158 /* Adjust window isn't allowed in fullscreen */ 184 159 actionsPool()->action(UIActionIndex_Simple_AdjustWindow)->setEnabled(false); 185 }186 187 void UIMachineLogicFullscreen::prepareActionConnections()188 {189 /* Base class connections: */190 UIMachineLogic::prepareActionConnections();191 192 /* This class connections: */193 connect(actionsPool()->action(UIActionIndex_Menu_NetworkAdapters)->menu(), SIGNAL(aboutToShow()),194 this, SLOT(sltPrepareNetworkAdaptersMenu()));195 connect(actionsPool()->action(UIActionIndex_Menu_SharedFolders)->menu(), SIGNAL(aboutToShow()),196 this, SLOT(sltPrepareSharedFoldersMenu()));197 connect(actionsPool()->action(UIActionIndex_Menu_MouseIntegration)->menu(), SIGNAL(aboutToShow()),198 this, SLOT(sltPrepareMouseIntegrationMenu()));199 160 } 200 161 … … 218 179 #endif /* Q_WS_MAC */ 219 180 181 #if 0 // TODO: Add seamless multi-monitor support! 220 182 /* Create machine window(s): */ 221 183 for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId) … … 224 186 for (ulong uScreenId = uMonitorCount; uScreenId > 0; -- uScreenId) 225 187 machineWindows()[uScreenId - 1]->machineWindow()->raise(); 188 #else 189 /* Create primary machine window: */ 190 addMachineWindow(UIMachineWindow::create(this, visualStateType(), 0 /* primary only */)); 191 #endif 226 192 227 193 /* Notify others about machine window(s) created: */ … … 310 276 } 311 277 312 void UIMachineLogicFullscreen::cleanupMachineWindow ()278 void UIMachineLogicFullscreen::cleanupMachineWindows() 313 279 { 314 280 /* Do not cleanup machine window if it is not present: */ … … 316 282 return; 317 283 318 /* Cleanup machine window: */ 284 #if 0 // TODO: Add seamless multi-monitor support! 285 /* Cleanup normal machine window: */ 319 286 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 320 287 UIMachineWindow::destroy(pMachineWindow); 288 #else 289 /* Create machine window(s): */ 290 UIMachineWindow::destroy(machineWindows()[0] /* primary only */); 291 #endif 321 292 322 293 #ifdef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r27015 r27028 45 45 void initialize(); 46 46 47 private slots:48 49 /* Windowed mode funtionality: */50 void sltPrepareNetworkAdaptersMenu();51 void sltPrepareSharedFoldersMenu();52 void sltPrepareMouseIntegrationMenu();53 54 47 private: 55 48 56 49 /* Prepare helpers: */ 57 50 void prepareActionGroups(); 58 void prepareActionConnections();59 51 void prepareMachineWindows(); 60 52 61 53 /* Cleanup helpers: */ 62 void cleanupMachineWindow(); 63 void cleanupActionConnections() {} 54 void cleanupMachineWindows(); 64 55 void cleanupActionGroups(); 65 56 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r27012 r27028 22 22 */ 23 23 24 /* Global includes */ 25 #include <QDesktopWidget> 26 24 27 /* Local includes */ 25 28 #include "COMDefs.h" … … 28 31 29 32 #include "UISession.h" 33 #include "UIActionsPool.h" 30 34 #include "UIMachineLogicSeamless.h" 31 35 #include "UIMachineWindow.h" … … 42 46 /* Cleanup normal machine window: */ 43 47 cleanupMachineWindows(); 48 } 49 50 bool UIMachineLogicSeamless::checkAvailability() 51 { 52 /* Temporary get a machine object */ 53 const CMachine &machine = uisession()->session().GetMachine(); 54 const CConsole &console = uisession()->session().GetConsole(); 55 56 #if (QT_VERSION >= 0x040600) 57 int cHostScreens = QApplication::desktop()->screenCount(); 58 #else /* (QT_VERSION >= 0x040600) */ 59 int cHostScreens = QApplication::desktop()->numScreens(); 60 #endif /* !(QT_VERSION >= 0x040600) */ 61 62 int cGuestScreens = machine.GetMonitorCount(); 63 /* Check that there are enough physical screens are connected */ 64 if (cHostScreens < cGuestScreens) 65 { 66 vboxProblem().cannotEnterSeamlessMode(); 67 return false; 68 } 69 70 // TODO_NEW_CORE: this is how it looked in the old version 71 // bool VBoxConsoleView::isAutoresizeGuestActive() { return mGuestSupportsGraphics && mAutoresizeGuest; } 72 // if (uisession()->session().GetConsole().isAutoresizeGuestActive()) 73 if (uisession()->isGuestAdditionsActive()) 74 { 75 ULONG64 availBits = machine.GetVRAMSize() /* VRAM */ 76 * _1M /* MB to bytes */ 77 * 8; /* to bits */ 78 ULONG guestBpp = console.GetDisplay().GetBitsPerPixel(); 79 ULONG64 usedBits = 0; 80 for (int i = 0; i < cGuestScreens; ++ i) 81 { 82 // TODO_NEW_CORE: really take the screen geometry into account the 83 // different fb will be displayed. */ 84 QRect screen = QApplication::desktop()->availableGeometry(i); 85 usedBits += screen.width() /* display width */ 86 * screen.height() /* display height */ 87 * guestBpp 88 + _1M * 8; /* current cache per screen - may be changed in future */ 89 } 90 usedBits += 4096 * 8; /* adapter info */ 91 92 if (availBits < usedBits) 93 { 94 // vboxProblem().cannotEnterSeamlessMode(screen.width(), screen.height(), guestBpp, 95 // (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M); 96 vboxProblem().cannotEnterSeamlessMode(0, 0, guestBpp, 97 (((usedBits + 7) / 8 + _1M - 1) / _1M) * _1M); 98 return false; 99 } 100 } 101 102 return true; 44 103 } 45 104 … … 69 128 sltMouseCapabilityChanged(); 70 129 } 130 } 131 132 void UIMachineLogicSeamless::prepareActionGroups() 133 { 134 /* Base class action groups: */ 135 UIMachineLogic::prepareActionGroups(); 136 137 /* Adjust window isn't allowed in seamless */ 138 actionsPool()->action(UIActionIndex_Simple_AdjustWindow)->setEnabled(false); 71 139 } 72 140 … … 203 271 } 204 272 273 void UIMachineLogicSeamless::cleanupActionGroups() 274 { 275 /* Reenable adjust window */ 276 actionsPool()->action(UIActionIndex_Simple_AdjustWindow)->setEnabled(true); 277 } 278 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h
r27012 r27028 42 42 virtual ~UIMachineLogicSeamless(); 43 43 44 bool checkAvailability(); 44 45 void initialize(); 45 46 … … 47 48 48 49 /* Prepare helpers: */ 50 void prepareActionGroups(); 49 51 void prepareMachineWindows(); 50 52 51 53 /* Cleanup helpers: */ 52 54 void cleanupMachineWindows(); 55 void cleanupActionGroups(); 53 56 54 57 /* Friend classes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
r27012 r27028 33 33 protected: 34 34 35 /* Normalmachine view constructor/destructor: */35 /* Seamless machine view constructor/destructor: */ 36 36 UIMachineViewSeamless( UIMachineWindow *pMachineWindow 37 37 , VBoxDefs::RenderMode renderMode
Note:
See TracChangeset
for help on using the changeset viewer.