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] Adds keyboard to dialog class, using all of Dialog().numeric() methods. #2629
[Python] Adds keyboard to dialog class, using all of Dialog().numeric() methods. #2629
Conversation
* Types: | ||
* 0 : xbmcgui.INPUT_STANDARD | ||
* 1 : xbmcgui.INPUT_NUMERIC (format: #) | ||
* 2 : xbmcgui.INPUT_DATE (format: DD/MM/YYYY) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@MartijnKaijser I don't see anyway other than modifying the base class to enter date other than DD/MM/YYYY My rebase eliminated all comments. The changes to GUIDialogGamePad and GUIDialogNumeric were necessary to not return Hashed values. |
I originally returned the hashed result, which might make more sense. It is a password keyboard. |
I eliminated the changes to GUIDialogGamePad and GUIDialogNumeric and just return the hashed password. |
Is this what you had in mind? |
And is there a way to rebase without losing someone's comments? |
Also #2767 needs to be considered otherwise all pydocs that list "default" as a keyword are wrong as currently the keyword would be "defaultt" |
Rebase always kills off comments (as they're assigned to the old commits) - you can get to them if you know the hash still (i.e. via your email). That is exactly what I was suggesting. A couple of minor points:
Looks fine other than that. |
About your comment getting to the numeric keyboard from the standard keyboard. I only see IP keyboard as a shortcut. Maybe I should add that one back in, but leave it only up to the developer. No choose. |
I'm not sure why current addons would be broken - this is a new function, right? Or are you meaning there'd be inconsistency between the specific dialog methods and this generic one? Regarding the numeric, what I meant (but didn't say!) was that you can punch the numbers in on the keyboard slightly less efficiently than the number. I'm not sure what use-cases there are where you know that there's a numeric password and want it hashed. |
I meant other methods that had default as a parameter, if they used the I'll make the changes you requested, then maybe a discussion on making all |
minor pydocs fixups and some unneeded include's |
I hate to be annoying (well ... usually), and if it matters to anyone, but since the 'type' is an 'int' it should probably use a 'switch' statement (which is more efficient) than an if/else chain. Plus, just a style note, the "get" statements on the module are really just a means of exporting the constants. I would use the defines in C++ code rather than calling the getters. If you do the above (change to a switch statement) you'll be forced to anyway. |
I agree, but I was having difficulty getting the defines to work right and have them set as constants in xbmcgui module. Where should these defines be put? outside python? That's why I ended up just using the getters in this and notification dialog. Also why I didn't use a switch. Any hints? |
You'll need to move the defines to somewhere that you have access to from Dialog.cpp and ModuleXbmcGui.cpp. i.e. a header. |
Maybe Dialog.h. Then include that in ModuleXbmcGui.cpp (as long as there's no circular includes). |
Right, I put them in dialog.h before I think and had issues. Maybe that was before trying the getters for setting constants. I'll play with it. If I get it to work do you want a patch for notification which also uses the getters? |
I can not get this to work. PyModule_AddStringConstant(module,"NOTIFICATION_INFO",getNOTIFICATION_INFO()); notice the last three duplicated lines in generated AddonModuleXbmcgui.cpp. if you could have a look at the following to see what I'm doing wrong? This was a simple test to see if I could get it to work. This was the issue i ran into before. |
Also I notice Dialog.h get's included twice in AddonModuleXbmcgui.cpp, is this a circular reference issue? #include "interfaces/legacy/Dialog.h" |
Discussion over here: nuka1195@af8c5a2#commitcomment-3350583 Including Dialog.h twice isn't a circular dependency but is also unnecessary. |
@jmarshallnz , I don't really care if my suggestions go in. It's fine the way it is now if you want to take it. It was just a suggestion but it's not important. I'll let you push it as you see fit. |
So the issue is with SWIG? It would have been nice to put the defines in dialog.h, I just couldn't get it to work. |
The issue is with String constants in the codegenerator. Which is why I only wanted you to move the constants you added as part of this commit (which are all ints). |
Then I'll move them. @jmarshallnz please wait til my next push. I'll post when I'm done. |
@jimfcarroll, It's still generating two constants for the defines i put in Dialog.h. it compiles and links in OS X. PyModule_AddIntConstant(module,"INPUT_ALPHANUM",INPUT_ALPHANUM); [these two left so maybe it's a hint to you as order of creation] PyModule_AddIntConstant(module,"INPUT_ALPHANUM",0); |
actually that doesn't compile now. |
ok this does compile |
…() methods. This does not eliminate xbmc.Keyboard() or Dialog().numeric. Those could be depreciated.
not sure what your decision is on this, since it adds two constants for each define when done this way, but i rebased with master so you wouldn't get any merge conflicts. |
@jmarshallnz, I'm fine with this. My suggestion was only minor and when I get some time maybe I'll play around with it a little. In my absence (since my participation is sparse right now) Can you be the final approver of the Python stuff? I watch the emails and try to review things Python related but I'll let you push the button during the windows if that's OK with you? Thanks. |
[Python] Adds keyboard to dialog class, using all of Dialog().numeric() methods.
This does not eliminate xbmc.Keyboard() or Dialog().numeric. Those could be depreciated.