From b6bc4fd3de7324dd4b086c215768bc50b54c49bb Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 24 May 2016 20:27:25 -0400 Subject: 0.1.1 Release Candidate 1 Committing all code for 0.1.1 Release Candidate 1. --- source/WindowsFormsApplication1/File Skimmer.cs | 35 +++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'source/WindowsFormsApplication1/File Skimmer.cs') diff --git a/source/WindowsFormsApplication1/File Skimmer.cs b/source/WindowsFormsApplication1/File Skimmer.cs index 3c63693..883ff95 100644 --- a/source/WindowsFormsApplication1/File Skimmer.cs +++ b/source/WindowsFormsApplication1/File Skimmer.cs @@ -128,6 +128,7 @@ namespace ShiftOS /// public File_Skimmer() { + MountMgr.Init(); InitializeComponent(); } @@ -176,13 +177,28 @@ namespace ShiftOS { if (lbcurrentfolder.Text != "/") { - CurrentFolder = Directory.GetParent(CurrentFolder).FullName; - ListFiles(); + if (lbcurrentfolder.Text == MountPoint.Replace("\\", "/")) + { + CurrentFolder = Paths.SaveRoot; + ListFiles(); + } + else + { + CurrentFolder = Directory.GetParent(CurrentFolder).FullName; + ListFiles(); + } } else { API.CreateInfoboxSession("Can't read directory", "File Skimmer is not able to read the requested directory as it is not formatted with the ShiftFS file system.", infobox.InfoboxMode.Info); } } + else if(tag.StartsWith("drv:")) + { + string drivepath = tag.Remove(0, 4); + CurrentFolder = drivepath; + MountPoint = drivepath; + ListFiles(); + } } } } @@ -198,11 +214,14 @@ namespace ShiftOS }; } + string MountPoint = null; + /// /// Lists all the files in the current folder. /// public void ListFiles() { + MountMgr.Init(); SetupImages(); txtfilename.Text = ""; //SetupUI(); @@ -223,6 +242,18 @@ namespace ShiftOS upone.Tag = "_uponedir"; upone.ImageKey = "directory"; lvfiles.Items.Add(upone); + if(CurrentFolder == Paths.SaveRoot) + { + foreach(var drive in MountMgr.links) + { + var dinf = new DirectoryInfo(drive.Key); + var item = new ListViewItem(); + item.Text = drive.Value; + item.Tag = "drv:" + dinf.FullName; + lvfiles.Items.Add(item); + item.ImageKey = "directory"; + } + } foreach (string dir in Directory.GetDirectories(CurrentFolder)) { var dirinf = new DirectoryInfo(dir); -- cgit v1.2.3