Changeset 92616 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 28, 2021 5:45:25 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148508
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r92082 r92616 722 722 src/guestctrl/UIFileManagerOperationsPanel.h \ 723 723 src/guestctrl/UIFileManagerOptionsPanel.h \ 724 src/guestctrl/UIFileManager SessionPanel.h \724 src/guestctrl/UIFileManagerGuestSessionPanel.h \ 725 725 src/guestctrl/UIFileManagerTable.h \ 726 726 src/guestctrl/UIGuestControlConsole.h \ … … 990 990 src/guestctrl/UIFileManagerLogPanel.cpp \ 991 991 src/guestctrl/UIFileManagerOperationsPanel.cpp \ 992 src/guestctrl/UIFileManager SessionPanel.cpp \992 src/guestctrl/UIFileManagerGuestSessionPanel.cpp \ 993 993 src/guestctrl/UIFileManagerTable.cpp \ 994 994 src/guestctrl/UIFileManagerGuestTable.cpp \ … … 1243 1243 src/guestctrl/UIFileManagerOperationsPanel.cpp \ 1244 1244 src/guestctrl/UIFileManagerOptionsPanel.cpp \ 1245 src/guestctrl/UIFileManager SessionPanel.cpp \1245 src/guestctrl/UIFileManagerGuestSessionPanel.cpp \ 1246 1246 src/guestctrl/UIFileManagerTable.cpp \ 1247 1247 src/guestctrl/UIGuestControlConsole.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r92563 r92616 1702 1702 }; 1703 1703 1704 /** Toggle action extension, used to toggle 'File Manager Session' panel in file manager. */1705 class UIActionMenuFileManager Session : public UIActionToggle1706 { 1707 Q_OBJECT; 1708 1709 public: 1710 1711 /** Constructs action passing @a pParent to the base-class. */ 1712 UIActionMenuFileManager Session(UIActionPool *pParent)1704 /** Toggle action extension, used to toggle 'File Manager Guest Session' panel in file manager. */ 1705 class UIActionMenuFileManagerGuestSession : public UIActionToggle 1706 { 1707 Q_OBJECT; 1708 1709 public: 1710 1711 /** Constructs action passing @a pParent to the base-class. */ 1712 UIActionMenuFileManagerGuestSession(UIActionPool *pParent) 1713 1713 : UIActionToggle(pParent) 1714 1714 { … … 1723 1723 virtual QString shortcutExtraDataID() const /* override */ 1724 1724 { 1725 return QString("ToggleFileManager SessionPanel");1725 return QString("ToggleFileManagerGuestSessionPanel"); 1726 1726 } 1727 1727 … … 3106 3106 m_pool[UIActionIndex_M_FileManager_T_Log] = new UIActionMenuFileManagerLog(this); 3107 3107 m_pool[UIActionIndex_M_FileManager_T_Operations] = new UIActionMenuFileManagerOperations(this); 3108 m_pool[UIActionIndex_M_FileManager_T_ Session] = new UIActionMenuFileManagerSession(this);3108 m_pool[UIActionIndex_M_FileManager_T_GuestSession] = new UIActionMenuFileManagerGuestSession(this); 3109 3109 m_pool[UIActionIndex_M_FileManager_S_Host_GoUp] = new UIActionMenuFileManagerGoUp(this); 3110 3110 m_pool[UIActionIndex_M_FileManager_S_Guest_GoUp] = new UIActionMenuFileManagerGoUp(this); … … 3557 3557 void UIActionPool::updateMenuFileManagerWrapper(UIMenu *pMenu) 3558 3558 { 3559 addAction(pMenu, action(UIActionIndex_M_FileManager_T_ Session));3559 addAction(pMenu, action(UIActionIndex_M_FileManager_T_GuestSession)); 3560 3560 addAction(pMenu, action(UIActionIndex_M_FileManager_T_Options)); 3561 3561 addAction(pMenu, action(UIActionIndex_M_FileManager_T_Operations)); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r92487 r92616 112 112 UIActionIndex_M_FileManager_T_Log, 113 113 UIActionIndex_M_FileManager_T_Operations, 114 UIActionIndex_M_FileManager_T_ Session,114 UIActionIndex_M_FileManager_T_GuestSession, 115 115 UIActionIndex_M_FileManager_S_Host_GoUp, 116 116 UIActionIndex_M_FileManager_S_Guest_GoUp, -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r92610 r92616 31 31 #include "UIIconPool.h" 32 32 #include "UIFileManager.h" 33 #include "UIFileManager SessionPanel.h"33 #include "UIFileManagerGuestSessionPanel.h" 34 34 #include "UIFileManagerOptionsPanel.h" 35 35 #include "UIFileManagerLogPanel.h" … … 126 126 , m_pOptionsPanel(0) 127 127 , m_pLogPanel(0) 128 , m_p SessionPanel(0)128 , m_pGuestSessionPanel(0) 129 129 , m_pOperationsPanel(0) 130 130 , m_fDialogBeingClosed(false) … … 246 246 247 247 pTopLayout->addLayout(pFileTableContainerLayout); 248 m_p SessionPanel = new UIFileManagerSessionPanel;249 if (m_p SessionPanel)250 { 251 m_p SessionPanel->hide();252 m_panelActionMap.insert(m_p SessionPanel, m_pActionPool->action(UIActionIndex_M_FileManager_T_Session));253 pTopLayout->addWidget(m_p SessionPanel);248 m_pGuestSessionPanel = new UIFileManagerGuestSessionPanel; 249 if (m_pGuestSessionPanel) 250 { 251 m_pGuestSessionPanel->hide(); 252 m_panelActionMap.insert(m_pGuestSessionPanel, m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)); 253 pTopLayout->addWidget(m_pGuestSessionPanel); 254 254 } 255 255 … … 330 330 { 331 331 if (m_pQtGuestListener) 332 {333 332 connect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered, 334 333 this, &UIFileManager::sltGuestSessionUnregistered); 335 } 336 if (m_p SessionPanel)337 { 338 connect(m_p SessionPanel, &UIFileManagerSessionPanel::sigCreateSession,339 this, &UIFileManager::sltCreate Session);340 connect(m_p SessionPanel, &UIFileManagerSessionPanel::sigCloseSession,341 this, &UIFileManager::sltClose Session);342 connect(m_p SessionPanel, &UIFileManagerSessionPanel::sigHidePanel,334 335 if (m_pGuestSessionPanel) 336 { 337 connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCreateSession, 338 this, &UIFileManager::sltCreateGuestSession); 339 connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCloseSession, 340 this, &UIFileManager::sltCloseGuestSession); 341 connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigHidePanel, 343 342 this, &UIFileManager::sltHandleHidePanel); 344 343 } … … 367 366 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 368 367 369 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_ Session));368 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)); 370 369 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Options)); 371 370 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations)); … … 376 375 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log), &QAction::toggled, 377 376 this, &UIFileManager::sltPanelActionToggled); 378 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_ Session), &QAction::toggled,377 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession), &QAction::toggled, 379 378 this, &UIFileManager::sltPanelActionToggled); 380 379 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations), &QAction::toggled, … … 395 394 } 396 395 397 398 396 void UIFileManager::sltGuestSessionUnregistered(CGuestSession guestSession) 399 397 { … … 403 401 { 404 402 m_comGuestSession.detach(); 405 post SessionClosed();406 } 407 } 408 409 void UIFileManager::sltCreate Session(QString strUserName, QString strPassword)403 postGuestSessionClosed(); 404 } 405 } 406 407 void UIFileManager::sltCreateGuestSession(QString strUserName, QString strPassword) 410 408 { 411 409 if (!UIGuestControlInterface::isGuestAdditionsAvailable(m_comGuest)) 412 410 { 413 411 appendLog("Could not find Guest Additions", FileManagerLogType_Error); 414 post SessionClosed();415 if (m_p SessionPanel)416 m_p SessionPanel->markForError(true);412 postGuestSessionClosed(); 413 if (m_pGuestSessionPanel) 414 m_pGuestSessionPanel->markForError(true); 417 415 return; 418 416 } … … 420 418 { 421 419 appendLog("No user name is given", FileManagerLogType_Error); 422 if (m_p SessionPanel)423 m_p SessionPanel->markForError(true);424 return; 425 } 426 if (m_p SessionPanel)427 m_p SessionPanel->markForError(!createSession(strUserName, strPassword));428 } 429 430 void UIFileManager::sltClose Session()420 if (m_pGuestSessionPanel) 421 m_pGuestSessionPanel->markForError(true); 422 return; 423 } 424 if (m_pGuestSessionPanel) 425 m_pGuestSessionPanel->markForError(!createGuestSession(strUserName, strPassword)); 426 } 427 428 void UIFileManager::sltCloseGuestSession() 431 429 { 432 430 if (!m_comGuestSession.isOk()) 433 431 { 434 432 appendLog("Guest session is not valid", FileManagerLogType_Error); 435 post SessionClosed();433 postGuestSessionClosed(); 436 434 return; 437 435 } … … 444 442 m_comGuestSession.Close(); 445 443 appendLog("Guest session is closed", FileManagerLogType_Info); 446 post SessionClosed();444 postGuestSessionClosed(); 447 445 } 448 446 … … 460 458 { 461 459 initFileTable(); 462 post SessionCreated();460 postGuestSessionCreated(); 463 461 } 464 462 appendLog(QString("%1: %2").arg("Session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())), … … 578 576 } 579 577 580 void UIFileManager::post SessionCreated()581 { 582 if (m_p SessionPanel)583 m_p SessionPanel->switchSessionCloseMode();578 void UIFileManager::postGuestSessionCreated() 579 { 580 if (m_pGuestSessionPanel) 581 m_pGuestSessionPanel->switchSessionCloseMode(); 584 582 if (m_pGuestFileTable) 585 583 m_pGuestFileTable->setEnabled(true); … … 588 586 } 589 587 590 void UIFileManager::post SessionClosed()591 { 592 if (m_p SessionPanel)593 m_p SessionPanel->switchSessionCreateMode();588 void UIFileManager::postGuestSessionClosed() 589 { 590 if (m_pGuestSessionPanel) 591 m_pGuestSessionPanel->switchSessionCreateMode(); 594 592 if (m_pGuestFileTable) 595 593 m_pGuestFileTable->setEnabled(false); … … 598 596 } 599 597 600 bool UIFileManager::create Session(const QString& strUserName, const QString& strPassword,601 598 bool UIFileManager::createGuestSession(const QString& strUserName, const QString& strPassword, 599 const QString& strDomain /* not used currently */) 602 600 { 603 601 if (!m_comGuest.isOk()) … … 612 610 } 613 611 appendLog("Guest session has been created", FileManagerLogType_Info); 614 if (m_p SessionPanel)615 m_p SessionPanel->switchSessionCloseMode();612 if (m_pGuestSessionPanel) 613 m_pGuestSessionPanel->switchSessionCloseMode(); 616 614 617 615 /* Prepare session listener */ … … 625 623 qRegisterMetaType<CGuestSessionStateChangedEvent>(); 626 624 627 628 625 connect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged, 629 626 this, &UIFileManager::sltGuestSessionStateChanged); … … 631 628 /* Wait session to start. For some reason we cannot get GuestSessionStatusChanged event 632 629 consistently. So we wait: */ 633 appendLog("Waiting the session to start", FileManagerLogType_Info);630 appendLog("Waiting the guest session to start", FileManagerLogType_Info); 634 631 const ULONG waitTimeout = 2000; 635 632 KGuestSessionWaitResult waitResult = m_comGuestSession.WaitFor(KGuestSessionWaitForFlag_Start, waitTimeout); 636 633 if (waitResult != KGuestSessionWaitResult_Start) 637 634 { 638 appendLog("The session did not start", FileManagerLogType_Error);639 sltClose Session();635 appendLog("The guest session did not start", FileManagerLogType_Error); 636 sltCloseGuestSession(); 640 637 return false; 641 638 } … … 645 642 646 643 void UIFileManager::prepareListener(ComObjPtr<UIMainEventListenerImpl> &QtListener, 647 648 644 CEventListener &comEventListener, 645 CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes) 649 646 { 650 647 if (!comEventSource.isOk()) … … 727 724 } 728 725 /* Make sure Session panel is visible: */ 729 if (m_p SessionPanel && !m_pSessionPanel->isVisible())730 showPanel(m_p SessionPanel);726 if (m_pGuestSessionPanel && !m_pGuestSessionPanel->isVisible()) 727 showPanel(m_pGuestSessionPanel); 731 728 } 732 729 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r89111 r92616 49 49 class UIFileManagerLogPanel; 50 50 class UIFileManagerOperationsPanel; 51 class UIFileManager SessionPanel;51 class UIFileManagerGuestSessionPanel; 52 52 class UIFileManagerOptionsPanel; 53 53 class UIFileManagerGuestTable; … … 110 110 111 111 void sltGuestSessionUnregistered(CGuestSession guestSession); 112 void sltCreate Session(QString strUserName, QString strPassword);113 void sltClose Session();112 void sltCreateGuestSession(QString strUserName, QString strPassword); 113 void sltCloseGuestSession(); 114 114 void sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent); 115 115 void sltReceieveLogOutput(QString strOutput, FileManagerLogType eLogType); … … 131 131 void prepareVerticalToolBar(QHBoxLayout *layout); 132 132 void prepareToolBar(); 133 bool create Session(const QString& strUserName, const QString& strPassword,133 bool createGuestSession(const QString& strUserName, const QString& strPassword, 134 134 const QString& strDomain = QString() /* not used currently */); 135 135 … … 145 145 /** @name Perform operations needed after creating/ending a guest control session 146 146 * @{ */ 147 void post SessionCreated();148 void post SessionClosed();147 void postGuestSessionCreated(); 148 void postGuestSessionClosed(); 149 149 /** @} */ 150 150 … … 191 191 UIFileManagerOptionsPanel *m_pOptionsPanel; 192 192 UIFileManagerLogPanel *m_pLogPanel; 193 UIFileManager SessionPanel *m_pSessionPanel;193 UIFileManagerGuestSessionPanel *m_pGuestSessionPanel; 194 194 UIFileManagerOperationsPanel *m_pOperationsPanel; 195 195 bool m_fDialogBeingClosed; -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestSessionPanel.cpp
r92615 r92616 23 23 /* GUI includes: */ 24 24 #include "QILineEdit.h" 25 #include "UIFileManager SessionPanel.h"25 #include "UIFileManagerGuestSessionPanel.h" 26 26 27 27 /********************************************************************************************************************************* … … 261 261 262 262 /********************************************************************************************************************************* 263 * UIFileManager SessionPanel implementation. *263 * UIFileManagerGuestSessionPanel implementation. * 264 264 *********************************************************************************************************************************/ 265 265 266 UIFileManager SessionPanel::UIFileManagerSessionPanel(QWidget *pParent /* = 0 */)266 UIFileManagerGuestSessionPanel::UIFileManagerGuestSessionPanel(QWidget *pParent /* = 0 */) 267 267 : UIDialogPanel(pParent) 268 268 , m_pSessionCreateWidget(0) … … 271 271 } 272 272 273 void UIFileManager SessionPanel::switchSessionCloseMode()273 void UIFileManagerGuestSessionPanel::switchSessionCloseMode() 274 274 { 275 275 if (m_pSessionCreateWidget) … … 277 277 } 278 278 279 void UIFileManager SessionPanel::switchSessionCreateMode()279 void UIFileManagerGuestSessionPanel::switchSessionCreateMode() 280 280 { 281 281 if (m_pSessionCreateWidget) … … 283 283 } 284 284 285 QString UIFileManager SessionPanel::panelName() const286 { 287 return " SessionPanel";288 } 289 290 void UIFileManager SessionPanel::markForError(bool fMarkForError)285 QString UIFileManagerGuestSessionPanel::panelName() const 286 { 287 return "GuestSessionPanel"; 288 } 289 290 void UIFileManagerGuestSessionPanel::markForError(bool fMarkForError) 291 291 { 292 292 if (m_pSessionCreateWidget) … … 294 294 } 295 295 296 void UIFileManager SessionPanel::prepareWidgets()296 void UIFileManagerGuestSessionPanel::prepareWidgets() 297 297 { 298 298 if (!mainLayout()) … … 303 303 } 304 304 305 void UIFileManager SessionPanel::prepareConnections()305 void UIFileManagerGuestSessionPanel::prepareConnections() 306 306 { 307 307 if (m_pSessionCreateWidget) 308 308 { 309 309 connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCreateSession, 310 this, &UIFileManager SessionPanel::sigCreateSession);310 this, &UIFileManagerGuestSessionPanel::sigCreateSession); 311 311 connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCloseSession, 312 this, &UIFileManager SessionPanel::sigCloseSession);313 } 314 } 315 316 void UIFileManager SessionPanel::retranslateUi()312 this, &UIFileManagerGuestSessionPanel::sigCloseSession); 313 } 314 } 315 316 void UIFileManagerGuestSessionPanel::retranslateUi() 317 317 { 318 318 UIDialogPanel::retranslateUi(); … … 320 320 } 321 321 322 void UIFileManager SessionPanel::showEvent(QShowEvent *pEvent)322 void UIFileManagerGuestSessionPanel::showEvent(QShowEvent *pEvent) 323 323 { 324 324 markForError(false); … … 326 326 } 327 327 328 #include "UIFileManager SessionPanel.moc"328 #include "UIFileManagerGuestSessionPanel.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestSessionPanel.h
r92615 r92616 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManager SessionPanel_h19 #define FEQT_INCLUDED_SRC_guestctrl_UIFileManager SessionPanel_h18 #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h 19 #define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 29 29 30 30 /** UIDialogPanel extension providing GUI for creating/stopping a guest session. */ 31 class UIFileManager SessionPanel : public UIDialogPanel31 class UIFileManagerGuestSessionPanel : public UIDialogPanel 32 32 { 33 33 Q_OBJECT; … … 40 40 public: 41 41 42 UIFileManager SessionPanel(QWidget *pParent = 0);42 UIFileManagerGuestSessionPanel(QWidget *pParent = 0); 43 43 /** @name Enable/disable member widget wrt. guest session status. 44 44 * @{ */ … … 61 61 }; 62 62 63 #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManager SessionPanel_h */63 #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h */
Note:
See TracChangeset
for help on using the changeset viewer.