class FSPathEntry(InputEntry): (source)
Known subclasses: zim.gui.widgets.FileEntry
, zim.gui.widgets.FolderEntry
Base class for FileEntry
and FolderEntry
, handles input of file system paths.
File paths can either be absolute paths or relative to the notebook. When a notebook and optionally a page path are set, Notebook.resolve_file()
is used to make file paths relative.
This class should not be instantiated directly, use either FileEntry
or FolderEntry
.
Unknown Field: todo | |
add completion for file paths - make sure both absolute and relative paths are supported + re-use this completion in LinkEntry |
Method | __init__ |
Constructor |
Method | get_path |
Get the file path for this entry @returns: a File or Folder object (depending on sub-class) |
Method | popup_dialog |
Run a dialog to browse for a file or folder. Used by the 'browse' button in input forms. |
Method | set_path |
Set the file path for this entry @param path: a File or Folder object |
Method | set_use_relative_paths |
Set the notebook and path to be used for relative paths. |
Instance Variable | action |
Undocumented |
Instance Variable | file_type_hint |
Undocumented |
Instance Variable | notebook |
Undocumented |
Instance Variable | notebookpath |
Undocumented |
Inherited from InputEntry
:
Method | clear |
Clear the text in the entry |
Method | do_input_valid_changed |
Undocumented |
Method | get_input_valid |
Get the valid state. @returns: True if the input is valid |
Method | get_text |
Get the text from the widget. Like Gtk.Entry.get_text() but with UTF-8 decoding and whitespace stripped. @returns: string |
Method | set_check_func |
Set a function to check whether input is valid or not @param check_func: the function |
Method | set_icon |
Add an icon in the entry widget behind the text |
Method | set_icon_to_clear |
Adds a "clear" icon in the entry widget |
Method | set_input_valid |
No summary |
Method | update_input_valid |
Undocumented |
Constant | ERROR_COLOR |
Undocumented |
Class Variable | __gsignals__ |
Undocumented |
Instance Variable | allow_empty |
Undocumented |
Instance Variable | allow_whitespace |
Undocumented |
Instance Variable | check_func |
Undocumented |
Instance Variable | show_empty_invalid |
Undocumented |
Instance Variable | _input_valid |
Undocumented |
Instance Variable | _normal_color |
Undocumented |
zim.gui.widgets.InputEntry.__init__
zim.gui.widgets.FileEntry
, zim.gui.widgets.FolderEntry
Parameters | |
check_func | a function to check input is valid. This function will be called with the current text as argument and should return True if this text is a valid input. |
allow_empty | if False an empty string is considered invalid input |
show_empty_invalid | if True a red background is also shown when the entry is still empty, if False the background is kept normal even if the empty input is invalid. Without this option a whole input form would start in red color, which looks bad. |
placeholder_text | text to show in the widget when it is empty and does not have focus, text will be shown in a color different from normal text and disappear when the user selects the widget. Used to set hints on the usage of the widget. |
allow_whitespace | if True allow trailing whitespace or even string containing only whitespace. If False all whitespace is stripped. |
zim.gui.widgets.FileEntry
, zim.gui.widgets.FolderEntry
Undocumented