Changeset 83191 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 3, 2020 12:32:40 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r83175 r83191 534 534 if (table.isEmpty()) 535 535 table << UITextTableLine(QApplication::translate("UIDetails", "Not Attached", "details (storage)"), QString()); 536 537 return table; 538 } 539 540 UITextTable UIDetailsGenerator::generateMachineInformationStorage(UICloudMachine &guiCloudMachine, 541 const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions) 542 { 543 UITextTable table; 544 545 if (guiCloudMachine.isNull()) 546 return table; 547 548 if (!guiCloudMachine.isAccessible()) 549 { 550 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString()); 551 return table; 552 } 553 554 /* Image: */ 555 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks) 556 { 557 const QString strImageName = guiCloudMachine.imageName(); 558 const QString strImageSize = guiCloudMachine.imageSize(); 559 const QString strResult = !strImageName.isEmpty() && !strImageSize.isEmpty() 560 ? QString("%1 (%2)").arg(strImageName, strImageSize) 561 : QString(); 562 table << UITextTableLine(QApplication::translate("UIDetails", "Image", "details (storage)"), strResult); 563 } 536 564 537 565 return table; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.h
r83151 r83191 52 52 bool fLink = true); 53 53 54 SHARED_LIBRARY_STUFF UITextTable generateMachineInformationStorage(UICloudMachine &guiCloudMachine, 55 const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions); 56 54 57 SHARED_LIBRARY_STUFF UITextTable generateMachineInformationAudio(CMachine &comMachine, 55 58 const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &fOptions); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp
r83151 r83191 325 325 } 326 326 327 void UIDetailsUpdateTaskStorageCloud::run() 328 { 329 /* Acquire corresponding machine: */ 330 UICloudMachine guiCloudMachine = property("cloudMachine").value<UICloudMachine>(); 331 if (guiCloudMachine.isNull()) 332 return; 333 334 /* Generate details table: */ 335 UITextTable table = UIDetailsGenerator::generateMachineInformationStorage(guiCloudMachine, m_fOptions); 336 setProperty("table", QVariant::fromValue(table)); 337 } 338 327 339 UITask *UIDetailsElementStorage::createUpdateTask() 328 340 { 329 return new UIDetailsUpdateTaskStorage(machine(), model()->optionsStorage()); 341 return isLocal() 342 ? static_cast<UITask*>(new UIDetailsUpdateTaskStorage(machine(), model()->optionsStorage())) 343 : static_cast<UITask*>(new UIDetailsUpdateTaskStorageCloud(cloudMachine(), model()->optionsStorage())); 330 344 } 331 345 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.h
r83151 r83191 295 295 }; 296 296 297 /** UITask extension used as update task for the details-element type 'Storage' of cloud VM. */ 298 class UIDetailsUpdateTaskStorageCloud : public UIDetailsUpdateTask 299 { 300 Q_OBJECT; 301 302 public: 303 304 /** Constructs update task passing @a guiCloudMachine to the base-class. */ 305 UIDetailsUpdateTaskStorageCloud(const UICloudMachine &guiCloudMachine, UIExtraDataMetaDefs::DetailsElementOptionTypeStorage fOptions) 306 : UIDetailsUpdateTask(guiCloudMachine), m_fOptions(fOptions) {} 307 308 private: 309 310 /** Contains update task body. */ 311 void run(); 312 313 /** Holds the options. */ 314 UIExtraDataMetaDefs::DetailsElementOptionTypeStorage m_fOptions; 315 }; 316 297 317 /** UIDetailsElementInterface extension for the details-element type 'Storage'. */ 298 318 class UIDetailsElementStorage : public UIDetailsElementInterface -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r83179 r83191 108 108 109 109 /* Compose a list of types to build: */ 110 types << DetailsElementType_General << DetailsElementType_System ;110 types << DetailsElementType_General << DetailsElementType_System << DetailsElementType_Storage; 111 111 112 112 break;
Note:
See TracChangeset
for help on using the changeset viewer.