Changeset 52112 in vbox
- Timestamp:
- Jul 21, 2014 4:14:18 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95135
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 12 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc ¶
r51922 r52112 59 59 <file alias="diskimage_16px.png">images/diskimage_16px.png</file> 60 60 <file alias="diskimage_32px.png">images/diskimage_32px.png</file> 61 <file alias="display_software_16px.png">images/display_software_16px.png</file> 62 <file alias="display_hardware_16px.png">images/display_hardware_16px.png</file> 63 <file alias="display_hardware_write_16px.png">images/display_hardware_write_16px.png</file> 61 64 <file alias="drag_drop_16px.png">images/drag_drop_16px.png</file> 62 65 <file alias="drag_drop_disabled_16px.png">images/drag_drop_disabled_16px.png</file> -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp ¶
r52097 r52112 1102 1102 case IndicatorType_USB: strResult = "USB"; break; 1103 1103 case IndicatorType_SharedFolders: strResult = "SharedFolders"; break; 1104 case IndicatorType_Display: strResult = "Display"; break; 1104 1105 case IndicatorType_VideoCapture: strResult = "VideoCapture"; break; 1105 1106 case IndicatorType_Features: strResult = "Features"; break; … … 1127 1128 keys << "USB"; values << IndicatorType_USB; 1128 1129 keys << "SharedFolders"; values << IndicatorType_SharedFolders; 1130 keys << "Display"; values << IndicatorType_Display; 1129 1131 keys << "VideoCapture"; values << IndicatorType_VideoCapture; 1130 1132 keys << "Features"; values << IndicatorType_Features; … … 1149 1151 case IndicatorType_USB: return UIIconPool::iconSet(":/usb_16px.png"); 1150 1152 case IndicatorType_SharedFolders: return UIIconPool::iconSet(":/sf_16px.png"); 1153 case IndicatorType_Display: return UIIconPool::iconSet(":/display_software_16px.png"); 1151 1154 case IndicatorType_VideoCapture: return UIIconPool::iconSet(":/video_capture_16px.png"); 1152 1155 case IndicatorType_Features: return UIIconPool::iconSet(":/vtx_amdv_16px.png"); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h ¶
r52100 r52112 490 490 IndicatorType_Network, 491 491 IndicatorType_SharedFolders, 492 IndicatorType_Display, 492 493 IndicatorType_VideoCapture, 493 494 IndicatorType_Features, -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp ¶
r52100 r52112 530 530 setName(QApplication::translate("UIActionPool", "&View")); 531 531 } 532 }; 533 534 class UIActionMenuViewPopup : public UIActionMenu 535 { 536 Q_OBJECT; 537 538 public: 539 540 UIActionMenuViewPopup(UIActionPool *pParent) 541 : UIActionMenu(pParent) 542 { 543 retranslateUi(); 544 } 545 546 protected: 547 548 void retranslateUi() {} 532 549 }; 533 550 … … 1469 1486 delete m_pool[UIActionIndexRuntime_Menu_View]; 1470 1487 m_pool[UIActionIndexRuntime_Menu_View] = new UIActionMenuView(this); 1488 if (m_pool[UIActionIndexRuntime_Menu_ViewPopup]) 1489 delete m_pool[UIActionIndexRuntime_Menu_ViewPopup]; 1490 m_pool[UIActionIndexRuntime_Menu_ViewPopup] = new UIActionMenuViewPopup(this); 1471 1491 if (m_pool[UIActionIndexRuntime_Menu_StatusBar]) 1472 1492 delete m_pool[UIActionIndexRuntime_Menu_StatusBar]; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h ¶
r52100 r52112 49 49 /* 'View' menu actions: */ 50 50 UIActionIndexRuntime_Menu_View, 51 UIActionIndexRuntime_Menu_ViewPopup, 51 52 UIActionIndexRuntime_Toggle_Fullscreen, 52 53 UIActionIndexRuntime_Toggle_Seamless, -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h ¶
r52086 r52112 158 158 uchar *address() { return m_image.bits(); } 159 159 /** Returns frame-buffer width. */ 160 ulong width() { return m_iWidth; }160 ulong width() const { return m_iWidth; } 161 161 /** Returns frame-buffer height. */ 162 ulong height() { return m_iHeight; }162 ulong height() const { return m_iHeight; } 163 163 /** Returns frame-buffer bits-per-pixel value. */ 164 ulong bitsPerPixel() { return m_image.depth(); }164 ulong bitsPerPixel() const { return m_image.depth(); } 165 165 /** Returns frame-buffer bytes-per-line value. */ 166 ulong bytesPerLine() { return m_image.bytesPerLine(); }166 ulong bytesPerLine() const { return m_image.bytesPerLine(); } 167 167 /** Returns default frame-buffer pixel-format. */ 168 ulong pixelFormat() { return FramebufferPixelFormat_FOURCC_RGB; }168 ulong pixelFormat() const { return FramebufferPixelFormat_FOURCC_RGB; } 169 169 170 170 /** Locks frame-buffer access. */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp ¶
r52100 r52112 558 558 }; 559 559 560 /** UISessionStateStatusBarIndicator extension for Runtime UI: Display indicator. */ 561 class UIIndicatorDisplay : public UISessionStateStatusBarIndicator 562 { 563 Q_OBJECT; 564 565 public: 566 567 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */ 568 UIIndicatorDisplay(CSession &session) 569 : UISessionStateStatusBarIndicator(session) 570 { 571 /* Assign state-icons: */ 572 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/display_software_16px.png")); 573 setStateIcon(KDeviceActivity_Idle, UIIconPool::iconSet(":/display_hardware_16px.png")); 574 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/display_hardware_write_16px.png")); 575 /* Translate finally: */ 576 retranslateUi(); 577 } 578 579 private: 580 581 /** Retranslation routine. */ 582 void retranslateUi() 583 { 584 updateAppearance(); 585 } 586 587 /** Update routine. */ 588 void updateAppearance() 589 { 590 /* Get machine: */ 591 const CMachine machine = m_session.GetMachine(); 592 593 /* Prepare tool-tip: */ 594 QString strToolTip = QApplication::translate("UIIndicatorsPool", 595 "<p style='white-space:pre'>" 596 "<nobr>Indicates the activity of the display:</nobr>%1</p>"); 597 QString strFullData; 598 599 /* Video Memory: */ 600 const ULONG uVRAMSize = machine.GetVRAMSize(); 601 const QString strVRAMSize = VBoxGlobal::tr("<nobr>%1 MB</nobr>", "details report").arg(uVRAMSize); 602 strFullData += QString("<br><nobr><b>%1:</b> %2</nobr>") 603 .arg(VBoxGlobal::tr("Video Memory", "details report"), strVRAMSize); 604 605 /* Monitor Count: */ 606 const ULONG uMonitorCount = machine.GetMonitorCount(); 607 if (uMonitorCount > 1) 608 { 609 const QString strMonitorCount = QString::number(uMonitorCount); 610 strFullData += QString("<br><nobr><b>%1:</b> %2</nobr>") 611 .arg(VBoxGlobal::tr("Screens", "details report"), strMonitorCount); 612 } 613 614 /* 3D acceleration: */ 615 const bool fAcceleration3D = machine.GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable(); 616 if (fAcceleration3D) 617 { 618 const QString strAcceleration3D = fAcceleration3D 619 ? VBoxGlobal::tr("Enabled", "details report (3D Acceleration)") 620 : VBoxGlobal::tr("Disabled", "details report (3D Acceleration)"); 621 strFullData += QString("<br><nobr><b>%1:</b> %2</nobr>") 622 .arg(VBoxGlobal::tr("3D Acceleration", "details report"), strAcceleration3D); 623 } 624 625 /* Update tool-tip: */ 626 setToolTip(strToolTip.arg(strFullData)); 627 /* Set initial indicator state: */ 628 setState(fAcceleration3D ? KDeviceActivity_Idle : KDeviceActivity_Null); 629 } 630 }; 631 560 632 /** UISessionStateStatusBarIndicator extension for Runtime UI: Video-capture indicator. */ 561 633 class UIIndicatorVideoCapture : public UISessionStateStatusBarIndicator … … 981 1053 if (m_pool.contains(IndicatorType_SharedFolders)) 982 1054 updateIndicatorStateForDevice(m_pool.value(IndicatorType_SharedFolders), KDeviceType_SharedFolder); 1055 if (m_pool.contains(IndicatorType_Display)) 1056 updateIndicatorStateForDevice(m_pool.value(IndicatorType_Display), KDeviceType_Graphics3D); 983 1057 } 984 1058 … … 1118 1192 case IndicatorType_Network: m_pool[indicatorType] = new UIIndicatorNetwork(m_session); break; 1119 1193 case IndicatorType_SharedFolders: m_pool[indicatorType] = new UIIndicatorSharedFolders(m_session); break; 1194 case IndicatorType_Display: m_pool[indicatorType] = new UIIndicatorDisplay(m_session); break; 1120 1195 case IndicatorType_VideoCapture: m_pool[indicatorType] = new UIIndicatorVideoCapture(m_session); break; 1121 1196 case IndicatorType_Features: m_pool[indicatorType] = new UIIndicatorFeatures(m_session); break; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h ¶
r47478 r52112 35 35 UIVisualElement_USBStuff = RT_BIT(7), 36 36 UIVisualElement_SharedFolderStuff = RT_BIT(8), 37 UIVisualElement_VideoCapture = RT_BIT(9), 38 UIVisualElement_FeaturesStuff = RT_BIT(10), 39 UIVisualElement_MiniToolBar = RT_BIT(11), 37 UIVisualElement_Display = RT_BIT(9), 38 UIVisualElement_VideoCapture = RT_BIT(10), 39 UIVisualElement_FeaturesStuff = RT_BIT(11), 40 UIVisualElement_MiniToolBar = RT_BIT(12), 40 41 UIVisualElement_AllStuff = 0xFFFF 41 42 }; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp ¶
r52100 r52112 840 840 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Reset)); 841 841 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Shutdown)); 842 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_ViewPopup)); 842 843 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_Fullscreen)); 843 844 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_Seamless)); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp ¶
r52100 r52112 28 28 #include "UIStatusBarEditorWindow.h" 29 29 #include "UIExtraDataManager.h" 30 #include "UIFrameBuffer.h" 30 31 #ifdef Q_WS_MAC 31 32 #include "VBoxUtils.h" 32 33 #endif /* Q_WS_MAC */ 34 35 /* COM includes: */ 36 #include "CConsole.h" 37 #include "CDisplay.h" 33 38 34 39 UIMachineLogicNormal::UIMachineLogicNormal(QObject *pParent, UISession *pSession) … … 119 124 } 120 125 126 void UIMachineLogicNormal::sltPrepareMenuViewPopup() 127 { 128 /* Make sure sender is valid: */ 129 QMenu *pMenu = qobject_cast<QMenu*>(sender()); 130 AssertMsgReturnVoid(pMenu, ("This slot should be called only on View popup-menu show!\n")); 131 132 /* Clear contents: */ 133 pMenu->clear(); 134 135 /* Add default contents: */ 136 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)); 137 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)); 138 pMenu->addSeparator(); 139 140 /* Check if guest additions are enabled: */ 141 const bool fGAEnabled = uisession()->isGuestAdditionsActive() && 142 uisession()->isGuestSupportsGraphics(); 143 144 /* For each the machine-window: */ 145 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 146 { 147 /* Add 'Virtual Screen %1' menu: */ 148 const int iScreenID = pMachineWindow->screenId(); 149 QMenu *pSubMenu = pMenu->addMenu(QApplication::translate("UIMultiScreenLayout", 150 "Virtual Screen %1").arg(iScreenID + 1)); 151 pSubMenu->setProperty("Screen ID", iScreenID); 152 pSubMenu->setEnabled(fGAEnabled); 153 connect(pSubMenu, SIGNAL(aboutToShow()), this, SLOT(sltPrepareMenuViewVirtualScreen())); 154 } 155 } 156 157 void UIMachineLogicNormal::sltPrepareMenuViewVirtualScreen() 158 { 159 /* Make sure sender is valid: */ 160 QMenu *pMenu = qobject_cast<QMenu*>(sender()); 161 AssertMsgReturnVoid(pMenu, ("This slot should be called only on 'Virtual Screen %1' menu show!\n")); 162 163 /* Clear contents: */ 164 pMenu->clear(); 165 166 /* Prepare new contents: */ 167 const QList<QSize> sizes = QList<QSize>() 168 << QSize(640, 480) 169 << QSize(800, 600) 170 << QSize(1024, 768) 171 << QSize(1280, 720) 172 << QSize(1280, 800) 173 << QSize(1366, 768) 174 << QSize(1440, 900) 175 << QSize(1600, 900) 176 << QSize(1680, 1050) 177 << QSize(1920, 1080) 178 << QSize(1920, 1200); 179 180 /* Get corresponding screen ID and frame-buffer: */ 181 const int iScreenID = pMenu->property("Screen ID").toInt(); 182 const UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(iScreenID); 183 184 /* Create exclusive action-group: */ 185 QActionGroup *pActionGroup = new QActionGroup(pMenu); 186 AssertPtrReturnVoid(pActionGroup); 187 { 188 /* Configure exclusive action-group: */ 189 pActionGroup->setExclusive(true); 190 /* For every available size: */ 191 foreach (const QSize &size, sizes) 192 { 193 /* Create exclusive action: */ 194 QAction *pAction = pActionGroup->addAction(UIActionPoolRuntime::tr("Resize to %1x%2", "Virtual Screen") 195 .arg(size.width()).arg(size.height())); 196 AssertPtrReturnVoid(pAction); 197 { 198 /* Configure exclusive action: */ 199 pAction->setProperty("Screen ID", iScreenID); 200 pAction->setProperty("Requested Size", size); 201 pAction->setCheckable(true); 202 if (pFrameBuffer->width() == size.width() && 203 pFrameBuffer->height() == size.height()) 204 { 205 pAction->setChecked(true); 206 } 207 /* Insert group actions into menu: */ 208 pMenu->addActions(pActionGroup->actions()); 209 } 210 } 211 /* Install listener for exclusive action-group: */ 212 connect(pActionGroup, SIGNAL(triggered(QAction*)), 213 this, SLOT(sltHandleActionTriggerViewVirtualScreen(QAction*))); 214 } 215 } 216 217 void UIMachineLogicNormal::sltHandleActionTriggerViewVirtualScreen(QAction *pAction) 218 { 219 /* Make sure sender is valid: */ 220 AssertMsgReturnVoid(pAction, ("This slot should be called only on 'Virtual Screen %1' menu action trigger!\n")); 221 222 /* Resize guest to required size: */ 223 const int iScreenID = pAction->property("Screen ID").toInt(); 224 const QSize size = pAction->property("Requested Size").toSize(); 225 CDisplay display = session().GetConsole().GetDisplay(); 226 display.SetVideoModeHint(iScreenID, uisession()->isScreenVisible(iScreenID), 227 false, 0, 0, size.width(), size.height(), 0); 228 } 229 121 230 void UIMachineLogicNormal::sltPrepareHardDisksMenu() 122 231 { … … 166 275 167 276 /* "View" actions connections: */ 277 connect(gActionPool->action(UIActionIndexRuntime_Menu_ViewPopup)->menu(), SIGNAL(aboutToShow()), 278 this, SLOT(sltPrepareMenuViewPopup())); 168 279 connect(gActionPool->action(UIActionIndexRuntime_Toggle_Fullscreen), SIGNAL(triggered(bool)), 169 280 this, SLOT(sltChangeVisualStateToFullscreen())); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h ¶
r52100 r52112 43 43 void sltStatusBarSettingsClosed(); 44 44 void sltToggleStatusBar(); 45 void sltPrepareMenuViewPopup(); 46 void sltPrepareMenuViewVirtualScreen(); 47 void sltHandleActionTriggerViewVirtualScreen(QAction *pAction); 45 48 46 49 /* Devices menu functionality: */ -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp ¶
r52100 r52112 152 152 case IndicatorType_Network: pAction = gActionPool->action(UIActionIndexRuntime_Menu_Network); break; 153 153 case IndicatorType_SharedFolders: pAction = gActionPool->action(UIActionIndexRuntime_Menu_SharedFolders); break; 154 case IndicatorType_Display: pAction = gActionPool->action(UIActionIndexRuntime_Menu_ViewPopup); break; 154 155 case IndicatorType_VideoCapture: pAction = gActionPool->action(UIActionIndexRuntime_Menu_VideoCapture); break; 155 156 case IndicatorType_Mouse: pAction = gActionPool->action(UIActionIndexRuntime_Menu_MouseIntegration); break; … … 488 489 if (iElement & UIVisualElement_SharedFolderStuff) 489 490 m_pIndicatorsPool->updateAppearance(IndicatorType_SharedFolders); 491 if (iElement & UIVisualElement_Display) 492 m_pIndicatorsPool->updateAppearance(IndicatorType_Display); 490 493 if (iElement & UIVisualElement_VideoCapture) 491 494 m_pIndicatorsPool->updateAppearance(IndicatorType_VideoCapture);
Note:
See TracChangeset
for help on using the changeset viewer.