Commit Graph

214 Commits

Author SHA1 Message Date
Christian Kandeler
a8a6a9e774 ProjectExplorer: Make project window state persistent
Task-number: QTCREATORBUG-24690
Change-Id: Ia261fc5a98681676e8d67e6d840f2f48073cdbb2
Reviewed-by: hjk <hjk@qt.io>
2020-10-26 13:54:04 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Kandeler
08d16332f2 ProjectExplorer: Do not activate kits via right click
... in the target selector. When requesting the kit context menu by
right-clicking, we get extra mouse events on Windows that activate the
kit, which is annoying to users. Suppress these events.

Fixes: QTCREATORBUG-24156
Change-Id: I8a5de927634dfdfafb54d265ab31763c6120a527
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-06-29 08:02:45 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
hjk
b4ee6eb3c0 ProjectExplorer: Move some of the BuildInfo setup code to central places
Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 13:56:10 +00:00
Eike Ziller
6fc85b49fa Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/designer/codemodelhelpers.cpp

Change-Id: I78906f2fbbfd27d254589a272ebca423b0b80699
2019-11-28 08:24:10 +01:00
Nikolai Kosjar
b2f5ed78e1 ClangTools: Add "go to project settings" toolbar button
With the introduction of the "Analyze Current File" action the widget to
configure the diagnostic config was moved to the project panel (Project
mode > Project Settings > Clang Tools).

As not too many users are aware of the project settings there and
navigating there involves more user interation now (mode switch, looking
for the "Clang Tools" item), add a toolbar button as a shortcut.

Change-Id: I4c864045ef41ff501d925d3175ce604def213f29
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-27 14:42:12 +00:00
Christian Kandeler
58da82835b ProjectExplorer: Add shortcut for switching active project
... when in project mode.
We re-use the "GotoPreviousInHistory" action, which is semantically not
equivalent, but still seems like the most natural fit.

Fixes: QTCREATORBUG-19719
Change-Id: If00a90ce93ac3bd7e079d47eefa69e4f4aeb30cb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-19 16:43:05 +00:00
Nikolai Kosjar
6c1b11dd3e ProjectExplorer: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Iaaac21e96a3e9db6b9819d77fdae623ede373e59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-01 09:31:32 +00:00
hjk
09e5c167bd ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit
Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:29 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +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
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
Tobias Hunger
80c2ce118d ProjectExplorer: Modernize even more
Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-24 09:04:54 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Tobias Hunger
bcbb6e61ef ProjectExplorer: Use unique_ptr to hold targets in projects
Change-Id: I8f793f5e552b65939d6c7c5e0eb42b89f9f45c3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-24 11:39:49 +00:00
hjk
f8937daf71 ProjectExplorer: Make "Manage..." kits button work again
When configuring a newly opened or created project you are
able to press a 'Manage...' button that brings up the
options page of the kits. Was broken with the rework done
on the global object pool.

Change-Id: I87d91351c5769655c1192431a53784de1bca77aa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-24 13:42:30 +00:00
Tasuku Suzuki
ff155a2e42 Improve "Import Existing Build..." in project pane
The action is for active project. The button should be under active
project.

Change-Id: Ie0029bff02f58dbd5cb4c2a17bc086c168a522dc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-15 02:06:24 +00:00
Ulf Hermann
1b0d6e3c26 Avoid some memory leaks at shutdown
StatusBarManager needs to delete its contexts when dropping them,
QActions should be parented, and in ProjectWindow we can save an
allocation.

Change-Id: Idee075d4f2ce8014f22f73453987d1ab6539cf18
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-07 09:02:29 +00:00
Vikas Pachdha
5364140529 iOS: Fix crash on startup when a device is connected
In a rare but plausible scenario panel might be updated on device
connection while project is not yet loaded. The panel update will
happen again when project loading is complete.

Task-number: QTCREATORBUG-18226
Change-Id: I566e2d23adee529f0536ae644cef420c66578d54
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-24 08:55:26 +00:00
Tobias Hunger
b913e9d548 ProjectExplorer: Make imported buildconfiguration active
Make the new buildconfiguration active after it was imported via
Project Mode. Before the buildconfiguration was added but the
current one was still set, which lead people to believe that the
build directory was wrong.

