From 612c43f3b1c0351fe2601ed73024d39bacd4ed52 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 18 Mar 2020 22:43:27 -0400 Subject: Added `ui.dialogs.progressbar()` and utilize it with Find in Files. --- core/.ui.dialogs.luadoc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core/.ui.dialogs.luadoc') diff --git a/core/.ui.dialogs.luadoc b/core/.ui.dialogs.luadoc index 0a6579d1..08a810d1 100644 --- a/core/.ui.dialogs.luadoc +++ b/core/.ui.dialogs.luadoc @@ -324,6 +324,32 @@ function filesave(options) end -- informative_text = 'You agree to:', text_from_file = _HOME..'/LICENSE'} function textbox(options) end +--- +-- Displays a progressbar dialog defined by dialog options table *options* and +-- updates from function *f*. +-- Returns "stopped" if *options*.`stoppable` is `true` and the user clicked the +-- "Stop" button. Otherwise, returns `nil`. +-- @param options Table of key-value option pairs for the progressbar dialog. +-- +-- * `title`: The dialog's title text. +-- * `percent`: The initial progressbar percentage between 0 and 100. +-- * `text`: The initial progressbar display text (GTK only). +-- * `indeterminate`: Show the progress bar as "busy", with no percentage +-- updates. +-- * `stoppable`: Show the "Stop" button. +-- * `width`: The dialog's pixel width. +-- * `height`: The dialog's pixel height. +-- @param f Function repeatedly called to do work and provide progress updates. +-- The function is called without arguments and must return either `nil`, +-- which indicates work is complete, or a progress percentage number in the +-- range 0-100 and optional string text to display (GTK only). If the text +-- is either "stop disable" or "stop enable" and *options*.`stoppable` is +-- `true`, the "Stop" button is disabled or enabled, respectively. +-- @return nil or "stopped" +-- @usage ui.dialogs.progressbar({stoppable = true}, +-- function() if work() then return percent, status else return nil end end) +function progressbar(options, f) end + --- -- Prompts the user with a drop-down item selection dialog defined by dialog -- options table *options*, returning the selected button's index along with the -- cgit v1.2.3