Changeset 75246 in vbox
- Timestamp:
- Nov 5, 2018 9:36:29 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 2 edited
-
UIGuestControlFileManager.cpp (modified) (7 diffs)
-
UIGuestControlFileManager.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp
r75224 r75246 27 27 # include <QTextEdit> 28 28 # include <QPushButton> 29 # include <QSplitter> 29 30 # include <QGridLayout> 30 31 … … 133 134 , m_comGuest(comGuest) 134 135 , m_pMainLayout(0) 136 , m_pVerticalSplitter(0) 135 137 , m_pToolBar(0) 136 , m_pFileTableContainerWidget(0)137 , m_pFileTableContainerLayout(0)138 138 , m_pGuestFileTable(0) 139 139 , m_pHostFileTable(0) … … 188 188 void UIGuestControlFileManager::prepareObjects() 189 189 { 190 /* Create layout: */190 /* m_pMainLayout is the outer most layout containing the main toolbar and splitter widget: */ 191 191 m_pMainLayout = new QVBoxLayout(this); 192 192 if (!m_pMainLayout) … … 195 195 /* Configure layout: */ 196 196 m_pMainLayout->setSpacing(0); 197 m_pMainLayout->setContentsMargins(0, 0, 0, 0); 197 198 198 199 if (m_fShowToolbar) 199 200 prepareToolBar(); 200 201 // m_pSessionCreateWidget = new UIGuestSessionCreateWidget(); 202 // if (m_pSessionCreateWidget) 203 // { 204 // m_pMainLayout->addWidget(m_pSessionCreateWidget); 205 // } 206 207 m_pFileTableContainerWidget = new QWidget; 208 m_pFileTableContainerLayout = new QHBoxLayout; 209 210 if (m_pFileTableContainerWidget) 211 { 212 if (m_pFileTableContainerLayout) 201 /* Two widgets are inserted into this splitter. Upper pWidget widget is a container with file tables and all the panels 202 except the log panel and lower widget is the log panel: */ 203 m_pVerticalSplitter = new QSplitter; 204 if (!m_pVerticalSplitter) 205 return; 206 207 m_pMainLayout->addWidget(m_pVerticalSplitter); 208 m_pVerticalSplitter->setOrientation(Qt::Vertical); 209 m_pVerticalSplitter->setHandleWidth(4); 210 211 QHBoxLayout *pFileTableContainerLayout = new QHBoxLayout; 212 pFileTableContainerLayout->setSpacing(0); 213 pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0); 214 215 QWidget *pTopWidget = new QWidget; 216 QVBoxLayout *pTopLayout = new QVBoxLayout; 217 pTopLayout->setSpacing(0); 218 pTopLayout->setContentsMargins(0, 0, 0, 0); 219 220 pTopWidget->setLayout(pTopLayout); 221 222 if (pFileTableContainerLayout) 223 { 224 pFileTableContainerLayout->setSpacing(0); 225 pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0); 226 m_pGuestFileTable = new UIGuestFileTable(m_pActionPool); 227 m_pGuestFileTable->setEnabled(false); 228 229 m_pHostFileTable = new UIHostFileTable(m_pActionPool); 230 if (m_pHostFileTable) 213 231 { 214 m_pFileTableContainerWidget->setLayout(m_pFileTableContainerLayout); 215 m_pFileTableContainerLayout->setSpacing(0); 216 m_pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0); 217 m_pGuestFileTable = new UIGuestFileTable(m_pActionPool); 218 m_pGuestFileTable->setEnabled(false); 219 220 m_pHostFileTable = new UIHostFileTable(m_pActionPool); 221 if (m_pHostFileTable) 222 { 223 connect(m_pHostFileTable, &UIHostFileTable::sigLogOutput, 224 this, &UIGuestControlFileManager::sltReceieveLogOutput); 225 m_pFileTableContainerLayout->addWidget(m_pHostFileTable); 226 } 227 prepareVerticalToolBar(); 228 if (m_pGuestFileTable) 229 { 230 connect(m_pGuestFileTable, &UIGuestFileTable::sigLogOutput, 231 this, &UIGuestControlFileManager::sltReceieveLogOutput); 232 m_pFileTableContainerLayout->addWidget(m_pGuestFileTable); 233 } 234 232 connect(m_pHostFileTable, &UIHostFileTable::sigLogOutput, 233 this, &UIGuestControlFileManager::sltReceieveLogOutput); 234 pFileTableContainerLayout->addWidget(m_pHostFileTable); 235 235 } 236 m_pMainLayout->addWidget(m_pFileTableContainerWidget); 236 prepareVerticalToolBar(pFileTableContainerLayout); 237 if (m_pGuestFileTable) 238 { 239 connect(m_pGuestFileTable, &UIGuestFileTable::sigLogOutput, 240 this, &UIGuestControlFileManager::sltReceieveLogOutput); 241 pFileTableContainerLayout->addWidget(m_pGuestFileTable); 242 } 237 243 } 238 244 … … 243 249 // m_pFileOperationsList->header()->hide(); 244 250 // } 245 246 /* Create the settings-panel: */ 247 m_pLogPanel = new UIGuestControlFileManagerLogPanel(this /* manager dialog */, 0 /*parent */); 248 if (m_pLogPanel) 249 { 250 /* Configure panel: */ 251 m_pLogPanel->hide(); 252 m_panelActionMap.insert(m_pLogPanel, m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_T_Log)); 253 /* Add into layout: */ 254 m_pMainLayout->addWidget(m_pLogPanel); 255 } 251 pTopLayout->addLayout(pFileTableContainerLayout); 256 252 m_pSessionPanel = new UIGuestControlFileManagerSessionPanel(this /* manager dialog */, 0 /*parent */); 257 253 if (m_pSessionPanel) 258 254 { 259 /* Configure panel: */260 255 m_pSessionPanel->hide(); 261 256 m_panelActionMap.insert(m_pSessionPanel, m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_T_Session)); 262 /* Add into layout: */ 263 m_pMainLayout->addWidget(m_pSessionPanel); 264 } 265 266 /* Create the settings-panel: */ 257 pTopLayout->addWidget(m_pSessionPanel); 258 } 259 267 260 m_pSettingsPanel = 268 261 new UIGuestControlFileManagerSettingsPanel(this /* manager dialog */, … … 270 263 if (m_pSettingsPanel) 271 264 { 272 /* Configure panel: */273 265 m_pSettingsPanel->hide(); 274 266 m_panelActionMap.insert(m_pSettingsPanel, m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_T_Settings)); 275 267 connect(m_pSettingsPanel, &UIGuestControlFileManagerSettingsPanel::sigListDirectoriesFirstChanged, 276 268 this, &UIGuestControlFileManager::sltListDirectoriesBeforeChanged); 277 /* Add into layout: */ 278 m_pMainLayout->addWidget(m_pSettingsPanel); 279 } 280 281 } 282 283 void UIGuestControlFileManager::prepareVerticalToolBar() 269 pTopLayout->addWidget(m_pSettingsPanel); 270 } 271 m_pVerticalSplitter->addWidget(pTopWidget); 272 273 m_pLogPanel = new UIGuestControlFileManagerLogPanel(this /* manager dialog */, 0 /*parent */); 274 if (m_pLogPanel) 275 { 276 m_pLogPanel->hide(); 277 m_panelActionMap.insert(m_pLogPanel, m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_T_Log)); 278 } 279 m_pVerticalSplitter->addWidget(pTopWidget); 280 m_pVerticalSplitter->addWidget(m_pLogPanel); 281 m_pVerticalSplitter->setCollapsible(m_pVerticalSplitter->indexOf(pTopWidget), false); 282 m_pVerticalSplitter->setCollapsible(m_pVerticalSplitter->indexOf(m_pLogPanel), false); 283 } 284 285 void UIGuestControlFileManager::prepareVerticalToolBar(QHBoxLayout *layout) 284 286 { 285 287 m_pToolBar = new UIToolBar; … … 306 308 this, &UIGuestControlFileManager::sltCopyHostToGuest); 307 309 connect(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_CopyToGuest), &QAction::triggered, 308 this, &UIGuestControlFileManager::sltCopyGuestToHost);309 310 m_pFileTableContainerLayout->addWidget(m_pToolBar);310 this, &UIGuestControlFileManager::sltCopyGuestToHost); 311 312 layout ->addWidget(m_pToolBar); 311 313 } 312 314 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.h
r75224 r75246 36 36 /* Forward declarations: */ 37 37 class QHBoxLayout; 38 class QSplitter; 38 39 class QTextEdit; 39 40 class QVBoxLayout; … … 112 113 void prepareGuestListener(); 113 114 void prepareConnections(); 114 void prepareVerticalToolBar( );115 void prepareVerticalToolBar(QHBoxLayout *layout); 115 116 void prepareToolBar(); 116 117 bool createSession(const QString& strUserName, const QString& strPassword, … … 139 140 void manageEscapeShortCut(); 140 141 141 142 142 template<typename T> 143 143 QStringList getFsObjInfoStringList(const T &fsObjectInfo) const; … … 147 147 CGuestSession m_comGuestSession; 148 148 QVBoxLayout *m_pMainLayout; 149 149 QSplitter *m_pVerticalSplitter; 150 150 UIToolBar *m_pToolBar; 151 QWidget *m_pFileTableContainerWidget;152 QHBoxLayout *m_pFileTableContainerLayout;153 151 154 152 //UIFileOperationsList *m_pFileOperationsList;
Note:
See TracChangeset
for help on using the changeset viewer.

