Changeset 52236 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 30, 2014 2:11:22 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r52220 r52236 20 20 #include "UIExtraDataManager.h" 21 21 #include "UIShortcutPool.h" 22 #include "UIFrameBuffer.h" 23 #include "UISession.h" 22 24 #include "VBoxGlobal.h" 23 25 … … 1259 1261 UIActionPoolRuntime::UIActionPoolRuntime(bool fTemporary /* = false */) 1260 1262 : UIActionPool(UIActionPoolType_Runtime, fTemporary) 1261 { 1263 , m_pSession(0) 1264 { 1265 } 1266 1267 void UIActionPoolRuntime::setSession(UISession *pSession) 1268 { 1269 m_pSession = pSession; 1270 m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup; 1271 } 1272 1273 UISession* UIActionPoolRuntime::session() const 1274 { 1275 return m_pSession; 1262 1276 } 1263 1277 … … 1334 1348 #endif /* VBOX_WITH_DEBUGGER_GUI */ 1335 1349 1336 void UIActionPoolRuntime::setCurrentFrameBufferSizes(const QList<QSize> &sizes, bool fUpdateMenu /* = false */)1337 {1338 m_sizes = sizes;1339 if (fUpdateMenu)1340 m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;1341 }1342 1343 1350 void UIActionPoolRuntime::sltPrepareMenuViewResize() 1344 1351 { … … 1360 1367 const QSize size = pAction->property("Requested Size").toSize(); 1361 1368 emit sigNotifyAboutTriggeringViewResize(iScreenIndex, size); 1369 } 1370 1371 void UIActionPoolRuntime::sltHandleFrameBufferResize() 1372 { 1373 /* Make sure session was set: */ 1374 AssertPtrReturnVoid(m_pSession); 1375 1376 /* Update the list of frame-buffer sizes: */ 1377 m_frameBufferSizes.clear(); 1378 foreach (const UIFrameBuffer *pFrameBuffer, session()->frameBuffers()) 1379 m_frameBufferSizes << QSize(pFrameBuffer->width(), pFrameBuffer->height()); 1380 /* Invalidate View and ViewPopup menus: */ 1381 m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup; 1362 1382 } 1363 1383 … … 1915 1935 const bool fAllowToShowActionResize = isAllowedInMenuView(RuntimeMenuViewActionType_Resize); 1916 1936 if (fAllowToShowActionResize) 1917 for (int iScreenIndex = 0; iScreenIndex < m_ sizes.size(); ++iScreenIndex)1937 for (int iScreenIndex = 0; iScreenIndex < m_frameBufferSizes.size(); ++iScreenIndex) 1918 1938 { 1919 1939 /* Add 'Virtual Screen %1' menu: */ … … 1967 1987 const bool fAllowToShowActionResize = isAllowedInMenuView(RuntimeMenuViewActionType_Resize); 1968 1988 if (fAllowToShowActionResize) 1969 for (int iScreenIndex = 0; iScreenIndex < m_ sizes.size(); ++iScreenIndex)1989 for (int iScreenIndex = 0; iScreenIndex < m_frameBufferSizes.size(); ++iScreenIndex) 1970 1990 { 1971 1991 /* Add 'Virtual Screen %1' menu: */ … … 2026 2046 /* Get corresponding screen index and size: */ 2027 2047 const int iScreenIndex = pMenu->property("Screen Index").toInt(); 2028 const QSize screenSize = m_ sizes.at(iScreenIndex);2048 const QSize screenSize = m_frameBufferSizes.at(iScreenIndex); 2029 2049 2030 2050 /* Create exclusive action-group: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r52220 r52236 25 25 #include "UIActionPool.h" 26 26 #include "UIExtraDataDefs.h" 27 28 /* Forward declarations: */ 29 class UISession; 27 30 28 31 /** Runtime action-pool index enum. … … 122 125 public: 123 126 127 /** Defines UI session object reference. 128 * @note For menus which uses it to build contents. */ 129 void setSession(UISession *pSession); 130 /** Returns UI session object reference. */ 131 UISession* session() const; 132 124 133 /** Returns whether the menu with passed @a type is allowed in menu-bar. */ 125 134 bool isAllowedInMenuBar(RuntimeMenuType type) const; … … 149 158 #endif /* VBOX_WITH_DEBUGGER_GUI */ 150 159 151 /** Defines current frame-buffer sizes152 * for menus which uses such arguments to build content. */153 void setCurrentFrameBufferSizes(const QList<QSize> &sizes, bool fUpdateMenu = false);154 155 160 protected slots: 156 161 … … 159 164 /** Handles 'View' : 'Resize' menu @a pAction trigger. */ 160 165 void sltHandleActionTriggerViewResize(QAction *pAction); 166 167 /** Handles frame-buffer resize. */ 168 void sltHandleFrameBufferResize(); 161 169 162 170 protected: … … 221 229 private: 222 230 231 /** Holds the UI session object reference. */ 232 UISession *m_pSession; 233 223 234 /** Holds the list of main-menus. */ 224 235 QList<QMenu*> m_mainMenus; … … 237 248 #endif /* VBOX_WITH_DEBUGGER_GUI */ 238 249 239 /** Defines current frame-buffer sizes 240 * for menus which uses such arguments to build content. */ 241 QList<QSize> m_sizes; 250 /** Holds current frame-buffer sizes. */ 251 QList<QSize> m_frameBufferSizes; 242 252 243 253 /* Enable factory in base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r52220 r52236 805 805 806 806 /* Host-screen-change updaters: */ 807 connect(uisession(), SIGNAL(sigHostScreenCountChanged()), 808 this, SLOT(sltHostScreenCountChanged())); 809 connect(uisession(), SIGNAL(sigHostScreenGeometryChanged()), 810 this, SLOT(sltHostScreenGeometryChanged())); 807 connect(uisession(), SIGNAL(sigHostScreenCountChanged()), this, SLOT(sltHostScreenCountChanged())); 808 connect(uisession(), SIGNAL(sigHostScreenGeometryChanged()), this, SLOT(sltHostScreenGeometryChanged())); 809 810 /* Frame-buffer connections: */ 811 connect(this, SIGNAL(sigFrameBufferResize()), uisession(), SIGNAL(sigFrameBufferResize())); 811 812 } 812 813 … … 957 958 } 958 959 959 void UIMachineLogic::prepareOtherConnections()960 {961 connect(this, SIGNAL(sigFrameBufferResize()), this, SLOT(sltHandleFrameBufferResize()));962 }963 964 960 void UIMachineLogic::prepareHandlers() 965 961 { … … 1487 1483 } 1488 1484 1489 void UIMachineLogic::sltHandleFrameBufferResize()1490 {1491 /* Prepare the list of frame-buffer sizes: */1492 QList<QSize> frameBufferSizes;1493 foreach (UIMachineWindow *pMachineWindow, machineWindows())1494 {1495 const UIFrameBuffer *pFB = uisession()->frameBuffer(pMachineWindow->screenId());1496 frameBufferSizes << QSize(pFB->width(), pFB->height());1497 }1498 /* Pass that list to the action-pool to update 'View' menu accordingly: */1499 actionPool()->toRuntime()->setCurrentFrameBufferSizes(frameBufferSizes);1500 }1501 1502 1485 void UIMachineLogic::sltOpenVMSettingsDialog(const QString &strCategory /* = QString() */, 1503 1486 const QString &strControl /* = QString()*/) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r52220 r52236 166 166 virtual void prepareActionGroups(); 167 167 virtual void prepareActionConnections(); 168 virtual void prepareOtherConnections() ;168 virtual void prepareOtherConnections() {} 169 169 virtual void prepareHandlers(); 170 170 virtual void prepareMachineWindows() = 0; … … 222 222 void sltClose(); 223 223 224 /** Handles frame-buffer resize. */225 void sltHandleFrameBufferResize();226 227 224 /* "Device" menu functionality: */ 228 225 void sltOpenVMSettingsDialog(const QString &strCategory = QString(), const QString &strControl = QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r52203 r52236 985 985 /* Create action-pool: */ 986 986 m_pActionPool = UIActionPool::create(UIActionPoolType_Runtime); 987 m_pActionPool->toRuntime()->setSession(this); 988 connect(this, SIGNAL(sigFrameBufferResize()), m_pActionPool, SLOT(sltHandleFrameBufferResize())); 987 989 988 990 /* Get host/machine: */ … … 1128 1130 { 1129 1131 /* Each framebuffer will be really prepared on first UIMachineView creation: */ 1130 const ULONG uMonitorCount = m_session.GetMachine().GetMonitorCount(); 1131 m_frameBufferVector.resize(uMonitorCount); 1132 QVector<QSize> sizes(uMonitorCount); 1133 actionPool()->toRuntime()->setCurrentFrameBufferSizes(sizes.toList(), true); 1132 m_frameBufferVector.resize(m_session.GetMachine().GetMonitorCount()); 1134 1133 } 1135 1134 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r52202 r52236 206 206 * Ignores (asserts) if screen-number attribute is out of bounds: */ 207 207 void setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer); 208 /** Returns existing frame-buffer vector. */ 209 const QVector<ComObjPtr<UIFrameBuffer> >& frameBuffers() const { return m_frameBufferVector; } 208 210 209 211 /* Temporary API: */ … … 215 217 /* Notifier: Close Runtime UI stuff: */ 216 218 void sigCloseRuntimeUI(); 219 220 /** Notifies about frame-buffer resize. */ 221 void sigFrameBufferResize(); 217 222 218 223 /* Console callback signals: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r52203 r52236 477 477 void UIMachineLogicFullscreen::prepareOtherConnections() 478 478 { 479 /* Call to base-class: */480 UIMachineLogic::prepareOtherConnections();481 482 479 /* Make sure 'presentation mode' preference handling 483 480 * is updated at runtime for Lion and previous: */ … … 517 514 connect(pMachineWindow, SIGNAL(sigFrameBufferResize()), 518 515 this, SIGNAL(sigFrameBufferResize())); 516 emit sigFrameBufferResize(); 519 517 520 518 /* Connect multi-screen layout change handler: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r52203 r52236 177 177 connect(pMachineWindow, SIGNAL(sigFrameBufferResize()), 178 178 this, SIGNAL(sigFrameBufferResize())); 179 emit sigFrameBufferResize(); 179 180 180 181 /* Mark machine-window(s) created: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp
r52203 r52236 130 130 connect(pMachineWindow, SIGNAL(sigFrameBufferResize()), 131 131 this, SIGNAL(sigFrameBufferResize())); 132 emit sigFrameBufferResize(); 132 133 133 134 /* Mark machine-window(s) created: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r52203 r52236 262 262 connect(pMachineWindow, SIGNAL(sigFrameBufferResize()), 263 263 this, SIGNAL(sigFrameBufferResize())); 264 emit sigFrameBufferResize(); 264 265 265 266 /* Connect multi-screen layout change handler: */
Note:
See TracChangeset
for help on using the changeset viewer.