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
55
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
55
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

I agree about the dash instead of colon on the LIVE thing. I did a little change to get the current program, just removed the D from the tags. Not that important, so I dont upload any new file. A little sad about the end time, but nothing to do about it.
I agree about the dash instead of colon on the LIVE thing. I did a little change to get the current program, just removed the D...
I'm trying to develop a new WebEPG grabber for sweden, but I got a few problem in parsing the html-file to get all programs. In...
Replies
9
Views
755
MP1 MP2 Auto Rating DE
Sorry i dont use Mov Pic
Sorry i dont use Mov Pic
Hi, I have done this previously but have just done a fresh install of MP1 (1.34 X64) and for the life of me can't see how to do it...
Replies
3
Views
1K
MP1 MP2 1.34 Changing from x86 to x64 DE
Your call, at present there is still an x86 version!;)
Your call, at present there is still an x86 version!;)
Hi! Is there a practicable way to change/UPDATE(?!?) from x86 to x64. All I found is the recommendation to make a total reset -->...
Replies
5
Views
771
The only changes I see are: Updated Marcel Groothuis version of the plugin to now support Media Portal 2.5 I can't say anything about the functionality of this plugin, I don't use TV Part, but if there are any changes that can be simply transferred, then I can try. But I can't give any guarantees.
The only changes I see are: Updated Marcel Groothuis version of the plugin to now support Media Portal 2.5 I can't say anything...
I am a long-time user of MediaPortal to watch TV. I use the Media Portal TV Server as a backend, and Kodi (previously known as...
Replies
15
Views
2K
Look for all GUI Exif properties: MediaPortal-1/mediaportal/Core/Util/ExifExtensions.cs at 58c955866fb54a8c293afe525862bbb50c8f7b28 · MediaPortal/MediaPortal-1 And: https://forum.team-mediaportal.com/threads/4986-add-to-mypictures-plugin-ability-to-search-view-by-keyword.133895/post-1273275
Look for all GUI Exif properties: MediaPortal-1/mediaportal/Core/Util/ExifExtensions.cs at 58c955866fb54a8c293afe525862bbb50c8f7b28...
I would like one of the above IPTC metadata fields to display when viewing pictures in MP. I don't really care which, as I can...
Replies
1
Views
1K
Top Bottom