Cortex
10.0.0-a4
|
The FileDialog class provides an alternative to Maya's maya.cmds.fileDialog(). More...
Public Member Functions | |
def | __init__ (self, key=None, callback=None, title="Choose a file", path=None, kw) |
def | setPath (self, path, args) |
Can be called to set the path being displayed in the Dialog. More... | |
Static Public Member Functions | |
def | registerPreset |
Register a preset for the 'Bookmarks' menu. More... | |
def | removePreset |
Removes the named preset with the given key, or global preset if no key is specified. More... | |
The FileDialog class provides an alternative to Maya's maya.cmds.fileDialog().
It is not a complete drop-in replacement, as, in order to have nice, resizable window functionality, it is not modal. Instead, a callback is registered, which will be called with the result of the users selection, which will be empty in the case of dismissal or cancellation.
If effectively provides an instance of the IECoreMaya.FileBrowser class in a window, along with path history, and bookmarking facilities.
key | (string) This key is used to provide context specific path history and bookmarks. It can be None, in which case, the global history/bookmarks are used. |
callback | Should be a callable with the signature f( result ). result will be a list of absolute paths to the seleceted items, or an empty list if the dialog was dismissed or cancelled. |
title (string) A title for the window.
path | (string) if specified, this path will be used as the initial path for the dialog. If the string "last" is passed, then the last path picked in an instance with a matching key will be used. If the argument is omitted, then the current working directory is used. |
Other kw arguments are passed to the FileBrowser constructor.
|
static |
Register a preset for the 'Bookmarks' menu.
The | name (string) the name of the preset, as it will appear in the menu. (srting) or <callable> If a string, the path to go to when selected. if a callable, it should return a tuple of ( name, path ) pairs. If the return tuple has more than one item, a submenu will be created. |
key | (string) if specified, the preset will only be available for dialogs with that ui key. |
|
static |
Removes the named preset with the given key, or global preset if no key is specified.
References IECoreMaya.FileDialog.__bookmarkMenuItemsForKey(), IECoreMaya.FileDialog.__bookmarksMenu, IECoreMaya.FileDialog.__key, IECore.curry(), IECoreMaya.ParameterUI.registerPopupMenuCallback(), IECoreMaya.FileBrowser.setPath(), and IECoreMaya.FileDialog.setPath().
def IECoreMaya.FileDialog.setPath | ( | self, | |
path, | |||
args | |||
) |
Can be called to set the path being displayed in the Dialog.
References IECoreMaya.FileDialog.__addToHistory(), IECoreMaya.FileDialog.__callback, IECoreMaya.FileDialog.__deletionCallback, IECoreMaya.FileDialog.__exit(), IECoreMaya.FileDialog.__key, and IECoreMaya.FileDialog.__window.
Referenced by IECoreMaya.FileDialog.removePreset().