Commit Graph

30 Commits

Author SHA1 Message Date
Jarek Kobus
9d8106e54a TerminalProcess: Fix stopping the terminal
Fixes 30 seconds freeze when stopping the terminal
during debugging (when being interrupted on some
breakpoint).

Fixes also the freeze on closing the preferences
dialog after opening the remote shell via
"Open Remote Shell" and keeping it open.

Fixes: QTCREATORBUG-28365
Change-Id: I15dfd9cba02d03e0ba65878c5285ea8cc96d8aad
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-31 10:29:09 +00:00
Leena Miettinen
7c9d1ef516 UI text: Fix UI text to follow the guidelines
- Fix typos
- Replace "options" with "preferences"
- Fix capitalization
- Remove "please"
- Do not use contractions

Task-number: QTCREATORBUG-28334
Change-Id: Ie029eae435634aa2fb354e173fa107af72f7b025
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-20 07:38:32 +00:00
Marcus Tillmanns
0cb3459c71 Terminal: Improve error message for start errors
Also fixes an issue where "Open Shell In Container" would fail if
the container has not been started yet.

Previously only "An Error occurred" was displayed to the user if
starting the terminal failed.

With this fix it gives more info about what went wrong, and a
specific error message is created if the openTerminal.py script
is not executable.

Change-Id: I49ae0d9b2aa7d5a27a9b100830b4fdefa5a279b8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-09-08 05:39:48 +00:00
Eike Ziller
e77c90469b Utils: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I50e457bab2d3495e5c69676fe1a0257a5fea3e52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 13:03:05 +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
Jarek Kobus
78958d5740 TerminalProcess: Emit done() signal when stop() was called
When we call QtcProcess::stop(), the terminal process invokes
stopProcess() method. However, if it doesn't emit done() then
subsequent call to waitForFinished() will timeout with 30 s.

This should fix the 30 seconds hang when debugging in terminal
after pressing the red square button.

Change-Id: Iea1f9ade85dc8a4414dc49d7c8a2cbe80f0b5756
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-07-07 08:51:48 +00:00
Eike Ziller
92c74abbf1 Fix lupdate issues
Change-Id: I7256c8aff5eb77b264b76ba24e79c26ab2924e84
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>
2022-06-27 07:05:22 +00:00
Jarek Kobus
493573b879 QtcProcess: Make reaper timeout customizable
Add a setter and getter for reaper timeout. This makes it
possible to customize the timeout for the reaper after which it
should call kill() when previous terminate() was unsuccessful.

This setting is also used for QtcProcess::stop().

Change-Id: I653a3ad107ae4173bb8254c85cfc07886bf6a9c6
Reviewed-by: hjk <hjk@qt.io>
2022-06-08 11:21:42 +00:00
Jarek Kobus
ed40753ed1 Utils: Drop unused headers [I-Z]
Round 2 - focus on sources.
For classes with initial in range [I-Z].
Try to keep the same separators between different kind of headers.

Change-Id: I8a7ab99bab8120ee72cda6433ee3dc6f260a4d76
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:49:25 +00:00
Jarek Kobus
f3957d383f Utils: More forward declarations / drop unused headers [T-Z]
Round 1 - focus on headers.
For classes with initial in range [T-Z].

Replace QT_FORWARD_DECLARE_CLASS with QT_BEGIN_NAMESPACE and
QT_END_NAMESPACE and forward declare inside.

Change-Id: I4ac3a8391e6167aa2db3973a9f94a45ac3c8ebd1
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:40:47 +00:00
Jarek Kobus
123a6e61de TerminalImpl: Set a parent to all the children
ProcessInterface subclasses may be moved between threads,
that's why we need to make them children of ProcessInterface.

Change-Id: Ia58f1ea05f85e22315dc22dbafce06ee6bcf0be6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-05-24 16:05:02 +00:00
Jarek Kobus
0a8dbaf153 Utils lib: Remove unneeded includes from cpp files
It's a result of a team work consisting of yellow triangle and me.

Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-19 12:37:20 +00:00
Jarek Kobus
44c7020651 ProcessInterface: Get rid of state() method
This is fully controlled by QtcProcess itself, so provide
general implementation of state() inside QtcProcess.

Task-number: QTCREATORBUG-27358
Change-Id: Id6f0b771ed933f870b80d6856c6d94896f946516
Reviewed-by: hjk <hjk@qt.io>
2022-04-14 13:49:25 +00:00
Jarek Kobus
bc30523293 ProcessInterface: Get rid of ProcessInterface::Ptr
Keep the setup data on stack instead on heap.

Task-number: QTCREATORBUG-27358
Change-Id: I0fffd525e2bd4f46533804e3b88fe5b330d02a91
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-14 12:41:01 +00:00
Jarek Kobus
7c8b5648fe ProcessInterface: Add sendControlSignal() method
It substitutes terminate, kill, interrupt and kickoffProcess
methods.

Task-number: QTCREATORBUG-27358
Change-Id: I9e952c2f4c1a7e76339366566f2c804a3df30347
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-13 14:39:33 +00:00
Jarek Kobus
267aa92a8a ProcessInterface: Pass processId with started() signal
Pass also applicationMainThreadId optionally (Windows only).
Remove two virtual accessors.

Task-number: QTCREATORBUG-27358
Change-Id: I3b12b642cc3c109653276c0fbf65e7f614ce6b56
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-13 14:39:18 +00:00
Jarek Kobus
4ca336762e ProcessInterface: Add done() signal
And get rid of errorOccurred() and finished() signals.
Get rid of resultData() accessor, as this data is passed
with done() signal.

Task-number: QTCREATORBUG-27358
Change-Id: I677bbd174cceea6d8f5a989f961222c417992b60
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-12 14:00:03 +00:00
Jarek Kobus
936c44f367 Introduce ProcessResultData
It should be useful when reimplementing ProcessInterface.
It replaces 4 virtual methods with just 1.

Task-number: QTCREATORBUG-27358
Change-Id: I2dafbfbc25f8f016ff2aa19c1a176335a4a7498c
Reviewed-by: hjk <hjk@qt.io>
2022-04-11 06:51:51 +00:00
hjk
6297851f29 Utils: Merge TerminalProcess into TerminalImpl
Change-Id: I60a03f315e84e17877d4ecd809a994f08934bedf
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-01 11:25:46 +00:00
hjk
38a6565199 Utils: Simplify TerminalProcess interface
Replace only internally used functions by direct access.

Change-Id: I3daff0596ef6fb6e1c5b5711928f14d590e4e56c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-03-31 14:54:31 +00:00
Jarek Kobus
82108e949a ProcessInterface: Rename interruptProcess() -> interrupt()
Both functionalities meant to do the same.

Change-Id: Idd9373cdb24b7b41f9e4befb09326c339263eeb1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-03-10 08:41:05 +00:00
Jarek Kobus
d502f78c4f TerminalImpl: Drop ProcessImpl and Terminal mode from c'tor
Change-Id: I0571eabb1a20389055a8e98dd942776b3d054981
Reviewed-by: hjk <hjk@qt.io>
2022-02-21 16:49:43 +00:00
Jarek Kobus
48960b5cfc QtcProcess: Extract QtcProcess specific enums into separate header
Change-Id: Ib3498f189000fd8f5501130c0d280b0f5ae83849
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-02-18 10:51:55 +00:00
Jarek Kobus
ae36fd943a ProcessInterface: Drop arguments from finished() signal
Make the API more similar to QtcProcess API.

Change-Id: If62051908b7974008bebda21dd288b02e7a772f3
Reviewed-by: hjk <hjk@qt.io>
2022-02-17 16:58:19 +00:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
Jarek Kobus
239688180d Fix running as root
There is no need for TerminalRunner::setRunAsRoot()
as debugger is already being run as root.
Implement runAsRoot for non-terminal QtcProcess, too.

Fixes: QTCREATORBUG-26964
Change-Id: Id5110db86b7b809a5608714464241cee73875f2b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-02-03 10:23:25 +00:00
Christian Kandeler
6993bc7382 Fix various warnings
Change-Id: Iea85f4b890ce7700e8b3632de4656cf848729a36
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-27 10:42:23 +00:00
Jarek Kobus
5e74b809cc FileUtils::openTerminal(): Hide startTerminalEmulator()
Make it a private method as it's not used outside.

Change-Id: Ib9cf3ad3a16169ad220e6474825e6cf846623c1a
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>
2022-01-25 14:52:29 +00:00
Jarek Kobus
8260074c67 Integrate ConsoleProcess into QtcProcess
Change-Id: I8e2b43ef27af6ff279b575a8d43f1ff918562951
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-25 08:36:09 +00:00
Jarek Kobus
89fb9e6b2b Make a copy of ConsoleProcess class
This is needed for transition period. Make a copy of
ConsoleProcess and name it TerminalProcess. Make it a private,
non-exported class. The ConsoleProcess is going to be removed
after unification of TerminalProcess and QtcProcess classes
is over.

Change-Id: Ib2d4bc8e8fd7ff714d891c57f695dd0debcb5a11
Reviewed-by: hjk <hjk@qt.io>
2022-01-21 15:13:15 +00:00