How to display waiting circle? (1 Viewer)

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Can anyone tell me how to show that waiting animation from a plugin? I have seen some code that uses "use Waitcursor" but can't really get it working.
 

kroko

Portal Pro
February 4, 2007
428
420
57
Itzehoe
Home Country
Germany Germany
Hi,

it should be enough to say

GUIWaitCursor.Init();
GUIWaitCursor.Show();
.
.
.do what ever
.
.
GUIWaitCursor.Hide();


Thats all, the class is static.

Regards
kroko
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Hmm.. I still can't see the waitcursor, do I need to put anything in the skin-file?

EDIT:
Well, it seems that I can display it. The problem is that it is only displayed after the timeconsuming part is done. For instance I would like to display the waitcursor, and then download some data from the internet.

If I have
GUIWaitcursor.show();
downloadData() // takes 15 secs
GUIWaitcursor.hide();

the cursor isn't displayed at all.

Guess I have to fiddle with threading or something to do that.
 

kroko

Portal Pro
February 4, 2007
428
420
57
Itzehoe
Home Country
Germany Germany
Hmm,


I tried it here and put the Show() in Onload of one plugin. The cursor is there and stays.

Are you doing that Onload ? Maybe this best way would be using a backgroundworker.

Regards
kroko
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Yes I tried to do it in the onload method. If I remove GUIWaitcursor.hide(); the cursor appears at the same time as the list is filled, and after the screen has been blank for some seconds. I'll have to try with a backgroundworker or something.
 

moiristo

Portal Pro
November 17, 2006
342
27
Enschede
Home Country
Netherlands Netherlands
Something like this:

Code:
_workerCompleted = false;

BackgroundWorker worker = new BackgroundWorker();

worker.DoWork += new DoWorkEventHandler(_DownloadWorker);
worker.RunWorkerAsync(arg);

while (_workerCompleted == false)  GUIWindowManager.Process();

one of the last pieces of old code from a plugin I've taken over :) Seems like calling GUIWindowManager.Process() is another way to display a wait cursor...
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Thx guys.. the solution for me was
Code:
        protected override void OnPageLoad()
        {
             GUIWaitCursor.Init();
             GUIWaitCursor.Show();
            _workerCompleted = false; //class member boolean

            BackgroundWorker worker = new BackgroundWorker();

            worker.DoWork += new DoWorkEventHandler(createList);
            worker.RunWorkerAsync(new object());

            while (_workerCompleted == false) GUIWindowManager.Process();
            GUIWaitCursor.Hide();
            
        }

        private void createList(object sender, DoWorkEventArgs e)
        {
            Artists artists = cAmpache.GetAllArtists();
            foreach (Artist item in artists.Items)
            {
                GUIListItem i = new GUIListItem(item.name);
                i.TVTag = item;
                this.facadeView.Add(i);
            }
            _workerCompleted = true;
        }

In a perfect world I would like the to not have the _workerCompleted = true in the createList method..but the most important for the moment was that it worked. :)
 

Users who are viewing this thread

Similar threads

Got a reply from SD ... "Looks like your last successful download was on 5/23. On 5/24 for some reason we received 194 connections between 10:54 and 11:05 triggering a denial of service attack ban. The logs show it was lifted on 5/25, but I still see the entry in iptables. I reset fail2ban and hopefully you're working again." Weird...
Got a reply from SD ... "Looks like your last successful download was on 5/23. On 5/24 for some reason we received 194...
I'm using MediaPortal 1.38.1 x64 and have an SD-DD lineup account. In the last week, I have not been able to update my EPG, and...
Replies
3
Views
489
MP1 MP2 TVGuide Users DE
Greetings Fellow MP'rs. Does anyone out there use tvguide.com to access TV listings..? :unsure: If so, can you advise on how it is set up for use with MediaPortal..? I havebeen using Zap2XML / GraceNote but that just died (for me alone seemingly) and I am out of listings. :( Would appreciate any help - Thanks.
Greetings Fellow MP'rs. Does anyone out there use tvguide.com to access TV listings..? :unsure: If so, can you advise on how it...
Greetings Fellow MP'rs. Does anyone out there use tvguide.com to access TV listings..? :unsure: If so, can you advise on how it...
Replies
0
Views
1K
Thankyou High_Five, that worked perfectly, I now remember doing that 10 years ago, thanks for jogging my old memory. Cheers Tony
Thankyou High_Five, that worked perfectly, I now remember doing that 10 years ago, thanks for jogging my old memory. Cheers Tony
Hi everyone, I have been using it For 16 years now (from V1.1.1) and it has worked flawlessly. I only use TV Series and Moving...
Replies
2
Views
434
Sorry, I didn't get email notifications on these latest replies. I just came here to report I solved the problem after adjusting power settings for "Intel Graphics". I set it to Maximum Performance. I tried many other things so it could be a combination of them, but this was the last thing I did and I haven't had the problem return...
Sorry, I didn't get email notifications on these latest replies. I just came here to report I solved the problem after adjusting...
I'm running MP1 as a client only on this: https://www.amazon.com/dp/B0DZX5DWS5?ref_=pe_123509780_1038749300_t_fed_asin_title&th=1...
Replies
5
Views
2K
I switched back to MePo 1 some time ago, and havent really used it that much. But i wanted to watch some old movies stored as ISO file. Virtuel Clone drive is installed, and it can mount the ISO file. However when i try to select it from MePo i only get an error that i cannot mount it. [2026-06-07 14:56:35,994] [Error ] [MPMain ]...
I switched back to MePo 1 some time ago, and havent really used it that much. But i wanted to watch some old movies stored as ISO...
I switched back to MePo 1 some time ago, and havent really used it that much. But i wanted to watch some old movies stored as ISO...
Replies
0
Views
416
Top Bottom