Changeset 71195 in vbox for trunk/src/VBox
- Timestamp:
- Mar 5, 2018 10:37:56 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121100
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp
r71191 r71195 308 308 containerLayout->setContentsMargins(0, 0, 0, 0); 309 309 m_pGuestFileTable = new UIGuestFileTable; 310 m_pGuestFileTable->setEnabled(false); 310 311 if (m_pGuestFileTable) 311 312 containerLayout->addWidget(m_pGuestFileTable); … … 315 316 { 316 317 m_pToolBar->setOrientation(Qt::Vertical); 318 m_pToolBar->setEnabled(false); 317 319 318 320 /* Add to dummy QWidget to toolbar to center the action icons vertically: */ … … 324 326 bottomSpacerWidget->setVisible(true); 325 327 326 327 328 328 m_pCopyGuestToHost = new QAction(this); 329 329 m_pCopyGuestToHost->setIcon(UIIconPool::iconSet(QString(":/arrow_right_10px_x2.png"))); … … 384 384 if (guestSession == m_comGuestSession && m_comGuestSession.isOk()) 385 385 m_comGuestSession.detach(); 386 if (m_pSessionCreateWidget) 387 m_pSessionCreateWidget->switchSessionCreateMode(); 386 postSessionClosed(); 388 387 } 389 388 390 389 void UIGuestControlFileManager::sltCreateSession(QString strUserName, QString strPassword) 391 390 { 391 if (!UIGuestControlInterface::isGuestAdditionsAvailable(m_comGuest)) 392 { 393 if (m_pLogOutput) 394 { 395 m_pLogOutput->appendPlainText("Could not find Guest Additions"); 396 return; 397 } 398 } 392 399 if (strUserName.isEmpty()) 393 400 { 394 m_pLogOutput->appendPlainText("No user name is given"); 401 if (m_pLogOutput) 402 m_pLogOutput->appendPlainText("No user name is given"); 395 403 return; 396 404 } … … 413 421 m_comGuestSession.Close(); 414 422 m_pLogOutput->appendPlainText("Guest session is closed"); 415 if (m_pSessionCreateWidget) 416 m_pSessionCreateWidget->switchSessionCreateMode(); 423 postSessionClosed(); 417 424 } 418 425 … … 430 437 { 431 438 initFileTable(); 439 postSessionCreated(); 432 440 } 433 441 else … … 446 454 } 447 455 456 void UIGuestControlFileManager::postSessionCreated() 457 { 458 if (m_pSessionCreateWidget) 459 m_pSessionCreateWidget->switchSessionCloseMode(); 460 if(m_pGuestFileTable) 461 m_pGuestFileTable->setEnabled(true); 462 if(m_pToolBar) 463 m_pToolBar->setEnabled(true); 464 } 465 466 void UIGuestControlFileManager::postSessionClosed() 467 { 468 if (m_pSessionCreateWidget) 469 m_pSessionCreateWidget->switchSessionCreateMode(); 470 if(m_pGuestFileTable) 471 m_pGuestFileTable->setEnabled(false); 472 if(m_pToolBar) 473 m_pToolBar->setEnabled(false); 474 475 } 448 476 449 477 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.h
r71191 r71195 82 82 83 83 void initFileTable(); 84 void postSessionCreated(); 85 void postSessionClosed(); 84 86 85 87 template<typename T> 86 88 QStringList getFsObjInfoStringList(const T &fsObjectInfo) const; 87 88 89 89 90 90 const int m_iMaxRecursionDepth; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp
r71191 r71195 551 551 void UIGuestControlInterface::putCommand(const QString &strCommand) 552 552 { 553 if (!isGuestAdditionsAvai ble(m_comGuest))553 if (!isGuestAdditionsAvailable(m_comGuest)) 554 554 { 555 555 emit sigOutputString("No guest addtions detected. Guest control needs guest additions"); … … 664 664 } 665 665 666 bool UIGuestControlInterface::isGuestAdditionsAvai ble(CGuest &guest)666 bool UIGuestControlInterface::isGuestAdditionsAvailable(const CGuest &guest) 667 667 { 668 668 if (!guest.isOk()) 669 669 return false; 670 return guest.GetAdditionsStatus(guest.GetAdditionsRunLevel());671 670 CGuest guestNonConst = const_cast<CGuest&>(guest); 671 return guestNonConst.GetAdditionsStatus(guestNonConst.GetAdditionsRunLevel()); 672 672 } 673 673 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.h
r71169 r71195 54 54 /** Pass a non-const ref since for some reason CGuest::GetAdditionsStatus 55 55 is non-const?! */ 56 static bool isGuestAdditionsAvai ble(CGuest &guest);56 static bool isGuestAdditionsAvailable(const CGuest &guest); 57 57 static QString getFsObjTypeString(KFsObjType type); 58 58 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.