Commit Graph

163 Commits

Author SHA1 Message Date
Alessandro Portale
b5ffff28ce Android: Make OpenSSL clone progress dialog application-modal
We need to hold the user off from doing funky stuff while cloning, like
for example from pressing the clone button multiple times in a row.

Change-Id: Ib20218e0b0fa28852412da2b71ec5ba410d682e8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-25 11:11:04 +00:00
Alessandro Portale
143ff3e126 Android: Trigger PathChooser validation after OpenSSL cloning
In case the path was non-existent before the cloning, it should not be
"red" anymore after cloning.

Change-Id: If33cfbd07710e317505a9fe1e4b3b9f19a10d5db
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-25 11:10:08 +00:00
Assam Boudjelthia
998c07dcbe Android: handle more potential fails for when cloning
Fixes: QTCREATORBUG-24200
Change-Id: I3f54f0610a70654c3711e7dc3bfd5f22863b2cd2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-25 11:09:36 +00:00
Assam Boudjelthia
a927c320f7 Android: fix sdkmanager detached from AndroidSettingsWidget
This was caused by 7419e09d0f.

Change-Id: I423047d353698798c712f9a32603e955ae1ee15c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-06-22 14:12:17 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
Assam Boudjelthia
759b38e2ac Android: don't delete the openssl dir when cloning
Avoid removing the openssl dir if the selected path already exist
and is not empty, rather just recommend selecting a different path
or empty the provided one.

Fixes: QTCREATORBUG-24173
Change-Id: I1e501b361d4917a59a5720146b11580e79ac32aa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-15 07:58:23 +00:00
hjk
4c2e76385c Android: Settings widget code shuffling and cosmetics
Avoid a few casts, consts, #include

Change-Id: I803d0b728ce6f7502893d07679f638c2504629e3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-20 11:24:22 +00:00
hjk
7419e09d0f Android: Settings widget code cosmetics
unnecessary indirections, const, namespaces, ...

Change-Id: I7955a81eafdce3fbb14646a57ce8436b00045278
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-20 10:03:24 +00:00
hjk
1b3920452a Android: Use Utils::ListModel for AvdModel
Change-Id: Iebbe137658288e60954bc63a97ddda948736fb09
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-20 07:52:36 +00:00
hjk
3a8bedf60b Android: Fix AvdModel::indexForAvdName
This was using serialNumber instead of avdname, whereas the
reverse function avdName() actually used avdname.

Change-Id: Ieb91f97323f2adcf9306c90c91b145e494f177c0
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-20 07:52:28 +00:00
Eike Ziller
ad9e4cd2f6 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/android/androidconfigurations.cpp
	src/plugins/qtsupport/qtoptionspage.cpp

Change-Id: I91ee3e771ab630ac3a54be53ac4be6d3c1c46950
2020-04-20 08:40:54 +02:00
BogDan Vatra
fdb0cf0f6b Update openSslPath when we change the android sdk path
Change-Id: I39bd02d4f5bba8d03d4606b0de89b50778c7aa01
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-04-17 13:04:38 +00:00
Eike Ziller
602d690bab Merge remote-tracking branch 'origin/4.12'
Change-Id: Ie35e9959693b6f6f78509eea5b259d6493ef87f2
2020-04-17 08:09:55 +02:00
Assam Boudjelthia
2d4a2d19ae Android: fix potentiallyy big clone of android_openssl with --depth=1
Change-Id: I839221ee7a3fe8c1dec90d010ecbb492517fcba1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-04-15 08:18:09 +00:00
hjk
e86a2bfdd2 Android: Simplify some PathChooser accesses
Change-Id: I270e7f662a2c148252e1b70166a784af8d0e0933
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-14 07:02:07 +00:00
hjk
68c539bb9d Utils: Replace FileChooser::path() by filePath().toString()
Keep the old method for now to ease downstream porting.

The change is kept mechanical, there's a lot of cleanup possible now
on the user code side.

Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-09 17:45:06 +00:00
hjk
79b680e7f0 Utils: Rename PathChooser::{f,setF}ileName() to {f,setF}ilePath()
It's returning a FilePath, so it's a better fit.

