path_widget
frog.gui.path_widget
¤
Provides a widget for choosing the path to a measure script.
Classes¤
OpenDirectoryWidget(initial_dir_path=None, **file_dialog_kwargs)
¤
Bases: PathWidget
A widget that lets the user choose the path to an existing directory.
Create a new OpenDirectoryWidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_dir_path
|
Path | None
|
The initial file path to display |
None
|
file_dialog_kwargs
|
Any
|
Arguments to pass to QFileDialog.getOpenFileName |
{}
|
Source code in frog/gui/path_widget.py
111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
Functions¤
try_get_path_from_dialog()
¤
Try to get the path of the dir to open by raising a dialog.
Source code in frog/gui/path_widget.py
125 126 127 128 129 |
|
OpenFileWidget(initial_file_path=None, extension=None, **file_dialog_kwargs)
¤
Bases: PathWidget
A widget that lets the user choose the path to an existing file.
Create a new OpenFileWidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_file_path
|
Path | None
|
The initial file path to display |
None
|
extension
|
str | None
|
The extension of the file to open |
None
|
file_dialog_kwargs
|
Any
|
Arguments to pass to QFileDialog.getOpenFileName |
{}
|
Source code in frog/gui/path_widget.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
Functions¤
try_get_path_from_dialog()
¤
Try to get the path of the file to open by raising a dialog.
Source code in frog/gui/path_widget.py
101 102 103 104 105 |
|
PathWidget(initial_file_path=None)
¤
Bases: QWidget
A widget containing a text box with a file path and a browse button.
Create a new PathWidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_file_path
|
Path | None
|
The initial file path to display |
None
|
Source code in frog/gui/path_widget.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Attributes¤
line_edit = QLineEdit()
instance-attribute
¤
Indicates the current selected path.
Functions¤
set_path(path)
¤
Set the path of this widget.
Source code in frog/gui/path_widget.py
75 76 77 |
|
try_get_path()
¤
Try to get the path of the chosen file for this widget.
If the path hasn't yet been set, a QFileDialog is opened to let the user choose one.
Returns:
Type | Description |
---|---|
Path | None
|
The selected file path or None if the user has cancelled |
Source code in frog/gui/path_widget.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
try_get_path_from_dialog()
abstractmethod
¤
Try to get the file name by raising a dialog.
Source code in frog/gui/path_widget.py
49 50 51 |
|
SaveFileWidget(initial_file_path=None, extension=None, **file_dialog_kwargs)
¤
Bases: PathWidget
A widget that lets the user choose the path to save a file.
Create a new SaveFileWidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_file_path
|
Path | None
|
The initial file path to display |
None
|
extension
|
str | None
|
The extension of the file to save |
None
|
file_dialog_kwargs
|
Any
|
Arguments to pass to QFileDialog.getSaveFileName |
{}
|
Source code in frog/gui/path_widget.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
Functions¤
try_get_path_from_dialog()
¤
Try to get the path to save the file to by opening a dialog.
Source code in frog/gui/path_widget.py
154 155 156 157 158 159 160 161 162 163 164 165 166 |
|