Commit Graph

263 Commits

Author SHA1 Message Date
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
Mathias Hasselmann
da2e60fa3e Core: Show context of filter matches
When inspecting logs often enough the relevant information is next to
the line with the unique expression that's easy to match. The `grep`
tool solves this problem by providing various `--*context` options
which configure how much context to show for each match.

This change tries to replicate this feature.

Task-number: QTCREATORBUG-30167
Change-Id: I6432870c0b958df8c5dc616009aea4ca54973245
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-09 09:00:17 +00:00
hjk
efae651924 Utils: Introduce a convenience function creatorColor()
... forwarding to creatorTheme()->color(...)

Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 13:49:25 +00:00
David Schulz
262dcc6643 Core: do not activate open documents entry on right click
If we activate an entry before we handle the context menu event we might
switch into another mode. For example when right clicking on a ui File.

Fixes: QTCREATORBUG-30357
Change-Id: I8de78c3a6bbd9d62e2766ccd2059ee3ee4ef0870
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-03-01 11:29:17 +00:00
Eike Ziller
a9c2be1071 Projects: Fix misc settings widgets if vanished targets are shown
When vanished targets where shown in Projects, clicking on the project
specific settings showed a blank page.

There were hardcoded indices for the target and the misc settings. Get
the right child for the index directly instead.

Change-Id: I725d470ad04f8a227c91938efada76a757a7442c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-02-23 12:35:58 +00:00
Eike Ziller
acedf93ba3 Remove CommandButton
The same can be achieve with a factory method in `Command`, similar to
the existing ones for actions and buttons which synchronize their tool
tips with the shortcut.

Change-Id: I7e17654706b902dfa14f37b958fc2a60705d5cb5
Reviewed-by: hjk <hjk@qt.io>
2024-01-26 12:25:26 +00:00
Eike Ziller
b8c9d79b9f Remove focus rect from some input fields on macOS
The focus rect on macOS needs some space around the widget itself,
otherwise it looks wrong. We already removed the focus rect for various
input fields like locator and search (cmd+f), also remove it from filter
input fields for the various output panes.

Change-Id: I048453c06264c51ec28b5a0c9368fad7c01dc5a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-01-26 10:31:07 +00:00
Christian Kandeler
3fc1b5f57b Core: Let callers specify which part of an options page to pre-select
... and use it for the "Manage kits" functionality.
We will make use of this in other contexts as well.

Task-number: QTCREATORBUG-25077
Change-Id: I79c622075b9385b060aed73534d39acc23fd765e
Reviewed-by: hjk <hjk@qt.io>
2024-01-19 11:27:11 +00:00
Eike Ziller
5c726df5b8 ProjectWindow: Initialize vanishedTargetsItem
We check for its existence in rebuildVanishedTargets(),
so this was a potential crash.

Change-Id: I5be2f4bad54cc9b1ce16e2f0ab7e63378379803d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-18 09:38:11 +00:00
Eike Ziller
38da356153 ProjectExplorer: Do not create replacement kits automatically
Instead keep a list of "vanished targets".

