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

Add method to MultiInputDialog to return input fields #9484

Closed
wants to merge 1 commit into from

Conversation

roygbyte
Copy link
Contributor

@roygbyte roygbyte commented Sep 5, 2022

In order to update the field's text value after it's been rendered, the input field needs to be returned, and not just the text value.


This change is Reviewable

In order to update the field's text value after it's been rendered, the input field needs to be returned, and not just the text value.
@NiLuJe
Copy link
Member

NiLuJe commented Sep 5, 2022

Not familiar with the widget, but wouldn't it make more sense to make those fugly-ass module-locals you're trying to access instance members, and just use a getter method?

@roygbyte
Copy link
Contributor Author

roygbyte commented Sep 5, 2022

Do you mean like, make input_field an instance member, as in: self.input_field? If so... yeah, probably. :)

In context, this is how I'm using the new method.

   dialog:getInputFields()[2]:setText(path)

It seems weird to me that the getFields method doesn't return the widgets to begin with. Oh well.

@zwim
Copy link
Contributor

zwim commented Sep 8, 2022

I want to raise the question to the use case here too.

If there is no use case, it is dead code.

@roygbyte
Copy link
Contributor Author

roygbyte commented Sep 9, 2022

Use case is the Newsdownloader replacement, again.

I might be able to avoid having to use this patch, though... and might retract this :)

@roygbyte
Copy link
Contributor Author

Ok! I do want this :)

@NiLuJe how are you suggesting I revise the code? Make input_field an instance member like as in self.input_field?

@NiLuJe
Copy link
Member

NiLuJe commented Sep 15, 2022

How are you suggesting I revise the code? Make input_field an instance member like as in self.input_field?

Unless there was a technical reason for the weird module local, yep!

NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Oct 4, 2022
NiLuJe added a commit to NiLuJe/koreader that referenced this pull request Oct 5, 2022
@NiLuJe
Copy link
Member

NiLuJe commented Oct 6, 2022

Superseded by #9586 (:getRawFields()) ;).

@NiLuJe NiLuJe closed this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants