Commit Graph

370 Commits

Author SHA1 Message Date
hjk
a6848e2026 Docker: Register settings aspect more directly
Change-Id: Iaf36d476f53eab459cba4d0e64e55b73a395beea
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-30 09:12:16 +00:00
hjk
2ca7aff073 Docker: Remove DockerPlugin::dockerApi()
Access is nowadays via DockerApi::instance()

Change-Id: Idc1530358771c3a008182661c263c30b68fe84be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-25 08:48:18 +00:00
hjk
6f31d87444 Use more FilePathAspect
Change-Id: Ib348df1460f8610607251498b07010df58d51ddf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-19 15:07:17 +00:00
hjk
6c5fb656d6 Utils: Make PagedSettings::readSettings() calls shorter
Ideally, this would not be needed on the user code side at all, but
there's no way to ensure the settings are read timing before sibling
constructors might need it. So keep the 'poor man's two-phase
initialization', but make it less intrusive.

Change-Id: Ica7f6510cd05072d7286f4e85cd72c494e8f10f8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-16 16:36:25 +00:00
hjk
5614696002 Core: Make PagedSettings autoapply by default in the base
Instead of relying (and forgetting...) it in all derived clases.

Change-Id: I5d1dea0ace420d464c39c192278ae6e5db01de90
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-11 13:43:58 +00:00
hjk
98d9ad8b3c Docker: Use PagedSettings
More compact.

Change-Id: Ic21c6ea9e7faf67e5f507f336f18e1134b371a97
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 16:23:21 +00:00
Marcus Tillmanns
e6081aaa0a Utils: Add TerminalMode::Detached
Change-Id: Ic36845d3469719e17f24602ce80f3e6cfc984fbf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-04 10:43:36 +00:00
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
hjk
50084f6b0e Layouting: Handle attach types via setter
Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:19 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Marcus Tillmanns
ccbab62461 Docker: Make end of auto detection obvious
Fixes: QTCREATORBUG-28819
Change-Id: I2d93c472ed7b29329642cb8052b6f7b980d017d9
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-06 11:20:12 +00:00
Marcus Tillmanns
522de9bfd7 Devices: Unify Port Gathering method
All devices that support it use the same mechanism to gather ports
so this patch removes the individual implementations in favor
of a single one in IDevice.cpp.

This patch also removes:
* canAutodetectPorts() as it was not used.
* Port::parseFrom...Output as they are not used anymore.

Change-Id: I8ecedec2d71e60985402387982c64311c5a651e6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-06 06:58:44 +00:00
Marcus Tillmanns
c378df273c Docker: Fix windows terminal
Do not send the marker when running in a PTY. On windows it gets encased
in junk and duplicated otherwise.

Change-Id: I9017066b0f1d22d4700704bfa2120c4f5d66daa9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-05 09:15:24 +00:00
hjk
de546ff3ec Debugger: Support piping dumpers into gdb
This allows using dumpers available on the host being used from
remotely running gdb. No lldb/cdb yet.

Task-number: QTCREATORBUG-29000
Task-number: QTCREATORBUG-16246
Change-Id: Ib1a40a8c0284dcf41e8800d70ca3e632c699b2fa
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-05 06:26:11 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
Marcus Tillmanns
b999e5700e Terminal: Fix docker cmd for terminals
* Fix env for terminals

Change-Id: Ie16a74aeca3ad34a76af1dee0c5a01e607aabebb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 05:59:35 +00:00
Marcus Tillmanns
f1f5a7412a Utils: Send __qtc marker from stub
Docker and ssh devices need the real process id on the
remote device. The process stub now send this if it receives
it as the first line of output.

Change-Id: I5d3af39651958fc88d21c3854a0fa1d7f51547a6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-04 05:59:25 +00:00
Marcus Tillmanns
0015c666d2 Docker: Fix ensureReachable return value
DockerDevice::ensureReachable returned false in case a path was
already mounted.

