Commit Graph

128 Commits

Author SHA1 Message Date
hjk
c6cc997be4 Python: More RunConfiguration aspect use
Include interpreter and main script settings.

Change-Id: I91c19ef124ff8b7da34bc67fb1a5ef054c3499b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-30 07:36:42 +00:00
hjk
50f2bcd9ae Python: Plugin code cosmetics
Use the common pattern for PythonEditorPluginPrivate.

Change-Id: Icec8d975e0ab921be7121d123af4dddecd7d0384
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-27 12:12:37 +00:00
hjk
366be94ad9 Pass id to RunConfiguration constructor
It's what the base class requires, and opens the possibility to
have several factories creating the same type of run configuration.

Also move ios, winrt and android factories closer to their products,
it's the predominant pattern nowadays.

Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-25 15:06:11 +00:00
hjk
def04e88a2 Simplify runconfiguration aspect addTo... interface
The parent widget is always given by the layout, no need to pass
it as separate parameter.

Change-Id: I9e7ed3a89eb63b78a549471d839060131737ff78
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-24 07:26:22 +00:00
Tobias Hunger
2a34f2177c ProjectExplorer: Hide build page for projects that do not build
Change-Id: I56feaab67690b5ece7379a9c1f676392230de107
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:52 +00:00
hjk
83c6a4916c ProjectExplorer: Streamline OutputFormatter creation a bit
Note that the concept of a single monolithic OutputFormatter per
RunConfiguration (and why RunConfiguration, not RunControl to start
with?) is unchanged and suboptimal as one cannot easily combine
existing use cases, e.g. Python_and_Qt.

Change-Id: Ibeb8191020387324f22ed313230293597f96e36a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 11:55:31 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
hjk
a06514c365 ProjectExplorer: Start unifing visual appearance of run config widgets
Margins and layout style widely differ so far. Start moving everything
to a QFormLayout with the same margin and growth policy.

Change-Id: I0bd1d8b2ec9830be56354be1376a2a24eebb8845
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-10 08:41:16 +00:00
hjk
afbeefba86 Python: Move TaskList emptying to OutputFormatter constructor
... in preparation of upcoming OutputFormatter creation reorganization.

Also, replace a raw string literal by a normal one to accommodate moc
and remove an unused member.

Change-Id: I416bb20afd891717fcb4f449955b4e46e5c05590
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-06 08:24:12 +00:00
Friedemann Kleint
217f2a49f6 PythonEditor: Show python stack traces in the build issues pane
Add an output formatter that captures stack traces and adds them
as tasks.

This helps to speed up fixing syntax errors.

Change-Id: I8a4fa77d0f87b4d16f4bb780b15ec06154a52441
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-04 07:56:24 +00:00
hjk
8e90ce7e01 PythonEditor: Simplify PythonRunConfigurationWidget
Use new wrapWidget() convenience function and don't use
members for locally used items.

Change-Id: Ia063501a124a56d0ade82dbc17d1087b11d4a88e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-23 08:34:30 +00:00
hjk
a5d6fe33cb Partially decouple local CMakeRunConfiguration from CMakeProject
Funnel all relevant data through target.applicationTargets() as
done for the non-local CMake-supporting setups and QBS already.

There is cleanup potential left for later changes.

Change-Id: I49ed6abd98c058a7fd1545e41b3bcd6ecb758a8b
Task-number: QTCREATORBUG-19985
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-13 15:02:54 +00:00
Tobias Hunger
f028a74f32 Python: Fix warning about inconsistent use of override
Change-Id: I13d601e1a67078ba2caedb3bb48296021859af1a
Reviewed-by: hjk <hjk@qt.io>
2018-03-09 13:50:21 +00:00
Tobias Hunger
835d4e92f3 Project: Improve default implementation of Project::needsConfiguration
Change-Id: Ic4d227334d818658f179c0589462551509274c17
Reviewed-by: hjk <hjk@qt.io>
2018-03-09 12:57:59 +00:00
hjk
8b92da254e Rename IRunConfigurationFactory to RunConfigurationFactory
It's not an *I*nterface anymore

Also, remove the in-all-but-one case unused QObject parent and the
object name that was only there for debugging purposes. The class
type serves the same purpose in the debugger.

