726 dn = os.path.basename(self._dirName) |
741 dn = os.path.basename(self._dirName) |
727 |
742 |
728 BrowserItem.__init__(self, parent, dn) |
743 BrowserItem.__init__(self, parent, dn) |
729 |
744 |
730 self.type_ = BrowserItemDirectory |
745 self.type_ = BrowserItemDirectory |
731 self.icon = UI.PixmapCache.getIcon("dirClosed.png") |
746 if os.path.lexists(self._dirName) and os.path.islink(self._dirName): |
|
747 self.symlink = True |
|
748 self.icon = UI.PixmapCache.getSymlinkIcon("dirClosed.png") |
|
749 else: |
|
750 self.icon = UI.PixmapCache.getIcon("dirClosed.png") |
732 self._populated = False |
751 self._populated = False |
733 self._lazyPopulation = True |
752 self._lazyPopulation = True |
734 |
753 |
735 def setName(self, dinfo, full = True): |
754 def setName(self, dinfo, full = True): |
736 """ |
755 """ |
737 Public method to set the directory name. |
756 Public method to set the directory name. |
738 |
757 |
739 @param dinfo dinfo is the string for the directory (string) |
758 @param dinfo dinfo is the string for the directory (string) |
808 self._dirName = os.path.dirname(finfo) |
827 self._dirName = os.path.dirname(finfo) |
809 self.sourceLanguage = sourceLanguage |
828 self.sourceLanguage = sourceLanguage |
810 |
829 |
811 self._moduleName = '' |
830 self._moduleName = '' |
812 |
831 |
|
832 pixName = "" |
813 if self.isPythonFile(): |
833 if self.isPythonFile(): |
814 if self.fileext == '.py': |
834 if self.fileext == '.py': |
815 self.icon = UI.PixmapCache.getIcon("filePython.png") |
835 pixName = "filePython.png" |
816 else: |
836 else: |
817 self.icon = UI.PixmapCache.getIcon("filePython2.png") |
837 pixName = "filePython2.png" |
818 self._populated = False |
838 self._populated = False |
819 self._lazyPopulation = True |
839 self._lazyPopulation = True |
820 self._moduleName = os.path.basename(finfo) |
840 self._moduleName = os.path.basename(finfo) |
821 elif self.isPython3File(): |
841 elif self.isPython3File(): |
822 self.icon = UI.PixmapCache.getIcon("filePython.png") |
842 pixName = "filePython.png" |
823 self._populated = False |
843 self._populated = False |
824 self._lazyPopulation = True |
844 self._lazyPopulation = True |
825 self._moduleName = os.path.basename(finfo) |
845 self._moduleName = os.path.basename(finfo) |
826 elif self.isRubyFile(): |
846 elif self.isRubyFile(): |
827 self.icon = UI.PixmapCache.getIcon("fileRuby.png") |
847 pixName = "fileRuby.png" |
828 self._populated = False |
848 self._populated = False |
829 self._lazyPopulation = True |
849 self._lazyPopulation = True |
830 self._moduleName = os.path.basename(finfo) |
850 self._moduleName = os.path.basename(finfo) |
831 elif self.isDesignerFile(): |
851 elif self.isDesignerFile(): |
832 self.icon = UI.PixmapCache.getIcon("fileDesigner.png") |
852 pixName = "fileDesigner.png" |
833 elif self.isLinguistFile(): |
853 elif self.isLinguistFile(): |
834 if self.fileext == '.ts': |
854 if self.fileext == '.ts': |
835 self.icon = UI.PixmapCache.getIcon("fileLinguist.png") |
855 pixName = "fileLinguist.png" |
836 else: |
856 else: |
837 self.icon = UI.PixmapCache.getIcon("fileLinguist2.png") |
857 pixName = "fileLinguist2.png" |
838 elif self.isResourcesFile(): |
858 elif self.isResourcesFile(): |
839 self.icon = UI.PixmapCache.getIcon("fileResource.png") |
859 pixName = "fileResource.png" |
840 elif self.isProjectFile(): |
860 elif self.isProjectFile(): |
841 self.icon = UI.PixmapCache.getIcon("fileProject.png") |
861 pixName = "fileProject.png" |
842 elif self.isMultiProjectFile(): |
862 elif self.isMultiProjectFile(): |
843 self.icon = UI.PixmapCache.getIcon("fileMultiProject.png") |
863 pixName = "fileMultiProject.png" |
844 elif self.isIdlFile(): |
864 elif self.isIdlFile(): |
845 self.icon = UI.PixmapCache.getIcon("fileIDL.png") |
865 pixName = "fileIDL.png" |
846 self._populated = False |
866 self._populated = False |
847 self._lazyPopulation = True |
867 self._lazyPopulation = True |
848 self._moduleName = os.path.basename(finfo) |
868 self._moduleName = os.path.basename(finfo) |
849 elif self.isPixmapFile(): |
869 elif self.isPixmapFile(): |
850 self.icon = UI.PixmapCache.getIcon("filePixmap.png") |
870 pixName = "filePixmap.png" |
851 elif self.isSvgFile(): |
871 elif self.isSvgFile(): |
852 self.icon = UI.PixmapCache.getIcon("fileSvg.png") |
872 pixName = "fileSvg.png" |
853 elif self.isDFile(): |
873 elif self.isDFile(): |
854 self.icon = UI.PixmapCache.getIcon("fileD.png") |
874 pixName = "fileD.png" |
855 else: |
875 else: |
856 self.icon = UI.PixmapCache.getIcon("fileMisc.png") |
876 pixName = "fileMisc.png" |
|
877 |
|
878 if os.path.lexists(self._filename) and os.path.islink(self._filename): |
|
879 self.symlink = True |
|
880 self.icon = UI.PixmapCache.getSymlinkIcon(pixName) |
|
881 else: |
|
882 self.icon = UI.PixmapCache.getIcon(pixName) |
857 |
883 |
858 def setName(self, finfo, full = True): |
884 def setName(self, finfo, full = True): |
859 """ |
885 """ |
860 Public method to set the directory name. |
886 Public method to set the directory name. |
861 |
887 |