Add the missing autoclose feature to the keyboardfactory... #2148

Merged
merged 1 commit into from Jan 31, 2013

Conversation

Projects
None yet
3 participants
Owner

Memphiz commented Jan 30, 2013

... as the comment says.

@jmarshallnz something like that?

@jmarshallnz jmarshallnz commented on an outdated diff Jan 30, 2013

xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
@@ -654,6 +654,10 @@ bool CGUIDialogKeyboardGeneric::ShowAndGetInput(char_callback_t pCallback, const
pKeyboard->SetHeading(heading);
pKeyboard->SetHiddenInput(bHiddenInput);
pKeyboard->SetText(initialString);
+
+ if (autoCloseMs > 0)
+ SetAutoClose(autoCloseMs);
@jmarshallnz

jmarshallnz Jan 30, 2013

Member

pKeyboard->SetAutoClose() ?

Member

jmarshallnz commented Jan 30, 2013

Looks fine other than that one.

Contributor

ulion commented Jan 31, 2013

I was considering give GUIKeyboard a common method CloseKeyboard(), then the autoclose code can only implement once in factory and do it by delayedThreadMessage or some other method, which need can be canceled after keyboard closed before the timeout.
But, implement SetAutoClose on each native keyboard isn't so hard, so it's ok.

Owner

Memphiz commented Jan 31, 2013

i also thought of the close method - not sure why i didn't like it. @ulion i used a nstimer in thenioskeyboard at the first try but somehow it never fired the callback (i already use nstimers e.x in externaltouchcontroller). Thats why i did the poor mans solution for ios.

@jmarshallnz the setautoclose is a method from the guidialog the generic keyboard is derived from - or i got tricked somehow ;)

Well i will overthink it - i guess adding a cancel method to the GUIKeyboard interface and handle autoclose in the factory is nicer.

Owner

Memphiz commented Jan 31, 2013

PR updated - native keyboards need to implement one additional method "Cancel()". AutoClose is realised in the factory/GUIKeyboard base class by using a CTimer object.

Tested for ios nativekeyboard and generic keyboard.

@jmarshallnz jmarshallnz commented on an outdated diff Jan 31, 2013

xbmc/guilib/GUIKeyboard.h
{
public:
+ CGUIKeyboard():m_pIdleTimer(new CTimer(this)){};
@jmarshallnz

jmarshallnz Jan 31, 2013

Member

It seems that a reference would be better as you have included the header anyway.

@Memphiz Memphiz [keyboardfactory] - add a new optional param for autoclose - impleme…
…nt autoclose feature in the factory by using a CTimer object - nativekeyboards need to implement one more methode "Cancel" as of now
3e6df33

@Memphiz Memphiz added a commit that referenced this pull request Jan 31, 2013

@Memphiz Memphiz Merge pull request #2148 from Memphiz/keyboardfactoryautoclose
Add the missing autoclose feature to the keyboardfactory...
fbc641f

@Memphiz Memphiz merged commit fbc641f into xbmc:master Jan 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment