Commit Graph

216 Commits

Author SHA1 Message Date
Cristian Adam
26e856254c CMakePM: Allow copy / editing of build directory
This reverts 69b0a2cafc

The build directory is preset and by having the ability to edit, you can
easily do a new build by appending a number.

When you have a new build directory a dialog will warn you that you'll
start from scratch. This is enough of a hinderniss to the user to start
typing and get lots of build directories. No need to have it read only.

Fixes: QTCREATORBUG-24451
Change-Id: Id1bc77d0fbcb071608f5ac83ddd6b8af943fdac5
Reviewed-by: hjk <hjk@qt.io>
2021-06-10 13:42:29 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +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
Christian Kandeler
ad48f2639c ProjectExplorer: Consider build environment
... in "Open Terminal Here" action in the build configuration.

Change-Id: I0b1b15d4f1097cf48eb5a977f2ca5951b2f78377
Reviewed-by: hjk <hjk@qt.io>
2020-11-10 09:01:48 +00:00
Christian Stenger
d6ce25903d Utils: Validate pathchooser on setting default value
When changing the default value we may also change the current
state of validity, so trigger a validation immediately.
Amends b938764820.

Change-Id: I99bce422d3a0aa2b6418495b4a2c69255df06674
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-28 09:01:52 +00:00
Christian Stenger
b938764820 Utils: Simplify pathchooser validation
Allow to set a default value for the PathChooser which will
be used on the one hand as placeHolderText and on the other
hand for the default validation if the underlying line edit
has no text set.

Change-Id: I49d2f773cf3933cb30b54ee6de82290b480e743d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-27 04:29:47 +00:00
hjk
de58fc104a Utils: Document PathChooser::Kind
Change-Id: I0d984c9cae98b59abfb62a3fd6932d63783e9015
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-27 07:50:26 +00:00
hjk
82be99a53e Utils: Rename FilePath::rawFileName to rawFilePath
Change-Id: Idf8cad2b18087f511aa1efe54adbb5a427660016
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-22 07:24:51 +00:00
Tobias Hunger
69b0a2cafc PathChooser: Allow for chooser-only selection of files/directories
Makes the line edit disabled and read-only in that case.
We also need to change the custom context menu from the line edit to the
path chooser itself, because disabled widgets do not show a context
menu, but we still want to see the select & copy, and the special
items for opening explorer or terminal.

Task-number: QTCREATORBUG-23798
Change-Id: Ib653b4eaaedfbe54c614377795ddc52d21ac12c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-21 13:18:43 +00:00
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
Alessandro Portale
1519dbf0c7 Utils: Remove "ok" and "error" colors accessors for FancyLineEdit
Change-Id: I4e6706f284182226da8c9815394f36e9764feab2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-19 12:15:41 +00:00
hjk
84d0e3dda8 Utils: Use FilePath for PathChooser::m_baseDirectory
... and collapse the two accessor versions to one.

Change-Id: I282753a0092601cff073684053ff914016452645
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-19 07:59:13 +00:00
Alessandro Portale
3dc511f1d1 Utils: Use Theme default "ok" and "error" colors for FancyLineEdit
...and remove the redundant setter calls elsewhere.

Change-Id: Iec71fe1bff7f8c9dd72bf3c3e643a4ed01e4dc80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 15:27:07 +00:00
Eike Ziller
8df0653bf8 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/projectexplorer/gcctoolchain.cpp
	src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp

Change-Id: Iffdf48e782a734107ea170ebb3812e997cea0e7b
2019-09-12 09:08:04 +02:00
Eike Ziller
6476c62065 macOS: Work around window stacking order issue after closing dialog
Fixes: QTCREATORBUG-22906
Change-Id: Id3c9f5e87ac83686b34c7f6d2e445312fc401ba6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-09 13:44:29 +00:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +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
Christian Kandeler
72cb9e26a1 PathChooser: Move setTextKeepingActiveCursor() to FancyLineEdit
We want to re-use it elsewhere.

Change-Id: Iadb03e2e85bc25f9111a8817170b9ec1f2f0a7b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-07 13:33:49 +00:00
Eike Ziller
f5647cc2c4 Allow non-host-platform libraries in Add Library wizard
Since much of the available UI and behavior depends on which platform's
library we start with, let the user choose a platform filter.
Default is the host OS.

Task-number: QTCREATORBUG-17995
Change-Id: Ic8bec7ac30eecf08c1684da4f2823a8add8f6d20
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-10-01 12:27:21 +00:00
Orgad Shaneh
d88a0d8e68 Utils: Modernize
range-based for, nullptr, member initializers, override.

Change-Id: I21ac5b23883c08dbd75819bb3298bc956cdb972c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-21 05:37:39 +00:00
Alexis Jeandet
08508522fe Expand QTC variables from PathChooser
This would allow to use QTC variables in settings using this widget
such as Extra Debugging Helpers.

Change-Id: I8ac6de46f359f58a501f09774d992a19b48d7d5f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 10:00:58 +00:00
Eike Ziller
8e05783019 Merge remote-tracking branch 'origin/4.7'
Change-Id: I4332eba9f1f66fef185359c79c4d96420d8b78ca
2018-08-30 08:31:25 +02:00
Eike Ziller
93a6dd0c67 Fix editing of custom executable path
When editing the path for a custom executable run configuration, the
text cursor would jump to the end every time anything is typed. This
makes changing a part inside the text very cumbersome.

This happens because the executable aspect registers a "display filter"
that transforms the input to native separators.

Solve that issue generically for the path chooser by resetting its text
cursor position after the path has been set, if the input field has
focus.

