Changeset 92814 in vbox for trunk/src/VBox
- Timestamp:
- Dec 8, 2021 1:57:05 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r92790 r92814 145 145 { 146 146 UIFileManagerOptions::destroy(); 147 if (m_pGuestTablesContainer) 148 { 149 for (int i = 0; i < m_pGuestTablesContainer->count(); ++i) 150 { 151 UIFileManagerGuestTable *pTable = qobject_cast<UIFileManagerGuestTable*>(m_pGuestTablesContainer->widget(i)); 152 if (pTable) 153 pTable->disconnect(); 154 } 155 } 147 156 } 148 157 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp
r92753 r92814 31 31 #endif 32 32 33 /* COM includes: */ 34 #include "COMEnums.h" 35 #include "CMachine.h" 33 36 34 37 /********************************************************************************************************************************* … … 36 39 *********************************************************************************************************************************/ 37 40 38 UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine)41 UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName) 39 42 : m_pActionPool(pActionPool) 40 , m_comMachine(comMachine) 43 , m_uMachineId(uMachineId) 44 , m_strMachineName(strMachineName) 41 45 { 42 46 } … … 45 49 UIFileManagerDialogFactory::UIFileManagerDialogFactory() 46 50 : m_pActionPool(0) 47 , m_ comMachine(CMachine())51 , m_uMachineId(QUuid()) 48 52 { 49 53 } … … 51 55 void UIFileManagerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 52 56 { 53 pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_ comMachine);57 pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_uMachineId, m_strMachineName); 54 58 } 55 59 … … 61 65 UIFileManagerDialog::UIFileManagerDialog(QWidget *pCenterWidget, 62 66 UIActionPool *pActionPool, 63 const CMachine &comMachine) 67 const QUuid &uMachineId, 68 const QString &strMachineName) 64 69 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 65 70 , m_pActionPool(pActionPool) 66 , m_comMachine(comMachine) 71 , m_uMachineId(uMachineId) 72 , m_strMachineName(strMachineName) 67 73 { 68 74 } … … 74 80 void UIFileManagerDialog::retranslateUi() 75 81 { 76 if (!m_ comMachine.isNull())77 setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_ comMachine.GetName()));82 if (!m_strMachineName.isEmpty()) 83 setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_strMachineName)); 78 84 else 79 85 setWindowTitle(UIFileManager::tr("File Manager")); … … 105 111 void UIFileManagerDialog::configureCentralWidget() 106 112 { 113 CMachine comMachine; 114 CVirtualBox vbox = uiCommon().virtualBox(); 115 if (!vbox.isNull() && !m_uMachineId.isNull()) 116 comMachine = vbox.FindMachine(m_uMachineId.toString()); 107 117 /* Create widget: */ 108 118 UIFileManager *pWidget = new UIFileManager(EmbedTo_Dialog, m_pActionPool, 109 m_comMachine, this, true);119 comMachine, this, true); 110 120 111 121 if (pWidget) -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h
r92638 r92814 29 29 #include "QIWithRetranslateUI.h" 30 30 31 /* COM includes: */ 32 #include "COMEnums.h" 33 #include "CMachine.h" 31 34 32 35 33 /* Forward declarations: */ … … 38 36 class UIActionPool; 39 37 class UIFileManagerDialog; 40 class CMachine;41 38 42 39 … … 46 43 public: 47 44 48 UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine);45 UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName); 49 46 UIFileManagerDialogFactory(); 50 47 … … 56 53 57 54 UIActionPool *m_pActionPool; 58 CMachine m_comMachine; 55 QUuid m_uMachineId; 56 QString m_strMachineName; 59 57 }; 60 58 … … 69 67 * @param pCenterWidget Passes the widget reference to center according to. 70 68 * @param pActionPool Passes the action-pool reference. 71 * @param comMachine Passes the machine reference. */72 UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine);69 * @param uMachineId Passes the machine id. */ 70 UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName); 73 71 ~UIFileManagerDialog(); 74 72 … … 110 108 void manageEscapeShortCut(); 111 109 UIActionPool *m_pActionPool; 112 CMachine m_comMachine; 110 QUuid m_uMachineId; 111 QString m_strMachineName; 113 112 }; 114 113 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp
r92790 r92814 178 178 } 179 179 180 UIFileManagerGuestTable::~UIFileManagerGuestTable() 181 { 182 cleanAll(); 183 } 184 180 185 void UIFileManagerGuestTable::initFileTable() 181 186 { … … 201 206 break; 202 207 case CheckMachine_MachineNotRunning: 203 strWarningText = UIFileManager::tr(" Guest system is not running. File manager work only onrunning guests.");208 strWarningText = UIFileManager::tr("File manager cannot work since it works only with running guests."); 204 209 break; 205 210 case CheckMachine_NoGuestAdditions: 206 strWarningText = UIFileManager::tr(" No guest additions is found on the guest system. File manager needs guest additions to function correctly.");211 strWarningText = UIFileManager::tr("File manager cannot work since it needs running guest additions in the guest system."); 207 212 break; 208 213 case CheckMachine_SessionPossible: … … 853 858 void UIFileManagerGuestTable::sltHandleGuestSessionPanelHidden() 854 859 { 860 return; 855 861 if (m_pActionPool && m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)) 856 862 m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)->setChecked(false); … … 870 876 if (enmMachineState == KMachineState_Running) 871 877 openMachineSession(); 878 else if (enmMachineState == KMachineState_Paused) 879 return; 872 880 else 873 {874 881 cleanAll(); 875 }876 882 877 883 setSessionDependentWidgetsEnabled(isSessionPossible()); … … 881 887 bool UIFileManagerGuestTable::closeMachineSession() 882 888 { 883 if (!m_comSession.isNull())884 m_comSession.UnlockMachine();885 886 889 if (!m_comGuest.isNull()) 887 890 m_comGuest.detach(); 888 891 889 if (!m_comSession.isNull())890 m_comSession.detach();891 892 if (!m_comConsole.isNull()) 892 893 m_comConsole.detach(); 893 894 895 if (!m_comSession.isNull()) 896 { 897 m_comSession.UnlockMachine(); 898 m_comSession.detach(); 899 } 894 900 return true; 895 901 } … … 957 963 if (!m_pQtGuestListener.isNull()) 958 964 { 959 disconnect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered, 960 this, &UIFileManagerGuestTable::sltGuestSessionUnregistered); 961 disconnect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionRegistered, 962 this, &UIFileManagerGuestTable::sltGuestSessionRegistered); 965 m_pQtGuestListener->getWrapped()->disconnect(); 963 966 if (!m_comGuest.isNull()) 964 967 cleanupListener(m_pQtGuestListener, m_comGuestListener, m_comGuest.GetEventSource()); … … 970 973 if (!m_pQtSessionListener.isNull()) 971 974 { 972 disconnect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged, 973 this, &UIFileManagerGuestTable::sltGuestSessionStateChanged); 975 m_pQtSessionListener->getWrapped()->disconnect(); 974 976 if (!m_comGuestSession.isNull()) 975 977 cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuestSession.GetEventSource()); … … 981 983 if (!m_pQtConsoleListener.isNull()) 982 984 { 983 disconnect(m_pQtConsoleListener->getWrapped(), &UIMainEventListener::sigAdditionsChange, 984 this, &UIFileManagerGuestTable::sltAdditionsStateChange); 985 m_pQtConsoleListener->getWrapped()->disconnect(); 985 986 if (!m_comConsole.isNull()) 986 987 cleanupListener(m_pQtConsoleListener, m_comConsoleListener, m_comConsole.GetEventSource()); … … 1178 1179 void UIFileManagerGuestTable::closeGuestSession() 1179 1180 { 1180 1181 1181 if (!m_comGuestSession.isNull()) 1182 1182 { 1183 1183 m_comGuestSession.Close(); 1184 1184 m_comGuestSession.detach(); 1185 emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info); 1185 1186 } 1186 1187 reset(); 1187 emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info);1188 1188 postGuestSessionClosed(); 1189 1189 } -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h
r92790 r92814 59 59 60 60 UIFileManagerGuestTable(UIActionPool *pActionPool, const CMachine &comMachine, QWidget *pParent = 0); 61 ~UIFileManagerGuestTable(); 61 62 void copyGuestToHost(const QString& hostDestinationPath); 62 63 void copyHostToGuest(const QStringList &hostSourcePathList, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r92744 r92814 1781 1781 1782 1782 QIManagerDialog *pFileManagerDialog; 1783 UIFileManagerDialogFactory dialogFactory(actionPool(), machine() );1783 UIFileManagerDialogFactory dialogFactory(actionPool(), machine().GetId(), machine().GetName()); 1784 1784 dialogFactory.prepare(pFileManagerDialog, activeMachineWindow()); 1785 1785 if (pFileManagerDialog)
Note:
See TracChangeset
for help on using the changeset viewer.