gui.showSaveDialog

Show a ShiVa save dialogue.

Prototype

  1. kDialogResult|nil = gui.showSaveDialog ( hVariable|aVariables|nil )

Description

The Save dialogue will only pop up if at least one item/entry/... has been modified, otherwise it will return nil. You can pass one variable or a set of variables. The save dialog will determine which one of them needs to be saved. If there are no parameters, the save dialog will present all the currently modified variables. This is what happens f.i. when you want to quit ShiVa or switch to another project.


Parameters

hVariable|aVariables|nil - pass a variable or an array of variables that you want to save, or nil to save all


Return values

kDialogResult|nil - predefined accepted/canceled/rejected constant, or nil if nothing has changed


Sample

  1. function onMainViewPrepareForBuild ( )
  2. -- if nothing to save => vResult will be "nil" => we must return true
  3. -- if user clicked "ok" => vResult will be "true" => we must return true
  4. -- if user clicked "cancel" => vResult will be "false" => we must return false
  5. --
  6. local vResult = gui.showSaveDialog ( nil )
  7. return ( vResult ~= gui.kDialogResultCanceled )
  8. end

Available since ShiVa 2.0