Answered
Trying to persist a dialog value using LrPrefs
I'm trying to set up a simple dialog with an edit field the value of which persists using the code below, called using LrPluginInfoProvider in my info file. What am I doing wrong?
local LrView = import "LrView"
local LrPrefs = import "LrPrefs"
local LrDialogs = import "LrDialogs"
local bind = LrView.bind
local pluginInfoProvider = {}
function pluginInfoProvider.sectionsForTopOfDialog(f, properties )
local prefs = LrPrefs.prefsForPlugin( )
if properties.userName == nil then
properties.userName = prefs.userName or "yyyy"
end
return {
{
title = "Chatter Preferences --",
synopsis = "Chatter, by Kim Aldis",
f:row {
f:column {
spacing = f:control_spacing(),
f:static_text {
title = "Testing:"
},
f:edit_field {
value = bind "userName",
width = 300
}
}
}
}
}
end
return pluginInfoProvider