Changeset 52097 in vbox
- Timestamp:
- Jul 18, 2014 11:03:57 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r52012 r52097 507 507 case RuntimeMenuViewActionType_GuestAutoresize: strResult = "GuestAutoresize"; break; 508 508 case RuntimeMenuViewActionType_AdjustWindow: strResult = "AdjustWindow"; break; 509 case RuntimeMenuViewActionType_StatusBar: strResult = "StatusBar"; break; 509 510 case RuntimeMenuViewActionType_Multiscreen: strResult = "Multiscreen"; break; 510 511 case RuntimeMenuViewActionType_All: strResult = "All"; break; … … 529 530 keys << "GuestAutoresize"; values << RuntimeMenuViewActionType_GuestAutoresize; 530 531 keys << "AdjustWindow"; values << RuntimeMenuViewActionType_AdjustWindow; 532 keys << "StatusBar"; values << RuntimeMenuViewActionType_StatusBar; 531 533 keys << "Multiscreen"; values << RuntimeMenuViewActionType_Multiscreen; 532 534 keys << "All"; values << RuntimeMenuViewActionType_All; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r52035 r52097 413 413 RuntimeMenuViewActionType_GuestAutoresize = RT_BIT(3), 414 414 RuntimeMenuViewActionType_AdjustWindow = RT_BIT(4), 415 RuntimeMenuViewActionType_Multiscreen = RT_BIT(5), 415 RuntimeMenuViewActionType_StatusBar = RT_BIT(5), 416 RuntimeMenuViewActionType_Multiscreen = RT_BIT(6), 416 417 RuntimeMenuViewActionType_All = 0xFFFF 417 418 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r51993 r52097 692 692 setName(QApplication::translate("UIActionPool", "&Adjust Window Size")); 693 693 setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display")); 694 } 695 }; 696 697 class UIActionMenuStatusBar : public UIActionMenu 698 { 699 Q_OBJECT; 700 701 public: 702 703 UIActionMenuStatusBar(UIActionPool *pParent) 704 : UIActionMenu(pParent) 705 { 706 retranslateUi(); 707 } 708 709 protected: 710 711 void retranslateUi() 712 { 713 setName(QApplication::translate("UIActionPool", "&Status Bar")); 714 } 715 }; 716 717 class UIActionSimpleShowStatusBarSettingsWindow : public UIActionSimple 718 { 719 Q_OBJECT; 720 721 public: 722 723 UIActionSimpleShowStatusBarSettingsWindow(UIActionPool *pParent) 724 : UIActionSimple(pParent) 725 { 726 retranslateUi(); 727 } 728 729 protected: 730 731 QString shortcutExtraDataID() const 732 { 733 return QString("StatusBarSettings"); 734 } 735 736 void retranslateUi() 737 { 738 setName(QApplication::translate("UIActionPool", "&Status Bar Settings...")); 739 setStatusTip(QApplication::translate("UIActionPool", "Opens window to configure status-bar")); 694 740 } 695 741 }; … … 1341 1387 m_pool[UIActionIndexRuntime_Toggle_GuestAutoresize] = new UIActionToggleGuestAutoresize(this); 1342 1388 m_pool[UIActionIndexRuntime_Simple_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this); 1389 m_pool[UIActionIndexRuntime_Simple_StatusBarSettings] = new UIActionSimpleShowStatusBarSettingsWindow(this); 1343 1390 1344 1391 /* 'Devices' actions: */ … … 1395 1442 delete m_pool[UIActionIndexRuntime_Menu_View]; 1396 1443 m_pool[UIActionIndexRuntime_Menu_View] = new UIActionMenuView(this); 1444 if (m_pool[UIActionIndexRuntime_Menu_StatusBar]) 1445 delete m_pool[UIActionIndexRuntime_Menu_StatusBar]; 1446 m_pool[UIActionIndexRuntime_Menu_StatusBar] = new UIActionMenuStatusBar(this); 1397 1447 1398 1448 /* 'Devices' menu: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r51398 r52097 54 54 UIActionIndexRuntime_Toggle_GuestAutoresize, 55 55 UIActionIndexRuntime_Simple_AdjustWindow, 56 UIActionIndexRuntime_Menu_StatusBar, 57 UIActionIndexRuntime_Simple_StatusBarSettings, 56 58 57 59 /* 'Devices' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r52055 r52097 857 857 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_MouseIntegration)); 858 858 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_Pause)); 859 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)); 860 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings)); 859 861 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Menu_HardDisks)); 860 862 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_StorageSettings)); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r51666 r52097 382 382 383 383 384 /* Separator #2? */ 385 bool fSeparator2 = false; 386 384 387 /* Guest Autoresize action: */ 385 388 if (m_pSession->allowedActionsMenuView() & RuntimeMenuViewActionType_GuestAutoresize) 389 { 386 390 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)); 391 fSeparator2 = true; 392 } 387 393 else 388 394 gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->setEnabled(false); … … 390 396 /* Adjust Window action: */ 391 397 if (m_pSession->allowedActionsMenuView() & RuntimeMenuViewActionType_AdjustWindow) 398 { 392 399 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)); 400 fSeparator2 = true; 401 } 393 402 else 394 403 gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setEnabled(false); 404 405 /* Separator #2: */ 406 if (fSeparator2) 407 pMenu->addSeparator(); 408 409 410 /* Status-bar submenu: */ 411 if (m_pSession->allowedActionsMenuView() & RuntimeMenuViewActionType_StatusBar) 412 { 413 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)); 414 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->menu()->addAction(gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings)); 415 } 416 else 417 { 418 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setEnabled(false); 419 gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings)->setEnabled(false); 420 } 395 421 } 396 422 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
r52076 r52097 23 23 #include <QPaintEvent> 24 24 #include <QMouseEvent> 25 #include <QStatusBar> 25 26 #include <QMdiArea> 26 27 #include <QPainter> … … 35 36 #include "UIExtraDataManager.h" 36 37 #include "UIExtraDataDefs.h" 38 #include "UIMachineWindow.h" 37 39 #include "UIConverter.h" 38 40 #include "UIIconPool.h" … … 699 701 700 702 701 UIStatusBarEditorWindow::UIStatusBarEditorWindow( QWidget *pParent, const QRect &rect, const QRect &statusBarRect)703 UIStatusBarEditorWindow::UIStatusBarEditorWindow(UIMachineWindow *pParent) 702 704 : QWidget(pParent, Qt::Tool | Qt::FramelessWindowHint) 703 , m_rect(rect), m_statusBarRect(statusBarRect) 705 , m_rect(pParent->geometry()) 706 , m_statusBarRect(pParent->statusBar()->geometry()) 704 707 , m_pAnimation(0), m_fExpanded(false) 705 708 , m_pMainLayout(0), m_pMdiArea(0) … … 809 812 #endif /* Q_WS_WIN */ 810 813 811 /* Request to activate window after it was shown: */ 812 connect(this, SIGNAL(sigShown()), this, SLOT(sltActivateWindow()), Qt::QueuedConnection); 814 /* Activate window after it was shown: */ 815 connect(this, SIGNAL(sigShown()), this, 816 SLOT(sltActivateWindow()), Qt::QueuedConnection); 817 /* Update window geometry after parent geometry changed: */ 818 connect(parent(), SIGNAL(sigGeometryChange(const QRect&)), 819 this, SLOT(sltParentGeometryChanged(const QRect&))); 813 820 } 814 821 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.h
r52074 r52097 24 24 class QMdiArea; 25 25 class QMdiSubWindow; 26 class QHBoxLayout; 26 27 class UIAnimation; 27 class QHBoxLayout;28 class UIMachineWindow; 28 29 class UIStatusBarEditorWidget; 29 30 … … 48 49 public: 49 50 50 /** Constructor, passes @a pParent to the QWidget constructor. 51 * @param rect is used to define initial cached parent geometry. 52 * @param statusBarRect is used to define initial cached status-bar geometry. */ 53 UIStatusBarEditorWindow(QWidget *pParent, const QRect &rect, const QRect &statusBarRect); 51 /** Constructor, passes @a pParent to the QWidget constructor. */ 52 UIStatusBarEditorWindow(UIMachineWindow *pParent); 54 53 55 54 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r51671 r52097 434 434 /* Adjust-window action isn't allowed in fullscreen: */ 435 435 gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false); 436 /* Status-bar menu isn't allowed in fullscreen: */ 437 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(false); 436 438 437 439 /* Take care of view-action toggle state: */ … … 606 608 } 607 609 610 /* Reenable status-bar menu: */ 611 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(true); 608 612 /* Reenable adjust-window action: */ 609 613 gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(true); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r51398 r52097 26 26 #include "UIMachineLogicNormal.h" 27 27 #include "UIMachineWindow.h" 28 #include "UIStatusBarEditorWindow.h" 29 #include "UIExtraDataManager.h" 28 30 #ifdef Q_WS_MAC 29 31 #include "VBoxUtils.h" … … 68 70 } 69 71 72 void UIMachineLogicNormal::sltOpenStatusBarSettings() 73 { 74 /* Do not process if window(s) missed! */ 75 AssertReturnVoid(isMachineWindowsCreated()); 76 77 /* Prevent user from opening another one editor: */ 78 gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings)->setEnabled(false); 79 /* Create status-bar editor: */ 80 UIStatusBarEditorWindow *pStatusBarEditor = new UIStatusBarEditorWindow(activeMachineWindow()); 81 AssertPtrReturnVoid(pStatusBarEditor); 82 { 83 /* Configure status-bar editor: */ 84 connect(pStatusBarEditor, SIGNAL(destroyed(QObject*)), 85 this, SLOT(sltStatusBarSettingsClosed())); 86 #ifdef Q_WS_MAC 87 connect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)), 88 pStatusBarEditor, SLOT(sltActivateWindow())); 89 #endif /* Q_WS_MAC */ 90 /* Show window: */ 91 pStatusBarEditor->show(); 92 } 93 } 94 95 void UIMachineLogicNormal::sltStatusBarSettingsClosed() 96 { 97 /* Allow user to open editor again: */ 98 gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings)->setEnabled(true); 99 } 100 70 101 void UIMachineLogicNormal::sltPrepareHardDisksMenu() 71 102 { … … 121 152 connect(gActionPool->action(UIActionIndexRuntime_Toggle_Scale), SIGNAL(triggered(bool)), 122 153 this, SLOT(sltChangeVisualStateToScale())); 154 connect(gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings), SIGNAL(triggered(bool)), 155 this, SLOT(sltOpenStatusBarSettings())); 123 156 124 157 /* "Device" actions connections: */ … … 183 216 disconnect(gActionPool->action(UIActionIndexRuntime_Toggle_Scale), SIGNAL(triggered(bool)), 184 217 this, SLOT(sltChangeVisualStateToScale())); 218 disconnect(gActionPool->action(UIActionIndexRuntime_Simple_StatusBarSettings), SIGNAL(triggered(bool)), 219 this, SLOT(sltOpenStatusBarSettings())); 185 220 186 221 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h
r51398 r52097 39 39 void sltCheckForRequestedVisualStateType(); 40 40 41 /* Windowed mode functionality: */ 41 /* View menu functionality: */ 42 void sltOpenStatusBarSettings(); 43 void sltStatusBarSettingsClosed(); 44 45 /* Devices menu functionality: */ 42 46 void sltPrepareHardDisksMenu(); 43 47 void sltPrepareSharedFoldersMenu(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r52070 r52097 28 28 #include "VBoxGlobal.h" 29 29 #include "UIMachineWindowNormal.h" 30 #include "UIStatusBarEditorWindow.h"31 30 #include "UIActionPoolRuntime.h" 32 31 #include "UIExtraDataManager.h" … … 114 113 } 115 114 116 void UIMachineWindowNormal::sltShowStatusBarContextMenu(const QPoint &position) 117 { 118 /* Prepare context-menu: */ 119 QMenu menu; 120 /* Having just one action to configure status-bar: */ 121 QAction *pAction = menu.addAction(UIIconPool::iconSet(":/vm_settings_16px.png"), 122 tr("Configure status-bar..."), 123 this, SLOT(sltOpenStatusBarEditorWindow())); 124 pAction->setEnabled(!uisession()->property("StatusBarEditorOpened").toBool()); 125 /* Execute context-menu: */ 126 menu.exec(statusBar()->mapToGlobal(position)); 127 } 128 129 void UIMachineWindowNormal::sltOpenStatusBarEditorWindow() 130 { 131 /* Prevent user from opening another one editor: */ 132 uisession()->setProperty("StatusBarEditorOpened", true); 133 /* Create status-bar editor: */ 134 UIStatusBarEditorWindow *pStatusBarEditor = 135 new UIStatusBarEditorWindow(this, m_normalGeometry, statusBar()->geometry()); 136 AssertPtrReturnVoid(pStatusBarEditor); 137 { 138 /* Configure status-bar editor: */ 139 connect(this, SIGNAL(sigGeometryChange(const QRect&)), 140 pStatusBarEditor, SLOT(sltParentGeometryChanged(const QRect&))); 141 connect(pStatusBarEditor, SIGNAL(destroyed(QObject*)), 142 this, SLOT(sltStatusBarEditorWindowClosed())); 143 #ifdef Q_WS_MAC 144 connect(machineLogic(), SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)), 145 pStatusBarEditor, SLOT(sltActivateWindow())); 146 #endif /* Q_WS_MAC */ 147 /* Show window: */ 148 pStatusBarEditor->show(); 149 } 150 } 151 152 void UIMachineWindowNormal::sltStatusBarEditorWindowClosed() 153 { 154 /* Allow user to open editor again: */ 155 uisession()->setProperty("StatusBarEditorOpened", QVariant()); 115 void UIMachineWindowNormal::sltHandleStatusBarContextMenuRequest(const QPoint &position) 116 { 117 /* Raise action's context-menu: */ 118 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->menu()->exec(statusBar()->mapToGlobal(position)); 156 119 } 157 120 … … 237 200 statusBar()->setContextMenuPolicy(Qt::CustomContextMenu); 238 201 connect(statusBar(), SIGNAL(customContextMenuRequested(const QPoint&)), 239 this, SLOT(slt ShowStatusBarContextMenu(const QPoint&)));202 this, SLOT(sltHandleStatusBarContextMenuRequest(const QPoint&))); 240 203 /* Create indicator-pool: */ 241 204 m_pIndicatorsPool = new UIIndicatorsPool(machineLogic()->uisession()); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r52053 r52097 60 60 61 61 /** Handles status-bar context-menu-request: */ 62 void sltShowStatusBarContextMenu(const QPoint &position); 63 /** Handles status-bar editor opening. */ 64 void sltOpenStatusBarEditorWindow(); 65 /** Handles status-bar editor closing. */ 66 void sltStatusBarEditorWindowClosed(); 67 68 /** Handles indicator context-menu-request: */ 62 void sltHandleStatusBarContextMenuRequest(const QPoint &position); 63 /** Handles status-bar indicator context-menu-request: */ 69 64 void sltHandleIndicatorContextMenuRequest(IndicatorType indicatorType, const QPoint &position); 70 65 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp
r50490 r52097 57 57 /* Adjust-window isn't allowed in scale-mode: */ 58 58 gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false); 59 /* Status-bar menu isn't allowed in scale-mode: */ 60 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(false); 59 61 60 62 /* Take care of view-action toggle state: */ … … 149 151 } 150 152 153 /* Reenable status-bar menu: */ 154 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(true); 151 155 /* Reenable guest-autoresize action: */ 152 156 gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->setVisible(true); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r51249 r52097 189 189 /* Disable mouse-integration isn't allowed in seamless: */ 190 190 gActionPool->action(UIActionIndexRuntime_Toggle_MouseIntegration)->setVisible(false); 191 /* Status-bar menu isn't allowed in seamless: */ 192 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(false); 191 193 192 194 /* Take care of view-action toggle state: */ … … 292 294 } 293 295 296 /* Reenable status-bar menu: */ 297 gActionPool->action(UIActionIndexRuntime_Menu_StatusBar)->setVisible(true); 294 298 /* Reenable guest-autoresize action: */ 295 299 gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->setVisible(true);
Note:
See TracChangeset
for help on using the changeset viewer.