Changeset 74947 in vbox
- Timestamp:
- Oct 19, 2018 3:03:34 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.cpp
r71693 r74947 58 58 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 59 59 60 UIGuestControlFileManagerSettings *UIGuestControlFileManagerSettings::m_pInstance = 0; 61 62 UIGuestControlFileManagerSettings* UIGuestControlFileManagerSettings::instance() 63 { 64 return m_pInstance; 65 } 66 67 void UIGuestControlFileManagerSettings::create() 68 { 69 if (m_pInstance) 70 return; 71 m_pInstance = new UIGuestControlFileManagerSettings; 72 } 73 74 void UIGuestControlFileManagerSettings::destroy() 75 { 76 delete m_pInstance; 77 } 78 79 UIGuestControlFileManagerSettings::UIGuestControlFileManagerSettings() 80 : bListDirectoriesOnTop(true) 81 { 82 } 83 60 84 /********************************************************************************************************************************* 61 85 * UIFileOperationsList definition. * … … 284 308 retranslateUi(); 285 309 loadSettings(); 310 UIGuestControlFileManagerSettings::create(); 286 311 } 287 312 … … 293 318 cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuestSession.GetEventSource()); 294 319 saveSettings(); 320 UIGuestControlFileManagerSettings::destroy(); 295 321 } 296 322 … … 364 390 m_pFileTableContainerLayout->setSpacing(0); 365 391 m_pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0); 366 m_pGuestFileTable = new UIGuestFileTable;392 m_pGuestFileTable = new UIGuestFileTable; 367 393 m_pGuestFileTable->setEnabled(false); 368 394 … … 713 739 714 740 #include "UIGuestControlFileManager.moc" 715 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.h
r72151 r74947 48 48 class UIToolBar; 49 49 50 class UIGuestControlFileManagerSettings 51 { 52 public: 53 static UIGuestControlFileManagerSettings* instance(); 54 static void create(); 55 static void destroy(); 56 57 bool bListDirectoriesOnTop; 58 private: 59 UIGuestControlFileManagerSettings(); 60 61 62 static UIGuestControlFileManagerSettings *m_pInstance; 63 }; 50 64 51 65 /** A QWidget extension. it includes a QWidget extension for initiating a guest session … … 60 74 UIGuestControlFileManager(QWidget *pParent, const CGuest &comGuest); 61 75 ~UIGuestControlFileManager(); 76 //const UIGuestControlFileManagerSettings& settings() const; 62 77 63 78 protected: … … 127 142 CEventListener m_comSessionListener; 128 143 CEventListener m_comGuestListener; 144 //UIGuestControlFileManagerSettings m_settings; 129 145 }; 130 146 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileModel.cpp
r72086 r74947 28 28 # include "UIGuestControlFileModel.h" 29 29 # include "UIGuestControlFileTable.h" 30 # include "UIGuestControlFileManager.h" 30 31 31 32 … … 41 42 bool UIGuestControlFileProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const 42 43 { 43 QVariant leftData = sourceModel()->data(left); 44 QVariant rightData = sourceModel()->data(right); 45 46 if (leftData.canConvert(QMetaType::QString) && rightData.canConvert(QMetaType::QString)) 47 { 48 49 if (leftData == UIGuestControlFileModel::strUpDirectoryString) 44 UIFileTableItem *pLeftItem = static_cast<UIFileTableItem*>(left.internalPointer()); 45 UIFileTableItem *pRightItem = static_cast<UIFileTableItem*>(right.internalPointer()); 46 47 UIGuestControlFileManagerSettings *settings = UIGuestControlFileManagerSettings::instance(); 48 49 if (pLeftItem && pRightItem) 50 { 51 /* List the directories before the files if settings say so: */ 52 if (settings && settings->bListDirectoriesOnTop) 53 { 54 if (pLeftItem->isDirectory() && !pRightItem->isDirectory()) 55 return true && (sortOrder() == Qt::AscendingOrder); 56 if (!pLeftItem->isDirectory() && pRightItem->isDirectory()) 57 return false && (sortOrder() == Qt::AscendingOrder); 58 } 59 /* Up directory item should be always the first item: */ 60 if (pLeftItem->isUpDirectory()) 50 61 return true && (sortOrder() == Qt::AscendingOrder); 51 else if ( rightData == UIGuestControlFileModel::strUpDirectoryString)62 else if (pRightItem->isUpDirectory()) 52 63 return false && (sortOrder() == Qt::AscendingOrder); 53 64 } 54 55 65 return QSortFilterProxyModel::lessThan(left, right); 56 66 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileModel.h
r72086 r74947 61 61 ~UIGuestControlFileModel(); 62 62 63 QVariant data(const QModelIndex &index, int role) const /* override */;64 bool setData(const QModelIndex &index, const QVariant &value, int role);63 QVariant data(const QModelIndex &index, int role) const /* override */; 64 bool setData(const QModelIndex &index, const QVariant &value, int role); 65 65 66 Qt::ItemFlags flags(const QModelIndex &index) const /* override */;67 QVariant headerData(int section, Qt::Orientation orientation,66 Qt::ItemFlags flags(const QModelIndex &index) const /* override */; 67 QVariant headerData(int section, Qt::Orientation orientation, 68 68 int role = Qt::DisplayRole) const /* override */; 69 QModelIndex index(int row, int column,69 QModelIndex index(int row, int column, 70 70 const QModelIndex &parent = QModelIndex()) const /* override */; 71 QModelIndex index(UIFileTableItem* item);72 QModelIndex parent(const QModelIndex &index) const /* override */;73 int rowCount(const QModelIndex &parent = QModelIndex()) const /* override */;74 int columnCount(const QModelIndex &parent = QModelIndex()) const /* override */;75 void signalUpdate();76 QModelIndex rootIndex() const;77 void beginReset();78 void endReset();79 bool insertRows(int position, int rows, const QModelIndex &parent);71 QModelIndex index(UIFileTableItem* item); 72 QModelIndex parent(const QModelIndex &index) const /* override */; 73 int rowCount(const QModelIndex &parent = QModelIndex()) const /* override */; 74 int columnCount(const QModelIndex &parent = QModelIndex()) const /* override */; 75 void signalUpdate(); 76 QModelIndex rootIndex() const; 77 void beginReset(); 78 void endReset(); 79 bool insertRows(int position, int rows, const QModelIndex &parent); 80 80 static const char* strUpDirectoryString; 81 81 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp
r72086 r74947 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIGuest ControlFileTable class implementation.3 * VBox Qt GUI - UIGuestFileTable class implementation. 4 4 */ 5 5 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h
r72086 r74947 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIGuest ControlFileTable class declaration.3 * VBox Qt GUI - UIGuestFileTable class declaration. 4 4 */ 5 5 … … 62 62 }; 63 63 64 #endif /* !___UIGuest ControlFileTable_h___ */64 #endif /* !___UIGuestFileTable_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.h
r72151 r74947 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GuestControlFileTable class declaration.3 * VBox Qt GUI - UIHostFileTable class declaration. 4 4 */ 5 5 … … 51 51 }; 52 52 53 #endif /* !___UI GuestControlFileTable_h___ */53 #endif /* !___UIHostFileTable_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r74940 r74947 121 121 m_pTabWidget->setTabText(0, tr("Configuration &Details")); 122 122 m_pTabWidget->setTabText(1, tr("&Runtime Information")); 123 m_pTabWidget->setTabText(2, tr(" &GuestSession Manager"));124 m_pTabWidget->setTabText(3, tr(" &GuestFile Manager"));123 m_pTabWidget->setTabText(2, tr("Guest &Session Manager")); 124 m_pTabWidget->setTabText(3, tr("Guest &File Manager")); 125 125 } 126 126
Note:
See TracChangeset
for help on using the changeset viewer.