Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-api] - BUG - cancel of a preselect dialog behaving badly #13196

Merged
merged 1 commit into from Dec 14, 2017

Conversation

@ooware
Copy link
Contributor

commented Dec 14, 2017

Description

The internal list maintenance structures were not being totally cleared when a user canceled a select or multiselect dialog. My change ensures the list is fully cleared.

Motivation and Context

The preselect parameter was added to Dialog().select() and Dialog().multiselect() methods in PR #9666.

It turns out that canceling a Dialog().select() or Dialog().multiselect() that has the preselect parameter specified incorrectly returns the indexes of the preselected items as opposed to an indication of being canceled. This is true whether the dialog is canceled via the dialog's cancel button or the back key on the remote/keyboard.

This bug has been mentioned in the Kodi forums on a few threads:

Thread: BUG - Dialog Preselect prevents cancel
Thread: select dialog, detect cancel?

How Has This Been Tested?

I created a small add-on that presented both single and multi select dialogs. I tested canceling with the dialog's cancel button as well as the remote/keyboard back button. I also made sure that selection worked properly when I didn't cancel the dialog.

Screenshots (if appropriate):

N/A

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed
BUG: canceling a preselect dialog is ignored
Canceling a `Dialog().select()` or `Dialog().multiselect()` that
has the `preselect` parameter specified incorrectly returns the
indexes of the preselected items. This is true whether the dialog
is canceled via the dialog's cancel button or the `back` key on
the remote/keyboard.

Ref:
https://forum.kodi.tv/showthread.php?tid=288460
https://forum.kodi.tv/showthread.php?tid=305479
@notspiff

This comment has been minimized.

Copy link
Contributor

commented Dec 14, 2017

thanks. looks fine, builds fine.

osx failure is just a hickup and this is not platform specific in any way.

@notspiff notspiff merged commit 5a6f7d6 into xbmc:master Dec 14, 2017

1 check failed

default Sorry, building this PR failed. Please check the logs for the errors.
Details

@Rechi Rechi added this to the L 18.0-alpha1 milestone Dec 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.