diff options
| author | MichaelTheShifter <[email protected]> | 2016-05-24 20:27:25 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-05-24 20:27:35 -0400 |
| commit | b6bc4fd3de7324dd4b086c215768bc50b54c49bb (patch) | |
| tree | eba44505bcd8d824a093a0b18d471ffa0477384a /source/WindowsFormsApplication1/File Skimmer.cs | |
| parent | 95a1f2e4ae8fdb6862dc238106b1cda4948262a9 (diff) | |
| download | shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.tar.gz shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.tar.bz2 shiftos-c--b6bc4fd3de7324dd4b086c215768bc50b54c49bb.zip | |
0.1.1 Release Candidate 1
Committing all code for 0.1.1 Release Candidate 1.
Diffstat (limited to 'source/WindowsFormsApplication1/File Skimmer.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/File Skimmer.cs | 35 |
1 files changed, 33 insertions, 2 deletions
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 /// </summary> 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; + /// <summary> /// Lists all the files in the current folder. /// </summary> 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); |
