Changeset 75093 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 26, 2018 12:22:34 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r75016 r75093 144 144 /* Configure pane: */ 145 145 m_pPaneSnapshots->setProperty("ToolType", QVariant::fromValue(UIToolType_Snapshots)); 146 connect(m_pPaneSnapshots, &UISnapshotPane::sigCurrentItemChange, 147 this, &UIToolPaneMachine::sigCurrentSnapshotItemChange); 146 148 147 149 /* Add into layout: */ … … 246 248 } 247 249 250 bool UIToolPaneMachine::isCurrentStateItemSelected() const 251 { 252 if (!m_pPaneSnapshots) 253 return false; 254 return m_pPaneSnapshots->isCurrentStateItemSelected(); 255 } 256 248 257 void UIToolPaneMachine::prepare() 249 258 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r75016 r75093 54 54 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &uId); 55 55 56 /** Notifies listeners about current Snapshot pane item change. */ 57 void sigCurrentSnapshotItemChange(); 58 56 59 public: 57 60 … … 81 84 /** Defines the @a comMachine object. */ 82 85 void setMachine(const CMachine &comMachine); 86 87 /** Returns whether current-state item of Snapshot pane is selected. */ 88 bool isCurrentStateItemSelected() const; 83 89 84 90 private: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r75054 r75093 392 392 default: break; 393 393 } 394 } 395 396 void UIVirtualBoxManager::sltCurrentSnapshotItemChange() 397 { 398 updateActionsAppearance(); 394 399 } 395 400 … … 1845 1850 connect(m_pWidget, &UIVirtualBoxManagerWidget::sigCloudProfileManagerChange, 1846 1851 this, &UIVirtualBoxManager::sigCloudProfileManagerChange); 1852 connect(m_pWidget, &UIVirtualBoxManagerWidget::sigCurrentSnapshotItemChange, 1853 this, &UIVirtualBoxManager::sltCurrentSnapshotItemChange); 1847 1854 setCentralWidget(m_pWidget); 1848 1855 } … … 2305 2312 return !isGroupSavingInProgress() && 2306 2313 items.size() == 1 && 2307 pItem->configurationAccessLevel() != ConfigurationAccessLevel_Null; 2314 pItem->configurationAccessLevel() != ConfigurationAccessLevel_Null && 2315 (m_pWidget->currentMachineTool() != UIToolType_Snapshots || 2316 m_pWidget->isCurrentStateItemSelected()); 2308 2317 } 2309 2318 case UIActionIndexST_M_Machine_S_Clone: … … 2335 2344 { 2336 2345 return !isGroupSavingInProgress() && 2337 isAtLeastOneItemCanBeStartedOrShown(items); 2346 isAtLeastOneItemCanBeStartedOrShown(items) && 2347 (m_pWidget->currentMachineTool() != UIToolType_Snapshots || 2348 m_pWidget->isCurrentStateItemSelected()); 2338 2349 } 2339 2350 case UIActionIndexST_M_Group_S_Discard: … … 2341 2352 { 2342 2353 return !isGroupSavingInProgress() && 2343 isAtLeastOneItemDiscardable(items); 2354 isAtLeastOneItemDiscardable(items) && 2355 (m_pWidget->currentMachineTool() != UIToolType_Snapshots || 2356 m_pWidget->isCurrentStateItemSelected()); 2344 2357 } 2345 2358 case UIActionIndexST_M_Group_S_ShowLogDialog: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r75055 r75093 121 121 /** Handles singal about Tool type change. */ 122 122 void sltHandleToolTypeChange(); 123 124 /** Handles current snapshot item change. */ 125 void sltCurrentSnapshotItemChange(); 123 126 /** @} */ 124 127 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r75086 r75093 168 168 } 169 169 170 bool UIVirtualBoxManagerWidget::isCurrentStateItemSelected() const 171 { 172 return m_pPaneToolsMachine->isCurrentStateItemSelected(); 173 } 174 170 175 void UIVirtualBoxManagerWidget::sltHandleContextMenuRequest(const QPoint &position) 171 176 { … … 454 459 if (m_pPaneToolsMachine) 455 460 { 461 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigCurrentSnapshotItemChange, 462 this, &UIVirtualBoxManagerWidget::sigCurrentSnapshotItemChange); 463 456 464 /* Add into stack: */ 457 465 m_pStackedWidget->addWidget(m_pPaneToolsMachine); … … 657 665 case UIToolType_Snapshots: 658 666 { 659 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_New));660 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));661 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));662 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));663 m_pToolBar->addSeparator();664 667 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Take)); 665 668 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Delete)); … … 667 670 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_T_Properties)); 668 671 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Clone)); 672 m_pToolBar->addSeparator(); 673 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings)); 674 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard)); 675 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)); 669 676 break; 670 677 } 671 678 case UIToolType_Logs: 672 679 { 673 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_New));674 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));675 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));676 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));677 m_pToolBar->addSeparator();678 680 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Save)); 679 681 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Find)); … … 682 684 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_T_Settings)); 683 685 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Log_S_Refresh)); 686 m_pToolBar->addSeparator(); 687 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings)); 688 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard)); 689 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)); 684 690 break; 685 691 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r75086 r75093 59 59 /** Notifies listeners about Cloud Profile Manager change. */ 60 60 void sigCloudProfileManagerChange(); 61 62 /** Notifies listeners about current Snapshots pane item change. */ 63 void sigCurrentSnapshotItemChange(); 61 64 62 65 public: … … 113 116 /** @} */ 114 117 118 /** @name Snapshot pane stuff. 119 * @{ */ 120 /** Returns whether current-state item of Snapshot pane is selected. */ 121 bool isCurrentStateItemSelected() const; 122 /** @} */ 123 115 124 public slots: 116 125 -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r75027 r75093 506 506 } 507 507 508 bool UISnapshotPane::isCurrentStateItemSelected() const 509 { 510 return m_pCurrentStateItem && m_pSnapshotTree->currentItem() == m_pCurrentStateItem; 511 } 512 508 513 void UISnapshotPane::retranslateUi() 509 514 { … … 1051 1056 m_pDetailsWidget->setData(*pSnapshotItem, pSnapshotItem->snapshot()); 1052 1057 } 1058 1059 /* Notify listeners: */ 1060 emit sigCurrentItemChange(); 1053 1061 } 1054 1062 -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h
r74942 r75093 55 55 Q_OBJECT; 56 56 57 signals: 58 59 /** Notifies listeners about current item change. */ 60 void sigCurrentItemChange(); 61 57 62 public: 58 63 … … 67 72 /** Returns cached snapshot-item icon depending on @a fOnline flag. */ 68 73 const QIcon *snapshotItemIcon(bool fOnline) const; 74 75 /** Returns whether "current state" item selected. */ 76 bool isCurrentStateItemSelected() const; 69 77 70 78 protected:
Note:
See TracChangeset
for help on using the changeset viewer.