Change-Id: I0dafb01e6b4fd7c7df04a63aaa3ef3e4bd693f6f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:07:42 +00:00
hjk
981846726b PythonEditor: Model RunConfiguration according to RemoteLinux setup
Change-Id: I9733dbb72dd4483dd06865ea8174fbe6a9934338
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:06:07 +00:00
hjk
813bd806d3 RunConfiguration: Add a more explicit way to transfer creation info
... at RunConfig Creation time. This eases the id mangling case.

Use it in the PythonProject.

Change-Id: I9a7e2c90997ed5ab737cd4fa68895217bdbe1dfe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:05:15 +00:00
hjk
9f2bb5d0c5 ProjectExplorer: Simplify collection of RunConfigurationCreationInfos
Instead of calling twice for AutoCreated and UserCreated, call once
and record to which case it belongs. Only the 'both' and
'user only' combination are ever used.

Change-Id: I9c15085bcbb4bf6584a6156135f2084dbfc51c1c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-15 14:23:02 +00:00
hjk
0bbf224667 PythonEditor: Remove uses of global object pool
Change-Id: Iba9903ca994a0e9aef268685269789daf2b83183
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-06 14:29:05 +00:00
Tobias Hunger
e1409ae50f IRunConfiguration: Remove BuildTargetInfo from the RC factory APIs
Change-Id: I1d77d22a1c1ce1cbcfca8af7855ae7b935ac1c2c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-06 09:01:32 +00:00
hjk
7d039de7a8 PythonEditor: Fix run configuration
This amends commit 53a151074a.

Change-Id: Icf171667b6d03802e0be615c8c7b9491b8d6fd54
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-01-11 13:51:50 +00:00
hjk
c3d87e81c5 ProjectExplorer: Return BuildTargetInfo from availableBuildTarget()
... including build target name and display names instead of
returning QString build target names and producing display names
via displayNameForBuildTarget()

This is a mechanical intermediate step on the road to use
Target::applicationTargets().list uniformly as source of build
targets.

Change-Id: I7b0b1fb398d5061b0cec0b86890f9eaf0bb53a19
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-05 09:34:29 +00:00
hjk
b2a16190e8 Use project id uniformly as project context
The possibly intented flexibility e.g. to have different project types
share the same idea of a common context was never used, in all cases
we had a 1:1 relation ship between project ids and ids that were used
as context. This led to oversights like the one fixed in 60fb35a2.

This patch here uses the project id unconditionally as context and
drops all context ids. If we'll ever have the situation where the
original flexibility was needed, Project::projectContext() could be
made virtual and overridden were needed.

Also, the context was never modified for any given project, so the
updating machinery is not needed.

Change-Id: I3f7fac0ed5e4704e126558987c48577f26082dfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 12:35:14 +00:00
hjk
4a66cae854 ProjectExplorer: Use ids in RunConfigFactory:: setSupportedProjectType
More similar to what build/deploy uses.

Change-Id: Icf8bd7031d00a6e2831f8c1f3b1bdcaa8bf259b4
Reviewed-by: hjk <hjk@qt.io>
2017-12-19 09:42:01 +00:00
hjk
53a151074a ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.

- Collapse the two lines of constructors similar to what
  890c1906e6 did for RunConfigurations
  * Deploy* was purely mechanical
  * Build* ctors are split in connects() in the ctor body
    to create "empty shell for clone" etc
    and build step additions in initialize() functions which
    are only used in the create() case.
  -- Allows to collapse the shared 'ctor()' functions, too.

