- Timestamp:
- Nov 13, 2015 3:19:03 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extradata
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r58674 r58689 147 147 /* Virtual Machine: Information dialog: */ 148 148 const char* UIExtraDataDefs::GUI_InformationWindowGeometry = "GUI/InformationWindowGeometry"; 149 const char* UIExtraDataDefs::GUI_InformationWindowElements = "GUI/InformationWindowElements"; 149 150 150 151 /* Virtual Machine: Close dialog: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r58686 r58689 256 256 /** Holds information-window geometry. */ 257 257 extern const char* GUI_InformationWindowGeometry; 258 /** Holds information-window elements. */ 259 extern const char* GUI_InformationWindowElements; 258 260 /** @} */ 259 261 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r58674 r58689 1882 1882 << GUI_ScaleFactor << GUI_Scaling_Optimization 1883 1883 << GUI_InformationWindowGeometry 1884 << GUI_InformationWindowElements 1884 1885 << GUI_DefaultCloseAction << GUI_RestrictedCloseActions 1885 1886 << GUI_LastCloseAction << GUI_CloseActionHook … … 3561 3562 } 3562 3563 3564 QMap<InformationElementType, bool> UIExtraDataManager::informationWindowElements() 3565 { 3566 /* Get corresponding extra-data: */ 3567 const QStringList data = extraDataStringList(GUI_InformationWindowElements); 3568 3569 /* Desearialize passed elements: */ 3570 QMap<InformationElementType, bool> elements; 3571 foreach (QString strItem, data) 3572 { 3573 bool fOpened = true; 3574 if (strItem.endsWith("Closed", Qt::CaseInsensitive)) 3575 { 3576 fOpened = false; 3577 strItem.remove("Closed"); 3578 } 3579 InformationElementType type = gpConverter->fromInternalString<InformationElementType>(strItem); 3580 if (type != InformationElementType_Invalid) 3581 elements[type] = fOpened; 3582 } 3583 3584 /* Return elements: */ 3585 return elements; 3586 } 3587 3588 void UIExtraDataManager::setInformationWindowElements(const QMap<InformationElementType, bool> &elements) 3589 { 3590 /* Prepare corresponding extra-data: */ 3591 QStringList data; 3592 3593 /* Searialize passed elements: */ 3594 foreach (InformationElementType type, elements.keys()) 3595 { 3596 QString strValue = gpConverter->toInternalString(type); 3597 if (!elements[type]) 3598 strValue += "Closed"; 3599 data << strValue; 3600 } 3601 3602 /* Re-cache corresponding extra-data: */ 3603 setExtraDataStringList(GUI_InformationWindowElements, data); 3604 } 3605 3563 3606 MachineCloseAction UIExtraDataManager::defaultMachineCloseAction(const QString &strID) 3564 3607 { … … 3724 3767 /* Parse loaded data: */ 3725 3768 int iX = 0, iY = 0, iW = 0, iH = 0; 3726 bool fOk = data.size() >= 4; 3769 bool fOk = data.size() >= 4; 3727 3770 do 3728 3771 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r58674 r58689 498 498 /** Defines information-window @a geometry and @a fMaximized state. */ 499 499 void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QString &strID); 500 501 /** Returns information-window elements. */ 502 QMap<InformationElementType, bool> informationWindowElements(); 503 /** Defines information-window @a elements. */ 504 void setInformationWindowElements(const QMap<InformationElementType, bool> &elements); 500 505 /** @} */ 501 506
Note:
See TracChangeset
for help on using the changeset viewer.