Changeset 103138 in vbox
- Timestamp:
- Jan 31, 2024 10:36:12 AM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/activity/overview
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp
r103129 r103138 247 247 virtual bool isCloudVM() const = 0; 248 248 virtual void updateColumnData() = 0; 249 virtual void setMachineState(int iState) = 0; 249 250 250 251 QString columnData(int iColumnIndex) const; … … 302 303 virtual void updateColumnData() override; 303 304 virtual QString machineStateString() const override; 304 v oid setMachineState(KMachineState enmState);305 virtual void setMachineState(int iState) override; 305 306 306 307 protected: … … 332 333 UIActivityOverviewItemCloud(); 333 334 ~UIActivityOverviewItemCloud(); 335 void updateMachineState(); 334 336 virtual bool isRunning() const override; 335 337 virtual bool isCloudVM() const override; 336 338 virtual void updateColumnData() override; 337 339 virtual QString machineStateString() const override; 340 virtual void setMachineState(int iState) override; 338 341 339 342 protected: … … 348 351 QTimer *m_pTimer; 349 352 CCloudMachine m_comCloudMachine; 353 KCloudMachineState m_enmMachineState; 350 354 }; 351 355 … … 950 954 , m_comCloudMachine(comCloudMachine) 951 955 { 956 m_enmMachineState = comCloudMachine.GetState(); 952 957 m_pTimer = new QTimer(this); 953 958 if (m_pTimer) … … 968 973 } 969 974 975 void UIActivityOverviewItemCloud::updateMachineState() 976 { 977 if (m_comCloudMachine.isOk()) 978 setMachineState(m_comCloudMachine.GetState()); 979 } 980 970 981 bool UIActivityOverviewItemCloud::isRunning() const 971 982 { 972 if (!m_comCloudMachine.isOk()) 973 return false; 974 return m_comCloudMachine.GetState() == KCloudMachineState_Running; 983 return m_enmMachineState == KCloudMachineState_Running; 975 984 } 976 985 … … 1002 1011 void UIActivityOverviewItemCloud::sltTimeout() 1003 1012 { 1013 } 1014 1015 void UIActivityOverviewItemCloud::setMachineState(int iState) 1016 { 1017 if (iState <= KCloudMachineState_Invalid || iState >= KCloudMachineState_Max) 1018 return; 1019 KCloudMachineState enmState = static_cast<KCloudMachineState>(iState); 1020 if (m_enmMachineState == enmState) 1021 return; 1022 m_enmMachineState = enmState; 1004 1023 } 1005 1024 … … 1062 1081 } 1063 1082 1064 void UIActivityOverviewItemLocal::setMachineState(KMachineState enmState) 1065 { 1083 void UIActivityOverviewItemLocal::setMachineState(int iState) 1084 { 1085 if (iState <= KMachineState_Null || iState >= KMachineState_Max) 1086 return; 1087 KMachineState enmState = static_cast<KMachineState>(iState); 1088 if (m_enmMachineState == enmState) 1089 return; 1066 1090 m_enmMachineState = enmState; 1067 1091 if (m_enmMachineState == KMachineState_Running) 1068 1092 resetDebugger(); 1069 1093 } 1070 1071 1094 1072 1095 void UIActivityOverviewItemLocal::updateMetricData() … … 1369 1392 if (!fFound) 1370 1393 m_itemList.append(new UIActivityOverviewItemCloud(this, id, comMachine.GetName(), comMachine)); 1394 } 1395 1396 /* Update cloud machine states: */ 1397 for (int i = 0; i < m_itemList.size(); ++i) 1398 { 1399 if (!m_itemList[i] || !m_itemList[i]->isCloudVM()) 1400 continue; 1401 UIActivityOverviewItemCloud *pItem = qobject_cast<UIActivityOverviewItemCloud*>(m_itemList[i]); 1402 if (!pItem) 1403 continue; 1404 pItem->updateMachineState(); 1371 1405 } 1372 1406 } -
trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.h
r103019 r103138 74 74 bool isCurrentTool() const; 75 75 void setIsCurrentTool(bool fIsCurrentTool); 76 77 76 void setCloudMachineItems(const QList<UIVirtualMachineItemCloud*> &cloudItems); 78 77
Note:
See TracChangeset
for help on using the changeset viewer.