BusyDialog on add-on

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #1
Hi all,

I am currently developing an add-on for xbmc where I am using and API browsing through differente directories/folders. Every time the user wants to browse one directory further, I create another xbmc.WindowXMLDialog class where I show the next directory. In this manner, when the user press back, the class is destroyed so they will see the previous directory without overloading the API (which has some demands per seconds limitation).

The issue here is that while requesting the next directory, I want to activate the busydialog and close it afterwards. What I am experiencing is that the busy dialog is only shown for the first instance of the WindowXMLDialog class, but I am not seeing it for the following class instances.

I do not know any other way to call this dialog than through the built-in function ActivateWindow(BusyDialog), so that is the way I am doing it.

My question is, is there any way to get this working? Maybe this several class instance thing that I am doing is not desirable? Is it a bug from the busy dialog?

Thank you in advance,

Efren
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #2
It sounds like what you're seeing is the influence of xbmc's directory caching. The busy dialog pops when something takes a certain amount of time. When the directory is cached, it doesn't take as long. I don't remember off the top of my head, but look into the cache to disk property when building your directory.

I think if you want to to be shown when you decide it should be shown, you're already doing it right.
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #3
Hi Bstrdsmkr,

I am afraid I have not explained myself very well Smile.

My add-on is an script add-on that has nothing to do with XBMC directories. I am building my own directory hierarchy based on what I receive from some servers on the Internet.

Besides, this is not only happening when retrieving elements within a directory (hierarchy level), but also when I try to play one of the elements (URLs) in the XBMC player, which is taking around 10 seconds and no busy dialog is showing either.

Anyway, thanks for the response.

Any other ideas?

Thanks!
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #4
In that case, I'm not sure what you mean. Are you not using xbmcplugin.addDirectoryItem() to build your list of items?
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #5
I am not using xbmcplugin module at all, since that is intended for plugins rather and not for scripts as far as I've understood.

The point is that I want to have my own look and feel and not depend on the skin the user has. I have a XML window that I have created myself where I have a List Control where I add the elements I am fetching from the internet. When the user clicks let's say one folder, I call again the same GUI class based on the mentioned XML window. After I perform the first GUI object call, the following calls (every step deeper = one extra GUI object on top of the previous ones) will not show the BusyDialog.

I hope I've improved my explanation Smile
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #6
Ahh, now I see what you mean.

There will still be spots where you'll want to show the busy dialog manually, since it'll look to xbmc like it's not waiting on anything, but nothing is happening on screen.

That being said, I think the most likely reason it shows the first time (although I can't be sure without seeing your code), but not subsequent times is window.close() doesn't destroy the window object, it just hides it. Make sure you explicitly del your window object.
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #7
Thank you Bstrdsmkr,

Just last thing I ask, could I know what is the manual way to activate the BusyDialog window? The only way I know is to call the builtin function ActivateWindow, or create my own busy dialog that would be much more time consuming Smile.

Any ideas?

Thanks!
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 802
Joined: Oct 2010
Reputation: 16
Post: #8
You could also call it through xbmcgui.WindowXML() and use the xml name from here: http://wiki.xbmc.org/index.php?title=Window_IDs

But the only difference is usability. There's nothing wrong with calling it through ActivateWindow
find quote