summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/scriptengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CLI: Exit when expecting user input and the output device is not a TTYArttu Tarkiainen2021-02-041-1/+8
| | | | | | | | | | - For arbitrary text input queries, fail and exit. - For file/directory queries, fail and exit. - For message boxes, default to negative option and exit if necessary. Task-number: QTIFW-1949 Change-Id: Iaf8a07247a0e358d4544a856788e48447c6720d9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix translating from component scriptKatja Marttila2021-01-141-6/+1
| | | | | | | | | Translate using QCoreApplication::translate instead of QObject::tr. Removed the use of obsolete installTranslatorFunctions() function. Task-number: QTIFW-392 Change-Id: Icdd67efb6889acd26d63297fb89945c3431c881c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix loading controller script with comment on last lineMartin Kampas2020-11-041-1/+1
| | | | | | | Task-number: QTIFW-1062 Change-Id: I3deb46cae74d1e5851d4ddd4b58c0ba19375ddbd Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Remove internal classes and structs from generated documentationArttu Tarkiainen2020-09-211-0/+24
| | | | | | | | | | After migration to using 5.12.7 based qdoc, the generated documentation contains also empty declarations for members of undocumented internal classes. Mark them internal as needed. Task-number: QTIFW-1483 Change-Id: Iad40e4efdd098f09a825ce1c8d0aafcc76bd83bf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Fix documentation warningsTopi Reinio2020-09-161-1/+1
| | | | | | | | | These changes fix many of the documentation warnings when building with a recent version of (Clang-integrated) QDoc. Change-Id: I5714635a25707cd7ab7bec209fa043a95f0b9832 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add function to enable button click with objectnameKatja Marttila2020-06-041-0/+10
| | | | | | Task-number: QTIFW-1707 Change-Id: I8574ef96df6a00e577549342d4a4336207dcd9ec Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: Add new option --file-query to auto answer QFileDialogKatja Marttila2020-05-261-2/+67
| | | | | | | | | | | | | QFileDialog.getExistingDirectory and QFileDialog.getOpenFileName can be called from scipt. If command line interface is used, user must type the correct directory or file name from command line during install. With --file-query option user can give the values when running the installer or maintenancetool with syntax --file-query filedialogId=C:/temp,filedialogId2=C:/temp/file.txt. Task-number: QTIFW-1631 Change-Id: I5e58be6b509cf00de832646ef31ec4eda90773be Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Replace 0 with nullptrKatja Marttila2019-01-091-1/+1
| | | | | | | Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-09-171-1/+10
|\ | | | | | | Change-Id: I77d539e079f3c7d61c4a965b222f4e02c35b1108
| * Prepend file:// on Windows when calling QJSEngine::evaluate()Andy Shaw2018-09-101-1/+10
| | | | | | | | | | | | | | | | | | | | Due to a bug reported at QTBUG-70425, it is necessary to ensure that QJSEngine will see the filename passed in as a valid URL. So we prepend file:// for those cases to ensure qsTr() will find the right context when looking for translations. Change-Id: Ib38b1f8467de78ec82c2c6c6909487f3a06c09bb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Add findFiles methodKatja Marttila2018-03-261-1/+23
|/ | | | | | | Task-number: QTIFW-1094 Change-Id: Ibc37e9b568f7f54e37f6ed6a5b040940cab5aebd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add line number information when throwing an Error regarding the scriptAndy Shaw2018-01-241-2/+3
| | | | | Change-Id: I5bc3ca4779ed12d927c3a6a041a81d8e39d5bd1f Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Introduced gui.setTextItems() methodFrerich Raabe2016-06-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This utility function can be used to populate a Qt control which is backed by some QAbstractItemModel with a list of strings. E.g. this can be used to populate a QComboBox or any QAbstractItemView with some items. This is very useful since in many cases, the methods for adding elements to such controls are neither slots, nor marked with Q_INVOKABLE and such unreachable from the script code. Change-Id: I2195f41e53765ef3a798477ed08d8f09ab5c4379 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | | | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* | add silent modeChristoph Vogtländer2015-07-171-0/+9
| | | | | | | | | | | | | | | | | | | | Add possibility to run silently without a gui. Silent mode can be enabled in a controller script using gui.setSilent(true). Change-Id: I5c5d0cc2be734e8e447edfe4e71106fe08f87188 Task-number: QTIFW-166 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Unify translated error messagesKai Koehne2015-06-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | * Enclose file paths in "" * Localize file paths with QDir::toNativeSeparators. * Make sure sentences end with a '.' * Append error details always by ':', e.g. tr("Failed to copy file '%1': %2").(...) * Use 'directory' instead of 'folder' everywhere Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Convert to Qt 5 connect syntaxKai Koehne2015-06-151-1/+1
|/ | | | | | | | | | | | Convert to new signal/slot syntax where it does not make things more complicated: connections where the signal or slot is an overloaded method, or where the receiver method is not in a QObject, are left alone. The new syntax allows compile-time checking of the connection. Change-Id: I2cc3c93b9812797bd67f64a8728569491eeec668 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Doc: add docs for ScriptEngine::newArrayLeena Miettinen2015-05-271-0/+4
| | | | | Change-Id: I69462de7442612c35634cead37572db387031c3e Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* fix empty installer.components arrayChristoph Vogtländer2015-03-131-10/+21
| | | | | | | | | | Make sure the current list of components is used when referencing installer.components in a controller script. Change-Id: I9468110d61a958f13edba66da0059d6622aa7037 Task-number: QTIFW-601 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Doc: move ScriptEngine scripting docs to separate filesLeena Miettinen2015-03-061-313/+0
| | | | | Change-Id: Iac1c810cf52fb4a480ebde956d62830af97b6f8c Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: add docs for ScriptEngine methodsLeena Miettinen2015-02-251-3/+17
| | | | | | | Fix the formatting of a list. Change-Id: I93bcd369f5e685fecacab632b801084199b06d4b Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: fix language and QDoc command issuesLeena Miettinen2015-02-121-2/+2
| | | | | | | | To follow the Qt documentation guidelines. Change-Id: I8f533737b39d7d58645a05b033fc966f70918369 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Doc: add docs for arguments and return valuesLeena Miettinen2015-01-301-3/+4
| | | | | | | | To get rid of QDoc errors. Change-Id: I4932f1f3ff5fab87eebf24536d63be550582b195 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Doc: add docs for QDesktopServices JavaScript objectLeena Miettinen2015-01-281-3/+32
| | | | | | | | | Based on Qt 5 documentation for QDesktopServices. Change-Id: Ib1a42505b1c046b5175aae0a76f3c71d58c0e86f Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make sure component wrapper is not deleted in advanceKai Koehne2015-01-281-1/+11
| | | | | | | | | | Use ScriptEngine::newQObject instead of the stock QScriptEngine one. This one (among other things) sets object ownership to Cpp, preventing dubious "cannot call name on undefined" script failures if the garbage collector runs. Change-Id: Ib3275012d307533c13de3520f4630d1eeee66869 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: Add docs for QInstaller JavaScript objectLeena Miettinen2015-01-231-19/+38
| | | | | Change-Id: Ied88c365fdbd1cb7fe07d4ed196e7b568f6e892c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Doc: add docs for QFileDialog JavaScript objectLeena Miettinen2015-01-221-0/+32
| | | | | | | | Based on Qt reference docs for QFileDialog. Change-Id: Ic56fd5a48b290608f7810bc8f9260367389c5896 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: add docs for the gui JavaScript objectLeena Miettinen2015-01-221-0/+12
| | | | | | | | Based on the example code in the Manual. Change-Id: I4b933fe49768fe296c89d715ea5aef30b6e3430b Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: add docs for the console JavaScript objectLeena Miettinen2015-01-211-0/+19
| | | | | | | Change-Id: I0560178f9a1fbd60fa4a5f7c25706b2c826ecd14 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Doc: add docs for buttons JavaScript objectLeena Miettinen2015-01-131-11/+26
| | | | | | | | | Based on Qt 5 QWizard documentation. Change-Id: Ic61ed428d1513fc21131992b1b40bf63a93b4fd2 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Doc: remove "type" from briefs in Scripting APILeena Miettinen2015-01-131-2/+2
| | | | | | | | These are not QML types, but JavaScript objects. Change-Id: Ib50656c764270a1184c74a2c653438a2f42846fd Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Fix objects returned by gui methodsKai Koehne2015-01-081-9/+146
| | | | | | | | | | | | | We need to make sure objects like pageWidgetByObjectName are augmented too (so that one can access child objects). This is achieved by a proxy object that augments all raw QObject * and QWidget * return values. This fixes e.g. the dynamicpage example. Task-number: QTIFW-605 Change-Id: If26dc59220946a7445ef0f9ec7caa15e5b04eaa8 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Simplify registration of objects into script engineKai Koehne2015-01-071-29/+36
| | | | | | | | | | | | Rename addQObjectChildren, removeQObjectChildren methods to addToGlobalObject, removeToGlobalObject, and merge the augmentation of the properties with newQObject. Also, don't recursively register all objects with their objectNames in the global scope. This avoids name pollution. Change-Id: I28f1bc67e6febecc7b5142982c918432b61ed96f Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Expose findChild, findChildren methods to JSKai Koehne2014-12-101-0/+31
| | | | | | | | Re-add the findChild, findChildren methods known from Qt Script. Change-Id: I3db6be53ccd89a09b2c7de14ba7f96ebb26dbdbb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Expose systemInfo APIKai Koehne2014-12-051-0/+3
| | | | | | | | | Add systemInfo as a wrapper for QSystemInfo. Task-number: QTIFW-592 Change-Id: Ib54fcea8b0ef3a397a74f5315202f3000abd63cd Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Set the object ownership -before- adding the widget as property.kh12014-11-171-0/+1
| | | | | Change-Id: I0af2c4ae71bcf89466826024b8a2af4584d805be Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make sure to remove all objects from script engine.kh12014-10-301-0/+14
| | | | | | Change-Id: I5dedd63bad3eb37b55a3cc246b3c74ba58396b32 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix regression after porting to QJSEngine.kh12014-10-301-0/+1
| | | | | | | | | | | | Setting a dynamic property of a dynamic page from JS doesn't have any effect anymore, as the properties are not synced. Now we define the property directly on the JavaScript object and connect it to corresponding C++ page with static Qt properties. Task-number: QTIFW-562 Change-Id: If95222a94ebee7f8bb455792eab96c5e9bc19b86 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Some more documentation fixes (removes more warnings).kh12014-10-151-6/+6
| | | | | Change-Id: I1efb7f98ac4cccdc4dbd1784806cce286654af9f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Fix c++ documentation creation. Add, fix inline documentation.kh12014-10-081-2/+201
| | | | | | Change-Id: Idd6805afbf5736eebf03c2d1ca6dae272c519634 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* Rewrite the component getter mess, remove superfluous methods.kh12014-10-061-4/+4
| | | | | | | | Now we can combine some enum values to achieve the same as before with the several getter functions, removes the clutter from the API. Change-Id: I6368b0ff77821ac95d1defaec4af27dd7d383396 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Expose qsTr to the scripts, makes component error example work.kh12014-06-061-1/+6
| | | | | Change-Id: I73be2490182af8582b3e56b177e8ca26c950fa97 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Set the right ownership for the components we expose.kh12014-06-061-2/+5
| | | | | | | | Make sure we set the component ownership to c++, by default the script engine would take it and delete the component... Change-Id: If4ea905495566954ff804b636934c33eb118ccf3 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Replace script with js engine.kh12014-06-031-261/+167
| | | | | Change-Id: Ic9c88e27dca1e936ba09a3776df3df7ec166c606 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Cleanup to support Qt5 only.kh12014-06-021-27/+0
| | | | | Change-Id: Ib8f61229ce2f07e52c22a15e10dc817aca860ead Reviewed-by: Niels Weber <niels.weber@digia.com>