Task-number: QTCREATORBUG-18082
Change-Id: I10412d94326d9e21820dfcac89adbe2c5da948ae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-25 15:31:14 +00:00
Leena Miettinen
778d711393 Project explorer: Fix UI text capitalization
Change-Id: I59c391b1d910ad74e30592217451a956463bd804
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 13:23:12 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
hjk
196dbbe0e7 Utils: Introduce TreeItem::{begin,end}
... and use this to reduce the number of explicit uses of m_children.

Despite of being shorter code by itself it is a step towards having
an explicit LeafItem object that doesn't explicitly store a(n empty)
vector of child nodes.

Change-Id: If8db85e2f1134dd1578a78d31235bf57a28f863a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-02-08 16:08:42 +00:00
hjk
8c3307a51a ProjectExplorer: Add space between treeview entries
Task-number: QTCREATORBUG-17481
Change-Id: I27c304d1a63477c6ad081dd843ec3a6e9b6b2a4e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-02-03 15:26:31 +00:00
Tobias Hunger
25fbcca96b KitManager: Get rid of KitMatcher class
Use std::function instead. Clean up API while at it.

Change-Id: I6e401ab57f5375e36710c30508c596af3f4b3385
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-18 10:39:16 +00:00
hjk
02dd37d30a ProjectWindow: Add a PanelsWidget convenience constructor
... combining default construction plus a single invocation of
addPropertiesPanel(), the only way it is ever used.

Change-Id: I2080e8b8fa25a2d7e429b7c18f5272466bc4eb79
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-15 10:23:01 +00:00
hjk
6bb0880a6b ProjectWindow: Rename SelectorModel to ProjectWindowPrivate
Less quirky, and that's what it is now.

Change-Id: Iae18f289ab498eb409579235e96325a7d0341e1a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-12 14:00:50 +00:00
Eike Ziller
c175f1e62f Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/ios/iossimulator.cpp
	src/plugins/projectexplorer/projectwindow.cpp
	src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp
	src/shared/qbs

Change-Id: Ie98e2401a2259903141a13170c78388f2da467d2
2016-12-09 12:42:01 +01:00
Eike Ziller
c226d311b7 Projects mode: Disable "Import" button if not supported by project
Task-number: QTCREATORBUG-17399
Change-Id: I79b64298c902776282d54d70efdc0eef03415a51
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-08 14:16:05 +00:00
hjk
98e0b4b0b5 ProjectWindow: Add a buttons to import builds to project tree
... to a shortcut to the Kits setup page.

This duplicates the functionality from the context menu but can
be directly spotted.

Change-Id: Ia5c2e1208346dc7191a04fbb9c2569ccab9aab31
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-06 11:53:15 +00:00
Tobias Hunger
7c4d993640 ProjectExplorer: Avoid possible nullptr dereference
Change-Id: I1c82c4187e075055a44746879df1513e48853c22
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-01 14:50:54 +00:00
hjk
757153fce5 ProjectExplorer: Don't show context menu when it makes no sense
Task-number: QTCREATORBUG-17152
Change-Id: Ic67386bdfd6d6d79e8a15bc6394a22cb46305335
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-15 13:25:09 +00:00
Sergey Belyashov
874683a15e Fix lacks of Q_OBJECT macro
Change-Id: I0de19ed983c45260c957ea88422093bf7faca6a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-11 13:15:49 +00:00
Tobias Hunger
6486cc8127 ProjectExplorer: Fix possible use-after-free in Project combobox
Make sure the combobox values are set to null. Otherwise the ComboBoxItem
might try to read from that value while it is being removed from the model.

Task-number: QTCREATORBUG-17223
Change-Id: I6588aaddf39736846878593a8e6844dab96de408
Reviewed-by: hjk <hjk@qt.io>
2016-11-03 14:34:22 +00:00
hjk
7157e5c1d2 ProjectExplorer: Revive project importer
Fixes a regression introduced in recent changes. Import project from
build is now available again on the target setup page (shown when
no kit is active) and in the context menu of the left pane.

Task-number: QTCREATORBUG-17046
Change-Id: I5a1285624084f0cb6e0947560516ae88d4b3e376
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-17 16:17:57 +00:00
hjk
91090f8871 ProjectExplorer: Add an "Active Project" label to Project window
Change-Id: I9036d25f9cde0849c8a2fed5b2c3ce97f1315f55
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-10-17 10:40:07 +00:00
hjk
d78e87329f ProjectExplorer: Filter out unusable kits
As side-effect, fix missing expansion of subitems in some cases.

