Changeset 71385 in vbox
- Timestamp:
- Mar 20, 2018 9:16:13 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
r71380 r71385 57 57 *********************************************************************************************************************************/ 58 58 59 /** A collection of utility functions for some path string manipulations */ 59 /** A collection of utility functions for so 60 me path string manipulations */ 60 61 class UIPathOperations 61 62 { … … 445 446 if (m_pInfoEdit) 446 447 { 447 // m_pInfoEdit->setTextFormat(Qt::RichText);448 448 m_pInfoEdit->setReadOnly(true); 449 449 m_pInfoEdit->setFrameStyle(QFrame::NoFrame); 450 // m_pInfoEdit->setText("Line 1\nLine 2\n\nLine 4");451 // m_pInfoEdit->setWordWrap(true);452 450 } 453 451 QIDialogButtonBox *pButtonBox = … … 1125 1123 1126 1124 UIPropertiesDialog *dialog = new UIPropertiesDialog(); 1125 if (!dialog) 1126 return; 1127 dialog->setWindowTitle("Properties"); 1127 1128 dialog->setPropertyText(fsPropertyString); 1128 1129 dialog->execute(); 1129 1130 1131 1132 // QIMessageBox *pFsObjectPropertiesBox = new QIMessageBox("Properties",1133 // fsPropertyString,1134 // AlertIconType_Information,1135 // AlertButton_Ok| AlertButtonOption_Escape, 0, 0, this);1136 // pFsObjectPropertiesBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);1137 1138 1139 // //pFsObjectPropertiesBox->setFixedWidth(300);1140 // pFsObjectPropertiesBox->exec();1141 1142 // delete pFsObjectPropertiesBox;1143 1130 } 1144 1131 … … 1609 1596 } 1610 1597 1598 FileObjectType UIGuestFileTable::fileType(const CGuestFsObjInfo &fsInfo) 1599 { 1600 if (fsInfo.isNull() || !fsInfo.isOk()) 1601 return FileObjectType_Unknown; 1602 if (fsInfo.GetType() == KFsObjType_Directory) 1603 return FileObjectType_Directory; 1604 else if (fsInfo.GetType() == KFsObjType_File) 1605 return FileObjectType_File; 1606 else if (fsInfo.GetType() == KFsObjType_Symlink) 1607 return FileObjectType_SymLink; 1608 1609 return FileObjectType_Other; 1610 } 1611 1612 1611 1613 QString UIGuestFileTable::fsObjectPropertyString() 1612 1614 { 1615 if (m_comGuestSession.isNull()) 1616 return QString(); 1617 1618 QStringList selectedObjects = selectedItemPathList(); 1619 if (selectedObjects.isEmpty()) 1620 return QString(); 1621 if (selectedObjects.size() == 1) 1622 { 1623 if (selectedObjects.at(0).isNull()) 1624 return QString(); 1625 CGuestFsObjInfo fileInfo = m_comGuestSession.FsObjQueryInfo(selectedObjects.at(0), true); 1626 if (!m_comGuestSession.isOk()) 1627 return QString(); 1628 1629 QString propertyString; 1630 /* Name: */ 1631 propertyString += "<b>Name:</b> " + UIPathOperations::getObjectName(fileInfo.GetName()) + "\n"; 1632 propertyString += "<br/>"; 1633 /* Size: */ 1634 propertyString += "<b>Size:</b> " + QString::number(fileInfo.GetObjectSize()) + QString(" bytes"); 1635 propertyString += "<br/>"; 1636 /* Type: */ 1637 propertyString += "<b>Type:</b> " + fileTypeString(fileType(fileInfo)); 1638 propertyString += "<br/>"; 1639 /* Creation Date: */ 1640 // LONG64 GetChangeTime() const; 1641 propertyString += "<b>Created:</b> " + QDateTime::fromMSecsSinceEpoch(fileInfo.GetChangeTime()/1000000).toString(); 1642 propertyString += "<br/>"; 1643 /* Last Modification Date: */ 1644 propertyString += "<b>Modified:</b> " + QDateTime::fromMSecsSinceEpoch(fileInfo.GetModificationTime()/1000000).toString(); 1645 propertyString += "<br/>"; 1646 /* Owner: */ 1647 propertyString += "<b>Owner:</b> " + fileInfo.GetUserName(); 1648 return propertyString; 1649 } 1613 1650 return QString(); 1614 1651 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h
r71380 r71385 245 245 246 246 static FileObjectType fileType(const CFsObjInfo &fsInfo); 247 static FileObjectType fileType(const CGuestFsObjInfo &fsInfo); 248 247 249 bool copyGuestToHost(const QString &guestSourcePath, const QString& hostDestinationPath); 248 250 bool copyHostToGuest(const QString& hostSourcePath, const QString &guestDestinationPath);
Note:
See TracChangeset
for help on using the changeset viewer.