Keep the old versions as inline function now to ease downstream migration.

Change-Id: I535887928018f42b92895c8b0c82527f0d55e5ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-04-09 17:30:23 +00:00
Assam Boudjelthia
8009962584 Android: remove automatic sdk setup ambiguity
Use label text instead of icon for Auto SDK download button.

Fixes: QTCREATORBUG-23774
Change-Id: I5f10bafb0cdf88210f7121504778885291169e07
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-02 09:12:32 +00:00
Eike Ziller
9a149e295b Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/tools/qml2puppet/CMakeLists.txt

Change-Id: Id6243b0f725a68075d789bf35e771113b742645b
2020-03-30 17:27:55 +02:00
Oliver Wolff
faad83d5a3 Android: Make sure that to be accepted licenses are visible to the user
If Qt Creator is not run in fullscreen or the user's resolution is too
small it is possible, that the licenses which have to be accepted are not
visible when the according message box is shown.

In these cases we scroll down to the SDK manager so that it's obvious that
the licenses have to be accepted there and no additional message box will
be shown.

Task-number: QTBUG-79664
Change-Id: Ic24bd8c4457a43011b4035b659063dd45b321bcc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-28 09:25:07 +00:00
Oliver Wolff
a4be1e8b66 Android: Check for usable JDK version in settings
sdkmanager only works with version 8 of JDK specifically. We should warn
the user if a different version is used.

Task-number: QTBUG-79664
Change-Id: I5be8d068e4ec119453654adda1a684dc65b4c631
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-03-27 08:55:45 +00:00
Eike Ziller
bac32dc740 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/coreplugin/dialogs/shortcutsettings.cpp

Change-Id: I1f21845350bb69268ca51bc77167a8244adce22a
2020-03-26 15:26:27 +01:00
Oliver Wolff
b04391619b Android: Fix download link for JDK
sdkmanager only works correctly with JDK 8, so we should not point to the
latest JDK release, but specifically that one.

Task-number: QTBUG-79664
Change-Id: I29dc2d26d41eed96c1abc03907ee835d70b9553b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-26 07:33:46 +00:00
Robert Loehning
08e5e84c9d Android: Remove pointless line break
Change-Id: I3f8d94cb637c279d7549c819a03233cc8d4aff87
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-25 09:44:51 +00:00
Assam Boudjelthia
41dd8dc8ef Android: read SDK configuration from user editable path
By default, copy the sdk_definitions.json to Qt Creator user resource
path. The user can use that to make any updates if desired.

Add SdkDownloader instance as a member of AndroidSettingsWidget.

Change-Id: Ieabc9c6ddecbe63586f750b26bcf4ca990caee26
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-18 10:53:15 +00:00
Robert Loehning
d1daf6a542 Android: Add missing space
Change-Id: I061c91c9f48579179591dc912ab3bd48c13af0b0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-18 10:30:05 +00:00
Assam Boudjelthia
c03cc13bba Android: fix OpenSSL download minor wrong condition
Silent bool should be reversed.

Change-Id: I2b8506eb7af95dc51fab8e911c548dac766ce090
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-17 06:33:32 +00:00
Assam Boudjelthia
e857b02579 Android: rephrase some bad UI text sentences
Change-Id: If563b0778ceafcaeceb13f697d273c69f484929b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-16 12:08:42 +00:00
Assam Boudjelthia
7fd0f30776 Android: use QListWidget to show defined NDKs
Use QListWidget to show all installed NDKs (from SDK manager), and NDKs
Added manually by the user. Each item has an icon to indicate if it's
removable when added by the user, or non-removable if installed from the
SDK manager.

Change-Id: I26ae5909ce930d5cc8af561b6b4e9cc5415d12f1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-16 08:21:22 +00:00
Assam Boudjelthia
be8cdeafd6 Android: Allow adding OpenSSL libs directly from project settings
This serves as a convenience addition to allow users to directly
include OpenSSL prebuilt libs for Android. The path of the OpenSSL
would be defined once in the Android options page, and always used
to include the libs when needed by the user.