These are shown in Projects mode in a separate list under the list of
kits. Via the context menus of those items (or with single-click), the
user can choose to either copy the steps of the vanished target to
another kit (already configured or not), or to create a new replacement
kit for it (similar to the previous replacement kits, with the same
device type and the steps restored, but no other parameters from the
kit restored - the project doesn't save that information), or remove
them.

The vanished targets are not removed from the project's settings as
long as the user doesn't create a kit or copy the steps, so if the kit
re-appears on a later run of Qt Creator, the original target is
restored for that kit and the entry in the "vanished targets" list
automatically vanishes.

This has the advantage that in contrast to the replacement kits, the
vanished targets are clearly separate from "normal" kits, and that they
are local to the project. Nothing is left behind after closing the
project.

Change-Id: Iccec04fea38cd55ff683665c9cf4edc9a2388c82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-12 07:58:59 +00:00
Alessandro Portale
a4a27b8931 Utils: Fix function name case StyleHelper::Uifont -> uifont
Oopsie.

Change-Id: I66c4b56f43c50e3dfc5c17ffd95d778d496b77f2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-07 11:05:12 +00:00
Alessandro Portale
7f60ce0666 Utils: Align enum StyleHelper::UiElement with upcoming design system #1
This change demotes the existing H1 and H2 to H3 and H4. It is supposed
to not change the visual appearance.

Change-Id: Idc3056307f0286a2d4d276ba79125ba93d5ac428
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-17 10:42:53 +00:00
Alessandro Portale
6c57c51981 Use StyleHelper::UiFont()
Change-Id: I0c09578b76c48ddb255f44bb6117089dd092a72c
Reviewed-by: hjk <hjk@qt.io>
2023-11-15 15:02:13 +00:00
Tasuku Suzuki
b19a26b135 ProjectExplorer: Not create Manage Kits button if Kit options are hidden
Project window doesn't use the button anywhere else.

Change-Id: I97537524b615b9fd523828bc540b5412578c69c9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-14 18:19:59 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
hjk
c18de1ecb6 ProjectExplorer: Start with selected kit
If there's one; when clicking "Manage Kits..." in project mode.

Change-Id: I06a92d8e286f7b2b54844b7f41029d7c64684398
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-21 12:28:16 +00:00
Jarek Kobus
8d8e60436d ProjectExplorer: Simplify return statements
Change-Id: Ifef006cd2dcc567097ce16376eab9ccedb092f04
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-02 11:08:25 +00:00
Tim Jenssen
002d84cb15 Merge remote-tracking branch 'origin/11.0' into qds/dev
Conflicts: src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/auto/qml/qmlprojectmanager/fileformat/fileformat.qbs
  tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp

Change-Id: I257f1908917bcc58805619b53b6866f2f73ca544
2023-06-02 19:26:05 +00:00
Miikka Heikkinen
d9cc2dc8c5 ProjectExplorer: Fix check for "Kits" page hiding
Fixes: QDS-9231
Change-Id: I53fc333fca2ec81edcb2b254a98613309e8335a9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-06-02 12:41:26 +00:00
hjk
d6111f2e1d ProjectExplorer: Remove some pointerage around KitOptionsPage
Change-Id: Ib1736a80739c6052372896bac03aa324fd807151
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-16 12:45:24 +00:00
Alessandro Portale
1d4228dfda ProjectExplorer: Prevent context menu on ProjectSelector
The context menu on the ProjectSelector (outside the "SelectorTree")
does not make much sense and pops up with an offset.

Change-Id: I79aa3157e04b9d343077fdbc87b8f7cd891426b4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-09 09:22:07 +00:00
Tim Jenssen
adb664f521 Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/libs/utils/filepath.cpp
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/unit/unittest/CMakeLists.txt

Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
2023-03-30 13:30:42 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Miikka Heikkinen
67e5246be2 ProjectExplorer: Hide Manage Kits button if Kit options are hidden
Fixes: QDS-9231
Change-Id: I185a3f038ebd67fdc9aff60b860980d3c0f3cadb
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-03-02 12:43:25 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +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
hjk
c5f7f5ab0a ProjectExplorer: Tr::tr
Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-16 12:10:24 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +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
Alessandro Portale
0ec7a3797d Utils: Add a non-toolbar variant of the MINUS icon
Make it consistent with Utils::Icons::PLUS and
Utils::Icons::PLUS_TOOLBAR

Change-Id: I2d5c69ec13ceba172c2c583895eea6fdff77a64e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-18 09:02:58 +00:00
Jarek Kobus
5b3927869c Drop Qt5: ProjectExplorer: Get rid of QOverload
Change-Id: Id8b28efa7b31a92a5e24485803322c586a23802d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-20 13:13:11 +00:00
Eike Ziller
4d72cb55ba Projects mode: Use "Show Right Sidebar" action to toggle build output
For users who want the full area for the configuration widgets or don't
see output there because their build system doesn't put it there.

Fixes: QTCREATORBUG-26069
Change-Id: I4ffa73be88e5c7cc058227bc681f87e4c0a642bd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-07-05 09:08:40 +00:00
Jarek Kobus
e981bedf68 BuildSystemOutputWindow: Don't leak actions on shutdown
Detected by memory analyzer.

Change-Id: I49f9f73b552ba89810105d79d98cfff035f7d37e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-27 12:41:49 +00:00
Artem Sokolovskii
7954c4cc69 ProjectExplorer: Add a common template for project settings
- Added base widget class for common options among project settings tabs
- Added usage new template class to all pages used in project settings

ToDo
- Make CodeStyle tab standardized

Change-Id: I8f70413b6ee764c5e43fbeae104b9389237c582f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-24 10:02:45 +00:00
Artem Sokolovskii
51be3be2ea ProjectExplorer: Remove foreach / Q_FOREACH usage part 2
Task-number: QTCREATORBUG-27464
Change-Id: Ibfacf5a3b9789a3cf0ea229d1b0d22639101bf9a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-12 11:12:03 +00:00
Alessandro Portale
03d4fdc602 ProjectExplorer: Remove Icon from main panel
Only a few panels come with an icon, and then the icon is unthemed and
only for standard dpi (original design file is unavailable).

The gained space benefits the vertical output pane on the right.

Fixes: QTCREATORBUG-21917
Change-Id: Ie717ee7a08cbd21292a8e051c41406df58cad6d6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-14 12:44:29 +00:00
Eike Ziller
29df497d25 Add text search functionality to output window centrally
All output windows should be searchable with Edit > Find/Replace
(Ctrl+F), no reason for every single instance setting that up
individually.

Add a find placeholder for the build system output in Projects mode, so
the search functionality is available there as well.

Change-Id: Idad6824bfb21e6ae9ab923191a7e83b43256e68b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-20 13:58:45 +00:00
hjk
8885ef7e5a Utils: Pass dialog parent to Utils::* file dialog
Amends 3edc5673b5.

Turns out quite a few potential uses have other parents than
ICore::dialogParent().

Use a nullptr parent to mean ICore::dialogParent() to keep the
caller side simple.

Change-Id: Icfe1daafd710ae273d286679e0c8e2a3a27da552
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 12:54:08 +00:00
hjk
b8f369c436 Use the new file dialog wrappers in some places
Change-Id: I326c883f2f76593e6fcb0f3e376d387273312982
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:56:51 +00:00
Eike Ziller
e895a0380b Fix lupdate issues
Some tr functions missing, some places where we need full qualification
because lupdate gets confused with namespaces.

Change-Id: Ic1d6ef3b31960dda02bc0788a255857117acdca9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-07-09 13:05:03 +00:00
Eike Ziller
6261e9917f Add zoom buttons and use editor font in build system output
in Projects mode.

Change-Id: I4adee900651192c83de5b3a851c1766f3cb35200
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 07:12:27 +00:00
Eike Ziller
c70d4ae243 Add filter input to build system output
in Projects mode.

Change-Id: I69f40d38606b724ba07833141ce9f2f60239e0e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 07:12:17 +00:00
Eike Ziller
f3997c565e Add clear button to build system output
in Projects mode.

Change-Id: I7ab5b460228f6c8a2c68ece87ccfbdef3608bd9c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 07:11:56 +00:00
Eike Ziller
3c9da87f33 CMake: Duplicate CMake output in Projects mode
There is some space on the right side there, and in Projects mode it is
nice to have the output directly visible without opening the General
Messages pane (without intermangling with other output there).
This is a first step that duplicates the output in a very simple manner.

Fixes: QTCREATORBUG-25522
Change-Id: Id53b21d629b1f1bbc46ebf3d38bcec1fd83a6360
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-04 11:07:28 +00:00
hjk
d32cc4bd38 ProjectExplorer: Replace project mode main window splitter by dockwidget
The main window of the project mode is already a QMainWindow,
using a dock window also for the empty space on the right makes
it consistent with the separation of the project tree on the left.

Change-Id: Ida42f267b87eb45cd1692ebcc16ded2ee6c1e523
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-03 08:27:28 +00:00
Christian Kandeler
97744a071a ProjectExplorer: Fix project mode layout issue
Window state save/restore was undermined by code that added and removed
the central widget, leading to inconsistent data.
Fix this by making sure that we (de-)serialize if and only if a central
widget is present.
Also remove the hacky workaround that was supposed to fix this, but
didn't.

Fixes: QTCREATORBUG-25551
Change-Id: I6e7f2aff7455db476f870ead64b09a9716f3558b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-04 14:46:06 +00:00
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
Christian Kandeler
247a432f74 ProjectExplorer: Fix project window layout restore behavior
Steps to trigger the problem:
1) Start Creator with some fresh settings path.
2) Open an unconfigured project.
3) Observe a normal-looking target setup page.
4) Configure the project.
5) Close the project.
6) Remove the .user file.
7) Re-open the project.
8) Observe a target setup page whose left part takes up almost all the
   space, leaving the main project widget practically invisible.

Conclusion: The configure page does something to the widget state that
breaks the restored layout. I don't know what it is exactly.

Fix: Slightly delay restoring the widget layout.

Change-Id: Id88ea12267a7dd0fe54749c18b0761d0e873d646
Reviewed-by: hjk <hjk@qt.io>
2020-10-30 09:11:31 +00:00
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