summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformdialoghelper.h
Commit message (Collapse)AuthorAgeFilesLines
* QFileDialogOptions: Expose default name filter setting.Friedemann Kleint2016-02-221-0/+5
| | | | | | | | | | | | | | | Move the bool QFileDialogPrivate::defaultFileTypes to QFileDialogOptions as defaultNameFilters and add a static function returning the translated default filter string. Let QFileDialogOptions::nameFilters() return the default filter until a value has been set. This removes the need for special handling for empty filter lists in the QPA plugins. As a side effect, Qt Quick Controls's FileDialog will then also default to "All files" if no filters have been set. Task-number: QTBUG-50644 Change-Id: I9ba271a472d4fa03767b540ef6f1399f5ca4408e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Register QPA Menu, Dialog & SysTray enums & flagsJ-P Nurmi2015-12-091-0/+17
| | | | | | | | | | This allows QML Menu, Dialog & SystemTrayIcon to use the same enums without having to duplicate them. Change-Id: I1401583d3ae2ef07cdc795d2765fba07c9b30f2f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Declare StandardButton & ButtonRole types for cross-thread use.Samuel Nevala2015-08-311-0/+5
| | | | | | | | | | On windows phone native dialog interaction is handled from XMAL thread. Declare and register dialog helpers StandardButton and ButtonRole for cross-thread usage. Change-Id: Ic1842a5af8a1122fdffb766b4f723d272bdbcac2 Task-Id: QTBUG-47941 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* QFileDialog: add setSupportedSchemes and pass it along to the QPA.David Faure2015-07-171-0/+3
| | | | | | | | | | | | | | | | This also finishes the implementation of the static methods which were being passed a supportedSchemes argument but weren't using it. Now they can pass it along to the QFileDialog instance, which then passes it to the helper used by the QPA implementation of the file dialog. The default implementation only supports local files and can therefore ignore this, but other implementations can use this argument to restrict the protocols allowed to the user. [ChangeLog][Widgets][QFileDialog] Add supportedSchemes property. Change-Id: I5235f70e785da1c06866a8355ef98f571890c4a2 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* OSX: show file dialog in showCocoaFilePanel, don't wait for exec()Shawn Rutledge2015-06-171-1/+0
| | | | | | | | | | | This reverts commit 21e6c7ae4745a76b676dfaa9fe17a2dd40fc0c5c because in QtQuick.Controls, we do not call exec(): we just set the dialog visible. If it is a sheet, then it is already acting as a modal dialog, basically. Task-number: QTBUG-46691 Change-Id: I7fe89f2a2ade0d4ddcf540c9bfc4f5963a077471 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Cocoa integration - implement Qt::WindowModal file dialogsTimur Pocheptsov2015-05-131-0/+1
| | | | | | | | | | | | Previously, for Qt::WindowModal dialogs we were creating modal sheet with beginSheetModalForWindow: and later (from exec) calling -runModal, essentially making a window modal dialog into (now) application modal sheet, which is not right- it's centered relative to desktop and the jump from window modal sheet's position (centered relative to a window) to application modal was quite visible. Now, instead of [panel runModal] (== [NSApp runModalForWindow:panel]) we call [NSApp runModalForWindow:theRequiredWindow]. Change-Id: I793dc72c7d1fe96497bb35754f4d0eac9a5e00e5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPlatformDialogHelper: change ButtonRole flags to ensure 32-bit sizeShawn Rutledge2014-02-171-3/+3
| | | | | | | | | | | | | | | | | | | | 0x80000000 is too big for a signed 32-bit int, so the compiler ends up choosing a 64-bit number. Then it will not be the same size as the parallel enum QDialogButtonBox::ButtonRole, which does not have these extra flags. By making EOL be the same as InvalidRole and changing Reverse to 0x40000000, we don't need to use 0x80000000 at all, so again the compiler can choose a 32-bit representation for both if appropriate. EOL is used as a terminator in the static const int buttonRoleLayouts table and therefore as a terminator in arrays returned from QPlatformDialogHelper::buttonLayout(). It's internal API so it's OK to change in a minor release, but QtQuick.Dialogs is also looking for the EOL now, so we should avoid changing it again if possible. This is mainly for efficiency and for avoiding surprise data type conversions when casting from one enum to the other. Change-Id: Ia7b7ce43c8f929d09dd999769e9b7114f695e9a4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Consolidate StandardButton, ButtonRole and related static functionsShawn Rutledge2014-02-151-49/+71
| | | | | | | | | | Moving them into QPlatformDialogHelper for the convenience of both widgets and QtQuick.Dialogs. The main reason is to ensure that QtQuick.Dialogs does not need to depend on the widgets module, in order to re-implement the button box concept in a generic dialog. Change-Id: If400d215338d7cb6dade39d9de60e50b5e7515ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove disused version of QPlatformMessageDialogHelper::clicked signalShawn Rutledge2013-11-081-1/+0
| | | | | | | | It has been replaced with a version that sends both the button and the role. Change-Id: I47156288bf2039cfdfd4cf09f75563347bfb4141 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Dialogs: provide the StandardButton->ButtonRole mapping in QPAShawn Rutledge2013-11-071-1/+19
| | | | | | | | | | | | | As the QPlatformMessageDialogHelper will be implemented repeatedly, it's useful to have this mapping in one place for reuse. Also, since we do not guarantee that either accepted() or rejected() will be emitted for every possible button on a QtQuick MessageDialog, it's useful for the QtQuick.Dialogs module to have access to this mapping to interpret individual button presses and emit the role-specific signals such as yes(), apply(), help(), etc. Change-Id: I7be753080794adabb784df9b95ac04aa1c29151c Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Adding QPlatformMessageDialogHelper and QMessageDialogOptionsShawn Rutledge2013-09-131-0/+81
| | | | | | | | | | | | | | We plan to add support for native message/alert dialogs on Android and iOS because it's otherwise impossible to have a true popup window. Then we might as well have native message/alert dialogs on other platforms too. It will become an alternative implementation behind QMessageBox and perhaps QErrorMessage. Task-number: QTBUG-30883 Task-number: QTBUG-29462 Change-Id: I73dcfc6438e696189b6d37091874c7ad69b4ec68 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* QFileDialog: add MIME Type filtersDavid Faure2013-08-291-0/+3
| | | | | | | | | | | | | | Currently just a convenience method for setNameFilters(), it uses QMimeType to create a name filter from the glob patterns and description defined in each MIME type. In the longer term, this API could be used to do proper mimetype-based filtering using QMimeDatabase::mimeTypeForFile() in the builtin QFileDialog (aka "not native"), instead of only looking at globs via the name filters. Change-Id: I0edccf5f30c514481b47cd100d743d1ed7a24024 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Move SnapToDefaultButton from QPlatformDialogHelper to QPlatformThemeAndy Shaw2013-08-231-1/+0
| | | | | | | | | | | Since QPlatformTheme covers all dialogs whereas QPlatformDialogHelper is really only for the native dialogs then the SnapToDefaultButton hint is moved as it has relevance for all dialogs Task-number: QTBUG-32631 Change-Id: I1dce0bb4abcd4cfd39c4a199a33fc7078176ab4b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Have QFileDialog use QUrl internallyKevin Ottens2013-07-181-12/+15
| | | | | | | | | | | | When using the native dialog and through the helper, we use QUrl in QFileDialog. It is preparatory work for having QUrl based methods on QFileDialog interface itself. Done-with: sean.harmer@kdab.com Done-with: faure@kde.org Change-Id: I61e99d498252241f38ec05724702a90ba050c4bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Allow to filter the type of fonts displayedKevin Ottens2013-05-131-1/+5
| | | | | | | | | | QFontComboBox had convenient filtering options but somehow not QFontDialog, so provide the same type of flags and a similar behavior. Change-Id: Ia8efabc60ae795673c772ff8ed63fd49244a5bb9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Windows: Introduce QFileDialog::DontUseCustomDirectoryIconsSérgio Martins2013-05-091-7/+8
| | | | | | | | | | | | | | | Folders can have a custom icon, set by the user. Some system folders also have one, for example c:\windows\fonts. This option allows you to disable this behavior, you'll get the folder directory icon. As a side-effect, you'll get a very big performance improvement on removable/network media: 2 seconds vs 60 seconds on a SDCard with 10000 folders. Change-Id: Id55ea628186e0a6523585ec7a4ff622d6f5da505 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QtGui: declare some classes as sharedMarc Mutz2012-07-101-0/+6
| | | | | Change-Id: I0ebb0ca8b8edcecc939021407d1755693f97e553 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtGui: add member-swap to shared classesMarc Mutz2012-07-031-0/+6
| | | | | | | Implemented as in other shared classes (e.g. QPen). Change-Id: I5b96d4a4795870d6252aa53de6fbaedde7c0095a Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QPA: Refactor QFileDialogPrivate::qt_clean_filter_list for QPASean Harmer2012-05-241-0/+3
| | | | | | | | | | Allows QFileDialog and QPA plugins to access this helper function. Needed by the Cocoa and QNX plugins. This commit fixes up the Cocoa plugin. The QNX support will be in a follow-up commit. Change-Id: I8dd08a9f3dc27d85edd0dc9dad9629406c1e677a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* qpa api: replace QPA headers with something more benignGirish Ramakrishnan2012-05-221-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current 'we mean it' headers are considered too aggressive for QPA. Replaced using the following script. for file in `find -type f -name "qplatform*.h" -and -not -name "*_p.h"`; do LINE_NO_1=`grep -n -m 1 "W A R N I N G" $file | awk -F ':' '{print $1}'` LINE_NO_2=`grep -n -m 1 "We mean it." $file | awk -F ':' '{print $1}'` if [ -z "$LINE_NO_1" ]; then LINE_NO_1=`grep -n -m 1 "#define " $file | awk -F ':' '{print $1}'` LINE_NO_2=$((1+$LINE_NO_1)) else LINE_NO_1=$(($LINE_NO_1-2)) LINE_NO_2=$(($LINE_NO_2+2)) fi head -n $LINE_NO_1 $file > $file.new cat >> $file.new <<EOF // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // EOF tail -n +$LINE_NO_2 $file >> $file.new mv $file.new $file done Change-Id: I8a974c9bf8942647b7ad950afb372c1f738aa725 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa: Remove QPlatformDialogHelper::deleteNativeDialog()Bradley T. Hughes2012-05-101-3/+0
| | | | | | | | | | | | | | | | This function isn't really needed. The QDialogPrivate destructor deletes the platform helper, so the QDialog destructor does not need to do it. Subclasses of QPlatformDialogHelper are now responsible for deleting any native resources they create. The one place in QFileDialog that needs to recreate the native dialog can simply recreate the helper. QDialogPrivate::deleteNativeDialog() now becomes QDialogPrivate::deletePlatformHelper(), which resets all state to allow the platform helper to be recreated. Change-Id: I58adfe8801e02e63b3cb4a9a3a0b8cb5b3c7b161 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qpa: Clean up QPlatformDialogHelper APIBradley T. Hughes2012-05-101-15/+15
| | | | | | | | | | Remove the _sys suffix from all members of QPlatformDialogHelper and its subclasses. The QPlatform* class prefix already implies that these methods are system specific, we don't need the method suffix as well. Change-Id: I5ad1f928fab3a989992951acc244915e7fa48d32 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QPA: Cleanup native dialog modal executionBradley T. Hughes2012-05-091-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the _q_platformRunNativeAppModalPanel() function, together with the launchNativeAppModalPanel() signal and emitLaunchNativeAppModalPanel() slot, which were previously used to run the modal loop inside the QDialog::exec() loop. This trick isn't necessary anymore, so remove the mechanism and code related to it. Rename QPlatformDialogHelper::platformNativeDialogModalHelp() to exec_sys(). This function is now responsible for both showing the native dialog and running the modal loop. QDialog:exec() now calls this function if a native dialog is in use (it does not call QEventLoop::exec() anymore). The dialogResultCode_sys() function was unused, so it has also been removed. This commit also removes some unused private slots that were left over from the port to QPA. Note that the comments in the Cocoa plugin are still valid and relevant, but this commit does not fix the scenarios mentioned. This will be done in a future commit. The Windows plugin needs minor changes. The QueuedConnections to accept() and reject() cause the deliver to come too late, resulting in crashes, hence the change to AutoConnection (which ends up being a DirectConnection). Change-Id: Ifc90325c945ca78737e60bf331929f03ecc52e0a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-0/+320
The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>