Change-Id: I7b378a063dfe5380a1ead648f89911f2225c6338
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-03 07:34:40 +00:00
Marcus Tillmanns
0fb635e76c Docker: Fix Shell destruction handling
Change-Id: I125ac2eaf99e8dff85da06640f048b502f36fa08
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-29 06:54:40 +00:00
Marcus Tillmanns
c7b6c66cab Docker: Fix process state handling
Fixes the following errors that would trigger warnings due to incorrect
QtcProcess/ProcessImpl state synchronization

* Don't emit readyRead when state != Running
* Set result.m_error to FailedToStart if remote pid was not received
* Send stderr data once the pid was received
* Don't call deleteLater() on nullptr

Change-Id: I4b498a860ad27bef1a5b3e26417576431b54e84c
Reviewed-by: hjk <hjk@qt.io>
2023-03-28 06:32:38 +00:00
Jarek Kobus
b5af4501df Fix include style
Change-Id: I64cb77f8d39dac35821fe96d735bc5dda35738e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-24 13:42:50 +00:00
hjk
5996e58ffa ProjectExplorer: Allow Devices to be added without using the wizard
This re-organizes the buttons on the main device page a bit: The
topmost one still starts the wizard selection, below that are direct
individual buttons to add specific devices.

Change-Id: I52b2803febf658259dde9589544656fd4c8fc889
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-24 13:20:19 +00:00
Marcus Tillmanns
29873068eb Utils: Store Device::osType in settings
Change-Id: I41348be752598b7a8d1f1979764e7111cccc95a9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-23 12:33:58 +00:00
Marcus Tillmanns
4d6683b2cb Docker: Fix warning
Change-Id: Ia4665c1fcd0f52b5b8180b811e59ad7ba5bc2587
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-22 08:18:01 +00:00
Marcus Tillmanns
44074accc7 Terminal: Use QtcProcess to start terminal window
Previously DesktopDevice::openTerminal used custom code to open a
terminal window. This patch changes it to use QtcProcess with
TerminalMode::On.

This also removes the need for "openTerminal.py" on macOS.

Change-Id: Iec978bdd19487ff8e59dcd88c35c2d01b0681022
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-21 15:09:15 +00:00
Marcus Tillmanns
97c1bb53a5 Docker: Check Image available
Docker will try to download images from the registry if an image is
not available locally. This takes a while, even if the image is not
available remotely. To circumvent the hangs resulting from this we
first check if the image is available locally and if it is not we do
not try to start it.

Fixes: QTCREATORBUG-28880
Change-Id: I6b9de8601b87e3050ae9ac5f1bbe3fa9701d4cc1
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-21 14:09:33 +00:00
Jarek Kobus
a43c20969c QtcProcess: Remove TerminalMode::Pty enum value
Make Pty::Data optional. When set, the PtyProcessImpl
implementation is implied.

Change-Id: I7990e9d9016223e6597d876a5d0c4ed177365874
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-15 13:52:45 +00:00
Marcus Tillmanns
666f3258ba Docker: Fix shell exit handling
Previously if a docker container was removed outside of Qt Creator
the shell would not be correctly reset by the dockerdevice and
therefor cause a hang.

Change-Id: I5e84f7c114e525c732f45b701277736d6acc7a11
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-15 13:33:25 +00:00
Marcus Tillmanns
2d15be91bf ProjectExplorer: Consolidate ProcessList
* Combined local and ssh process list retrieval into LocalProcessList
* Combined QnxProcessList into LocalProcessList
* Renamed LocalProcessList to ProcessList

Change-Id: I230c575375e306c638e4ca3034fa2d7ed243a44c
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-03-14 14:40:19 +00:00
Jarek Kobus
fcb9194828 Docker: Use QtConcurrent invocation for async run
Change-Id: Ie5e6f5c746cf194fa00310a24db9344b72933ad5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-10 18:01:33 +00:00
hjk
08bacd3f19 Avoid a few double lookups when expanding environment values
Change-Id: Ie84caee89a48d8006e6324c5a82901d01a5fac6c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-03 11:37:05 +00:00
Marcus Tillmanns
78b1407adf Docker: Don't swallow output when startup fails
Previously error output occurring while the PID marker was
not parsed yet was not passed on to the parent QtcProcess.

