- Timestamp:
- Mar 7, 2018 1:53:41 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r71105 r71258 119 119 m_pTabWidget->setTabText(0, tr("Configuration &Details")); 120 120 m_pTabWidget->setTabText(1, tr("&Runtime Information")); 121 m_pTabWidget->setTabText(2, tr("&Guest Session "));121 m_pTabWidget->setTabText(2, tr("&Guest Session Manager")); 122 122 m_pTabWidget->setTabText(3, tr("&Guest File Manager")); 123 123 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp
r71255 r71258 343 343 344 344 m_pCopyGuestToHost = new QAction(this); 345 m_pCopyGuestToHost->setIcon(UIIconPool::iconSet(QString(":/arrow_right_10px_x2.png"))); 345 if(m_pCopyGuestToHost) 346 { 347 m_pCopyGuestToHost->setIcon(UIIconPool::iconSet(QString(":/arrow_right_10px_x2.png"))); 348 m_pCopyGuestToHost->setEnabled(false); 349 } 350 346 351 m_pCopyHostToGuest = new QAction(this); 347 m_pCopyHostToGuest->setIcon(UIIconPool::iconSet(QString(":/arrow_left_10px_x2.png"))); 348 349 352 if (m_pCopyHostToGuest) 353 { 354 m_pCopyHostToGuest->setIcon(UIIconPool::iconSet(QString(":/arrow_left_10px_x2.png"))); 355 m_pCopyHostToGuest->setEnabled(false); 356 } 350 357 m_pToolBar->addWidget(topSpacerWidget); 351 358 m_pToolBar->addAction(m_pCopyGuestToHost); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileTable.cpp
r71255 r71258 22 22 /* Qt includes: */ 23 23 # include <QAction> 24 # include <QDateTime> 24 25 # include <QDir> 25 26 # include <QHeaderView> … … 285 286 { 286 287 if (m_pParent) 287 m_pParent->emitLogOutput(QString( "cannot rename %1").arg(item->path()));288 m_pParent->emitLogOutput(QString(item->path()).append(" could not be renamed")); 288 289 } 289 290 return true; … … 586 587 587 588 m_pNewFolder = new QAction(this); 588 m_pNewFolder->setIcon(UIIconPool::iconSet(QString(":/sf_32px.png"))); 589 m_pToolBar->addAction(m_pNewFolder); 589 if (m_pNewFolder) 590 { 591 m_pNewFolder->setIcon(UIIconPool::iconSet(QString(":/sf_32px.png"))); 592 m_pToolBar->addAction(m_pNewFolder); 593 m_pNewFolder->setEnabled(false); 594 } 590 595 591 596 m_pCopy = new QAction(this); 592 m_pCopy->setIcon(UIIconPool::iconSet(QString(":/fd_copy_22px.png"))); 593 m_pToolBar->addAction(m_pCopy); 597 if (m_pCopy) 598 { 599 m_pCopy->setIcon(UIIconPool::iconSet(QString(":/fd_copy_22px.png"))); 600 m_pToolBar->addAction(m_pCopy); 601 m_pCopy->setEnabled(false); 602 } 594 603 595 604 m_pCut = new QAction(this); 596 m_pCut->setIcon(UIIconPool::iconSet(QString(":/fd_move_22px.png"))); 597 m_pToolBar->addAction(m_pCut); 598 605 if (m_pCut) 606 { 607 m_pCut->setIcon(UIIconPool::iconSet(QString(":/fd_move_22px.png"))); 608 m_pToolBar->addAction(m_pCut); 609 m_pCut->setEnabled(false); 610 } 599 611 600 612 m_pPaste = new QAction(this); 601 m_pPaste->setIcon(UIIconPool::iconSet(QString(":/shared_clipboard_16px.png"))); 602 m_pToolBar->addAction(m_pPaste); 613 if (m_pPaste) 614 { 615 m_pPaste->setIcon(UIIconPool::iconSet(QString(":/shared_clipboard_16px.png"))); 616 m_pToolBar->addAction(m_pPaste); 617 m_pPaste->setEnabled(false); 618 } 603 619 } 604 620 … … 631 647 632 648 QList<QVariant> headData; 633 headData << "Name" << "Size" ;649 headData << "Name" << "Size" << "Change Time"; 634 650 m_pRootItem = new UIFileTableItem(headData, true, 0); 635 651 636 652 QList<QVariant> startDirData; 637 startDirData << "/" << 4096 ;653 startDirData << "/" << 4096 << QDateTime(); 638 654 UIFileTableItem* startItem = new UIFileTableItem(startDirData, true, m_pRootItem); 639 655 startItem->setPath("/"); … … 941 957 return newPath; 942 958 } 959 960 943 961 /********************************************************************************************************************************* 944 962 * UIGuestFileTable implementation. * … … 994 1012 { 995 1013 QList<QVariant> data; 996 data << fsInfo.GetName() << static_cast<qulonglong>(fsInfo.GetObjectSize()); 1014 QDateTime changeTime = QDateTime::fromMSecsSinceEpoch(fsInfo.GetChangeTime()/1000); 1015 data << fsInfo.GetName() << static_cast<qulonglong>(fsInfo.GetObjectSize()) << changeTime; 997 1016 bool isDirectory = (fsInfo.GetType() == KFsObjType_Directory); 998 1017 UIFileTableItem *item = new UIFileTableItem(data, isDirectory, parent); 999 1000 1018 item->setPath(strPath, fsInfo.GetName()); 1001 1019 if (isDirectory) … … 1033 1051 else 1034 1052 m_comGuestSession.FsObjRemove(item->path()); 1053 if (!m_comGuestSession.isOk()) 1054 emit sigLogOutput(QString(item->path()).append(" could not be deleted")); 1055 1035 1056 } 1036 1057 1037 1058 void UIGuestFileTable::goToHomeDirectory() 1038 1059 { 1039 /* TODO:not implemented in guest control yet: */1060 /** @todo not implemented in guest control yet: */ 1040 1061 } 1041 1062 … … 1060 1081 } 1061 1082 1083 1062 1084 /********************************************************************************************************************************* 1063 1085 * UIHostFileTable implementation. * … … 1096 1118 const QFileInfo &fileInfo = entries.at(i); 1097 1119 QList<QVariant> data; 1098 data << fileInfo.baseName() << fileInfo.size() ;1120 data << fileInfo.baseName() << fileInfo.size() << fileInfo.lastModified(); 1099 1121 UIFileTableItem *item = new UIFileTableItem(data, fileInfo.isDir(), parent); 1100 1122 item->setPath(fileInfo.absoluteFilePath()); … … 1156 1178 } 1157 1179 1158 bool UIHostFileTable::renameItem(UIFileTableItem *item, QString newPath) 1159 { 1160 Q_UNUSED(item); 1161 return true; 1162 } 1180 bool UIHostFileTable::renameItem(UIFileTableItem *item, QString newBaseName) 1181 { 1182 if (!item || item->isUpDirectory() || newBaseName.isEmpty()) 1183 return false; 1184 QString newPath = constructNewItemPath(item->path(), newBaseName); 1185 QDir a; 1186 return a.rename(item->path(), newPath); 1187 } 1188 1189 1163 1190 #include "UIGuestControlFileTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileTable.h
r71255 r71258 114 114 virtual void deleteByItem(UIFileTableItem *item) = 0; 115 115 virtual void goToHomeDirectory() = 0; 116 virtual bool renameItem(UIFileTableItem *item, QString new Path) = 0;116 virtual bool renameItem(UIFileTableItem *item, QString newBaseName) = 0; 117 117 void goIntoDirectory(const QModelIndex &itemIndex); 118 118 /** Follow the path trail, open directories as we go and descend */ … … 187 187 virtual void deleteByItem(UIFileTableItem *item) /* override */; 188 188 virtual void goToHomeDirectory() /* override */; 189 virtual bool renameItem(UIFileTableItem *item, QString new Path);189 virtual bool renameItem(UIFileTableItem *item, QString newBaseName); 190 190 191 191 private: … … 212 212 virtual void deleteByItem(UIFileTableItem *item) /* override */; 213 213 virtual void goToHomeDirectory() /* override */; 214 virtual bool renameItem(UIFileTableItem *item, QString new Path);214 virtual bool renameItem(UIFileTableItem *item, QString newBaseName); 215 215 }; 216 216
Note:
See TracChangeset
for help on using the changeset viewer.