22 Commits

Author SHA1 Message Date
Iikka Eklund
6ba58b42ab Update license headers
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>
2015-12-29 07:31:11 +00:00
Karsten Heimrich
eb574d77b0 Use QQmlV4Function to correctly get empty parameters from script.
By using QQmlV4Function to get the parameters, empty strings passed
are correctly kept as empty and not null.

Task-number: QTIFW-724
Change-Id: I592e2230e574ba82e765bd0079964db29452b2e9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-11-26 07:04:11 +00:00
Christoph Vogtländer
17e29fc8d3 fix empty installer.components array
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>
2015-03-13 10:16:51 +00:00
Kai Koehne
99996591e0 Update Copyright
Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-02-18 10:33:48 +00:00
Kai Koehne
aa0e97f08a Fix testBrokenJSMethodConnect autotest
Since qtdeclarative change e2c1e7b8a exceptions in JS slots do _not_ set
the engine to an error state anymore, but are rather printed to console,
and ignored. This prevents exceptions to silently propagate ...

Change-Id: Icb065314730cf2142eedbde14b0c77c21bdd6f6f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-01-30 07:28:43 +00:00
jkobus
838f328496 Fix the invocation order of entering() and page callback
Task-number: QTIFW-620
Change-Id: I1a40aae35dc1c259a96043a1056aa631bf7279b2
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-01-27 13:52:14 +00:00
Kai Koehne
36a9594bce Make sure widgets from .ui files are properly registered to engine
Make the QWidget representing a UI file known to the engine, so that
e.g. child objects can be always accessed :

   component.userInterface("RegisterFileCheckBoxForm").RegisterFileCheckBox.checked;

This worked reliably only if the .ui file has been shown to the user,
which might not always been the case.

Change-Id: I7a87773e29f6210ab7160d8e33c41f6ebeeb82d6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-01-20 16:09:57 +01:00
Kai Koehne
f87efd7c14 Fix objects returned by gui methods
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>
2015-01-08 08:59:06 +01:00
Kai Koehne
8d86c06aef Simplify registration of objects into script engine
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>
2015-01-07 16:17:33 +01:00
Kai Koehne
71c248e270 Expose findChild, findChildren methods to JS
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>
2014-12-10 09:44:27 +01:00
Kai Koehne
de748023e5 Expose systemInfo API
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>
2014-12-05 14:02:38 +01:00
jkobus
79964b1ee5 Remove unused code.
Dead since commit 5359d0a3e8d84699701e73d3d15163fb20200bb0

Change-Id: I40af485876d70a6a68406eafe14258b185e16323
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2014-12-03 16:04:23 +01:00
kh1
76cb03cb60 Fix regression after porting to QJSEngine.
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>
2014-10-30 14:54:05 +01:00
kh1
d7e202fbd6 Add check for expected default properties.
Change-Id: I315c958bbc3cbc45452db4787ef3ab27750ebbaa
Reviewed-by: Niels Weber <niels.weber@digia.com>
2014-10-30 13:40:39 +01:00
kh1
00c6f94d1d Add test for default script engine properties.
Change-Id: Id07a6ffd193e032439d008878d6526806ef24c9f
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-03 10:52:01 +02:00
kh1
8addcf763b Replace script with js engine.
Change-Id: Ic9c88e27dca1e936ba09a3776df3df7ec166c606
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-06-03 10:51:51 +02:00
Tim Jenssen
016cdad413 Restart on the wizard needs to cleanup component left-overs
- use two different script engine instances
    - one which lives from the beginning -> the controlScriptEngine
    - the other one which will be reset if there are some new repositories
      loaded
  - now the core has a pointer to the gui object, but it should only be
    used by the script engine so a QObject type should be enough
  - engines are deleted as QObject children from the PackageManagerCore
  - registered downloaded archives are removed

Change-Id: I60a4a32fb2e409059839ec11b10c57357454f57a
Reviewed-by: Michal Klocek <michal.klocek@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-11-06 16:51:35 +01:00
Tim Jenssen
7a5aa97c9b remove slotCurrentPageChanged and call it directly
- also renamed it to better name: executeControlScript

Change-Id: Id2bb7cada2386561c2b25b158c6aa101382e5cc4
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-09-30 10:49:48 +02:00
Tim Jenssen
dfbb731676 add exceptionhandler code for connected signals/JS methods
- there wasn't any error information if a C++ triggered signal resulted
   in a JS method which has an error, now it will create an exception for it
 - creating messagebox inside the lib is something what we want to avoid,
   so the developer itself is responsible to catch these exceptions
 - most cases of the installer code does that already

Change-Id: I07486f73be9de13a486de235f14e3a7d7b54f5b1
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-06-03 16:35:28 +02:00
Tim Jenssen
802fe64d72 fix crash in scriptengine autotest
- destructor deletes components, so there was a double deletion

Change-Id: I5c4f14bb3b964297be542821d10a7ebb27925af5
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-05-22 18:14:00 +02:00
Tim Jenssen
37e436add7 fix scriptengine autotest
- since we are using one scriptengine the component needs to be
   registered on the packagemangercore to load the script

Change-Id: I931b75e8d68328c2317dd4a55ab9cc298229caba
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-05-22 17:45:05 +02:00
Tim Jenssen
06449248ab introduce installerscriptengine
- it uses one scriptengine for everything and adds the components
   or/and the install-controller in javascript closure contexts
 - added the gui object to the component script context
 - removed tabController from controlscript context

Change-Id: I3bd6c5dcf470666c30add1b7d04a8fdd094f5f11
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
2013-05-16 16:12:52 +02:00