How this works:
1- A download button is provided, it first tries to automatically
git clone the OpenSSL repo to the defined path. If the cloning fails,
the repo URL is opened externally for maunual download.

2- If SDK tools auto download is used (like for first time setup),
the OpenSSL download will start after SDK eseentials are installed.

3- Once the libs path is set, it can be used by AndroidBuildApkWidget
to include() function to the project (qmake/cmake). It also, should
detect if the include() part already exists in the project file.

Task-number: QTBUG-80625
Change-Id: I338e916f03f4ff55db25a118f1ea08f1da5dd103
Reviewed-by: hjk <hjk@qt.io>
2020-03-12 12:09:54 +00:00
Assam Boudjelthia
3f61e9a391 Android: Allow adding custom NDKs and auto detect their toolchains
This adds the option for the user to add a custom NDK out of the
predefined list installed from SDK manager. Once an NDK is added and
settings saved, both the toolchains and debuggers will be detected
automatically. The user then can create a custom kit with those added
toolchains and debuggers.

Task-number: QTCREATORBUG-23286
Change-Id: I46200accca6fc956b73f211213bfe2a495093934
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-28 19:19:12 +00:00
Assam Boudjelthia
351f39fb3b Android: fix sdkmanager duplicating packages list
It seems that forcing sdkmanager reloadPackages is causing a duplication
in all packages and ndk listings.

Change-Id: I7e92d1c6dcec2a09db088d9596aca31a3d8b437f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-28 11:42:28 +00:00
Assam Boudjelthia
37ff19c002 Android: update UI after downloadSdk() is done
Make sure the UI ticks are updated directly after SDK Tools package
is downloaded.

Change-Id: If1d94c624dcbc5be14246f61b197d849438d19e5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-20 17:55:53 +00:00
Assam Boudjelthia
2191bcea36 Android: avoid calling m_sdkManager->reloadPackages() twice
AndroidSettingsWidget::onSdkPathChanged() is being called then
m_sdkManager->reloadPackages(true) after it at start, that's not
necessary.

Change-Id: I6171e8a5fb765fa26aecb505ca50231c3e609b74
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-20 17:55:32 +00:00
Assam Boudjelthia
0a8d675c66 Android: fix Android options page blocking behavior
The change 286266 was causing an unwanted modal dialog upon entering
Options > Devices page, this fixes that.
Also, this fixes the synchronous SDK and AVD list reloading that was
causing some hang time upon opening Devices page.

Fixes: QTCREATORBUG-23581
Change-Id: I1a55aaadb873c77612aced1c687cc5a0ded3441d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-20 08:40:38 +00:00
Assam Boudjelthia
67df868f5c Android: Automatically use the correct NDK for each Qt version
Based on change 286266, we can find a correct NDK version for Qt for
Andriod version. This change allows Android plugin to get relevant NDK
information and registers appropriate toolchains and kits settings.

[ChangeLog][Android] Automatically use correct NDK version
corresponding to used Qt version.

Task-number: QTCREATORBUG-23583
Change-Id: Ic6b0d7a1ae8962c075b77498de88e018a008ac3e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-17 16:14:50 +00:00
Alessandro Portale
4960b2ac2a Android: Use FilePath::fromUserInput for user input
... or when reading non-Qt config files. FilePath::fromString would make
FilePath keep native dir delimiters, which would cause wrong negatives
for example in FilePath::isChildOf().

This change here fixes that AndroidToolChain:::isValid incorrectly
returned true.

Change-Id: I28b321fe3c4064f61b78dc7fc36b8af3d18b806c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-02-17 13:29:58 +00:00
Assam Boudjelthia
f46099d21e Android: Automatically download SDK tools and essential packages
Automatically download Android SDK Tools to default path
used by Android Studio, then essential packages will be installed
using the sdkmanager tool. Automatic installation can also be
triggered by an added button in the settings page.

Essentials packages include NDK Bundle and other NDK versions
required by previous Qt versions.

An sdk_definitions.json file holds download paths for SDK Tools,
and other (Qt version <-> essential packages) combinations.

