Changeset 67419 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 15, 2017 9:37:52 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116145
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r67114 r67419 211 211 } 212 212 213 void UISelectorWindow::sltHandleChooserPaneIndexChange(bool fRefreshDetails, bool fRefreshSnapshots, bool) 213 void UISelectorWindow::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */, 214 bool fUpdateTools /* = true */) 214 215 { 215 216 /* Get current item: */ … … 237 238 updateActionsAppearance(); 238 239 239 /* Refresh details-pane even if there are no items selected: */240 if (f RefreshDetails)240 /* Update Details-pane: */ 241 if (fUpdateDetails) 241 242 m_pPaneDetails->setItems(currentItems()); 242 243 … … 244 245 if (pItem && pItem->accessible()) 245 246 { 246 /* Make sure at least detailspane raised: */247 /* Make sure at least Details-pane raised: */ 247 248 if (m_pContainerDetails->currentWidget() == m_pPaneDesktop) 248 249 m_pContainerDetails->setCurrentWidget(m_pPaneDetails); 249 250 250 if (fRefreshSnapshots) 251 { 252 updateSnapshots(pItem, pItem->machine()); 253 /* Always hide snapshots-view if 254 * single group or more than one machine is selected: */ 255 if (currentItems().size() > 1 || m_pPaneChooser->isSingleGroupSelected()) 256 lockSnapshots(); 257 } 251 /* Refresh Tools-pane if requested: */ 252 if (fUpdateTools) 253 m_pPaneTools->setMachine(pItem->machine()); 258 254 } 259 255 else 260 256 { 261 /* Make sure desktoppane raised: */257 /* Make sure Desktop-pane raised: */ 262 258 if (m_pContainerDetails->currentWidget() != m_pPaneDesktop) 263 259 m_pContainerDetails->setCurrentWidget(m_pPaneDesktop); … … 290 286 } 291 287 292 /* Empty and disable other tabs: */293 updateSnapshots(0,CMachine());288 /* Refresh Tools-pane in any case: */ 289 m_pPaneTools->setMachine(CMachine()); 294 290 } 295 291 } … … 409 405 } 410 406 411 void UISelectorWindow::sltHandleSnapshotChange(QString strID)412 {413 /* Get current item: */414 UIVMItem *pItem = currentItem();415 416 /* Make sure current item present: */417 if (!pItem)418 return;419 420 /* If signal is for the current item: */421 if (pItem->id() == strID)422 updateSnapshots(pItem, pItem->machine());423 }424 425 407 void UISelectorWindow::sltOpenVirtualMediumManagerWindow() 426 408 { … … 1084 1066 else 1085 1067 { 1086 /* Raise the desktoppane with welcome text or error details: */1068 /* Raise the Desktop-pane with welcome text or error details: */ 1087 1069 m_pContainerDetails->setCurrentWidget(m_pPaneDesktop); 1088 1070 } … … 1126 1108 { 1127 1109 return m_pPaneChooser->currentItems(); 1128 }1129 1130 void UISelectorWindow::updateSnapshots(UIVMItem * /* pItem */, const CMachine &comMachine)1131 {1132 /* Update snapshot pane availability: */1133 if (comMachine.isNotNull())1134 m_pSegmentedButton->setEnabled(SegmentType_Tools, true);1135 else1136 lockSnapshots();1137 1138 /* Update tools pane finally: */1139 m_pPaneTools->setMachine(comMachine);1140 }1141 1142 void UISelectorWindow::lockSnapshots()1143 {1144 /* First switch to details pane: */1145 sltPerformSegmentedButtonSwitchToDetails();1146 /* Then lock the snapshot pane: */1147 m_pSegmentedButton->setEnabled(SegmentType_Tools, false);1148 1110 } 1149 1111 … … 1168 1130 1169 1131 /* Make sure details and snapshot panes are updated: */ 1170 sltHandleChooserPaneIndexChange( );1132 sltHandleChooserPaneIndexChange(false /* update details? */, false /* update snapshots? */); 1171 1133 1172 1134 #if defined(VBOX_WS_MAC) && QT_VERSION < 0x050000 … … 1332 1294 #endif /* VBOX_WS_MAC */ 1333 1295 1334 //#ifdef VBOX_WS_MAC 1335 // /* Cocoa stuff should be async.. 1336 // * Do not ask me why but otherwise 1337 // * it conflicts with native handlers. */ 1338 // QMetaObject::invokeMethod(this, "sltPerformSegmentedButtonSwitchToDetails", Qt::QueuedConnection); 1339 //#else /* !VBOX_WS_MAC */ 1296 /* Switch segmented-button to Details-pane: */ 1340 1297 sltPerformSegmentedButtonSwitchToDetails(); 1341 //#endif /* !VBOX_WS_MAC */ 1298 1299 /* Make sure current Chooser-pane index fetched: */ 1300 sltHandleChooserPaneIndexChange(); 1342 1301 } 1343 1302 … … 1815 1774 #endif 1816 1775 1817 /* Prepare graphics VM list: */1776 /* Prepare Chooser-pane: */ 1818 1777 m_pPaneChooser = new UIGChooser(this); 1819 1778 1820 /* Prepare graphics details: */1779 /* Prepare Details-pane: */ 1821 1780 m_pPaneDetails = new UIGDetails(this); 1822 1781 … … 1825 1784 m_pPaneDetails->palette().color(QPalette::Active, QPalette::Window)); 1826 1785 1827 /* Prepare desktoppane: */1786 /* Prepare Desktop-pane: */ 1828 1787 m_pPaneDesktop = new UIDesktopPane(actionPool()->action(UIActionIndexST_M_Group_S_Refresh), this); 1829 1788 1830 /* Prepare toolspane: */1789 /* Prepare Tools-pane: */ 1831 1790 m_pPaneTools = new UIToolsPane(this); 1832 1791 … … 1965 1924 connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltHandleStateChange(QString))); 1966 1925 connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltHandleStateChange(QString))); 1967 connect(gVBoxEvents, SIGNAL(sigSnapshotTake(QString, QString)), this, SLOT(sltHandleSnapshotChange(QString)));1968 connect(gVBoxEvents, SIGNAL(sigSnapshotDelete(QString, QString)), this, SLOT(sltHandleSnapshotChange(QString)));1969 connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltHandleSnapshotChange(QString)));1970 connect(gVBoxEvents, SIGNAL(sigSnapshotRestore(QString, QString)), this, SLOT(sltHandleSnapshotChange(QString)));1971 1926 } 1972 1927 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r67114 r67419 94 94 95 95 /** Handles signal about Chooser-pane index change. 96 * @param fRefreshDetails brings whether details should be updated.97 * @param fRefreshSnapshots brings whether snapshots should be updated.98 * @param fRefreshDescription brings whether description should be updated. */99 void sltHandleChooserPaneIndexChange(bool fRefreshDetails = true, bool fRefreshSnapshots = true, bool fRefreshDescription= true);96 * @param fUpdateDetails Brings whether details should be updated. 97 * @param fUpdateTools Brings whether tools should be updated. */ 98 void sltHandleChooserPaneIndexChange(bool fUpdateDetails = true, 99 bool fUpdateTools = true); 100 100 101 101 /** Handles signal about medium-enumeration finished. */ … … 117 117 /** Handles CVirtualBox event about state change for machine with @a strID. */ 118 118 void sltHandleStateChange(QString strID); 119 /** Handles CVirtualBox event about snapshot change for machine with @a strID. */120 void sltHandleSnapshotChange(QString strID);121 119 /** @} */ 122 120 … … 216 214 QList<UIVMItem*> currentItems() const; 217 215 218 /** Updates snapshot related controls for passed @a pItem and @a comMachine. */219 void updateSnapshots(UIVMItem *pItem, const CMachine &comMachine);220 /** Locks snapshot related controls. */221 void lockSnapshots();222 223 216 /** @name Event handling stuff. 224 217 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp
r67275 r67419 580 580 } 581 581 582 void UISnapshotPane::slt MachineDataChange(QString strMachineID)582 void UISnapshotPane::sltHandleMachineDataChange(QString strMachineID) 583 583 { 584 584 /* Make sure it's our VM: */ … … 593 593 } 594 594 595 void UISnapshotPane::slt MachineStateChange(QString strMachineID, KMachineState enmState)595 void UISnapshotPane::sltHandleMachineStateChange(QString strMachineID, KMachineState enmState) 596 596 { 597 597 /* Make sure it's our VM: */ … … 607 607 } 608 608 609 void UISnapshotPane::slt SessionStateChange(QString strMachineID, KSessionState enmState)609 void UISnapshotPane::sltHandleSessionStateChange(QString strMachineID, KSessionState enmState) 610 610 { 611 611 /* Make sure it's our VM: */ … … 621 621 /* Update action states: */ 622 622 updateActionStates(); 623 } 624 625 void UISnapshotPane::sltHandleSnapshotChange(QString strMachineID) 626 { 627 /* Make sure it's our VM: */ 628 if (strMachineID != m_strMachineID) 629 return; 630 631 // TODO: Refresh only necessary bits. 632 /* Refresh everything: */ 633 refreshAll(); 623 634 } 624 635 … … 839 850 /* Configure Main event connections: */ 840 851 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, 841 this, &UISnapshotPane::slt MachineDataChange);852 this, &UISnapshotPane::sltHandleMachineDataChange); 842 853 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 843 this, &UISnapshotPane::slt MachineStateChange);854 this, &UISnapshotPane::sltHandleMachineStateChange); 844 855 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSessionStateChange, 845 this, &UISnapshotPane::sltSessionStateChange); 856 this, &UISnapshotPane::sltHandleSessionStateChange); 857 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotTake, 858 this, &UISnapshotPane::sltHandleSnapshotChange); 859 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotDelete, 860 this, &UISnapshotPane::sltHandleSnapshotChange); 861 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotChange, 862 this, &UISnapshotPane::sltHandleSnapshotChange); 863 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore, 864 this, &UISnapshotPane::sltHandleSnapshotChange); 846 865 847 866 /* Create read-write locker: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.h
r67275 r67419 86 86 * @{ */ 87 87 /** Handles machine data change for machine with @a strMachineID. */ 88 void slt MachineDataChange(QString strMachineID);88 void sltHandleMachineDataChange(QString strMachineID); 89 89 /** Handles machine @a enmState change for machine with @a strMachineID. */ 90 void sltMachineStateChange(QString strMachineID, KMachineState enmState); 90 void sltHandleMachineStateChange(QString strMachineID, KMachineState enmState); 91 91 92 /** Handles session @a enmState change for machine with @a strMachineID. */ 92 void sltSessionStateChange(QString strMachineID, KSessionState enmState); 93 void sltHandleSessionStateChange(QString strMachineID, KSessionState enmState); 94 95 /** Handles any snapshot change for machine with @a strMachineID. */ 96 void sltHandleSnapshotChange(QString strMachineID); 93 97 /** @} */ 94 98
Note:
See TracChangeset
for help on using the changeset viewer.