summaryrefslogtreecommitdiff
path: root/src/dialogs/DefaultFileDialog.qml
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-241-2/+2
|\ | | | | | | Change-Id: I4a76c586b2e5e49616627c306dd345bdeee64b62
| * DefaultFileDialog: check cur selection properly on okButton clickedShawn Rutledge2016-11-171-2/+2
| | | | | | | | | | | | | | | | TableView has currentRow not currentIndex. Task-number: QTBUG-56663 Change-Id: I9376354364bc843d118a672fcd1d9dfbba8e775c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-161-11/+33
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/dialogs/qquickabstractfiledialog.cpp src/dialogs/qquickfiledialog.cpp Change-Id: I60aab7c7e819f82f82fc30f473b36a7a57d9a91a
| * FileDialog: create FolderListModel asynchronously when first openedShawn Rutledge2016-02-021-11/+33
| | | | | | | | | | | | | | | | | | | | | | | | This is only for the QML dialog implementation. The incubator should be able to do this without any UI freeze, however there can still be a delay when opening the dialog. It's better to delay at that time instead of during application startup. Task-number: QTBUG-46477 Change-Id: I31bada236ecbcfeb98ab98c511c65f95f1a1f83c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Unify license header usageAntti Kokko2016-02-041-12/+15
|/ | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I3c851bc24da89f6300b94199387d1adf16ca4f48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* FileDialog: change the button text to "Choose" for selecting directoryShawn Rutledge2015-04-011-1/+1
| | | | | | | Make DefaultFileDialog consistent with QFileDialog in this way. Change-Id: I6f24746f2816be1b8c0545e2bd63746b38412336 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Dialogs: store m_shortcutDetails as JS arrayRichard Moe Gustavsen2015-03-301-2/+2
| | | | | | | | Simplify the code a bit by storing the shortcuts as an JS array that keeps track of its own length. Change-Id: I4aa3c353d9d88d58feaf8e452cf11cc5bc05646c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* FileDialog: make the save/load distinction function properlyShawn Rutledge2015-03-181-1/+1
| | | | | | | | | | | - shortcuts need to be different: use QStandardPaths::writableLocation if it's a "save" dialog - that means shortcuts need to change dynamically, because the same dialog instance can be reused for both purposes - DefaultFileDialog.qml changes its button labels accordingly Change-Id: Ie90d96cc686caf30e86669a79e613585f8fb3704 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* FileDialog: expose several QStandardPaths in the shortcuts propertyShawn Rutledge2015-03-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | QStandardPaths::PicturesLocation is a specialized kind of file URL on iOS; if this folder is set, then when the dialog is opened, it will be the new dialog helper which uses the native picture gallery picker interface. This will always work, so we do not need to check whether the path exists. The application developer needs to have a way to get that platform-specific (and odd-looking) URL by name, so the FileDialog.shortcuts property is now public API: a map from programmatic names (similar to those in QStandardPaths) to URLs. But DefaultFileDialog.qml should not display the names from this map, because they are not translated to the user's language. So __shortcuts is added as a private property providing a map from programmatic name to an object containing the translated name and the URL. This makes possible setting FileDialog { folder: shortcuts.pictures } which will open the special image gallery browser on iOS; and several other paths from QStandardPaths can be set in the same way. [ChangeLog][QtQuick.Dialogs] added FileDialog.shortcuts to enable setting the starting folder to a standard system path. Setting folder to shortcuts.pictures will result in a special image gallery dialog on iOS. Change-Id: I14f04712eb4f44ff422ac91a8720b9e3ff8fb920 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Dialogs: let folder be assignable in DefaultFileDialog.qmlRichard Moe Gustavsen2015-03-181-6/+3
| | | | | | | | | | | | | | | | | | The current code creates an explicit binding of property 'folder' to its folder list model. The result is that if the app sets folder to something else, it would be overwritten by the binding already upon creation. This patch will keep the binding, but assign it to the property directly. That way the app can override its initial value. Note that since the app cannot manipulate the model directly, and since functions like dirUp(), dirDown(), click in tableview etc, updates 'folder' directly, the binding seems to be unnecessary in the first place. Change-Id: I65e900df9f9305e8bbec4ac401062243d83740aa Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Dialogs: update license headersJ-P Nurmi2015-02-111-31/+27
| | | | | | Change-Id: I1abdce308929507416b5f24b4442d0b978886a46 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* FileDialog: several logic corrections in handling the enter keyShawn Rutledge2014-10-291-3/+7
| | | | | | | | | | | | | | | | | | | | A "save as" dialog does not need to validate existence of the file. When the user presses enter in the text field at the top, and the text field contains a path to a directory, it usually means enter the directory; but if the dialog is for choosing a directory, then pressing enter will mean enter the directory if the dialog is not already viewing that one, or else accept the current directory as the choice if the table view does not have focus on some other row. When the user presses enter in table view, go down into a directory only if a directory is selected; otherwise accept the current selection. When the user clicks a row in the table, copy the path of that row into the text field so that it is possible to edit the path before pressing Enter or OK (behavior similar to a native dialog that has an editable path, such as GTK). Task-number: QTBUG-39435 Change-Id: Ibd5e988624c5b1072a12239d681cbdc812e0a697 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Dialogs: added private maximumDimension property for initial sizeShawn Rutledge2014-10-131-3/+2
| | | | | | | | | | | The Screen.attached property does not know which screen will be used until the dialog is shown, but we need to know how big the desktop is before it is shown in order to constrain a reasonable dialog size, before the Flow lays out the buttons. Otherwise it will be too tall. Task-number: QTBUG-41734 Change-Id: I44349fab4ad0254d2c6faf30c759fb9e52eebf03 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Dialogs: Use native rendering on non-mobile platformsShawn Rutledge2014-10-081-4/+4
| | | | | | | | | Follow the same rule as in QtQuick.Controls: change 332ef31f0d1645eded5588729176134bbdcd38a2 Task-number: QTBUG-41734 Change-Id: I6d80e0312d3986b90952e43ffbddec1fe007fddb Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Dialogs: add qsTr() wrappers to all QML strings for translationv5.4.0-alpha1Shawn Rutledge2014-09-051-10/+10
| | | | | Change-Id: If5304902f7167df56266542969723481477a7ba9 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* FileDialog: use icon font instead of PNG imagesShawn Rutledge2014-09-041-11/+15
| | | | | | | | The purpose is to make all icons scaleable so that there is no need for multiple resolutions. Change-Id: I535c569a10e0f97a81763fa334ed103ba7745907 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* FileDialog: add sidebarVisible property and buttonShawn Rutledge2014-09-041-1/+16
| | | | | | | | | | | | | | | The sidebar takes up too much space on some devices, so now it is possible for the application author to hide it by default. The user can also toggle it with a button similar to that used for the Qt Creator sidebar, and this state is stored as a setting; however if the application sets sidebarVisible: false, that overrides the setting. [ChangeLog][QtQuick.Dialogs] FileDialog: added sidebarVisible property and button Task-number: QTBUG-39231 Change-Id: Ie8b379da02f4b12764732b2c01b79039722778ab Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* FileDialog: tweak initial splitter positionsShawn Rutledge2014-09-041-3/+3
| | | | | | | | | | | | | | | | In Component.onCompleted, shortcutsView.model.count is undefined, so the height of the shortcuts area was dictated by its minimum. Further, the ListView removes delegates before they are completely "below the fold", so at a height of 2.5 rows, you see only two rows. The intention is to have the lowest item that you initially see be visually cut off, as a hint that there are more items. The sidebar was also too narrow by default on screens that have space for it, so the default width is increased (but as before, the user's preferred location for the splitter is saved to settings and restored each time). Change-Id: I74dc924254f0c87e6200c3fff6af900ff28b5b6a Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* FileDialog: ensure that arrow keys can always navigate the file listShawn Rutledge2014-08-081-0/+2
| | | | | | | | | | | By default the file list should be focused so that arrow keys can be used to select a file, and so that the list has a focused appearance. But even when the list does not have focus, the up/down arrow keys can still navigate the list because they are not accepted by any other controls in this dialog. Change-Id: Ie73bb187672cce86da0e5089d16a558af92414e9 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* FileDialog: handle back and esc keys to reject the dialogAndy Shaw2014-06-031-0/+12
| | | | | | | | | | When the dialog was open then pressing the Android back button would cause it to quit the application as it just went straight through. Task-number: QTBUG-39204 Change-Id: I69e5f39ab90a5c280ae4dbd1a498fb6f3d4dcf1e Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* FileDialog: update icon whenever the filename changesv5.3.0-rc1Shawn Rutledge2014-05-051-2/+1
| | | | | | | | | | | | | | view.model.get(styleData.row, "fileIsDir") is unreliable for some reason, but each filename usually changes when we go into a different directory. Maybe it could still fail if you navigate from a directory containing a directory, to another directory which has a file with exactly the same name in the same position. Since most files have extensions, this is unlikely... Task-number: QTBUG-38683 Change-Id: If080c4f1a7a01b20f6c468fcb06653e3c2314a1a Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Bump QtQuick.Controls import version to 1.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Idc0b93cbfc2fe23e8be3bcaece672d06555a81f6 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Import QtQuick 2.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Ifc9719ec6fbbd80b866c01eebc471d0ed121bd16 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QtQuick.Dialogs FileDialog: don't go astray into resources on AndroidShawn Rutledge2014-03-271-1/+1
| | | | | | | | Needed part of the same fix from QTBUG-36006. Task-number: QTBUG-37741 Change-Id: I3bfe518dfdd6027bdb932c612d01b0c8d1753dad Reviewed-by: Liang Qi <liang.qi@digia.com>
* FileDialog: centralize URL validation in setFolderShawn Rutledge2014-02-111-15/+24
| | | | | | | | | QQuickAbstractFileDialog::setFolder() takes care of the pathological cases so that the QML can be more straightforward. This is an alternate fix for QTBUG-36006 and some other navigation bugs. Change-Id: I7b6b6c8cb31d68e3971e39842ec63118854ecd6d Reviewed-by: Liang Qi <liang.qi@digia.com>
* FileDialog: new features in DefaultFileDialog.qmlShawn Rutledge2014-02-111-268/+288
| | | | | | | | | | | | | | Use a ComboBox for the filters. Add a sidebar showing shortcuts for the common paths and drives that the user will most likely need, and an editable list of favorite paths. [ChangeLog][QtQuickDialogs][FileDialog] The FileDialog fallback QML implementation now uses QtQuick.Controls, and has added features including a Combobox for file extension filters, and a sidebar with common paths, drives/volumes and favorite paths. Change-Id: I228ebdadcf338917db81a2b3d03d3c0b09584e7d Reviewed-by: Liang Qi <liang.qi@digia.com>
* QtQuick.Dialogs FileDialog: don't go astray into qrc:/ on AndroidShawn Rutledge2014-02-061-3/+12
| | | | | | | | | | Was due to string->URL conversion when setting FolderListModel.folder. Task-number: QTBUG-36006 Change-Id: Ia768d8a5473b3d4c22ef9be7c8b3cf28d3956f6f (cherry picked from qtdeclarative/cf2b04f6da6fb4d6a7da924a0796bfa8fda25398) Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* move QtQuick.Dialogs from qtdeclarative to qtquickcontrolsShawn Rutledge2014-01-031-0/+395
This will enable using Controls in the QML dialog implementations. For now, Controls are used only as drop-in replacements for the Button, Checkbox, and TextField which were custom implementations in the qtdeclarative module before. Change-Id: Ic79e9e8e5715a72ce51f4c724bfdfd33653300f2 Reviewed-by: Liang Qi <liang.qi@digia.com>