Commit Graph

148 Commits

Author SHA1 Message Date
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
Frederik Schwarzer
4ca3bd4d0f check if Android sdk folder is writable
Fixes: QTCREATORBUG-21943
Change-Id: Ic20ed4c24c567b0b08269b7ad07014eb4248b214
Reviewed-by: hjk <hjk@qt.io>
2019-08-13 21:49:18 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
eb9e3c807c Even more FileName::appendPath() -> pathAppended()
Change-Id: I0a8bc391ff3704e14df87e4fa3bc82269146f943
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-20 13:13:06 +00:00
Vikas Pachdha
dabe72b7bb Android: Remove missing Qt version warning
Task-number: QTCREATORBUG-21421
Change-Id: I1442c574e6d9bcd7e407e07a6ce688ddf45e86f3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-11-02 15:10:32 +00:00
Alessandro Portale
be5c228e5b Android: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: I6c9e567edf16cf436c0e0c1239b40f74574a1096
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-07-26 08:26:21 +00:00
Vikas Pachdha
5002372533 Android: Auto installation of missing necessary SDK packages
Task-number: QTCREATORBUG-18978
Change-Id: Iac3e2c956ac3da717c6509f28b8d810827947ea0
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 12:01:48 +00:00
Vikas Pachdha
476b133e91 Android: Android SDK manager user interface
Task-number: QTCREATORBUG-18978
Change-Id: I421ea66fcd4f3cf38e6cfd3be58a35b3f9204c6f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-10-11 12:01:02 +00:00
Vikas Pachdha
e70179e14f Android: Add API to check whether to use native SDK UI tools
Task-number: QTCREATORBUG-18978
Change-Id: I1cf4749e81b3b49de14ff88a5876569886d2cdfe
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:59:46 +00:00
Vikas Pachdha
ec4fe5f04f Android: Refactor Android SDK packages
Introduce a hierarchy for Android SDK packages and refactor the
code accordingly. This is ground work for sdk management and
automatic android setup

Task-number: QTCREATORBUG-18978
Change-Id: Idef545e3b3a8e33e920be52b26094fb8046afcd3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-10-11 11:58:16 +00:00
Vikas Pachdha
240d310a81 Android: Re-design android settings
Make Android setup related issues visible to user

Change-Id: Ib543c41edd9031d2bf12ac2e87b84bf4791781b7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-10-11 11:57:46 +00:00
Vikas Pachdha
bc32c380a5 Android: Remove python support checking for the NDK's GDB
The check and the warning was for the super old NDKs which are
not supported anymore

Change-Id: I13cb0d3aa1deb3e5cff284ac4e4960e4d23950b4
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-09-14 09:16:40 +00:00
Vikas Pachdha
027383814a Android: Remove Ant and make gradle as the default java build tool
All GUI options to choose between  ant and gradle are removed.
Gradle is the only java build tool used now.

Change-Id: I309ff66256c5d40920a5d77a8331c5917c53c185
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-09-14 09:01:12 +00:00
Vikas Pachdha
27e740cab4 Android: Extend Android SDK sanity
Verify the essential tools and packages required for development

Task-number: QTCREATORBUG-18837
Change-Id: Ie89e8fcf3bf75f1db9cc5eac50859cf6f3e5fafd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-09-06 11:41:37 +00:00
Vikas Pachdha
8dc98995fa Android: Force Gradle build post SDK tools version 25.3.0
Task-number: QTCREATORBUG-18013
Change-Id: Ic912427783d079f5f6bf06e3bf9a44657d24a96f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-12 13:54:24 +00:00
Vikas Pachdha
70be880bcb Android: Use avdmanager tool
android tool is deprecated since sdk tools version 25.3.0.
Use the new avdmanager tool

Task-number: QTCREATORBUG-17814
Change-Id: Id6f495f14e12d0069df08164cac1929b76d9e932
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-12 13:42:10 +00:00