Changeset 75732 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 26, 2018 12:38:19 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp
r75643 r75732 292 292 connect(m_pOperationsPanel, &UIGuestControlFileManagerOperationsPanel::sigFileOperationComplete, 293 293 this, &UIGuestControlFileManager::sltFileOperationComplete); 294 connect(m_pOperationsPanel, &UIGuestControlFileManagerOperationsPanel::sigFileOperationFail, 295 this, &UIGuestControlFileManager::sltReceieveLogOutput); 294 296 m_panelActionMap.insert(m_pOperationsPanel, m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_T_FileOperations)); 295 297 } -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerOperationsPanel.cpp
r75728 r75732 30 30 /* GUI includes: */ 31 31 # include "QIToolButton.h" 32 # include "UIErrorString.h" 32 33 # include "UIIconPool.h" 33 34 # include "UIGuestControlFileManager.h" … … 60 61 signals: 61 62 62 void sigProgressTaskComplete(QUuid progressId); 63 void sigProgressComplete(QUuid progressId); 64 void sigProgressFail(QString strErrorString, FileManagerLogType eLogType); 63 65 64 66 protected: … … 69 71 70 72 void sltHandleProgressPercentageChange(const QUuid &uProgressId, const int iPercent); 71 void sltHandleProgress TaskComplete(const QUuid &uProgressId);73 void sltHandleProgressComplete(const QUuid &uProgressId); 72 74 void sltCancelProgress(); 73 75 … … 176 178 this, &UIFileOperationProgressWidget::sltHandleProgressPercentageChange); 177 179 connect(m_pEventHandler, &UIProgressEventHandler::sigProgressTaskComplete, 178 this, &UIFileOperationProgressWidget::sltHandleProgress TaskComplete);180 this, &UIFileOperationProgressWidget::sltHandleProgressComplete); 179 181 } 180 182 … … 192 194 } 193 195 194 void UIFileOperationProgressWidget::sltHandleProgress TaskComplete(const QUuid &uProgressId)196 void UIFileOperationProgressWidget::sltHandleProgressComplete(const QUuid &uProgressId) 195 197 { 196 198 Q_UNUSED(uProgressId); 197 199 if (m_pCancelButton) 198 200 m_pCancelButton->setEnabled(false); 199 emit sigProgressTaskComplete(m_comProgress.GetId()); 201 202 if (!m_comProgress.isOk() || m_comProgress.GetResultCode() != 0) 203 emit sigProgressFail(UIErrorString::formatErrorInfo(m_comProgress), FileManagerLogType_Error); 204 else 205 emit sigProgressComplete(m_comProgress.GetId()); 200 206 } 201 207 … … 229 235 UIFileOperationProgressWidget *pOperationsWidget = new UIFileOperationProgressWidget(comProgress); 230 236 m_pTableWidget->setCellWidget(m_pTableWidget->rowCount() - 1, 0, pOperationsWidget); 231 connect(pOperationsWidget, &UIFileOperationProgressWidget::sigProgress TaskComplete,237 connect(pOperationsWidget, &UIFileOperationProgressWidget::sigProgressComplete, 232 238 this, &UIGuestControlFileManagerOperationsPanel::sigFileOperationComplete); 239 connect(pOperationsWidget, &UIFileOperationProgressWidget::sigProgressFail, 240 this, &UIGuestControlFileManagerOperationsPanel::sigFileOperationFail); 233 241 234 242 m_pTableWidget->resizeColumnsToContents(); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerOperationsPanel.h
r75728 r75732 42 42 43 43 void sigFileOperationComplete(QUuid progressId); 44 void sigFileOperationFail(QString strErrorString, FileManagerLogType eLogType); 44 45 45 46 public: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestFileTable.cpp
r75686 r75732 332 332 void UIGuestFileTable::copyHostToGuest(const QStringList &hostSourcePathList, bool fDeleteAfterSuccessfulCopy /* = false */) 333 333 { 334 if (!checkGuestSession()) 335 return; 334 336 QVector<QString> sourcePaths = hostSourcePathList.toVector(); 335 337 QVector<QString> aFilters; … … 348 350 349 351 CProgress progress = m_comGuestSession.CopyToGuest(sourcePaths, aFilters, aFlags, strDestinationPath); 350 if (!m_comGuestSession.isOk()) 351 { 352 emit sigLogOutput(UIErrorString::formatErrorInfo(m_comGuestSession), FileManagerLogType_Error); 353 return; 354 } 352 if (!checkGuestSession()) 353 return; 355 354 emit sigNewFileOperation(progress); 356 355 /* Cache the progress id and host source file objects' path in case of move operation. we will delete … … 362 361 void UIGuestFileTable::copyGuestToHost(const QString& hostDestinationPath, bool fDeleteAfterSuccessfulCopy /* = false */) 363 362 { 363 if (!checkGuestSession()) 364 return; 364 365 QVector<QString> sourcePaths = selectedItemPathList().toVector(); 365 366 QVector<QString> aFilters; … … 378 379 379 380 CProgress progress = m_comGuestSession.CopyFromGuest(sourcePaths, aFilters, aFlags, hostDestinationPath); 380 if (!m_comGuestSession.isOk()) 381 { 382 emit sigLogOutput(UIErrorString::formatErrorInfo(m_comGuestSession), FileManagerLogType_Error); 383 return; 384 } 381 if (!checkGuestSession()) 382 return; 385 383 emit sigNewFileOperation(progress); 386 384 /* Cache the progress id and source file objects' path in case of move operation. we will delete … … 651 649 } 652 650 651 bool UIGuestFileTable::checkGuestSession() 652 { 653 if (!m_comGuestSession.isOk()) 654 { 655 emit sigLogOutput(UIErrorString::formatErrorInfo(m_comGuestSession), FileManagerLogType_Error); 656 return false; 657 } 658 return true; 659 } 653 660 #include "UIGuestFileTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestFileTable.h
r75610 r75732 71 71 72 72 void prepareActionConnections(); 73 bool checkGuestSession(); 73 74 74 75 mutable CGuestSession m_comGuestSession;
Note:
See TracChangeset
for help on using the changeset viewer.