Commit Graph

212 Commits

Author SHA1 Message Date
Assam Boudjelthia
5f16074cb3 Android: rephrase sdk download popup question
Remove the double column, put the path in new line to avoid potential
word wrap at the start, and surround it with quotes.

Change-Id: Ifb33e4efaaa13342bfc3a75fc58d67e359e4e804
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-25 09:23:52 +00:00
Assam Boudjelthia
b6c83df7d9 Android: move SDK Manager to separate dialog
Hide the SDK Manager into own dialog which reduces the visible
elements on the Android Settings page by default. The dialog
will be brought up when installing essential packages for example.

Also, the dialog can be opened manually via a new button, which
makes it available on demand instead be there in the front all
the time, because that SDK Manager UI is needed only when installing
packages which doesn't happen often.

Change-Id: I09b92ae7b10673ba520da9ffd98d8120e1aaf104
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-03-25 09:23:37 +00:00
Jarek Kobus
5924716e21 AndroidSettingsWidget: Fix some issues
1. Don't create gitCloner if we are not going to start it,
   i.e. when we early return with QMessageBox::information().
2. Pass a context object of *this into gitCloner connection.
3. Don't kill the gitCloner, deleteLater() instead.

Change-Id: Ibb68627ed8d16e2dc43c9d63761609c8b8c82db0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-25 07:05:05 +00:00
Assam Boudjelthia
5454dda249 Android: keep up with sdk tools changing folder structure
The cmdline-tools package used to have the folder structure "tools/bin".
However, latest packages are using the structure "cmdline-tools/bin".
And since subsequent updates we are installing "cmdline-tools;latest"
package, it will be put in "cmdline-tools/latest" folder, so we cannot
extract to that path, or otherwise sdkmanager will complain that the
path is in use.

Currently we extract it and put it under the SDK path, then use it to
install the essential packages, then it won't be used at all. This patch
changes that by extracting the downloaded package into a temporary
location, and use sdkmanager from there directly.

Also, this patch updates the links to the cmdline-tools along the way.

Fixes: QTCREATORBUG-27174
Change-Id: I1f5d0e38f5a026631e8a3852821d85a69d543c32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-17 20:45:07 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
Assam Boudjelthia
ef003ba769 Android: Simplify SDK setup process by minimizing number of dialogs
SDK setup process currently downloads the SDK tools, then checks
the mandatory packages, asks the user if they want to install them,
then show a dialog with package details, then asks again whether
the user wants to check the licenses.

The following two steps are redundant because there's a dialog which
guards the package installation and waits for user's input:
* Asking the user if they want to install the mandatory packages
* Asking the user if they want to verify the licenses

Change-Id: If06c0adea9444107a149c3ec32be67061954d1bb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-01 10:31:18 +00:00
Alessandro Portale
9e2554b660 Use Utils::Archive instead of java's jar in AndroidSdkDownloader
The exctraction of the downloaded commandlinetools zip file via java's
jar tool did suddenly not work anymore on Windows. The exit code of
jarExtractProc in AndroidSdkDownloader::extractSdk would be != 0.

Instead of fixing the jar usage, this change replaces it with the
recently added Utils::Archive.

That has the advantage that it preserves the file permissions while
exctracting, so that we can also get rid of setSdkFilesExecPermission.

Another advantage is that the SDK can be extracted even before a jdk
has been selected.

Change-Id: I99cc2aff8e183108eb11dbf96f06557e5b299d56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-01-28 12:35:45 +00:00
Alessandro Portale
f1a5a1f716 Android: Allow users to select which NDK to use for kits
This adds a "Make Default" button next to the NDKs list view. The
default NDK version is then used to override the NDK version for all Qt
versions in the sdk_definitions.json.

Fixes: QTCREATORBUG-21755
Fixes: QTCREATORBUG-22389
Fixes: QTCREATORBUG-24248
Fixes: QTCREATORBUG-26281
Change-Id: I460daafdd7f2d6380c0114bcd14cb0c46226d516
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-10 09:15:34 +00:00
Alessandro Portale
5e77303b57 Android: Turn SDK manager from QTabWidget into QGroupBox
Since the AVD manager moved into the "Devices" option page, the SDK
manager tab was left alone in the QTabWidget. One single tab looks
strange and uses more space than needed.

