def loadArchivedFilePods(self): self.treeCtrl.DeleteChildren(self.ArchivedFilePodsRoot) businessLogic = bl.BusinessLogic() pods = businessLogic.RetrieveFilePodsArchived( self.mainWindow.loggedInSecurityUserID) if False != pods: for pod in pods["pods"]: filePodNode = self.treeCtrl.AppendItem( self.ArchivedFilePodsRoot, pod['Name']) self.treeCtrl.SetItemData( filePodNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('myfilepod', pod['PodID']))) self.treeCtrl.SetItemImage(filePodNode, 3, wx.TreeItemIcon_Normal) filePodSettingsNode = self.treeCtrl.AppendItem( filePodNode, 'Settings') self.treeCtrl.SetItemData( filePodSettingsNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('myfilepodsettings', pod['PodID']))) self.treeCtrl.SetItemImage(filePodSettingsNode, 6, wx.TreeItemIcon_Normal) filePodBrowserNode = self.treeCtrl.AppendItem( filePodNode, 'Browser') self.treeCtrl.SetItemData( filePodBrowserNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('myfilepodbrowser', pod['PodID']))) self.treeCtrl.SetItemImage(filePodBrowserNode, 0, wx.TreeItemIcon_Normal) filePodSharingNode = self.treeCtrl.AppendItem( filePodNode, 'Sharing') self.treeCtrl.SetItemData( filePodSharingNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('myfilepodsharing', pod['PodID']))) self.treeCtrl.SetItemImage(filePodSharingNode, 7, wx.TreeItemIcon_Normal) filePodQuickShortcuts = self.treeCtrl.AppendItem( filePodNode, 'Shortcuts') self.treeCtrl.SetItemData( filePodQuickShortcuts, wx.TreeItemData( treenodeinfo.TreeNodeInfo('quickshortcuts', pod['PodID']))) self.treeCtrl.SetItemImage(filePodQuickShortcuts, 10, wx.TreeItemIcon_Normal)
def loadFilePodsSharedWithMe(self): self.treeCtrl.DeleteChildren(self.OthersFilePodsRoot) businessLogic = bl.BusinessLogic() pods = businessLogic.RetrieveFilePodsSharedWithMe( self.mainWindow.loggedInSecurityUserID) self.filePodsSharedWithMe = [] if False != pods: for pod in pods["pods"]: filePodNode = self.treeCtrl.AppendItem(self.OthersFilePodsRoot, pod['Name']) self.treeCtrl.SetItemData( filePodNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('otherfilepod', pod['PodID']))) self.treeCtrl.SetItemImage(filePodNode, 3, wx.TreeItemIcon_Normal) filePodBrowserNode = self.treeCtrl.AppendItem( filePodNode, 'Browser') self.treeCtrl.SetItemData( filePodBrowserNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('otherfilepodbrowser', pod['PodID']))) self.treeCtrl.SetItemImage(filePodBrowserNode, 0, wx.TreeItemIcon_Normal) self.filePodsSharedWithMe.append(pod)
def LoadFolderTree(self, folderParentId, folderTree, ParentTreeNode): childFolders = self.FindChildFolders(folderParentId, folderTree) for childFolder in childFolders: childTreeNode = self.m_treeCtrlFoldersAndFiles.AppendItem(ParentTreeNode, childFolder["Name"]) self.m_treeCtrlFoldersAndFiles.SetItemData(childTreeNode, wx.TreeItemData(treenodeinfo.TreeNodeInfo('', childFolder["FolderID"]))) self.m_treeCtrlFoldersAndFiles.SetItemImage(childTreeNode, 1, wx.TreeItemIcon_Normal) self.LoadFolderTree(childFolder["FolderID"], folderTree, childTreeNode)
def LoadFilePodTree(self): self.m_treeCtrlFoldersAndFiles.DeleteAllItems() businessLogic = bl.BusinessLogic() FilePodRootFolders = businessLogic.RetrieveFilePodRootFolder(self.rightPaneInitData['podid'])[1]['podfolders'] for filePodRootFolder in FilePodRootFolders: folderTree = businessLogic.RetrieveFolderTree(filePodRootFolder["FolderID"]) rootFolder = businessLogic.RetrieveFolderByFolderId(filePodRootFolder["FolderID"]) filePodRootTreeNode = self.m_treeCtrlFoldersAndFiles.AddRoot(rootFolder["Name"]) self.m_treeCtrlFoldersAndFiles.SetItemData(filePodRootTreeNode, wx.TreeItemData( treenodeinfo.TreeNodeInfo('root', filePodRootFolder["FolderID"]))) self.m_treeCtrlFoldersAndFiles.SetItemImage(filePodRootTreeNode, 1, wx.TreeItemIcon_Normal) self.LoadFolderTree(filePodRootFolder["FolderID"], folderTree, filePodRootTreeNode) if self.m_treeCtrlFoldersAndFiles.GetCount() > 0: self.m_treeCtrlFoldersAndFiles.SelectItem(self.m_treeCtrlFoldersAndFiles.GetRootItem())
def loadInitialTreeNodes(self): self.appRoot = self.treeCtrl.AddRoot('File Pods') self.treeCtrl.SetItemData( self.appRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('root', -1))) self.treeCtrl.SetItemImage(self.appRoot, 4, wx.TreeItemIcon_Normal) self.QuickShortcutsRoot = self.treeCtrl.AppendItem( self.appRoot, 'Quick Shortcuts') self.treeCtrl.SetItemData( self.QuickShortcutsRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('quickshortcutsroot', -1))) self.treeCtrl.SetItemImage(self.QuickShortcutsRoot, 8, wx.TreeItemIcon_Normal) self.SearchPods = self.treeCtrl.AppendItem(self.appRoot, 'Search Pods') self.treeCtrl.SetItemData( self.SearchPods, wx.TreeItemData(treenodeinfo.TreeNodeInfo('searchpodsroot', -1))) self.treeCtrl.SetItemImage(self.SearchPods, 9, wx.TreeItemIcon_Normal) self.MyFilePodsRoot = self.treeCtrl.AppendItem(self.appRoot, 'My File Pods') self.treeCtrl.SetItemData( self.MyFilePodsRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('myfilepods', -1))) self.treeCtrl.SetItemImage(self.MyFilePodsRoot, 1, wx.TreeItemIcon_Normal) self.OthersFilePodsRoot = self.treeCtrl.AppendItem( self.appRoot, 'Others File Pods Shared with Me') self.treeCtrl.SetItemData( self.OthersFilePodsRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('othersfilepods', -1))) self.treeCtrl.SetItemImage(self.OthersFilePodsRoot, 2, wx.TreeItemIcon_Normal) self.ArchivedFilePodsRoot = self.treeCtrl.AppendItem( self.appRoot, 'My Archived File Pods') self.treeCtrl.SetItemData( self.ArchivedFilePodsRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('archivefilepods', -1))) self.treeCtrl.SetItemImage(self.ArchivedFilePodsRoot, 1, wx.TreeItemIcon_Normal) self.FilesWebSharedRoot = self.treeCtrl.AppendItem( self.appRoot, 'Web Shared Files') self.treeCtrl.SetItemData( self.FilesWebSharedRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('fileswebsharedroot', -1))) self.treeCtrl.SetItemImage(self.FilesWebSharedRoot, 12, wx.TreeItemIcon_Normal) self.FoldersWebSharedRoot = self.treeCtrl.AppendItem( self.appRoot, 'Web Shared Folders') self.treeCtrl.SetItemData( self.FoldersWebSharedRoot, wx.TreeItemData( treenodeinfo.TreeNodeInfo('folderswebsharedroot', -1))) self.treeCtrl.SetItemImage(self.FoldersWebSharedRoot, 13, wx.TreeItemIcon_Normal) self.FoldersWebImportsRoot = self.treeCtrl.AppendItem( self.appRoot, 'Web Import Folders') self.treeCtrl.SetItemData( self.FoldersWebImportsRoot, wx.TreeItemData( treenodeinfo.TreeNodeInfo('folderswebimportsroot', -1))) self.treeCtrl.SetItemImage(self.FoldersWebImportsRoot, 13, wx.TreeItemIcon_Normal) self.FilesInEditRoot = self.treeCtrl.AppendItem( self.appRoot, 'Files Being Edited') self.treeCtrl.SetItemData( self.FilesInEditRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('filesinedit', -1))) self.treeCtrl.SetItemImage(self.FilesInEditRoot, 11, wx.TreeItemIcon_Normal) self.RunningOperationsRoot = self.treeCtrl.AppendItem( self.appRoot, 'Running Operations') self.treeCtrl.SetItemData( self.RunningOperationsRoot, wx.TreeItemData(treenodeinfo.TreeNodeInfo('runningoperations', -1))) self.treeCtrl.SetItemImage(self.RunningOperationsRoot, 5, wx.TreeItemIcon_Normal) self.loadMyFilePods() self.loadFilePodsSharedWithMe() self.loadArchivedFilePods()