Change-Id: Id6cbaa13a7d6c62d7a8612e118092eb2be6e790c
Reviewed-by: hjk <hjk@qt.io>
2023-03-02 16:32:57 +00:00
Marcus Tillmanns
86da87d306 ProjectExplorer: Remove IDevice::terminalCommand
Since Terminals can now be started for device file paths, there
is no need anymore for IDevice::terminalCommand.

Change-Id: I01c831ea7ee29d53efa6880631e8c6d54a4316aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:13:19 +00:00
Marcus Tillmanns
1da18a4b62 Utils: Integrate ptyqt into qtcprocess
Integrating PtyQt directly into QtcProcess allows us to
start Pseudo terminal processes using the existing QtcProcess
functionality such as starting remote process on e.g. docker
or remote linux devices.

This is needed for the new Terminal plugin.

Change-Id: Iaeed5ff9b341ba4646d955b2ed9577a18cd7100f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-02 14:10:11 +00:00
Jarek Kobus
8b09ad8898 QtcProcess: Introduce PtyData
That's going to be used by PtyProcessImpl.

Change-Id: Ifc1a7886ceed73272c9e415414db49452175a334
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 14:10:06 +00:00
hjk
81748fa00b Docker: Avoid explicit environment iteration
Task-number: QTCREATORBUG-28357
Change-Id: I0addc68309ab532d5a710916c7d017eccee1f348
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-03-02 13:43:58 +00:00
Marcus Tillmanns
6451538d39 Docker: Don't try to mount existing directories
Change-Id: I1df4e1bf8689edf08c539d71529e4149909502d7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 12:55:02 +00:00
Jarek Kobus
d249e77f77 DockerDevice: Fix compile warning
Amends 682ef157d8

Change-Id: I2ee639aac5d6b2ba55e96d322a6d5818ca0d6735
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-02-27 11:50:02 +00:00
Marcus Tillmanns
682ef157d8 Terminal: Add Terminal plugin
Adds a new Terminal plugin that provides a Terminal pane inside
Qt Creator.

Fixes: QTCREATORBUG-8511
Change-Id: I7eacb3efa2463d7df9f383ae3fc33254fb9019a9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-02-24 10:19:33 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Alessandro Portale
226799858c Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over
QCoreApplication::translate("::<Module>", "..."). This changes
occurrences in .cpp files.

Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:37 +00:00
Marcus Tillmanns
f06bc4ab5a Docker: Fix searching for clangd
Environment::searchInPath() does not know from which device it came.
Therefore it will take the PATH variable as it is ( without the
device://... prefix ) and search for files on the local device.

Change-Id: Iecddb5ee1beb4ac821a9ac592f6edb1fc0f68b54
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-09 13:42:24 +00:00
Marcus Tillmanns
78cf3eb671 Docker: Check writeData
Previously only the process mode was checked to decide
whether we need an interactive docker session when starting
a process.

Change-Id: Ia80c78d861107239d0c86c405e06f30e7770ff8e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-02-07 13:06:56 +00:00
Marcus Tillmanns
e780ca991c Docker: Use rootPath() for Shell
Change-Id: Ie2578b768d8fcb91c55a33b4eb62e43c127ccee2
Reviewed-by: hjk <hjk@qt.io>
2023-02-07 11:16:02 +00:00
hjk
040ef3b7d3 Docker: Use a optional<Environment> to handle the non-fetched state
Change-Id: I93ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-27 12:37:51 +00:00
hjk
dab859e776 Utils: Replace Environment.isValid() with .hasChanges()
That's closer to the intended semantics. The "other" use in docker
will be changed to an optional<Environment> as follow-up to
keep this here mechanical.

Change-Id: I43ef9da6c9c7731b28f9d6fab6413ce9c4f428b4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-27 12:37:35 +00:00
hjk
1285b80c40 Utils: Use an enum indication the possible abort of an dir iteration
The bool is not really clear.

Change-Id: I4ce6412736aec6b1853fd53d4e535ad045748350
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-26 07:38:21 +00:00
Jarek Kobus
8e3a22329d QtcProcess: Add closeWriteChannel()
Change-Id: I080be230ec420ead2866f9481123125361e57033
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-24 08:48:12 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00