Change-Id: Ic0a178e942da8df1e53b5d90c78a5bf1675865c2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 08:12:12 +00:00
Alessandro Portale
e38410b76c Utils: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I8d44d9405011a1878353baf9325f7af90b89db02
Reviewed-by: hjk <hjk@qt.io>
2018-07-20 13:36:22 +00:00
Orgad Shaneh
7cee991c70 Utils: Remove superfluous qualifications
Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-19 08:21:29 +00:00
Alessandro Portale
3d3f14e3fe Prefer using 'override' instead of 'virtual'
warning: prefer using 'override' or (rarely) 'final' instead of
'virtual' [modernize-use-override]

Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-07-11 16:31:35 +00:00
Alessandro Portale
caff9f9aac Use C++11’s override and remove virtual where applicable
Fixes warning: prefer using 'override' or (rarely) 'final' instead of
'virtual' [modernize-use-override]

Change-Id: I4b8b8ecce028dfd051fe14984b40115e92057a40
Reviewed-by: hjk <hjk@qt.io>
2018-06-27 07:13:21 +00:00
Christian Stenger
2653cb229c Utils: Fix manual usage of PathChooser
When manually typing inside a PathChooser that expects an
existing command it was no more possible to type a trailing
slash without tricking the PathChooser.

Change-Id: Ie30e7b0de030f4a3d64fce89ed799c03a594261d
Reviewed-by: hjk <hjk@qt.io>
2018-05-14 13:07:25 +00:00
Tobias Hunger
4146a98599 PathChooser: Remove wrong comments
Change-Id: I2cd240ff79747dc8e3bac164beb3353960d0dc1e
Reviewed-by: hjk <hjk@qt.io>
2018-04-25 14:19:49 +00:00
Tobias Hunger
3d8be750b9 Environment: Use Utils::FileName for path() and related methods
Update users accordingly.

Change-Id: I9432e82308e9d0630514c6c8632aeb6b6ee0cf90
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-27 07:37:26 +00:00
Andre Hartmann
63a75e3f4a PathChooser: Modernize
* Range-for
* Remove QLatin1{Char|String}
* Member-init

Change-Id: I8c928a21cd1187e83264c88e1c62d81d82ed088f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-22 12:37:13 +00:00
Orgad Shaneh
5368e29050 PathChooser: Avoid unneeded validation when base is unchanged
Change-Id: Ia4b00d673725ff3718dbc9703c933a44fe2314dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-19 06:55:53 +00:00
Orgad Shaneh
d4ac34449b PathChooser: Expand ~ to home directory
Change-Id: I4d767b6978f69c0e0a8dbfb3ccd6fc5b33fc3984
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-05 09:49:02 +00:00
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
Tobias Hunger
e3b40fa687 PathChooser: Consistently put "" around file names
This makes it a bit simpler to spot leading and trailing whitespaces.
Maybe that could help with problems like QTCREATORBUG-16805, but even
if not it makes our strings more consistent.

Change-Id: I65c486721967d9d3e17020641a1144d593f9bde1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-09 10:00:33 +00:00
Alessandro Portale
1acec7ceb4 Utils: Get default error color from Theme
The default Qt:red for the lineedit in  Utils::PathChooser is unreadable
in dark themes. This change ensures that the color comes from the
current theme.

Change-Id: I7b890bb18e4b996cf0a8f0ac3286da87dd33f5f2
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-25 11:49:02 +00:00
Tobias Hunger
ff66f5c62f PathChooser: Make path/rawPath and fileName/rawFileName more consistent
This moves the fromUserInput that used to be in rawFileName to fileName,
so that fileName produces the same output it used to produce.

Change-Id: Ifb209af3f60d959c3f7119ebfa20f999c5d5f0ca
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-27 09:22:37 +00:00
Tobias Hunger
1b5c46660c PathChooser: Handle things like %{buildDir}/../something
Do not call cleanPath on rawFileName as that sanitizes %{buildDir}/.. to '.',
which is not what is expected for a rawFileName.

Change-Id: I4bb95b33f4c12c79ed0029d5fbf539e113a3774c
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-27 08:35:58 +00:00
Tobias Hunger
5d3823ac47 Use SynchronousProcess::runBlocking
Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.

This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.

Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-26 11:50:03 +00:00
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.

Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-11 10:04:38 +00:00
Tobias Hunger
bfd84c3437 PathChooser: Remove duplicate code
Change-Id: Idfbe8e8f89dfe739b10c560a90f56fc519f6b474
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-04 13:24:09 +00:00
Orgad Shaneh
bf22f23066 TextEditor: Use PathChooser for FindInFiles
Change-Id: I17058cd41eec1cfea41ddbf2cae1a7c70a4e3a10
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-21 10:12:10 +00:00
Christian Stenger
069f8c234c PathChooser: Provide static way to expand a directory...
...to be able to fetch working directory even for
non-active targets.

Change-Id: I563e9b56e8a8393b998811e0fb364078d4c37d03
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-20 15:21:48 +00:00
Tobias Hunger
f72370f20a Update License according to agreement with Free Qt Foundation
* Update remaining files in src

Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:59:41 +00:00
Orgad Shaneh
cb501d4824 ProjectExplorer: Use FileName in WorkingDirectoryAspect
+ use native separators for user visible strings

Change-Id: Id6e4e27db369314f70e355a395cfddca12b8ea90
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-06 14:29:23 +00:00
Martin Kampas
7081b7aecb PathChooser: Fix segfault on destruction
I was only able to crash it with the Mer plugin (not in tree).

Change-Id: Ie478f74c48ac6686418207fd1af8b727bcfed3cd
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-23 09:07:55 +00:00