Task-number: QTCREATORBUG-17110
Change-Id: Ib0c74e968d6d814f9dadbb37b323c8ac68cda310
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-14 12:09:44 +00:00
hjk
a6032652ef ProjectWindow: More tree polish
- Remove 'panel memory effect' when switching kits

  Previously, each target entry memorized when its Build or
  Run page was used, and when switching to the target, that
  page came up.

  Now, don't use that when switching targets, but instead
  take the same page as is selected on the target we are
  switching from.

- Disable selection of the Build&Run and Project Settings
  "group entries"

Change-Id: I2214f8edc38be2e76a50f8984aa75d8f78b62026
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-10-10 06:15:38 +00:00
hjk
b83837de47 ProjectWindow: Some code cosmetics
Mainly remove unneeded stuff from the header. No functional changes,

Change-Id: I1dfcc97a0aeeca46a3b8891a97a805efea6cb349
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 13:28:07 +00:00
hjk
c05fd099e9 ProjectWindow: Fix display of kit list after loading new projects
It is still unclear what the original problem was. setRootIndex()
on changing model contents seems to be involved.

This patch works around the issue by splitting the original big tree
containing all projects into separate per-project trees.

Change-Id: I13295fc827d750d11300313ffb19cc085837f5bd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-06 20:38:32 +00:00
hjk
0906c62b70 ProjectExplorer: Remove PropertiesPanel struct
Parameter structs are convenient if they get passed around
a lot or are regularly changed. This isn't the case here,
so make the user code more compact instead.

Change-Id: Idd5e5cc1f70b1547607532cd3e6515c27983c169
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-04 12:54:02 +00:00
hjk
a5e26753bf ProjectWindow: Make switched-to project active again
This fixes a regression introduced in the recent ProjectWindow
reorganization and keeps the active project, the target selector
and the active item in the project combobox synchronized again.

Change-Id: If2baf4336d5da5d74f1cbf8ddc4e8cb056d49369
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-30 09:07:00 +00:00
hjk
06b362dcec ProjectWindow: Don't show icons in project combobox
Change-Id: I5438ebbcea598a6972fad1f89ab9ac4ee1ba67aa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-29 06:51:29 +00:00
hjk
14d3e89b7d ProjectWindow: Move Project combobox back from top bar
Better discoverable.

Change-Id: Ifae3311b566fc5e5e8b05f2b39abf1520aefde48
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-09-28 15:24:30 +00:00
Eike Ziller
39555d3b86 Projects mode: Make plus icon dark and get rid of branch indicators
The PLUS icon was actually PLUS_TOOLBAR, so name it that way and add an
actual PLUS icon.
Remove the drawing of the branch indicators from the kit tree view by
overriding the method that does it.

Change-Id: I395e5187c1738faaee3e122b4f3f359261b514d7
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 10:02:22 +00:00
hjk
b259939755 ProjectWindow: Make kit activation easier
Add a [+] icon for inactive kit entries, add a "Click to activate" to
the tool tip, and allow single click activation.

Change-Id: I1219eb54b4e3a077ef133afaf71134bb35e14fb7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-19 12:43:15 +00:00
hjk
734c348700 ProjectExplorer: Some polishing of the new ProjectWindow layout
This moves all non-Build&Run entries under a separate 'Project settings'
entry.

Internally, this mainly makes the information flow on what item a user
selected and in which direction in the tree information needs updated
a bit more explicit.

Change-Id: I4583151356ef50b244b1d05dd77f04de2355105f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-14 12:31:12 +00:00
hjk
a6acd3e8d9 TreeModel: Introduce a TreeItem::indexInParent() convenience function
To shorten user code and hide the ugly const_cast.

Change-Id: I798bd105932004ea17cb95b243fc38ccfcda0a2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-03 09:24:01 +00:00
hjk
def8ca8ba1 TreeModel: Move some base TreeItem code out-of-line
Avoid code explosion.

Change-Id: I7d239a4560e90b68cc4991341adf940a98776254
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-03 09:23:46 +00:00