- Move FooBuildConfigurationFactory::create() implementations
  to FooBuildConfiguration() constructor. That was a strange
  and unneeded ping-pong between factories and objects, and
  furthermore allows one level less of indirection (and for a
  later, left out here, some reduction of the
  FooBuildConfiguration interfaces that were only used to
  accommodate the *Factory::create() functions.

- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
  but there wasn't one in the base classses. Have one there.

- Most canHandle() functions were checking simple restrictions on
  e.g. project or target types, specify those by setters in the
  constructors instead and check them in the base canHandle()

- clone() is generally replaced by a creation of a "shell object"
  and a fromMap(source->toMap()), implemented in the base, there
  are two cases left for Android and Qbs that needed(?) some extra
  polish

- generally use canHandle() in base implementation, instead
  of doing that in all Derived::canFoo()

- as a result, canCreate/create/canClone/clone reimplementations
  are not needed anymore, keep the base implementation for
  now (could be inlined into their only users later), but
  de-virtualize them.

- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
  'dsym' build step they could create.

- Split the 'mangled' id into the ProjectConfiguration subtype
  specific constant identifier, and a QString extraId() bit.
  Only maintain the mangled id in saved settings.

- Make ProjectConfiguration::m_id a constant member, adapt
  all constructors of derived classe.

Not done in this patch:

- Finish possible cosmetic changes on top

- Add a way to specify restrictions to supported Qt versions
  (used in Android/Ios), as the base implementation does not
  depend on the qtsupport plugin

- Combine the QList<X> availableFoo() + createFoo(X) function
  pairs to somthing like a direct
   QList<struct { X; std::function<X()>; }> fooCreators()
  to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
  pingpong

- Remove the *Factories from the global object pool

- Do something about priority(). Falling back to plain
  qmake in android+qmake setup is not helpful.

Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-08 11:17:55 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
hjk
1697f97aff ProjectExplorer: Register createes' base id in RunConfigurationFactory
This shifts the resposibility of creation/splitting of RunConfiguration
ids into what are essentially "type ids" and "build targets" to the base
implementation, possibly opening the path of abandoning the mangled ids
in favor of explicitly storing their constituent parts.

Take advantage of base id split in RunConfigurations for availableIds
/displayNameForId and for canCreate/canRestore/canClone.

Change-Id: I19fefb32757407ab5053a2ae0e5a79438659f6ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
2017-11-27 07:23:17 +00:00
hjk
d1c9b33eb7 ProjectExplorer: Add a RunConfigurationFactory::canHandle(Target *)
All RunConfiguration factories had some kind of canHandle(Target *)
implementation. Centralize this notion.

Change-Id: Ie24a355e857bddfd76b866859b8c7a42ffc83840
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-20 08:52:00 +00:00
hjk
9792547ef9 ProjectExplorer: Implement RunConfiguration::do{Clone,Restore} in base
It's possible now.

Change-Id: I49ed73312aea1627a9543890431e2e379e3fb3ec
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-16 14:08:33 +00:00
hjk
dfd4ad8c2d ProjectExplorer: Simplify IRunConfigurationFactory::clone() use
Change-Id: I005d6c87142d26dfc7ae1349329737a68f54c427
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-14 10:58:30 +00:00
hjk
5ca90a4a5e ProjectExplorer: Fix copying of RunConfigurationAspects
Moving aspect data closer to real Value semantics fixes
the regression introduced by 890c1906e.

Task-number: QTCREATORBUG-19186
Task-number: QTCREATORBUG-19192
Change-Id: Ieaeef3995ae06a817f266c1e2514f9e5793bd4e8
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-10 15:09:59 +00:00
Christian Stenger
8fd3f55dbb PythonEditor: Ensure project file is listed first
Change-Id: I43377a97d4ef82e8ed3824a766ba86db086f4dc7
Reviewed-by: hjk <hjk@qt.io>
2017-10-18 12:46:33 +00:00
Christian Stenger
0a931c56a4 PythonEditor: Avoid creation of useless empty run config
Opening a python project created an empty 'Custom RunConfiguration'
the first time it had been opened.
Avoid this by re-ordering and simplifying the processing of the
project and its respective settings.

Change-Id: I0c0f71e0dab6f03df46e5ddbdc7e1dbf73e8bef8
Reviewed-by: hjk <hjk@qt.io>
2017-10-18 12:46:24 +00:00
Christian Stenger
094f7120c1 PythonEditor: Fix run config names
Change-Id: I1131fdfdb1599bf470db502c222792d4419fa13e
Reviewed-by: hjk <hjk@qt.io>
2017-10-17 04:56:05 +00:00
hjk
890c1906e6 ProjectExplorer: Re-organize RunConfiguration constructors
The idea is to massage the setup in a way to make implementation
of new configurations less error prone by identifying recurring patterns
and sharing repetitive code that tends to be forgotten (see Android cloning).

The former two lines of constructors (owner-and-id, owner-and-source)
are split into a simple, shared, constructor and new setId() and
copyFrom() functions.

The change is mostly mechanical, some multiple calls to fromMap
have been removed, though, some consts added.

Otherwise, to keep the patch small it temporarily introduces two
helper templates in IRunConfigurationFactory. Also, setId() signatures
have not been unified yet. These won't be needed in the final setup.

Change-Id: I8c0734496caae744a9883fe6d92c1d8f8e0234ea
Reviewed-by: hjk <hjk@qt.io>
2017-09-13 09:24:26 +00:00
Tobias Hunger
366ada9fea RunConfiguration: Centralize enabled state handling
Centralize handling of enabled state of RunConfiguration widgets.

Remove code that does the same thing in all the different run configuration
widgets.

Change-Id: I175d7e19d031bd28a2b19cd825e0b6568da19bc3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-28 17:26:10 +00:00
Tobias Hunger
131c7a1c4e ProjectExplorer: Introduce base class for enabled/disabled project configuration
... and use this as a base for all RunConfigurations.

Clean out code in the individual run configurations dealing with their
enabled/disabled state.

Change-Id: Icc2ea136b056f7aea7ce96480b4402459d7ac0ce
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-28 17:26:03 +00:00
Tobias Hunger
09b127f9f1 Project: Move signalling of parsing state into Project
Get rid of duplicated code to do such signaling in derived Project types.

Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:21 +00:00
hjk
f047e1a2a2 ProjectExplorer: Simplify standard run control construction
A lot of the target-and-tool specific run controls nowadays
have something like a single main RunWorker. This patch
removes the need to have user-implemented RunControlFactories
in those cases and adjusts local run, remote linux,
python and nim to take advantage.

There's more potential use downstream.

Change-Id: Ie2d2f839b8be1fad2be3b79e21de3c0e475d88cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-20 08:04:33 +00:00
hjk
230524da16 ProjectExplorer: Dissolve SimpleRunControl
As planned.

Change-Id: I9d9349cdd174c47b2331095fbe545b811e6ca770
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-21 10:36:15 +00:00
Tobias Hunger
0951589420 Project: Unify handling of displayName
Unify the handling of displayName with a proper changed signal across
all projects.

Change-Id: I7e503528854b85f6f38de4b0943775f82a0d6123
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-04-07 14:49:51 +00:00
hjk
bd5e2faa75 ProjectNodes: Handle supported actions one-by-one
Getting the full list for a node can get quite expensive e.g. in
cases of recursive calls of QMakeProjectManager::findPriFile.

However, the FlatModel needs to decide quickly on whether an item
is editable to potentially allow renaming.

So split up QList<Actions> supportedActions() into individual
bool supportsAction(action) calls and make sure Rename is not
on the critical path.

Task-number: QTCREATORBUG-17953
Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 12:47:03 +00:00
Tobias Hunger
b0c7bb0f7b Project: Move ProjectDocument setup into Project class
Change-Id: I5c0ec79ddf066e37660fb9a6b24f9d882355d511
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:53:24 +00:00
Tobias Hunger
348aa12eaa ProjectExplorer: Provide ProjectDocument and use it in all projects
Change-Id: I6e054ebf1043bd1f6748f1567f35c68394bd6528
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:03:34 +00:00
Tobias Hunger
fc5ce1e710 ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based
on the project tree.

Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.

Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-27 15:32:13 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
hjk
4d8352a6c1 ProjectExplorer: Add a FolderNode::addNestedNode() function
Also, rename buildTree() to addNestedNodes(), it's really
adding things, not recompletely (re-)building the subtree.

Use it whenever possible to avoid intermediate lists of items
to insert.

Change-Id: I5fde41e5b164a8a292410bd381a85f5efadf3471
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-14 12:26:22 +00:00
hjk
30b4955ed7 ProjectExplorer: Add a SimpleRunControl implementation
Essentially a RunControl with and ApplicationLauncher member like it is
used directly or in disguise in the LocalApplicationRunControl, Nim and
Python. Extenting that to RemoteLinux/Qnx is possible, but left to the
next patch.

Change-Id: I91b3199d3d6a418fe4e5be7a5d61689c581a5121
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-14 10:35:37 +00:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
hjk
fa67aa084b ProjectExplorer: Return a ProcessHandle for AppLauncher::applicationPID
Change-Id: I00fc4dbd3a3c022006de95087b61a86bbb83faeb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-10 16:44:13 +00:00