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

Show current and default values in config dialog (pdf) #3973

Merged
merged 4 commits into from May 26, 2018

Conversation

Projects
None yet
3 participants
@robert00s
Contributor

robert00s commented May 23, 2018

Similar to #3952 but for pdf.

@poire-z

This comment has been minimized.

Contributor

poire-z commented May 24, 2018

A bit bothering that the showValues code is duplicated (exactly the same?) in both creoptions.lua and koptoptions.lua. Could that be put into another file? ui/data/optionutils.lua (or better name)?

@robert00s

This comment has been minimized.

Contributor

robert00s commented May 26, 2018

@poire-z Done :)

@poire-z

This comment has been minimized.

Contributor

poire-z commented May 26, 2018

Thanks!
I think you could even avoid that kind of wrapper:

local showValues = function(configurable, option, prefix)
    OptionsUtil:showValues(configurable, option, prefix)
end

and just use local showValues = OptionsUtil.showValues (or use OptionsUtil.showValues directly in the config table) if you were using a dot . instead of a colon : for the OptionsUtil functions (make them plain functions instead of methods, as you don't use any self at all in them).
Like it's done for all the functions in frontend/util.lua. Guess that then, OptionsUtil should be lowercased.

@poire-z

Quick & neat, thanks :)

local Screen = Device.screen
local T = require("ffi/util").template
local optionutil = {}

This comment has been minimized.

@Frenzie

Frenzie May 26, 2018

Member

While it doesn't really matter for the code itself, I can't help but notice that the file and the use say optionsutil and in this file it all says optionutil. optionsutil probably sounds better. In any case, please make it consistent. ;-)

@robert00s

This comment has been minimized.

Contributor

robert00s commented May 26, 2018

@Frenzie: fixed :)

@Frenzie Frenzie merged commit 895372f into koreader:master May 26, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@robert00s robert00s deleted the robert00s:conf_dialog_value_pdf branch Aug 14, 2018

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