A loading dialogue for the preview function

Status: New request

Created by bcammo 10 Jul 2010 12:08

rating: +3+x

**STE **


wdavatar?user=leiger
leiger

11 Jul 2010 08:10. Edited 0 times. (Edit, Permalink)
I've tried to add progress bars before but have had a bit of trouble with them. I'll have to look into it a bit more.

A simple loading spinner that isn't affected by the % of progress would be easier, and could be used as an alternative. Good idea.

As for clicking the button a second time… the buttons are disabled when the preview is being generated in Windows - does this not happen on Mac?

Included page "inc:signature" does not exist (create it now)

wdavatar?user=bcammo
bcammo

12 Jul 2010 07:59. Edited 0 times. (Edit, Permalink)

the buttons are disabled when the preview is being generated in Windows - does this not happen on Mac?

I just tried this out: After clicking the preview button once, I clicked another two times while it was loading and I ended up with three 'HTML Preview' windows. So no, the button mustn't be disabled. Is Mac starting to annoy you yet? ;)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

12 Jul 2010 10:06. Edited 1 times. (Edit, Permalink)
Not Macs, but the Apple JRE is ;-) I just tried that on Ubuntu and had the same result, despite the buttons appearing to be disabled. I should probably look into forcibly disabling them while the preview is being generated.

Something to note is that unlike all other dialogs in STE, the preview dialog is not modal, so you can move it out of the way and keep it open while you edit text in the editor, then generate another preview window and compare them.

I was thinking about making it just refresh the original preview window, but left it as creating a new one every time - for now.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

22 Oct 2010 13:11. Edited 0 times. (Edit, Permalink)
I discovered that I had to use multi-threading to get this working (generate loading bar in one thread, whilst simultaneously generating the preview in another thread on the CPU) … and after spending a whole afternoon (literally midday to midnight) trying to get it working I gave up. I've never used multiple threads before and didn't understand most of the examples and tutorials I looked at.

So, I went out and bought a book today at Borders in the city to learn how to do it. Considering it was more than $100, I'm sure that shows how dedicated I am to getting this wish done!! ;-) Or more likely, it just shows how fun programming in Java is that I want to continue learning more about the language.

I will get this done - just give me some time to learn how first :)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=tsangk
tsangk

22 Oct 2010 13:20. Edited 0 times. (Edit, Permalink)
Well… lets hope your dedication is worthwhile :)
I would never allow such dedication in computing as I don't plan to study it anyway… but I hope your >$100 was well spent :)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

16 Mar 2011 00:57. Edited 3 times. (Edit, Permalink)
Just in case anyone is interested, I have posted a video explaining as simply as I can (trying to avoid technical terms) what threads are and how they are useful. You can see it on my blog, here: http://shane.wikify.me/blog:109

As I'm still new to threads, I understand the concept well but am having some issues implementing it into STE. At the moment, checking for updates and sending usage statistics both occur in background threads. (And there are a few other miscellaneous tasks that also occur in background threads.) All of these tasks are capable of acting on their own and don't depend on any other part of the app.

In this case, the loading animation needs to be put into a separate thread. Otherwise the application would do one thing after another… loading animation first, then the actual loading (or vice versa: load the page, then show an animation). By putting the animation in a thread, I can make it appear at the same time as the loading is being done. Which is what we want! ;-)

The problem is synchronising things so that when the loading is finished, the animation stops as well. That's where I'm currently stuck. Because the animation depends on the loading being done in a separate thread, this is a different situation to the other cases where I am using threads successfully.

This is a top priority wish, but I'm currently unable to implement it. Just thought I'd give a quick explanation why.

Included page "inc:signature" does not exist (create it now)

Post Reply

Add reply on "A loading dialogue for the preview function"

CSS Theme, Images and Code on this website are © Shane Smith 2010-2012. All forum posts by users and documentation licensed under Creative Commons BY-NC-SA 3.0 License.