This change turns the SDK manager area into a QGroupBox, which is
consistent with the rest of the Android Options page. This patch also
adjusts the margins and spacings of the SDK manager widget to fit to the
rest of the options page.

Change-Id: Id1ed38862e8f9e984f53cdfb59492e30902162a7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-08 11:45:45 +00:00
Assam Boudjelthia
e3fb97b5ce Android: give a visual indication when sdkmanager is reloading packages
Add an info message when sdkmanager is reloading the packages, and also
don't expand the summary widget when the widgets are not active,
which can be when the packages are being reloaded or when the licenses
are being reviewed, this will give more space for reviewing the licenses
instead of having the summary take most of the settings page space.

Change-Id: I6acf3f6edc3b3d3fa78f0ba00308a21f8bb4fa72
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-07 18:07:57 +00:00
Assam Boudjelthia
ca9742e2a1 Android: Merge Java settings into Android settings
... to save some space.

Change-Id: I68d7cae1b007eff0624f2c0993e191c64fb415fc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-07 15:44:57 +00:00
Assam Boudjelthia
d5a3435798 Android: drop const from AndroidConfigurations::currentConfig()
Since the config can be expected to modify configuration values
(e.g. setEmulatorArgs()) it shouldn't be const, but can be set
to const whenever creating a reference that is not meant for
modifying the config.

Change-Id: I8c816a5422d4d57afa158c723d908e3a9a9a0db8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 18:34:58 +00:00
Alessandro Portale
c44478f0fe Android: Fix FilePath usage (string vs. userInput/Output)
Important on Windows

Change-Id: I0a3041e28ad60f28544ecdab2f6153b7931939f2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-29 08:25:09 +00:00
Assam Boudjelthia
e860871d2a Move AVD Manager from Android Settings to Device Settings
Move AVD management and creation to Qt Creator's DeviceManager
facilities. This allows AVDs to be created from the Devices settings
page and their details and control/action buttons for starting/stopping,
etc. are added there as well. This makes the process similar to other
device types that Qt Creator supports, to get a similar experience.

Task-number: QTCREATORBUG-23991
Change-Id: I16c52b3cc73035e0ee12fd54ae9dad4595c8cda5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-27 19:09:05 +00:00
Artem Sokolovskii
2d22dbe612 Android: Use FilePath
Change-Id: Ia1cf2a615f0de70038a575f851572e944a9797df
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-17 11:37:35 +00:00
hjk
3b75ca96d6 Utils: Remove FilePath::isWritablePath() uses
And fix remaining users.

Change-Id: I41c27908f2e9f1e253d0b51830ba351b29a84ec5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-27 07:05:29 +00:00
Alessandro Portale
99700bb009 Android: Enforce portable/clean Android SDK path
When reading a path from file chooser, settings or environment variable,
make sure it is portable and "clean".

Avoids extra compiler registrations, invalid Kits and similar issues.

Fixes: QTCREATORBUG-26092
Change-Id: I2a11563f40973d5f595bf00e37ff045a503aa9f7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-16 07:31:12 +00:00
hjk
fe7d6f0def Utils: Drop QProcess specific parameters from QtcProcess::finished()
Mid-term plan is to concentrate on use of QtcProcess::result()
instead which is a bit more system-agnostic.

There's quite a bit of potential for downstream cleanup by
re-using QtcProcess::exitMessage() now.

Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 13:31:05 +00:00
hjk
08040e4e94 Utils: Move QProcess base to QtcProcessPrivate
Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 13:21:08 +00:00
Assam Boudjelthia
1372dfdf7f Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-01 08:11:56 +00:00
hjk
c49a0af504 Android: Use macro-expanded file paths in settings
Change-Id: I3db9fc6cc4e7da1c31579aff0e1e5b81a8f4ff94
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-18 15:28:15 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
2756794b4f Utils: Drop deprecated Utils::FilePath::{setFilePath,filePath}
Change-Id: I730dfb716f744bbcb62dedf611e93c0d2d358247
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-16 08:12:34 +00:00
Jarek Kobus
eaba657d90 Fix warnings about possible detach of temporary objects
Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().

Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:46 +00:00
Alessandro Portale
323f353c6c Android: Replace AVD partition-size spinbox with emulator args input
The android emulator supports many more command-line startup options
than "-partition-size". Let's allow the user to take advantage of the
full functionalty, by providing a free-text input field for the options.

