Changeset 83255 in vbox
- Timestamp:
- Mar 11, 2020 10:34:49 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.cpp
r83203 r83255 49 49 , m_strName(other.m_strName) 50 50 , m_fAccessible(other.m_fAccessible) 51 , m_strAccessError(other.m_strAccessError) 51 52 , m_enmMachineState(other.m_enmMachineState) 52 53 , m_strOsType(other.m_strOsType) … … 69 70 { 70 71 /* Acquire instance info sync way, be aware, this is blocking stuff, it takes some time: */ 71 const QMap<KVirtualSystemDescriptionType, QString> instanceInfoMap = getInstanceInfo(m_comCloudClient, m_strId); 72 const QMap<KVirtualSystemDescriptionType, QString> instanceInfoMap = getInstanceInfo(m_comCloudClient, m_strId, m_strAccessError); 73 /* Update accessibility state: */ 74 m_fAccessible = m_strAccessError.isNull(); 72 75 73 /* Refresh corresponding values: */ 74 m_strOsType = fetchOsType(instanceInfoMap); 75 m_iMemorySize = fetchMemorySize(instanceInfoMap); 76 m_iCpuCount = fetchCpuCount(instanceInfoMap); 77 m_enmMachineState = fetchMachineState(instanceInfoMap); 78 m_strShape = fetchShape(instanceInfoMap); 79 m_strDomain = fetchDomain(instanceInfoMap); 80 m_strBootingFirmware = fetchBootingFirmware(instanceInfoMap); 81 m_strImageId = fetchImageId(instanceInfoMap); 76 /* Refresh corresponding values if accessible: */ 77 if (m_fAccessible) 78 { 79 m_strOsType = fetchOsType(instanceInfoMap); 80 m_iMemorySize = fetchMemorySize(instanceInfoMap); 81 m_iCpuCount = fetchCpuCount(instanceInfoMap); 82 m_enmMachineState = fetchMachineState(instanceInfoMap); 83 m_strShape = fetchShape(instanceInfoMap); 84 m_strDomain = fetchDomain(instanceInfoMap); 85 m_strBootingFirmware = fetchBootingFirmware(instanceInfoMap); 86 m_strImageId = fetchImageId(instanceInfoMap); 82 87 83 /* Acquire image info sync way, be aware, this is blocking stuff, it takes some time: */ 84 const QMap<QString, QString> imageInfoMap = getImageInfo(m_comCloudClient, m_strImageId); 85 //printf("Image info:\n"); 86 //foreach (const QString &strKey, imageInfoMap.keys()) 87 // printf("key = %s, value = %s\n", strKey.toUtf8().constData(), imageInfoMap.value(strKey).toUtf8().constData()); 88 //printf("\n"); 88 /* Acquire image info sync way, be aware, this is blocking stuff, it takes some time: */ 89 const QMap<QString, QString> imageInfoMap = getImageInfo(m_comCloudClient, m_strImageId, m_strAccessError); 90 /* Update accessibility state: */ 91 m_fAccessible = m_strAccessError.isNull(); 89 92 90 /* Sorry, but these are hardcoded in Main: */ 91 m_strImageName = imageInfoMap.value("display name"); 92 m_strImageSize = imageInfoMap.value("size"); 93 //printf("Image info:\n"); 94 //foreach (const QString &strKey, imageInfoMap.keys()) 95 // printf("key = %s, value = %s\n", strKey.toUtf8().constData(), imageInfoMap.value(strKey).toUtf8().constData()); 96 //printf("\n"); 97 98 /* Refresh corresponding values if accessible: */ 99 if (m_fAccessible) 100 { 101 /* Sorry, but these are hardcoded in Main: */ 102 m_strImageName = imageInfoMap.value("display name"); 103 m_strImageSize = imageInfoMap.value("size"); 104 } 105 } 106 107 /* Reset everything if not accessible: */ 108 if (!m_fAccessible) 109 { 110 m_enmMachineState = KMachineState_PoweredOff; 111 m_strOsType = "Other"; 112 m_iMemorySize = 0; 113 m_iCpuCount = 0; 114 m_strShape.clear(); 115 m_strDomain.clear(); 116 m_strBootingFirmware.clear(); 117 m_strImageId.clear(); 118 m_strImageName.clear(); 119 m_strImageSize.clear(); 120 } 93 121 } 94 122 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudMachine.h
r83203 r83255 62 62 63 63 /** Returns whether cloud VM is accessible. */ 64 bool isAccessible() const { return m_fAccessible; } 64 bool accessible() const { return m_fAccessible; } 65 /** Returns last access error message. */ 66 QString accessError() const { return m_strAccessError; } 65 67 66 68 /** Returns cloud VM state. */ … … 97 99 98 100 /** Holds whether cloud VM is accessible. */ 99 bool m_fAccessible; 101 bool m_fAccessible; 102 /** Holds the last access error message. */ 103 QString m_strAccessError; 100 104 101 105 /** Holds the cloud VM state. */ … … 157 161 158 162 /** Returns whether cloud VM is accessible. */ 159 bool isAccessible() const { return d->isAccessible(); } 163 bool accessible() const { return d->accessible(); } 164 /** Returns last access error message. */ 165 QString accessError() const { return d->accessError(); } 160 166 161 167 /** Returns cloud VM state. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.cpp
r83212 r83255 85 85 QMap<KVirtualSystemDescriptionType, QString> UICloudNetworkingStuff::getInstanceInfo(const CCloudClient &comCloudClient, 86 86 const QString &strId, 87 QString &strErrorMessage, 87 88 QWidget *pParent /* = 0 */) 88 89 { … … 100 101 msgCenter().cannotCreateAppliance(comVBox, pParent); 101 102 else 102 { 103 /// @todo fetch error info 104 } 103 strErrorMessage = UIErrorString::formatErrorInfo(comVBox); 105 104 } 106 105 else … … 113 112 msgCenter().cannotCreateVirtualSystemDescription(comAppliance, pParent); 114 113 else 115 { 116 /// @todo fetch error info 117 } 114 strErrorMessage = UIErrorString::formatErrorInfo(comAppliance); 118 115 } 119 116 else … … 131 128 msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent); 132 129 else 133 { 134 /// @todo fetch error info 135 } 130 strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient); 136 131 } 137 132 else … … 149 144 msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent); 150 145 else 151 { 152 /// @todo fetch error info 153 } 146 strErrorMessage = UIErrorString::formatErrorInfo(comProgress); 154 147 } 155 148 else … … 177 170 const CCloudClient &comCloudClient, 178 171 const QString &strId, 172 QString &strErrorMessage, 179 173 QWidget *pParent /* = 0 */) 180 174 { 181 return getInstanceInfo(comCloudClient, strId, pParent).value(enmType, QString());175 return getInstanceInfo(comCloudClient, strId, strErrorMessage, pParent).value(enmType, QString()); 182 176 } 183 177 184 178 QMap<QString, QString> UICloudNetworkingStuff::getImageInfo(const CCloudClient &comCloudClient, 185 179 const QString &strId, 180 QString &strErrorMessage, 186 181 QWidget *pParent /* = 0 */) 187 182 { … … 197 192 msgCenter().cannotAcquireCloudClientParameter(comCloudClient, pParent); 198 193 else 199 { 200 /// @todo fetch error info 201 } 194 strErrorMessage = UIErrorString::formatErrorInfo(comCloudClient); 202 195 } 203 196 else … … 215 208 msgCenter().cannotAcquireCloudClientParameter(comProgress, pParent); 216 209 else 217 { 218 /// @todo fetch error info 219 } 210 strErrorMessage = UIErrorString::formatErrorInfo(comProgress); 220 211 } 221 212 else -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICloudNetworkingStuff.h
r83212 r83255 34 34 { 35 35 /** Acquires instance list. 36 * @param comCloudClient Brings cloud client object. 37 * @param pWidget Brings parent widget to show messages according to, 38 * if no parent set, progress will be executed in blocking way. */ 36 * @param comCloudClient Brings cloud client object. 37 * @param strErrorMessage Brings error message container. 38 * @param pWidget Brings parent widget to show messages according to, 39 * if no parent set, progress will be executed in blocking way. */ 39 40 SHARED_LIBRARY_STUFF QList<UICloudMachine> listInstances(const CCloudClient &comCloudClient, 40 41 QString &strErrorMessage, … … 42 43 43 44 /** Acquires instance info as a map. 44 * @param comCloudClient Brings cloud client object. 45 * @param strId Brings cloud instance id. 46 * @param pWidget Brings parent widget to show messages according to, 47 * if no parent set, progress will be executed in blocking way. */ 45 * @param comCloudClient Brings cloud client object. 46 * @param strId Brings cloud instance id. 47 * @param strErrorMessage Brings error message container. 48 * @param pWidget Brings parent widget to show messages according to, 49 * if no parent set, progress will be executed in blocking way. */ 48 50 SHARED_LIBRARY_STUFF QMap<KVirtualSystemDescriptionType, QString> getInstanceInfo(const CCloudClient &comCloudClient, 49 51 const QString &strId, 52 QString &strErrorMessage, 50 53 QWidget *pParent = 0); 51 54 /** Acquires instance info of certain @a enmType as a string. 52 * @param comCloudClient Brings cloud client object. 53 * @param strId Brings cloud instance id. 54 * @param pWidget Brings parent widget to show messages according to, 55 * if no parent set, progress will be executed in blocking way. */ 55 * @param comCloudClient Brings cloud client object. 56 * @param strId Brings cloud instance id. 57 * @param strErrorMessage Brings error message container. 58 * @param pWidget Brings parent widget to show messages according to, 59 * if no parent set, progress will be executed in blocking way. */ 56 60 SHARED_LIBRARY_STUFF QString getInstanceInfo(KVirtualSystemDescriptionType enmType, 57 61 const CCloudClient &comCloudClient, 58 62 const QString &strId, 63 QString &strErrorMessage, 59 64 QWidget *pParent = 0); 60 65 61 66 /** Acquires image info as a map. 62 * @param comCloudClient Brings cloud client object. 63 * @param strId Brings cloud image id. 64 * @param pWidget Brings parent widget to show messages according to, 65 * if no parent set, progress will be executed in blocking way. */ 67 * @param comCloudClient Brings cloud client object. 68 * @param strId Brings cloud image id. 69 * @param strErrorMessage Brings error message container. 70 * @param pWidget Brings parent widget to show messages according to, 71 * if no parent set, progress will be executed in blocking way. */ 66 72 SHARED_LIBRARY_STUFF QMap<QString, QString> getImageInfo(const CCloudClient &comCloudClient, 67 73 const QString &strId, 74 QString &strErrorMessage, 68 75 QWidget *pParent = 0); 69 76 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r83203 r83255 131 131 return table; 132 132 133 if (!guiCloudMachine. isAccessible())133 if (!guiCloudMachine.accessible()) 134 134 { 135 135 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString()); … … 292 292 return table; 293 293 294 if (!guiCloudMachine. isAccessible())294 if (!guiCloudMachine.accessible()) 295 295 { 296 296 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString()); … … 571 571 return table; 572 572 573 if (!guiCloudMachine. isAccessible())573 if (!guiCloudMachine.accessible()) 574 574 { 575 575 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h
r83254 r83255 156 156 * @{ */ 157 157 /** Holds cached machine id. */ 158 QString 158 QString m_strId; 159 159 /** Holds cached machine name. */ 160 QString 160 QString m_strName; 161 161 /** Holds cached machine OS type id. */ 162 QString 162 QString m_strOSTypeId; 163 163 /** Holds cached machine OS type pixmap. */ 164 QPixmap 164 QPixmap m_pixmap; 165 165 /** Holds cached machine OS type pixmap size. */ 166 QSize 166 QSize m_logicalPixmapSize; 167 167 /** @} */ 168 168 … … 170 170 * @{ */ 171 171 /** Holds cached machine state. */ 172 KMachineState 172 KMachineState m_enmMachineState; 173 173 /** Holds cached machine state name. */ 174 QString 174 QString m_strMachineStateName; 175 175 /** Holds cached machine state name. */ 176 QIcon 176 QIcon m_machineStateIcon; 177 177 178 178 /** Holds configuration access level. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp
r83254 r83255 109 109 110 110 /* Now determine whether VM is accessible: */ 111 m_fAccessible = true; 112 if (m_fAccessible) 113 { 114 /* Reset last access error information: */ 115 m_strAccessError.clear(); 116 117 /* Determine own VM attributes: */ 118 m_strOSTypeId = !m_guiCloudMachine.isNull() 119 ? m_guiCloudMachine.osType() 120 : "Other"; 121 122 /* Determine VM states: */ 123 m_enmMachineState = !m_guiCloudMachine.isNull() 124 ? m_guiCloudMachine.machineState() 125 : KMachineState_PoweredOff; 126 m_strMachineStateName = gpConverter->toString(m_enmMachineState); 127 if (itemType() == ItemType_CloudFake) 111 m_fAccessible = !m_guiCloudMachine.isNull() 112 ? m_guiCloudMachine.accessible() 113 : true; 114 m_strAccessError = !m_guiCloudMachine.isNull() 115 ? m_guiCloudMachine.accessError() 116 : QString(); 117 118 /* Determine own VM attributes: */ 119 m_strOSTypeId = !m_guiCloudMachine.isNull() 120 ? m_guiCloudMachine.osType() 121 : "Other"; 122 123 /* Determine VM states: */ 124 m_enmMachineState = !m_guiCloudMachine.isNull() 125 ? m_guiCloudMachine.machineState() 126 : KMachineState_PoweredOff; 127 m_strMachineStateName = gpConverter->toString(m_enmMachineState); 128 if (itemType() == ItemType_CloudFake) 129 { 130 switch (m_enmFakeCloudItemState) 128 131 { 129 switch (m_enmFakeCloudItemState) 130 { 131 case UIVirtualMachineItemCloud::FakeCloudItemState_Loading: 132 m_machineStateIcon = UIIconPool::iconSet(":/state_loading_16px.png"); 133 break; 134 case UIVirtualMachineItemCloud::FakeCloudItemState_Done: 135 m_machineStateIcon = UIIconPool::iconSet(":/vm_new_16px.png"); 136 break; 137 default: 138 break; 139 } 132 case UIVirtualMachineItemCloud::FakeCloudItemState_Loading: 133 m_machineStateIcon = UIIconPool::iconSet(":/state_loading_16px.png"); 134 break; 135 case UIVirtualMachineItemCloud::FakeCloudItemState_Done: 136 m_machineStateIcon = UIIconPool::iconSet(":/vm_new_16px.png"); 137 break; 138 default: 139 break; 140 140 } 141 else 142 m_machineStateIcon = gpConverter->toIcon(m_enmMachineState); 143 144 /* Determine configuration access level: */ 145 m_enmConfigurationAccessLevel = ConfigurationAccessLevel_Null; 146 147 /* Determine whether we should show this VM details: */ 148 m_fHasDetails = true; 149 } 150 else 151 { 152 /// @todo handle inaccessible cloud VM 153 } 141 } 142 else 143 m_machineStateIcon = gpConverter->toIcon(m_enmMachineState); 144 145 /* Determine configuration access level: */ 146 m_enmConfigurationAccessLevel = ConfigurationAccessLevel_Null; 147 148 /* Determine whether we should show this VM details: */ 149 m_fHasDetails = true; 154 150 155 151 /* Recache item pixmap: */
Note:
See TracChangeset
for help on using the changeset viewer.