History

Merge pull request #12184 from ctrlaltdavid/21700

Add Window browseChanged signal as replacement for openFileChanged

Ryan Downe Karpf committed 8 years ago

Commit f1b18cc2 parents 08b4c6e 85bda1d3 files · +18 −7Browse files

Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 3 files). Show all

Unified · Split

interface/src/scripting/WindowScriptingInterface.h+13−3
@@ -197,18 +197,19 @@ public slots: · 196 unmodified lines
197197
198198 /**jsdoc
199199 * Prompt the user to choose a file. Displays a non-modal dialog that navigates the directory tree. A
200− * {@link Window.openFileChanged|openFileChanged} signal is emitted when a file is chosen; no signal is emitted if the user
200+ * {@link Window.browseChanged|browseChanged} signal is emitted when a file is chosen; no signal is emitted if the user
201201 * cancels the dialog.
202+ * @deprecated A deprecated {@link Window.openFileChanged|openFileChanged} signal is also emitted when a file is chosen.
202203 * @function Window.browseAsync
203204 * @param {string} title="" - The title to display at the top of the dialog.
204205 * @param {string} directory="" - The initial directory to start browsing at.
205206 * @param {string} nameFilter="" - The types of files to display. Examples: <code>"*.json"</code> and
206207 * <code>"Images (*.png *.jpg *.svg)"</code>. All files are displayed if a filter isn't specified.
207208 * @example <caption>Ask the user to choose an image file without waiting for the answer.</caption>
208− * function onOpenFileChanged(filename) {
209+ * function onBrowseChanged(filename) {
209210 * print("File: " + filename);
210211 * }
211− * Window.openFileChanged.connect(onOpenFileChanged);
212+ * Window.browseChanged.connect(onBrowseChanged);
212213 *
213214 * Window.browseAsync("Select Image File", Paths.resources, "Images (*.png *.jpg *.svg)");
214215 * print("Script continues without waiting");
@@ -659,9 +660,18 @@ signals: · 444 unmodified lines
659660 */
660661 void saveFileChanged(QString filename);
661662
663+ /**jsdoc
664+ * Triggered when the user chooses a file in a {@link Window.browseAsync|browseAsync} dialog.
665+ * @function Window.browseChanged
666+ * @param {string} filename - The path and name of the file the user chose in the dialog.
667+ * @returns {Signal}
668+ */
669+ void browseChanged(QString filename);
670+
662671 /**jsdoc
663672 * Triggered when the user chooses a file in a {@link Window.browseAsync|browseAsync} dialog.
664673 * @function Window.openFileChanged
674+ * @deprecated This signal is being replaced with {@link Window.browseChanged|browseChanged} and will be removed.
665675 * @param {string} filename - The path and name of the file the user chose in the dialog.
666676 * @returns {Signal}
667677 */