- Timestamp:
- Mar 8, 2018 3:28:52 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.cpp
r71274 r71276 346 346 { 347 347 m_pCopyGuestToHost->setIcon(UIIconPool::iconSet(QString(":/arrow_right_10px_x2.png"))); 348 m_pCopyGuestToHost->setEnabled(false);348 connect(m_pCopyGuestToHost, &QAction::triggered, this, &UIGuestControlFileManager::sltCopyGuestToHost); 349 349 } 350 350 … … 353 353 { 354 354 m_pCopyHostToGuest->setIcon(UIIconPool::iconSet(QString(":/arrow_left_10px_x2.png"))); 355 m_pCopyHostToGuest->setEnabled(false);355 connect(m_pCopyHostToGuest, &QAction::triggered, this, &UIGuestControlFileManager::sltCopyHostToGuest); 356 356 } 357 357 358 m_pToolBar->addWidget(topSpacerWidget); 358 359 m_pToolBar->addAction(m_pCopyGuestToHost); … … 480 481 } 481 482 483 void UIGuestControlFileManager::sltCopyGuestToHost() 484 { 485 if (!m_pGuestFileTable || !m_pHostFileTable) 486 return; 487 QString hostDestinationPath = m_pHostFileTable->currentPath(); 488 printf("current host path %s\n", hostDestinationPath.toStdString().c_str()); 489 m_pGuestFileTable->copyGuestToHost(hostDestinationPath); 490 } 491 492 void UIGuestControlFileManager::sltCopyHostToGuest() 493 { 494 if (!m_pGuestFileTable || !m_pHostFileTable) 495 return; 496 QStringList hostSourcePathList = m_pHostFileTable->selectedItemPathList(); 497 for(int i = 0; i < hostSourcePathList.size(); ++i) 498 printf("%s\n", hostSourcePathList[i].toStdString().c_str()); 499 m_pGuestFileTable->copyHostToGuest(hostSourcePathList); 500 } 501 482 502 void UIGuestControlFileManager::initFileTable() 483 503 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.h
r71234 r71276 65 65 void sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent); 66 66 void sltReceieveLogOutput(QString strOutput); 67 void sltCopyGuestToHost(); 68 void sltCopyHostToGuest(); 67 69 68 70 private: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
r71274 r71276 821 821 } 822 822 823 QString UIGuestControlFileTable::currentPath() const 824 { 825 if (!m_pView) 826 return QString(); 827 QModelIndex currentRoot = m_pView->rootIndex(); 828 if (!currentRoot.isValid()) 829 return QString(); 830 UIFileTableItem *item = static_cast<UIFileTableItem*>(currentRoot.internalPointer()); 831 if (!item) 832 return QString(); 833 return item->path(); 834 } 835 836 QStringList UIGuestControlFileTable::selectedItemPathList() 837 { 838 QItemSelectionModel *selectionModel = m_pView->selectionModel(); 839 if (!selectionModel) 840 return QStringList(); 841 842 QStringList pathList; 843 QModelIndexList selectedItemIndices = selectionModel->selectedRows(); 844 for(int i = 0; i < selectedItemIndices.size(); ++i) 845 { 846 UIFileTableItem *item = static_cast<UIFileTableItem*>(selectedItemIndices.at(i).internalPointer()); 847 if (!item) 848 continue; 849 pathList.push_back(item->path()); 850 } 851 return pathList; 852 } 823 853 824 854 /********************************************************************************************************************************* … … 964 994 } 965 995 996 void UIGuestFileTable::copyGuestToHost(const QString& hostDestinationPath) 997 { 998 } 999 1000 void UIGuestFileTable::copyHostToGuest(const QStringList &hostSourcePathList) 1001 { 1002 } 966 1003 967 1004 /********************************************************************************************************************************* -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h
r71271 r71276 111 111 void reset(); 112 112 void emitLogOutput(const QString& strOutput); 113 /** Returns the path of the rootIndex */ 114 QString currentPath() const; 115 /** Returns the paths of the selected items (if any) as a list */ 116 QStringList selectedItemPathList(); 113 117 114 118 protected: … … 147 151 QILabel *m_pLocationLabel; 148 152 QAction *m_pGoHome; 153 149 154 protected slots: 150 155 … … 193 198 UIGuestFileTable(QWidget *pParent = 0); 194 199 void initGuestFileTable(const CGuestSession &session); 200 void copyGuestToHost(const QString& hostDestinationPath); 201 void copyHostToGuest(const QStringList &hostSourcePathList); 195 202 196 203 protected:
Note:
See TracChangeset
for help on using the changeset viewer.