vbox的更動 69057 路徑 trunk/src/VBox
- 時間撮記:
- 2017-10-12 上午09:43:58 (7 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox/src
- 檔案:
-
- 修改 8 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
r68418 r69057 1318 1318 m_pool[UIActionIndexST_M_Tools_T_Machine] = new UIActionToggleToolsMachine(this); 1319 1319 m_pool[UIActionIndexST_M_Tools_M_Machine] = new UIActionMenuToolsMachine(this); 1320 m_pool[UIActionIndexST_M_Tools_M_Machine_ Details] = new UIActionSimpleToolsMachineDetails(this);1321 m_pool[UIActionIndexST_M_Tools_M_Machine_S napshots] = new UIActionSimpleToolsMachineSnapshots(this);1320 m_pool[UIActionIndexST_M_Tools_M_Machine_S_Details] = new UIActionSimpleToolsMachineDetails(this); 1321 m_pool[UIActionIndexST_M_Tools_M_Machine_S_Snapshots] = new UIActionSimpleToolsMachineSnapshots(this); 1322 1322 1323 1323 /* Global Tools actions: */ 1324 1324 m_pool[UIActionIndexST_M_Tools_T_Global] = new UIActionToggleToolsGlobal(this); 1325 1325 m_pool[UIActionIndexST_M_Tools_M_Global] = new UIActionMenuToolsGlobal(this); 1326 m_pool[UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager] = new UIActionSimpleToolsGlobalVirtualMediaManager(this);1327 m_pool[UIActionIndexST_M_Tools_M_Global_ HostNetworkManager] = new UIActionSimpleToolsGlobalHostNetworkManager(this);1326 m_pool[UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager] = new UIActionSimpleToolsGlobalVirtualMediaManager(this); 1327 m_pool[UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager] = new UIActionSimpleToolsGlobalHostNetworkManager(this); 1328 1328 1329 1329 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h
r68200 r69057 95 95 UIActionIndexST_M_Tools_T_Machine, 96 96 UIActionIndexST_M_Tools_M_Machine, 97 UIActionIndexST_M_Tools_M_Machine_ Details,98 UIActionIndexST_M_Tools_M_Machine_S napshots,97 UIActionIndexST_M_Tools_M_Machine_S_Details, 98 UIActionIndexST_M_Tools_M_Machine_S_Snapshots, 99 99 100 100 /* Global Tools actions: */ 101 101 UIActionIndexST_M_Tools_T_Global, 102 102 UIActionIndexST_M_Tools_M_Global, 103 UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager,104 UIActionIndexST_M_Tools_M_Global_ HostNetworkManager,103 UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager, 104 UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager, 105 105 106 106 /* Maximum index: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r68456 r69057 157 157 /* Restore previously opened Machine tools at startup: */ 158 158 QMap<ToolTypeMachine, QAction*> mapActionsMachine; 159 mapActionsMachine[ToolTypeMachine_Details] = actionPool()->action(UIActionIndexST_M_Tools_M_Machine_ Details);160 mapActionsMachine[ToolTypeMachine_Snapshots] = actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S napshots);159 mapActionsMachine[ToolTypeMachine_Details] = actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Details); 160 mapActionsMachine[ToolTypeMachine_Snapshots] = actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots); 161 161 for (int i = m_orderMachine.size() - 1; i >= 0; --i) 162 162 if (m_orderMachine.at(i) != ToolTypeMachine_Invalid) … … 275 275 /* Make sure Details or Snapshot pane is chosen if opened: */ 276 276 if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Details)) 277 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_ Details)->trigger();277 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Details)->trigger(); 278 278 else 279 279 if (m_pPaneToolsMachine->isToolOpened(ToolTypeMachine_Snapshots)) 280 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S napshots)->trigger();280 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)->trigger(); 281 281 } 282 282 … … 2121 2121 /* We can restore previously opened Global tools right here: */ 2122 2122 QMap<ToolTypeGlobal, QAction*> mapActionsGlobal; 2123 mapActionsGlobal[ToolTypeGlobal_VirtualMedia] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager);2124 mapActionsGlobal[ToolTypeGlobal_HostNetwork] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_ HostNetworkManager);2123 mapActionsGlobal[ToolTypeGlobal_VirtualMedia] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager); 2124 mapActionsGlobal[ToolTypeGlobal_HostNetwork] = actionPool()->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager); 2125 2125 for (int i = m_orderGlobal.size() - 1; i >= 0; --i) 2126 2126 if (m_orderGlobal.at(i) != ToolTypeGlobal_Invalid) … … 2367 2367 /* Enable/disable tools actions: */ 2368 2368 actionPool()->action(UIActionIndexST_M_Tools_M_Machine)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine, items)); 2369 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_ Details)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_Details, items));2370 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S napshots)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_Snapshots, items));2369 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Details)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_S_Details, items)); 2370 actionPool()->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)->setEnabled(isActionEnabled(UIActionIndexST_M_Tools_M_Machine_S_Snapshots, items)); 2371 2371 } 2372 2372 … … 2496 2496 } 2497 2497 case UIActionIndexST_M_Tools_M_Machine: 2498 case UIActionIndexST_M_Tools_M_Machine_ Details:2499 case UIActionIndexST_M_Tools_M_Machine_S napshots:2498 case UIActionIndexST_M_Tools_M_Machine_S_Details: 2499 case UIActionIndexST_M_Tools_M_Machine_S_Snapshots: 2500 2500 { 2501 2501 return pItem->accessible(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp
r68418 r69057 196 196 197 197 /* Add tool descriptions: */ 198 QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager);198 QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager); 199 199 m_pPaneDesktop->addToolDescription(pAction1, 200 200 tr("Tool to observe virtual storage media. " … … 206 206 "<u>location/name</u>, <u>description</u> and <u>size</u> (for dynamical storages " 207 207 "only).")); 208 QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ HostNetworkManager);208 QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager); 209 209 m_pPaneDesktop->addToolDescription(pAction2, 210 210 tr("Tool to control host-only network interfaces. " -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneMachine.cpp
r68418 r69057 253 253 if (m_pItem && m_pItem->accessible()) 254 254 { 255 QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_ Details);255 QAction *pAction1 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details); 256 256 m_pPaneDesktop->addToolDescription(pAction1, 257 257 tr("Tool to observe virtual machine (VM) details. " 258 258 "Reflects groups of <u>properties</u> for the currently chosen VM and allows " 259 259 "basic operations on certain properties (like the machine storage devices).")); 260 QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S napshots);260 QAction *pAction2 = m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots); 261 261 m_pPaneDesktop->addToolDescription(pAction2, 262 262 tr("Tool to control virtual machine (VM) snapshots. " -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsToolbar.cpp
r68304 r69057 105 105 else 106 106 { 107 idTab = m_pTabBarMachine->addTab(pAction ->icon(), pAction->text().remove('&'));107 idTab = m_pTabBarMachine->addTab(pAction); 108 108 m_mapTabIdsMachine[enmType] = idTab; 109 109 } … … 128 128 else 129 129 { 130 idTab = m_pTabBarGlobal->addTab(pAction ->icon(), pAction->text().remove('&'));130 idTab = m_pTabBarGlobal->addTab(pAction); 131 131 m_mapTabIdsGlobal[enmType] = idTab; 132 132 } … … 207 207 { 208 208 /* Add 'Details' action: */ 209 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_ Details));210 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_ Details), &UIAction::triggered,209 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details)); 210 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details), &UIAction::triggered, 211 211 this, &UIToolsToolbar::sltHandleOpenToolMachine); 212 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_ Details)212 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details) 213 213 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Details)); 214 214 215 215 /* Add 'Snapshots' action: */ 216 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S napshots));217 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S napshots), &UIAction::triggered,216 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)); 217 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots), &UIAction::triggered, 218 218 this, &UIToolsToolbar::sltHandleOpenToolMachine); 219 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S napshots)219 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots) 220 220 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Snapshots)); 221 221 } … … 231 231 { 232 232 /* Add 'Virtual Media Manager' action: */ 233 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager));234 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager), &UIAction::triggered,233 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager)); 234 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager), &UIAction::triggered, 235 235 this, &UIToolsToolbar::sltHandleOpenToolGlobal); 236 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ VirtualMediaManager)236 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager) 237 237 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_VirtualMedia)); 238 238 239 239 /* Add 'Host Network Manager' action: */ 240 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ HostNetworkManager));241 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ HostNetworkManager), &UIAction::triggered,240 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)); 241 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager), &UIAction::triggered, 242 242 this, &UIToolsToolbar::sltHandleOpenToolGlobal); 243 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_ HostNetworkManager)243 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager) 244 244 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_HostNetwork)); 245 245 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp
r68522 r69057 21 21 22 22 /* Qt includes: */ 23 # include <QAction> 23 24 # include <QApplication> 24 25 # include <QDrag> … … 40 41 41 42 /* GUI includes: */ 43 # include "QIWithRetranslateUI.h" 42 44 # include "UIIconPool.h" 43 45 # include "UITabBar.h" 44 46 47 /* Other VBox includes: */ 45 48 # include "iprt/assert.h" 46 49 … … 64 67 65 68 /** Our own skinnable implementation of tabs for tab-bar. */ 66 class UITabBarItem : public Q Widget69 class UITabBarItem : public QIWithRetranslateUI<QWidget> 67 70 { 68 71 Q_OBJECT; … … 87 90 static const QString MimeType; 88 91 89 /** Creates tab-bar item on the basis of passed @a uuid , @a icon and @a strName. */90 UITabBarItem(const QUuid &uuid, const Q Icon &icon = QIcon(), const QString &strName = QString());92 /** Creates tab-bar item on the basis of passed @a uuid and @a pAction. */ 93 UITabBarItem(const QUuid &uuid, const QAction *pAction); 91 94 92 95 /** Returns item ID. */ 93 96 const QUuid uuid() const { return m_uuid; } 94 /** Returns item icon. */95 const QIcon icon() const { return m_icon; }96 /** Returns item name. */97 const QString name() const { return m_strName; }98 97 99 98 /** Defines the item @a enmPositionStyle. */ … … 104 103 105 104 protected: 105 106 /** Handles translation event. */ 107 virtual void retranslateUi() /* override */; 106 108 107 109 /** Handles paint @a pEvent. */ … … 130 132 131 133 /** Holds the item ID. */ 132 const QUuid m_uuid; 133 /** Holds the item icon. */ 134 QIcon m_icon; 135 /** Holds the item name. */ 136 QString m_strName; 134 const QUuid m_uuid; 135 /** Holds the item action reference. */ 136 const QAction *m_pAction; 137 137 138 138 /** Holds the item position style. */ … … 170 170 const QString UITabBarItem::MimeType = QString("application/virtualbox;value=TabID"); 171 171 172 UITabBarItem::UITabBarItem(const QUuid &uuid, const Q Icon &icon /* = QIcon() */, const QString &strName /* = QString() */)172 UITabBarItem::UITabBarItem(const QUuid &uuid, const QAction *pAction) 173 173 : m_uuid(uuid) 174 , m_icon(icon) 175 , m_strName(strName) 174 , m_pAction(pAction) 176 175 , m_enmPosition(PositionStyle_Single) 177 176 , m_fCurrent(false) … … 213 212 /* And call for repaint: */ 214 213 update(); 214 } 215 216 void UITabBarItem::retranslateUi() 217 { 218 /* Translate label: */ 219 m_pLabelName->setText(m_pAction->text().remove('&')); 215 220 } 216 221 … … 547 552 pDrag->setMimeData(pMimeData); 548 553 const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 549 pDrag->setPixmap( icon().pixmap(iMetric, iMetric));554 pDrag->setPixmap(m_pAction->icon().pixmap(iMetric, iMetric)); 550 555 pDrag->exec(); 551 556 } … … 618 623 /* Configure label: */ 619 624 m_pLabelIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 620 m_pLabelIcon->setPixmap(m_ icon.pixmap(iMetric));625 m_pLabelIcon->setPixmap(m_pAction->icon().pixmap(iMetric)); 621 626 } 622 627 … … 627 632 /* Configure label: */ 628 633 m_pLabelName->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 629 m_pLabelName->setText(m_strName);630 634 } 631 635 … … 671 675 #endif /* !VBOX_WS_MAC */ 672 676 } 677 678 /* Apply language settings: */ 679 retranslateUi(); 673 680 } 674 681 … … 690 697 } 691 698 692 QUuid UITabBar::addTab(const Q Icon &icon /* = QIcon() */, const QString &strName /* = QString() */)699 QUuid UITabBar::addTab(const QAction *pAction) 693 700 { 694 701 /* Generate unique ID: */ 695 702 const QUuid uuid = QUuid::createUuid(); 696 703 /* Create new tab item: */ 697 UITabBarItem *pItem = new UITabBarItem(uuid, icon, strName);704 UITabBarItem *pItem = new UITabBarItem(uuid, pAction); 698 705 AssertPtrReturn(pItem, QUuid()); 699 706 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.h
r68480 r69057 26 26 27 27 /* Forward declarations: */ 28 class QAction; 28 29 class QDragEnterEvent; 29 30 class QDragLeaveEvent; … … 58 59 UITabBar(QWidget *pParent = 0); 59 60 60 /** Adds new tab with passed @a icon and @a strName. @returns unique tab ID. */61 QUuid addTab(const Q Icon &icon = QIcon(), const QString &strName = QString());61 /** Adds new tab for passed @a pAction. @returns unique tab ID. */ 62 QUuid addTab(const QAction *pAction); 62 63 63 64 /** Removes tab with passed @a uuid. */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器