Changeset 76959 in vbox
- Timestamp:
- Jan 23, 2019 6:45:09 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
-
globals/VBoxGlobal.cpp (modified) (2 diffs)
-
medium/viso/UIVisoCreator.cpp (modified) (1 diff)
-
medium/viso/UIVisoCreator.h (modified) (1 diff)
-
medium/viso/UIVisoHostBrowser.cpp (modified) (2 diffs)
-
medium/viso/UIVisoHostBrowser.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r76883 r76959 2642 2642 return QString(); 2643 2643 windowManager().registerNewParent(pVisoCreator, pDialogParent); 2644 pVisoCreator->setCurrentPath(gEDataManager->recentFolderForVISOContent()); 2644 2645 2645 2646 if (pVisoCreator->exec(false /* not application modal */)) … … 2650 2651 if (files.empty() || files[0].isEmpty()) 2651 2652 return QUuid(); 2653 2654 gEDataManager->setRecentFolderForVISOContent(pVisoCreator->currentPath()); 2652 2655 2653 2656 /* Produce the VISO. */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r76948 r76959 79 79 } 80 80 81 QString UIVisoCreator::currentPath() const 82 { 83 if (!m_pHostBrowser) 84 return QString(); 85 return m_pHostBrowser->currentPath(); 86 } 87 88 void UIVisoCreator::setCurrentPath(const QString &strPath) 89 { 90 if (!m_pHostBrowser) 91 return; 92 m_pHostBrowser->setCurrentPath(strPath); 93 } 94 81 95 void UIVisoCreator::retranslateUi() 82 96 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r76947 r76959 59 59 const QString &visoName() const; 60 60 const QStringList &customOptions() const; 61 /** Returns the current path that the host browser is listing. */ 62 QString currentPath() const; 63 void setCurrentPath(const QString &strPath); 61 64 62 65 #ifdef VBOX_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.cpp
r76826 r76959 271 271 } 272 272 273 QString UIVisoHostBrowser::currentPath() const 274 { 275 if (!m_pTreeView || !m_pTreeModel) 276 return QString(); 277 QModelIndex currentTreeIndex = m_pTreeView->selectionModel()->currentIndex(); 278 return QDir::fromNativeSeparators(m_pTreeModel->filePath(currentTreeIndex)); 279 } 280 281 void UIVisoHostBrowser::setCurrentPath(const QString &strPath) 282 { 283 if (strPath.isEmpty() || !m_pTreeModel) 284 return; 285 QModelIndex index = m_pTreeModel->index(strPath); 286 setTreeCurrentIndex(index); 287 } 288 273 289 void UIVisoHostBrowser::sltHandleAddAction() 274 290 { … … 316 332 else 317 333 strCurrentTablePath = m_pTableModel->filePath(index); 318 m_pTreeView->setCurrentIndex(m_pTreeModel->index(strCurrentTablePath)); 334 QModelIndex treeIndex = m_pTreeModel->index(strCurrentTablePath); 335 m_pTreeView->setCurrentIndex(treeIndex); 336 m_pTreeView->setExpanded(treeIndex, true); 337 m_pTreeView->scrollTo(treeIndex, QAbstractItemView::PositionAtCenter); 319 338 } 320 339 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.h
r76913 r76959 46 46 ~UIVisoHostBrowser(); 47 47 virtual void showHideHiddenObjects(bool bShow) /* override */; 48 QString currentPath() const; 49 void setCurrentPath(const QString &strPath); 48 50 49 51 protected:
Note:
See TracChangeset
for help on using the changeset viewer.