[ChangeLog][Android] Automatically download SDK Tools, NDKs and
all essential packages for Android builds.

Task-number: QTCREATORBUG-23285
Change-Id: I90e7aafecd017d2bdc959e403711d9d440a6bbb2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-07 18:21:30 +00:00
Assam Boudjelthia
0a8588829f Android: detect JDK path automatically
Try to detect the install JDK path automatically.

Task-number: QTCREATORBUG-23407
Change-Id: Ie23aec9260d54f58b0284ed4a26b17b03d8ed87c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-01-17 12:11:16 +00:00
hjk
46cb07e5d5 Android: Minor simplification for settings widget
Change-Id: Ibd0e1f6ef101a1e8b25a7882f4f454ae6b87d436
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-15 16:04:25 +00:00
hjk
c75923756a Core: Provide empty implementation for IOptionPageWidget::finish()
Having it pure virtual only lead to a lot of unnecessary
re-implementation.

Change-Id: I37f71d1a160e21b93c7c73a6304b0eb6d5f0441d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-15 12:28:29 +00:00
Assam Boudjelthia
0df5d8c2e5 Android: Improve "Add new AVD" dialog
* Re-organize the implementation to create a new AVD
* Use SystemImage instead of SdKPlatform because now
an SdkPlatform can be installed partially with a SystemImage.
The current implementation does not consider the this case,
thus we end up with an uncomplete list of installed system images.
* Add Device definitions with categories (phone, tablet, tv, etc.)
to the creation process (check -d arg in avdmanager create avd).

Task-number: QTCREATORBUG-23284
Change-Id: Id02a71ad452fb423fa2781d06ef3fcf2afa328a9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-13 15:20:05 +00:00
hjk
5cd0749830 Android: Merge androidsettings{page,widget}.{h,cpp}
du -s .obj:  106256 -> 103628

Change-Id: I960ad42e1f73d2cd11aadcf5e2eaa0d840e3e9af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-13 08:30:59 +00:00
Assam Boudjelthia
6d897c00f4 Android: Add more informative fields to AVD manager UI
Task-number: QTCREATORBUG-23284
Change-Id: Ic93de1c05731360b85925acd23bdca12edc56069
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-08 08:36:44 +00:00
Assam Boudjelthia
50a3dae4dd Android: add refresh button for AVD list
* Added refresh button
* Moved startUpdateAvd() from updateUI() to AndroidSettingsWidget()
to avoid long load of AVD Manager UI.

Task-number: QTCREATORBUG-23284
Change-Id: I5128184f90437527d0a4a877bd277de1e6dbfad7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-08 07:26:41 +00:00
hjk
9c340a1758 Android: Use new settings page convenience
Following the pattern introduced in 809e62e373.

Change-Id: I6556aa71f37c4d5fc929a28a0abb71ea7fec788a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-07 13:20:25 +00:00
Alessandro Portale
1e87114bad Android: Use Utils::InfoLabel in AndroidSettingsWidget
Task-number: QTCREATORBUG-23346
Change-Id: I60ec7a27805fdea97ed572ad4d00150d935d4433
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2020-01-02 09:43:42 +00:00
Sona Kurazyan
8e31932c29 Remove usages of deprecated APIs of QLayout
Replaced:
  QLayout::setMargin() -> QLayout::setContentsMargins()
  QLayout::margin() -> QLayout::getContentsMargins()

Task-number: QTBUG-76491
Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-02 13:01:07 +00:00
Alessandro Portale
b98596490e Utils/Android: Add themable, DPI-endabled Download icon to Utils::Icons
And use it in AdroidSettingsDialog

Change-Id: Ia847b6df0e5ab26fc02157f888565a3e6d86bb34
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-26 10:27:28 +00:00
Eike Ziller
14da061c33 Android: Warn if sdkmanager could not be run
Add a line in the error checking for "SDK manager runs"

Fixes: QTCREATORBUG-22626
Change-Id: I63f783b376056a28c106bad1ce8c874acf6897f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-19 13:50:15 +00:00