Commit Graph

230 Commits

Author SHA1 Message Date
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Christian Stenger
5a5d6f7548 Android: Silence soft assert
Change-Id: Ie4916e2de2cb51388df674219a45df0e7d4d5abf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-04 15:04:52 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
0d74be319a Android: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: Id00e2bc736683bb844cc7ba936ac9d21aa204416
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-07 16:30:13 +00:00
Alessandro Portale
76804a0839 Android: Link directly to command line tools download
Change-Id: I6a5d4321a0d6c0b854730615aa33acfe4986c9b6
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-11-30 12:30:13 +00:00
Artem Sokolovskii
fabf2f8cde Android: Rename Android Settings names
Change-Id: I5d8fe1d1525dcea65c2a616b86d777d1ffabce28
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-11-22 13:31:19 +00:00
Alessandro Portale
5c65115271 Android: Convert to using Tr::tr
Change-Id: Ie9110093101b0f49808b4da7b13ac3f47c3bb994
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 10:24:32 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
58c5b126d3 Utils: Settle on lowerSnakeCase for LayoutBuilder::Setter
Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-27 08:40:12 +00:00
hjk
dc839df59b Utils: Introduce a Layouting::empty item
A bit more explicit than the current mix of Space() and asserting {}.

Change-Id: Ia296b1d23294dfccd1e33827e136b821a4d2c6fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-26 09:08:18 +00:00
hjk
14257a24f9 Utils: Introduce Layouting::{br,st}
... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 09:52:15 +00:00
hjk
50e53b3e63 Android: Inline androidsettingswidget.ui
Change-Id: Ib30810b182eabd3d7f58691f3c3023151408ae04
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-22 09:53:33 +00:00
Jarek Kobus
a98b185e90 Drop Qt5: Android, IOS & WASM: Get rid of QOverload
Add a context object into some lambdas.

Change-Id: I72631aeb36703f8f335f3819796fb52148f1b377
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-20 10:30:48 +00:00
Assam Boudjelthia
525a284f3e Android: simplify AndroidSdkManagerWidget::installEssentials()
Remove an argument that doesn't need to be be provided explicitly
by the caller and can be done internally.

Change-Id: Ie225f847560b746ce9b8103ab38caca5caca1b0a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-11 12:35:33 +00:00
Assam Boudjelthia
f079479756 Android: Look for latest JDK version and not 1.8 specifically
Recent SDK Manager that is used by Qt Creator works with JDK 11+,
and JDK 11 is needed by Qt 5.15.7+, so look for the newest JDK
instead of 1.8 as currently being done.

Change-Id: I6ff415aa300d742735e8636b24a03116d5bfe2b6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-08 10:40:43 +00:00
Jarek Kobus
c67ef789ee AndroidSettingsWidget: Remove unneeded includes
Change-Id: I8a0f78868a335125b5ccdbb3554d222d68d5751d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-05 11:09:01 +00:00
Jarek Kobus
104bbfc713 AndroidSettingsWidget: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: If802368f1f084e5990458942b3ef94517a0cfdff
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-08 18:50:07 +00:00
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