A link to the online documentation is also provided.

As a side-effect, the issue that an overridden parition size can cause
the "Cold Boot: different AVD configuration" warning is solved by not
having -partition-size by default.

Task-number: QTCREATORBUG-24735
Change-Id: I41d7b826133708c7ff447c1e257f62368745dea1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-07 11:25:28 +00:00
Robert Loehning
a53cd311e5 Android: Remove trailing white spaces from translated strings
Change-Id: Ie88b3bcd8f5e5c04bcd639924c278871245fad70
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-08-11 11:38:02 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Assam Boudjelthia
88be337b0d Android: change openssl error dialog Ok to Cancel
Change-Id: Ib2be438e330c969a2ddb46db35c8f11e5cf94e9e
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-28 09:43:55 +00:00
Alessandro Portale
e0915b7eff Android: Fix rendering of settings background in dark mode
This amends faad83d5a3 by undoing the
insertion of a QScrollArea + QWidget under the whole form. The reason
for adding this was to be able to scroll down to the license agreements.

Since Core::SettingsDialog already puts the settings widget into a
QScrollArea, we have two of those and one is superfluous. When using a
dark theme (e.g. flat-dark), this extra QScrollArea introduces wrong
background color. Also, it complicates the already quite blown
androidsettingswidget.ui

This change removes the QSrollArea + QWidget while keeping the feature
of scrolling to the license text. This is achieved by searching through
the parent chain for a QScrollArea and using the first found one for
scrolling.

Task-number: QTCREATORBUG-24379
Change-Id: I2bdae9367eb06b68fa47badf2556eb1ec7ebcafb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-23 10:28:48 +00:00
Alessandro Portale
8a8453e55d Android: Set more columns in AVD table to ResizeToContents
Give the columns with potentailly more content some space.

Change-Id: I4c213f97df077801e3b11ef09519973a61c58c4f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-23 09:04:27 +00:00
Assam Boudjelthia
ee1b8c2f16 Android: move tooltip from ui to widget class and shorten long phrases
Change-Id: I15bd9f54e7d4dbc3fae62b331172d6bc8e74e7ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-23 09:00:54 +00:00
Assam Boudjelthia
35ead659c7 Android: fix settings widget palelette in dark mode
Change-Id: I2ef4f0d510bbbe732c790134b39a9ea5cb0af2fc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-22 11:18:19 +00:00
Alessandro Portale
4d94f959f8 Android: Fix initial validating with clean settings and default paths
Relying on the PathChooser::rawPathChanged handlers to initially
validate default paths with clean settings does not work (I think)
because of a mix of interdependent (via m_androidConfig) synchronous
and asynchronous validations.

Let's assign the initial values for jdk, sdk and openssl also to
m_androidConfig, so that everything works on the first run.

Task-number: QTCREATORBUG-24372
Change-Id: Id6945d7bf81949a1f90cd20f9b3bd4e14a5bbe07
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-22 08:29:11 +00:00
hjk
babc1006f2 Various Qt6 porting
Rename QHashSeedType to QHashValueType and use it also for return
values.

Use qHashMulti directly instead of continuing using temporary QPairs.
Avoids ugly namespace tricks to find the new pair overloads, and is
actually clearer.

Classes used in signals cannot be forward-declared.  ...

Change-Id: I22450a0c642437a43f876e8e89cc8788fff3db61
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-16 09:45:43 +00:00
Assam Boudjelthia
c05755a2e1 Android: set summary widget ticks to false by default
To avoid any false positives.

