A sneak peak at a possible Compactor future #84
Replies: 9 comments 7 replies
-
Some of this GUI actually works now. The Compact/Settings/About buttons select the appropriate pages, the Select Folders button lets you select folders without blocking the rest of the UI, the folder list is properly populated and lets you delete items, and as demonstrated, the little sun icon does in fact flip you over to light mode (it defaults to whatever you have the system set to). Nothing actually useful yet, but we'll get to the rest of the owl in due course. |
Beta Was this translation helpful? Give feedback.
-
Bikeshed question: Should the file list be sorted, or just based off the order you added stuff? The centred buttons aren't natively supported by egui, but done by rendering one frame of them left-aligned, and using their rendered width to apply an indent the next frame. Such is life in immediate mode - I can't say I've noticed any flicker. |
Beta Was this translation helpful? Give feedback.
-
New icon I quickly hacked together. Resized rather poorly - sadly winit's icon support seems rather rudimentary and I can't pass multiple custom-resized versions in. Looks nice on my taskbar at least. I got rid of the second Wrote some supporting I also redid the output display so it'll scale to an arbitrary amount of data. |
Beta Was this translation helpful? Give feedback.
-
And we have first light on compression/decompression - all the buttons now do stuff. I added a file, analysed, decompressed, analysed, recompressed, changed compression, decompressed, recompressed. Again, all the Still a fair way to go before it's anything more than a proof-of-concept - the buttons run stuff directly on the main thread, settings aren't saved, there's no file walking, etc. But there's a good chance you'll be able to use it to break your computer in time for Christmas. |
Beta Was this translation helpful? Give feedback.
-
Hey, look - a settings page. |
Beta Was this translation helpful? Give feedback.
-
Starting to look like a real app. There's now filtering for minimum file sizes and ages, so you can skip all those tiny files that don't compress meaningfully or only compress files that haven't changed in the past hour/day/week/month. The big list of default globs has been replaced with a sorted list of file extensions in a drop-down list and a text box for adding more. Globs remain for advanced filtering. |
Beta Was this translation helpful? Give feedback.
-
Just to plant a seed, probably way far out: I'm working on a rust version of https://github.com/RJVB/afsctool (basically, the equivalent of transparent compression for macos) and it'd be pretty cool to be able to be able to have compactor work on Mac too. |
Beta Was this translation helpful? Give feedback.
-
Making slow but steady progress, following some delays due to holiday debauchery, other projects, yak shaving, and general life stuff - including a short inpatient hospital stay (I'm OK, probably, but getting a scan to confirm). I just redid the threading control stuff again - stop, pause, resume, etc. Third time lucky? First was a simple wrapper around a crossbeam channel Receiver - kind of nice, but didn't offer any feedback for whether threads have actually noticed a state change - a similar issue to @Dr-Emann's earlier work on the old control loop, where Pause would not have an intermediate "Pausing" state while the worker was still busy. Second was a generic ControlHandle/Token that could be fully shared and offered feedback on how many threads were active while having only minimal cost (a single atomic read to check state, and a mutex and condition variable for state changes). I kind of liked this and might extract it to another crate at some point. It's in writing this that I realised that @Dr-Emann's optimization for the existing pause function has a short race condition: The background worker thread runs this every iteration. while self.is_paused() && !self.is_cancelled() {
paused = true;
thread::park();
} And the foreground controller thread does this to unpause: self.control.resume();
self.thread.unpark(); It's possible for the background thread to perform its atomic Anyway, third time around yesterday was to rewrite the trivial ThreadPool I'd made to support dynamically changing the number of threads at runtime, because obviously it's really smart to pack in as much functionality as possible into the hairy multithreaded code I'm clearly not qualified to write. Not only does this mean you can save your config changes during operation and have them all actually be applied immediately(ish), but it enables Pause/Stop/Resume through just setting the target concurrency to zero and back. I was also happy to find my code stopped around 300 lines in - about the same length as the now-unneeded second attempt. And hey, if you very reasonably don't trust me to write 300 lines of multithreaded code, our friendly alternative CompactGUI implemented their multithreading in two words ( |
Beta Was this translation helpful? Give feedback.
-
Hi there, just wanted to say good work on this! The changes you're looking into look very interesting and will add even more value. Thanks for your work on this! |
Beta Was this translation helpful? Give feedback.
-
So with the latest release of egui finally supporting native OS accessibility features like screen readers, I've been messing around mocking up a new UI for Compactor so we can get away from the use of WebView.
It's been going pretty well, I think:
Beta Was this translation helpful? Give feedback.
All reactions