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

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
760
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
MP1 MP2 Picture-in-picture DE
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many tries, and it’s not clear what I am doing that makes it work on those occasions when it does. Cannot find guidance on the site. Thanks, N. Again, if anyone knows how to do this, would be much...
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many...
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many...
Replies
0
Views
2K
I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For the first example, I highlighted the example text and eventually found the location in the menus where I could select the CODE macro to have the example text formatted as a code example. So far, so good...
I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For...
I made some updates to the Wiki page describing the <import> and <include> tags, including adding a couple of new xml examples. For...
Replies
0
Views
528
My bad, I misunderstood your post then :) Yeah, these things can get complicated really quickly. I remember scrapping some of my skin-improvement-ideas because I couldn't get these cross-dependencies sorted out.
My bad, I misunderstood your post then :) Yeah, these things can get complicated really quickly. I remember scrapping some of my...
I adjusted the MyMusicPlayingNowInfos.xml for my OldEyes variant of DWHD so it fits without crowding. I now have the issue of text...
Replies
7
Views
2K
Top Bottom