select dialog, detect cancel?
#1
Is there anyway to detect a cancelled select dialog while using the preselect option?

I noticed when using dialog().select with the preselect focus cancel returns the preselect value.

Thank you in advance.

https://github.com/xbmc/xbmc/pull/9666
Code:
select = xbmcgui.Dialog().select(header, list, autoclose, preselect, useDetails)
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#2
Nope, I looked at the source and cancel is broken with preselect. I reported it a few months ago. http://forum.kodi.tv/showthread.php?tid=288460
Reply
#3
I guess the only way is to implement your own multi-select dialog.
Reply
#4
(2017-02-01, 15:48)Roman_V_M Wrote: I guess the only way is to implement your own multi-select dialog.
IMO that would only be a temporary solution.

I'll take a look at the source, there must be a long term fix.

Sent from my SM-G935T

I think I already spotted a solution in.
https://github.com/xbmc/xbmc/blob/master...Select.cpp

I'll try making changes and compile when I get home.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
Fixed by https://github.com/xbmc/xbmc/pull/13196
Reply
#6
Don't believe this has been fixed as xbmcgui.Dialog().select is returning the highlighted item when pressing cancel in the window. Using Kodi 18.1 on Windows.
Reply
#7
As pointed out by o__o bug is fixed in Leia but present in Krypton. In my addons I use different code for Krypton/Leia to avoid the bug (see here).
Reply
#8
(2019-05-01, 18:14)Wintermute0110 Wrote: As pointed out by o__o bug is fixed in Leia but present in Krypton. In my addons I use different code for Krypton/Leia to avoid the bug (see here).

Yeah my, bad. Assumed it returned false when cancel is selected not -1. That's a neat trick, do you have one for determining if an input dialog is cancelled? Currently, it returns blank if no text is entered or if the cancel button is pressed. Trying to distinguish between the two actions.
Reply
#9
(2019-05-02, 16:16)SEIKT Wrote:
(2019-05-01, 18:14)Wintermute0110 Wrote: As pointed out by o__o bug is fixed in Leia but present in Krypton. In my addons I use different code for Krypton/Leia to avoid the bug (see here).

Yeah my, bad. Assumed it returned false when cancel is selected not -1. That's a neat trick, do you have one for determining if an input dialog is cancelled? Currently, it returns blank if no text is entered or if the cancel button is pressed. Trying to distinguish between the two actions.

Yes. You have plenty of examples in the Advanced Launchers code which uses the Kodi GUI extensively.
Reply
#10
(2019-05-02, 17:35)Wintermute0110 Wrote:
(2019-05-02, 16:16)SEIKT Wrote:
(2019-05-01, 18:14)Wintermute0110 Wrote: As pointed out by o__o bug is fixed in Leia but present in Krypton. In my addons I use different code for Krypton/Leia to avoid the bug (see here).

Yeah my, bad. Assumed it returned false when cancel is selected not -1. That's a neat trick, do you have one for determining if an input dialog is cancelled? Currently, it returns blank if no text is entered or if the cancel button is pressed. Trying to distinguish between the two actions. 

Yes. You have plenty of examples in the Advanced Launchers code which uses the Kodi GUI extensively. 

Just what I needed. Thank you.
Reply
#11
Hi,
@Wintermute0110 

I need your help here.

I want to use Metadata Editor addon in krypton, so I modify a little the current version for Leia and it works.
https://github.com/sualfred/script.metadata.editor

But I have a prolem with the Dialog, when I try to close it by the Cancel button or Backspace key it doesn't close,
And instead it raises another dialog like I actually press on one of the items in the dialog list (Such as the keyboard or other).
The type of the dialog is: DialogSelect.xml

How can I make it close and not select an item instead?

Thanks.
Reply
#12
(2020-11-11, 20:40)burekas Wrote: Hi,
@Wintermute0110 

I need your help here.

I want to use Metadata Editor addon in krypton, so I modify a little the current version for Leia and it works.
https://github.com/sualfred/script.metadata.editor

But I have a prolem with the Dialog, when I try to close it by the Cancel button or Backspace key it doesn't close,
And instead it raises another dialog like I actually press on one of the items in the dialog list (Such as the keyboard or other).
The type of the dialog is: DialogSelect.xml

How can I make it close and not select an item instead?

Thanks.
I solved it by ignoring this line:
#winprop('SelectDialogPreselect', str(self.editdialog))
Reply

Logout Mark Read Team Forum Stats Members Help
select dialog, detect cancel?0