Override xbmc.Dialog cancel action?
#1
Hello,
I created some years ago an addon for personal use which displays a dialog with the contents of a folder. Recently I re-edit it to use it with kodi 19 and I'm trying to improve it a bit.
So, now I added another dialog with 2 items which now is the main dialog. Selecting an item opens a new dialog with a list with contents of a folder. I'm using xbmc.Dialog which has a "cancel" button". This button closes all dialogs, but I want to close only the current and to get me back to the main dialog with the 2 items.
Is possible to change this button's action?
Reply
#2
I think you'll find the first dialog is closing because your selecting something in it.

Why not just open the first dialog again after the cancel in the 2nd dislog? Stick the logic in a loop and exit the loop once you get the input your looking for
Reply
#3
But the "cancel" button has a default action, I haven't any code for this and this is what I'm asking. How to override this default action so to open the first dialog again as you wrote, when this "cancel" button pressed.
EDIT:
Nevermind, I found how to do it.
When I select an item from the list I this code executed:
Code:
if selected > -1:
    ..some actions..
Just needed to add an "else" to if contition and there to re-open the first dialog. Thanks.
Reply
#4
Thread moved to addon development.

The support section is more designed for issues with existing (and public) addons, rather than help for coding or updating them.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply

Logout Mark Read Team Forum Stats Members Help
Override xbmc.Dialog cancel action?0