NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 38 39 40 41 42 … 93 Next »
'Please wait...' type popups?

 
  • 0 Vote(s) - 0 Average
'Please wait...' type popups?
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2007-10-26, 02:11 AM
Is it possible to have a popup without buttons that can be created then closed again after a certain task has completed?

Example - user clicks a button...popup appears saying 'Please wait...', some processing is done, popup is then closed by the plugin without user input.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#2
2007-10-26, 02:18 AM
I'm fairly sure there is a constructor for PopupMessageBox that takes no button names which can be used for this purpose. ie, assuming you're using the new BaseButtonUiTask or BaseButtonListUiTask then create it with something like:

setPopup(new Popups.PopupMessageBox(this, "please wait for download to complete"));

Then later dismiss it with:

setPopup(null);
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2007-10-26, 02:24 AM
Yes - using BaseButtonListUiTask for a PVRX2 plugin. I'll give it a try and see what happens.

Cheers,
Brian
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#4
2007-10-26, 02:48 AM
Wouldn't you have to spawn a thread to do the actual work?

After the call to:

setPopup(new Popups.PopupMessageBox(this, "please wait for download to complete"));

You'd have to give control back, so that render processing would take place....

Or am I way off base???
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#5
2007-10-26, 02:55 AM
No, its all done asynchronously. The rest of the code after setPopup() continues to execute.

He can then use the regular call to needsRendering() on the main thread to check the background work he is doing (either as chunks on the main thread or a continuous process on a background thread), then dismis the popup when it is complete.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#6
2007-10-26, 02:59 AM
sub Wrote:No, its all done asynchronously. The rest of the code after setPopup() continues to execute.

He can then use the regular call to needsRendering() on the main thread to check the background work he is doing (either as chunks on the main thread or a continuous process on a background thread), then dismis the popup when it is complete.
Excellent. Thanks for the explanation.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#7
2007-10-26, 03:08 AM
Thanks JavaWiz for posing that question. The way I was going to do things doesn't quite tie-in with sub's explanation. Besides, I've got a bug in my background code anyway.

4am and it's time to take my programmer's head off (it hurts) and time to put my 'stare at the TV' head on. Big Grin

I'll rethink things later.

Cheers,
Brian
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#8
2007-10-26, 03:44 AM
I do it just as sub mentioned for my Netflix plugin. I call the function PopulateListWidget(), which launches the "Please wait.." popup and then calls a background worker thread with bgListWidget() to populate the list. At the end of bgListWidget(), I set the popup to null to clear the "Please Wait..." message.

Code:
protected override void PopulateListWidget()
        {
            setPopup(new GBPVRX2.Popups.PopupMessageBox(this, "\n\n\n\nRetrieving titles.\n\nPlease wait."));
            new Thread(bgListWidget).Start();
            
        }

        private void bgListWidget()
        {
            string ClientID = myFeeds.ClientId;
            ArrayList itemList = new ArrayList();
            string uri = string.Concat(baseUri, myMenu, "RSS");
            switch (myMenu)
            {
                // Snipped case statements.
            }
            if (myMenu != RssFeeds.Top100 && myMenu != RssFeeds.NewReleases)
                itemList = GetList(uri);

            uiList.setViewMode(UiList.ViewMode.MODE_DETAILS);
            setPopup(null);
        }
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#9
2007-10-26, 02:14 PM
Thanks whurlston - nice example. Something similar should work OK for what I want to do.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Busy/Wait Indicator? cncb 7 2,581 2011-11-20, 10:22 PM
Last Post: sub
  Using C#: Update EPG and wait for end dero 12 5,445 2008-12-10, 12:37 PM
Last Post: Sheik Yerbouti
  Closing Deactivating popups with handlePopupCallback psycik 4 1,599 2008-12-09, 08:38 AM
Last Post: psycik
  GBPVRX2.Popups.PopupBase don't close on button press psycik 2 1,440 2008-11-03, 07:35 AM
Last Post: psycik
  GBPVRX2.Popups.PopupBase - GetBackgroundArgs() psycik 5 2,091 2008-10-30, 08:49 AM
Last Post: whurlston
  GBPVRX2.Popups.PopupBase - exited, still triggering callbacks psycik 6 2,273 2008-09-30, 11:50 PM
Last Post: psycik
  Custom popups? bgowland 2 1,769 2008-05-11, 12:26 AM
Last Post: bgowland
  Horizontal buttons in popups. whurlston 6 2,266 2008-03-30, 12:19 PM
Last Post: roy
  Memory management - controls and popups JavaWiz 2 1,909 2008-01-06, 02:48 AM
Last Post: JavaWiz
  ZProcess/FFmpeg wait time... zehd 2 1,737 2006-11-18, 06:00 PM
Last Post: zehd

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode