JXImage* SyGGetDirectorySmallIcon ( const JCharacter* path ) { JMountType type; JXImage* image; if ((SyGGetApplication())->IsMountPoint(path, &type) && SyGGetMountPointSmallIcon(type, &image)) { return image; } else if (SyGIsTrashDirectory(path)) { return SyGGetTrashSmallIcon(); } else if (!JFSFileTreeNode::CanHaveChildren(path)) { return SyGGetLockedFolderSmallIcon(); } else if (!JDirectoryWritable(path)) { return SyGGetReadOnlyFolderSmallIcon(); } else { return SyGGetFolderSmallIcon(); } }
const JString& SyGTreeDir::GetName() const { if (SyGIsTrashDirectory(GetDirectory())) { return JGetString(kTrashNameID); } else { return itsPathInput->GetText(); } }
JIndex SyGGetMountPointLargeIcon ( const JCharacter* path, SyGFileTreeList* fileList, JXPM* plainIcon, JXPM* selectedIcon ) { JMountType type; const JBoolean isMP = theApplication->IsMountPoint(path, &type); if (!isMP) { JBoolean writable, isTop; JString device, fsTypeString; JFileSystemType fsType; if (JIsMounted(path, &writable, &isTop, &device, &fsType, &fsTypeString)) { type = JGetUserMountPointType(path, device, fsTypeString); } else { type = kJHardDisk; } } const JBoolean writable = JDirectoryWritable(path); JString dir; if (JGetHomeDirectory(&dir) && JSameDirEntry(dir, path)) { *plainIcon = syg_home_folder_large; *selectedIcon = syg_home_folder_selected_large; return 1; } else if (SyGIsTrashDirectory(path)) { (fileList->GetSyGFileTree())->Update(); if (fileList->IsEmpty()) { *plainIcon = jx_trash_can_empty_large; *selectedIcon = jx_trash_can_empty_selected_large; return 2; } else { *plainIcon = jx_trash_can_full_large; *selectedIcon = jx_trash_can_full_selected_large; return 3; } } else if (!isMP && type == kJFloppyDisk && !writable) { *plainIcon = syg_floppy_folder_read_only_large; *selectedIcon = syg_floppy_folder_read_only_large; return 4; } else if (!isMP && type == kJFloppyDisk) { *plainIcon = syg_floppy_folder_large; *selectedIcon = syg_floppy_folder_large; return 5; } else if (!isMP && type == kJCDROM && !writable) { *plainIcon = syg_cdrom_folder_read_only_large; *selectedIcon = syg_cdrom_folder_read_only_large; return 4; } else if (!isMP && type == kJCDROM) { *plainIcon = syg_cdrom_folder_large; *selectedIcon = syg_cdrom_folder_large; return 5; } else if (!isMP && !writable) { *plainIcon = jx_folder_read_only_large; *selectedIcon = jx_folder_read_only_selected_large; return 6; } else if (!isMP) { *plainIcon = jx_folder_large; *selectedIcon = jx_folder_selected_large; return 7; } else if (type == kJFloppyDisk) { *plainIcon = jx_floppy_disk_large; *selectedIcon = jx_floppy_disk_selected_large; return 8; } else if (type == kJCDROM) { *plainIcon = jx_cdrom_disk_large; *selectedIcon = jx_cdrom_disk_selected_large; return 9; } else { *plainIcon = jx_hard_disk_large; *selectedIcon = jx_hard_disk_selected_large; return 11; } }