File View.lua
Functions
View:getCollectionBrowser (params) | Gets collection browser in the form of a push-button view item. |
View:getEncryptedPasswordViewItems (passwordFieldName, props, pwDescr, viewOptions) | Get (encrypted) password view items. |
View:getLogControls (params) | Create items for view of log-file controls (verbose, show, clear). |
View:getPluginManagerPresetControls (params) | Create items for view of plugin manager preset (label, preset-dropdown). |
View:getPresetName (presetId, props) | Get preset name and associated data value(s) key, given ID and props - nil => in transition, blank => no preset selected. |
View:getThumbnailViewItem (params) | Get a view item capable of representing the thumbnail of a catalog photo. |
View:getThumbnailsView (args) | Get catalog-photo view in a scroller. |
View:makePresetPopup (params) | Makes a preset popup menu which utilizes callbacks to handle associated preset data, whilst encapsulating preset selection/new/delete. |
View:new (t) | Constructor for new instance. |
View:newClass (t) | Constructor for extending class. |
View:observeFtpPropertyChanges (object, props, ftpSettingsName, checkSetting) | Observe ftp setting property changes. |
View:setObserver (props, name, id, handler) | Add observer, without having duplicate. |
View:startFtpSettingsView (object, props, enabledBinding, retItems, labelOptions, dataOptions) | Get view items for ftp settings as an array of two arrays containing view items, suitable for a two-row display. |
View:unobserveFtpPropertyChanges (object) | Discontinue observation of ftp setting changes. |
View:verifyPassword (passwordFieldName, props) | Determines whether password entered (in props) is same as corresponding value in encrypted store. |
Functions
- View:getCollectionBrowser (params)
-
Gets collection browser in the form of a push-button view item.
Parameters:
-
params
:
-
- View:getEncryptedPasswordViewItems (passwordFieldName, props, pwDescr, viewOptions)
-
Get (encrypted) password view items.
Parameters:
-
passwordFieldName
: -
props
: -
pwDescr
: -
viewOptions
:
Return value:
- array with:
editable password field
encryption button.
show password button. -
- View:getLogControls (params)
-
Create items for view of log-file controls (verbose, show, clear).
Parameters:
-
params
: (table/structure, optional) with named members:
verboseCheckboxViewOptions
showLogsButtonViewOptions
clearLogsButtonViewOptions
Usage:
assign named items to create view of your choice.
Return value:
- table of named items: verboseCheckbox, showLogsButton, clearLogsButton.
-
- View:getPluginManagerPresetControls (params)
-
Create items for view of plugin manager preset (label, preset-dropdown).
Parameters:
-
params
: (table/structure, required) with named members:
call (Call class, required) not sure what this is used for, but never tried NOT passing it.
labelViewOptions (table/structure, optional) view options for static-text label control.
presetPopupOptions (table/structure, optional) options for argument to pref-mgr's make-preset-popup method, most notably:
call - defaults to call passed as top-level param.
valueBindTo - defaults to prefs
valueKey - defaults to global pref key whose name is 'pluginManagerPreset'.
callback - defaults to integrity-checking no-op.
popupViewOptions (table/structure, optional) these can be included as part of the former, or as this var instead.
Usage:
assign named items to create view of your choice.
By default, target value is bound to 'pluginManagerPreset' in global prefs, and is NOT initialized by this method.
target value is NOT initialized by this method, so initialize externally before presenting dialog box.
Return value:
- table of named view items: label, popup.
-
- View:getPresetName (presetId, props)
-
Get preset name and associated data value(s) key, given ID and props - nil => in transition, blank => no preset selected.
Parameters:
-
presetId
: -
props
:
-
- View:getThumbnailViewItem (params)
-
Get a view item capable of representing the thumbnail of a catalog photo.
Parameters:
-
params
:
-
- View:getThumbnailsView (args)
-
Get catalog-photo view in a scroller.
Parameters:
-
args
: (table) containing:
- photos (array, required) photos to view.
- fmtMetaSpecs (array, optional) formatted metadata keys to accompany thumbnails.
- fmtMeta (array, optional) formatted metadata to accompany thumbnails.
- clickBack (function, optional) callback function for clickage.
- viewWidth
- viewHeight
- thumbWidth
- thumbHeight
-
- View:makePresetPopup (params)
-
Makes a preset popup menu which utilizes callbacks to handle associated preset data, whilst encapsulating preset selection/new/delete.
Parameters:
-
params
: (table) with members:
presetId (string, required) uniquely identifies this preset popup and it's preference settings.
props (propertyTable, required) property table created in calling context. note: initialized afresh from persistent prefs, so no need for it to also be persistent.
callback (table, required) members are callback functions:
getPresetNames ( function( presetId, app:getPref( presetNamesPref ), app:getPref( selectedPresetNamePref ) ) - returns presetNames, presetName; required ) sort names, or generate default list, ... ).
initNewPreset ( function( presetId, presetName, presetKey ) - returns name, m; required ) initialize data associated with specified preset.
deletePreset ( function( presetId, presetName, presetKey ) - returns s, m; required ) scrub settings associated with specified preset.
selectPreset ( function( presetId, presetName, presetKey ) - returns s, m; required ) function to select preset.
isEqual ( function( presetId, presetName, presetKey ) - returns s, m; optional ) function to determine equality - if not passed, then auto-save is assumed.
viewOptions (table, optional) view options.
-
- View:new (t)
-
Constructor for new instance.
Parameters:
-
t
:
-
- View:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- View:observeFtpPropertyChanges (object, props, ftpSettingsName, checkSetting)
-
Observe ftp setting property changes. ### deprecated. @deprecated
Parameters:
-
object
: (table, required) must include 'observeFtpPropertyChanges' table with a named member set to boolean 'true' for each property to be observed. -
props
: (property-table, required) ftp-settings. -
ftpSettingsName
: (string, required) name of ftp-settings property. -
checkSetting
: (function( ftpProps, name, prev, value ), optional) can be used to check the values being set, and return true for 'OK' or false and a warning message if not.
Usage:
Call when starting dialog box containing ftp settings.
This function was designed to be used in conjunction with
the framework object's version of ftp-query-for-password-if-needed, since it will look
in the encrypted store for the password saved by this function.
-
- View:setObserver (props, name, id, handler)
-
Add observer, without having duplicate.
Parameters:
-
props
: -
name
: -
id
: -
handler
:
-
- View:startFtpSettingsView (object, props, enabledBinding, retItems, labelOptions, dataOptions)
-
Get view items for ftp settings as an array of two arrays containing view items, suitable for a two-row display.
Parameters:
-
object
: (table, required) Serves as ID for set-observer. May contain ftpPropertyMap member table with elements:
* server = { propName='ftpServer', validationMethodName='checkFtpSetting' },
* ... ditto for other ftp-settings, and
* remoteDirPathForFtpUploadTest = { propName='customUploadDir', validationMethodName='checkUploadDir' },
Note: validation method(s) of object take name, value as param and return sts, msg. -
props
: (LrObservableTable, required) properties passed to start-dialog box... -
enabledBinding
: (binding table, optional) if passed, all fields enabling will be contingent upon specified binding. -
retItems
: (boolean, optional) if passed, return items. -
labelOptions
: (table, optional) if passed, options for labels. -
dataOptions
: (table, optional) if passed, options for labels.
Usage:
starts task to watch for property changes, so you must call end-ftp-settings-view in end-dialog method.
So far, it only works for display directly in plugin manager dialog or export/publish dialog.
If you want a different physical arrangement..., you can massage the returned items and re-package...
To use:
local vi = view:getFtpSettingsViewItems( ftpSettings, props, "getPrefBinding" ) -- bind using app--get-pref-binding method.
local view = vf:view{ vf:row( vi[1] ), vf:row( vi[2] ) } -- or
local vi = view:getFtpSettingsViewItems( ftpSettings, props ) -- default props binding
local view = vf:view{ vf:row( vi[1] ), vf:row( vi[2] ) }
Return values:
- defaultView (LrView) default ftp view.
- viewItems (2-D array of view-items, 1st-D is "row", 2nd-D has 3 view items for the "row") in case you want to massage before creating custom view.
-
- View:unobserveFtpPropertyChanges (object)
-
Discontinue observation of ftp setting changes. deprecated. @deprecated
Parameters:
-
object
:
Usage:
This must be called when dialog box is ended.
-
- View:verifyPassword (passwordFieldName, props)
-
Determines whether password entered (in props) is same as corresponding value in encrypted store.
Parameters:
-
passwordFieldName
: -
props
:
-