This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Exerro's profile picture

Slant Filebrowser

Started by Exerro, 04 October 2015 - 11:11 AM
Exerro #1
Posted 04 October 2015 - 01:11 PM
Slant Filebrowser




Slant is a filebrowser made using Flare. It's lightning fast, practical, and easy to use.

Navigation
Navigating around is easy. Simply click a folder to view its contents, and use the < and > buttons on the top left to go back and forward. The ^ button moves up a directory. If something's in an awkward directory, you can just type in the path-bar and press enter to go there.

Context menus
Folders and files have useful context menus.

Folder:
Spoiler
File:
Spoiler

Many things work like they do in windows explorer, for example renaming a file. Rather than making some bloated box pop up in your face, it simply lets you type in the place of the file name and press enter to confirm.

Running files
You can run files right from the filebrowser:
Spoiler

You can even edit files and paint them from here.

Some more screenies:
Spoiler


(note that the emulated computer uses a CC program I wrote that supports windows of multiple sizes, which is how I resized it, and I test everything using 101x35 computer)

Other features
  • Any size screen support (it even resizes, so you can use it in windowed OSs like LyqydOS).
  • Copy/paste of files and folders.
  • Renaming and deleting files and folders.
  • Browsing history.
  • Address bar.
  • Running files with arguments just like a shell can.
Installation

Being developed with Flare, there are two versions below. The first (default build) installs Flare automatically and works just fine. The second (inclusive build) has Flare embedded in it, so is completely standalone, but takes up a fair bit more space and is minified.

Default Build: pastebin get P4au2MPM Slant
Inclusive Build: pastebin get Mv8mUEAa Slant

What's to come?

Custom file types (so custom icons and file descriptions), custom "New" context-menu entries, custom "Open with" entries, and multiple sorting options (ascending, descending, sort by size, etc).

I'd love to know anything else that you think would make this any better. It's the first release, and it's kind of lacking features, so feedback is greatly appreciated. Have fun browsing your files :P/>
Creator #2
Posted 04 October 2015 - 01:42 PM
It looks awfully a lot like OneOS file browser. And the design is a little pale. However, the functionality looks awesome.
Exerro #3
Posted 04 October 2015 - 02:52 PM
I'd say it looks a lot like the Nova filebrowser, but I guess you're right. The right click context menus are a bit hard to distinguish on the pictures, but once you use them and see them appear when you click it feels a lot less like they're blending in. Thanks for the feedback.
Creator #4
Posted 04 October 2015 - 04:43 PM
The nova browser kinda looks better. Not so Voldemortish.
Exerro #5
Posted 04 October 2015 - 04:53 PM
Lol, what's the difference?
FUNCTION MAN! #6
Posted 04 October 2015 - 04:58 PM
It isn't voldemortish, duh.
Exerro #7
Posted 04 October 2015 - 05:02 PM
Haha, funny. The only actual difference I can see between them is the area on the left of Nova's one and the folder icon, which wouldn't exactly constitute 'Voldemortish' to me.
LDDestroier #8
Posted 04 October 2015 - 08:45 PM
Cool browser!

However, if it tries to do something like delete /rom/, then it errors and closes, rather than telling you the error in a nice little popup.
Exerro #9
Posted 04 October 2015 - 09:17 PM
Yeah, although why are you trying to delete the rom?
Creator #10
Posted 04 October 2015 - 10:19 PM
Because he can!
FUNCTION MAN! #11
Posted 04 October 2015 - 11:54 PM
Because he can!

Because he can… 't!
Geforce Fan #12
Posted 05 October 2015 - 12:39 AM
Yeah, although why are you trying to delete the rom?
Generally, you should program things that assumes the user is an idiot and will try their best to break your program.
If you're not checking for readonly, if, per say, an OS where to prohibit writing to a file(such as mine), this might also crash your program. Also keep in mind that the REAL operating system CC is running in(ex. linux) might say that you can't read a file, so make checks when reading files.

I really like the look of Nova's file browser better. I prefer its folder icons , and I really really really really really really really really really really love how Nova's file browser had a sidebar. Really.

Another thing I notice is that this really struggles when there's a crapload of files in the directory you're in. Personally, my root directory has 40-50 files &amp; folders(I'm horribly disorganized) and not only does the scrollbar disappear, but the file browser performs really slow. Now, you might thing that this is just something you have to deal with in CC, it being rather slow and all, but I've managed to get my file browser to work super fast by stacking the if statements. What I mean by this, is first checking if the icon is even close to being able to be on the screen–is its Y coord over where the top of the screen would be, including how scrolled down you are, and is it not over 4 down off where the bottom of the screen would be, incorporating scroll. Perhaps you're already doing this, and the lag is caused by something else, but that's my guess as to why this is happening.

Bug reports:
Attempting to rename something the same name is already had(ex. renaming "Folder1" to "Folder1") - Crashes.
Scrollbar disappears when having a ridiculous amount of crap in the current folder you're in
Edited on 04 October 2015 - 11:00 PM
Exerro #13
Posted 05 October 2015 - 04:41 PM
Thanks for the comprehensive feedback.

I was thinking to myself that folders look a fair bit better in Nova actually, so I'll change that now. I guess I could add in a sidebar too.

I'm surprised it lags with lots of files. Flare seemed to deal pretty well with things like that in my tests, since it's simply drawing a single canvas per file onto a bigger canvas. Anyway, I could write an element that only draws required things I guess. As for the scrollbar disappearing, I completely forgot to add the check for that in :| Silly me.

Bug 1: How should it deal with that? Popup error, or just don't rename the file?
Bug 2: Yeah, I'll fix that soon.
MKlegoman357 #14
Posted 05 October 2015 - 04:53 PM
Renaming a file to it's original name should simply act like it's being renamed, rather than error or show a popup. There could also be a button in the Run with.. option "Choose another program" to be able to open the given file with your own programs (just like in Windows).
Exerro #15
Posted 05 October 2015 - 05:43 PM
Oh, right, I misread that bug report. I'll be adding in a way to customise the "Run with" context menu at some point, just haven't got around to it yet.
manu_03 #16
Posted 09 October 2015 - 03:43 PM
Renaming a file to it's original name should simply act like it's being renamed, rather than error or show a popup. There could also be a button in the Run with.. option "Choose another program" to be able to open the given file with your own programs (just like in Windows).
Oh, right, I misread that bug report. I'll be adding in a way to customise the "Run with" context menu at some point, just haven't got around to it yet.

I think that would be a good idea to make it more like Windows. For example, you can add icons. So in a config menu it asks you to set an icon to a file, to files with a concrete extension or to files opened with a program. Also you would can set the program that opens a file or files with an extension. Tooltips would be great too.