Change-Id: I30a0056975d99a85230b83df44dd119a9f1dabcd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-03 08:15:30 +00:00
Assam Boudjelthia
e3e0dd6c4d Android: pass sdkMaanger to allEssentialsInstalled() to keep sync
Change-Id: Ibe8385140c0d64394941b215324b70138d6f0cdf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-03 08:14:14 +00:00
Alessandro Portale
a6313a1d6b Android: Reduce vertical spacings in the SummaryWidget
Less margins, less spacings. More space.

Change-Id: Ida15baa5ba2579332d4f67edcf0c785719cbad8d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-02 11:20:48 +00:00
Leena Miettinen
ec05ab94fd Android: Fix UI text capitalization and punctuation
Change-Id: I5fd24f164d45fea6e666e0e95f82273d2f91f934
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-01 15:05:13 +00:00
Assam Boudjelthia
67634d0d46 Android: disable controls when sdkmanager is running a task
Change-Id: Ib8220fa3510a186d69e17ae46a23c5b40f1de76b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 15:02:42 +00:00
Assam Boudjelthia
097c9ed484 Android: remove unnecessary validateNDK function and ticks
The NDK is installed via sdkmanager anyways, and custom NDK paths are
verified upon choosing in the file dialog and rejected if not valid.

Change-Id: I18f876dfacdbc1045679c6b082a500527a933673
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-30 10:05:55 +00:00
Assam Boudjelthia
518e7970bf Android: remove "Bundle" from ndk name
Change-Id: I5368d77cfe3e94560fb897bfd0213fc3dec74d55
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-30 09:38:37 +00:00
Assam Boudjelthia
34963768c0 Android: move non UI functions from settingsWidget class
Change-Id: I2d6c6806fc8b219b65d241a0243ee1edab5125a1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-29 08:13:27 +00:00
Assam Boudjelthia
c90d1c61ce Android: recommend AdoptOpenJDK in settings UI and docs
Show JDK downlaod button on Linux and point it to OpenJDK becuse
it's the most used on Linux. Otherwise, recommend AdoptOpenJDK because
it works on all platforms and easy to install as well.

Change-Id: I94fd61262fe759b96db59a9e2abfbd063f6795f0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-26 20:06:32 +00:00
Alessandro Portale
97ac63b401 Android, McuSupport: Change "download" icons to "online"
The download icon might suggest that clicking that button causes an
automated download/installation. Since we have similar automation in the
Android settings, that could be misleading.

Change-Id: Ia1e4f1cfe15f79daf090546ee7c991f93b23fd13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-26 11:18:40 +00:00
Assam Boudjelthia
5c5c505910 Android: validate jdk path at start and reload sdkmanager after that
* Validate Jdk path at the start to avoid showing valide settings on
empty path.
* Reload sdkmanager after jdk path is changed to reflect changes.

Change-Id: Ib5eafead9d4f695cf79c55b79866bd3269dadbd5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 09:52:28 +00:00
Assam Boudjelthia
b410def067 Android: fix some issues with jdk path detection
* There were two functions to detect jdk path, unified them.
* First try to find jdk 1.8, if not found, look for newer versions.
SDK Tools version 26.x needs jdk 1.8 however, the new cmdline-tools
can work with the newest jdk, so the UI will warn the user if the
selected jdk cannot run sdkmanager potentially because of the jdk
version.

Change-Id: Iee2c378598c26e8a9a8245262110ac20322a2d2b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 09:52:17 +00:00
Assam Boudjelthia
03f6517a6a Android: use text button for openssl download instead of icon only
Change-Id: I37dd0076c9dad78f8e40921facfec62a7363c27c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-26 08:38:54 +00:00
Assam Boudjelthia
af7c218d95 Android: remove native sdk and avd manager buttons
The native SDK and AVD manager buttons are no longer useful, since the
original, visual Java-basd tool for managing SDK and AVDs were removed
from Google's offering. The replacement is a set of command line tools
and a visual tool within Android Studio, which can not directly be
launched from Qt Creator.

Qt Creator has it's UI on top of the command line tools.

Change-Id: If660d7f566c173f46d9b2a97c9204746d33270e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 07:15:07 +00:00
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