Commit Graph

236 Commits

Author SHA1 Message Date
Marcus Tillmanns
84ba3c58c2 Utils: Replace BaseAspect::pushUndo
Moving the logic into Undoable::set() reduces allocations.

Change-Id: Ib4a10d1e41da8d42d66bfe9ef24a667c5bfd8c0c
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 12:01:46 +00:00
Marcus Tillmanns
811792df58 Utils: Don't store widgets in BoolAspect
Change-Id: I185dbb32ccae6bff4e222f7a9d9cd6ccd6bdbc69
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 09:20:18 +00:00
Marcus Tillmanns
399c2f92d6 Utils: Don't store pointer to aspect label widget
Change-Id: Ieb8a04357fbdbc909fed79e33ef6a1d0cef2d721
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 08:30:48 +00:00
Marcus Tillmanns
f4f75224b7 Revert "Utils: Add StringListAspect editor"
This reverts commit cd8bc98e52.

Reason for revert: Breaks compilation

Change-Id: I27ef9b718adf8cd4b8ac72e77161515ff637bd6e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-21 07:35:28 +00:00
Marcus Tillmanns
cd8bc98e52 Utils: Add StringListAspect editor
Change-Id: I0d6713f75967fb56132f89772aa48fa1de2368af
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 07:34:03 +00:00
Marcus Tillmanns
67bd5fc359 Utils: Add StringSelectionAspect
Change-Id: I73b5c964be1222f56fcc01f30d17506f92d1f6b2
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 13:02:07 +00:00
Marcus Tillmanns
b81026488c Docker: Improve error reporting
Change-Id: I1a1ad824b4084ce7203357acf9ec19ccfe91b5cd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 13:00:39 +00:00
Marcus Tillmanns
16f7652717 Utils: Add AspectList::addToLayout
Added a new, clean IconButton that mimiks the ToolButton
with the compact/relaxed background.

Change-Id: I582c6aac404724af5459bab2ca9023aa63171f93
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 06:26:42 +00:00
Marcus Tillmanns
26b436f46f Utils: Fix constness in AspectList functions
Change-Id: I960e02e1a193856de3ed0e090fdf694884a28ac5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-15 06:25:22 +00:00
Marcus Tillmanns
d44afce0f0 Utils: Add AspectList aspect
Change-Id: Id164828f4ba46c973edbcd123c855bb7b70ad8f7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 11:37:10 +00:00
Marcus Tillmanns
7200644f75 Utils: Syntax cleaning
Change-Id: If296e0240840f66c371106508f3f0046bc7a9a71
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-13 07:11:52 +00:00
Marcus Tillmanns
67aab38873 Utils: Add undo/redo to BoolAspect
Change-Id: Ie80e81c2ceef232278e2815ffa56bcbaef903eb2
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 13:30:40 +00:00
Marcus Tillmanns
ed0935733e Utils: Add FilePathListAspect
Change-Id: Iec89581e5818139bcc48ed807935c10421b7b664
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 08:51:20 +00:00
Marcus Tillmanns
66c8eda943 Utils: Add Undo facilities for aspects
Change-Id: I2a8acfa23b3a4303414be21af224b08c13561666
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 07:12:45 +00:00
Marcus Tillmanns
8bcec807d9 Utils: Fix AspectContainer::setAutoApply
Removes duplicate m_autoApply from AspectContainerPrivate.
Fixes issue when calling BaseAspect::setAutoApply()
on an AspectContainer.

Change-Id: I5f56d8d3c6d52d32c9365faf3d0e22facb757f03
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 07:11:26 +00:00
Marcus Tillmanns
76a95ff0ee Utils: Switch to QtcSettings
Changes a few remaining QSettings members that popped
up when trying to build with "apt-get" Qt 6.2.4.

Change-Id: I3caa8545cf02d6453b802559c2f65279e1fb63fd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-05 07:02:24 +00:00
Marcus Tillmanns
0490266723 Utils: Add Aspects::volatileToMap
Change-Id: Ic4b77e27570485864cb4a9a412d685c400a9e7d1
Reviewed-by: hjk <hjk@qt.io>
2023-08-24 08:49:06 +00:00
hjk
2bf886ed73 Utils: Use a bit more Key and Store
Also, separate the Key into a separate header to minimiz impact
on #include load.

Change-Id: I4f719cad4d23a71a9c228d0b7f5c2409fd6e24d5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 05:58:05 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
hjk
ec7abcf98c Utils: Make FilePathAspect::setDefaultValue take a QString
This sets the unexpanded value, so going to a "cooked" FilePath can
at least theoretically break. On the user side it saves a
roundtrip in a few cases, but is more ugly when the input is already
a proper FilePath.

Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-17 11:58:41 +00:00
hjk
e9c1901bad Core: Use an aspect for the Patch tool path setting
Change-Id: Ifc758fb4ac5d00a7b755ea06f3f6b98d53e7cc46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-16 08:57:09 +00:00
Marcus Tillmanns
013b71b301 Utils: Allow cascaded aspect "setEnabler"
Change-Id: I4e519c0ef27460b42c4e44a755e5e6cbbf49ebdf
Reviewed-by: hjk <hjk@qt.io>
2023-08-15 13:30:06 +00:00
Marcus Tillmanns
b0d5e44235 Utils: Add Password display to StringAspect
Task-number: QTCREATORBUG-29485
Change-Id: I8da46be4c63f97595aa1e93b6ac4905bdbb54799
Reviewed-by: hjk <hjk@qt.io>
2023-08-15 13:02:31 +00:00
hjk
2c353c37ea Utils: Base AspectContainer on BaseAspect
Change-Id: I78b11727af6e465da5731ba36bbae476d11d11ee
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-09 06:59:01 +00:00
hjk
f09b61651e Utils: Approach aspect update signalling more systematicly
This was pretty much ad-hoc so far. Now do the actual value proliferation
inside the aspect first and collect information on what changed. Signal
changes in the end centrally. At that time the aspect internal state is
consistent again.

Additional design desision implemented here: setDefaultValue and
fromMap/readSetting do _not_ signal, user code with unusual needs
has to check on its own.

Change-Id: I1e46282558e014f51933d1044a72bf5c67437ec5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-08 12:06:16 +00:00
hjk
bf5296292a Utils: Rename LabelPlacement::AtCheckBoxWithoutDummyLabel to Compact
In BoolAspect. Felt a bit too descriptive by now.

Change-Id: I0cf2eb88576da3d3741d146a8274cf8a85bc7c83
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-07 08:22:00 +00:00
hjk
7d08f96da5 Utils: Remove AspectContainer ctor's parent parameter
Instead use setParent in the two cases that use it. The parent gets
in the way when attempting to derive AspectContainer from BaseAspect.

Change-Id: I6079beb0e00334133da115b714bc5186064c6722
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-28 12:24:04 +00:00
hjk
6ed56f640a Utils: Make it possible to change internal aspect updates
... without subclassing. This is useful in situations where there
are small modifications needed for simple aspects that are themselves
exposed as members of an aspect container in a header but we
don't want to create a subclass for it.

Change-Id: I058643137c38e564072af9a2f45b1576ea058651
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-28 07:31:00 +00:00
hjk
429ad78bc7 Utils: Finally split FilePathAspect and StringAspect
The patch was done by
    - duplicating StringAspectPrivate to FilePathAspectPrivate
    - basing FilePathAspect on TypedAspect<QString>,
      duplicating the needed used parts of StringAspect interface
      and implementation
    - dropping m_pathChooserDisplay from StringPathAspectPrivate and
      all other *displays from FilePathAspect private
    - remove related things until it compile
    - remove now unused members in the privates.

Change-Id: I6ad710135dc4d3fc2f48bb620b502c20e717aa42
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-27 14:38:53 +00:00
Marcus Tillmanns
4c5e3aa6ba Utils: Fix BoolAspect::action
Change-Id: I6c82dfd5ec15eae16091e4ab52b552b636fbcca6
Reviewed-by: hjk <hjk@qt.io>
2023-07-27 10:58:23 +00:00
hjk
d31416a5f5 Utils: Introduce a way to immediate force aspect value saving
Will be used for e.g. valgrinds error categories. These are handled
by actions in a menu outside the settings page mechanism.

Change-Id: I2dea9b9f13dbc92fa3e9938f85aa083d01d0d99b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-25 08:11:33 +00:00
hjk
d22df34e6c Utils: Factor out code related to optional checkboxes for strings
We will need it twice when the FilePathAspect is fully separate.

Change-Id: Ief69af0e1167d5ca5c770c3cbd16fdafa16114f7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-25 05:43:31 +00:00
hjk
0f91561667 Utils: Make FilePathAspect::value() return a QString
This is meant to be the "internal", raw, unexpanded value that does not
necessarily match a scheme://host/path pattern before expansion.

Change-Id: I627afbe1e9682d85c5bb04542c7354760ba9a13f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-21 12:48:23 +00:00
hjk
0a37ff4149 Utils: Move some more FilePath-only functions to FilePathAspect
Change-Id: Id814e69339d510e88efbf95108c7573bcc53a87b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-21 12:34:35 +00:00
hjk
ce998a1661 Utils: Move pathChooser accessor from String to FilePathAspect
Change-Id: Ida3cf1ea8249461bd48327b0c77de1e66a2541e6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-21 08:52:48 +00:00
hjk
6847c7c5ae Utils: Consolidate some duplicated code in aspect implementations
Change-Id: Iad6b81d13705ce6ad752f2855fb47ea038ffe581
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-21 07:42:12 +00:00
hjk
7cc6078756 Utils: Let aspect transition functions indicate there was a change
Helps to make it easier to reason about the necessity of emitting
*changed signals.

Change-Id: Ieab29b25f5cc2799e193417b9cab02c99501c60a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-20 13:52:24 +00:00
hjk
635e8c1614 Utils: Introduce a FilePathAspect::expandedValue()
Currently and long-term synonym for operator(), to be used in
cases where (*this)() or such looks ugly.

Change-Id: I3f70ecd3298a1df394a0e3cc593917b4c7d36d82
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-20 10:39:43 +00:00
Jarek Kobus
6cc471f38d Utils: Replace QVector with QList
Make usages of QList consistent. In some cases the
declaration contained QVector arg, while the definition
had QList arg.

Remove some unneeded includes of QList.

Change-Id: I7c15b39f261cefdeec6aaaf506ff4cc981432855
Reviewed-by: hjk <hjk@qt.io>
2023-07-20 09:57:07 +00:00
hjk
2a31f17354 Utils: Use handleGuiChanged more consistently in aspect implementations
Change-Id: I53eb3416b27dca45bd30860f1fb0ec674c98240e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-19 05:16:32 +00:00
Christian Stenger
9338f7a4d7 Utils: Fix visibility handling for aspects
Otherwise we may fail to hide widgets of aspects that are explicitly
set invisible while construction.

Change-Id: I2679c8fa22e79e4eb32ca5ae4266010d8cf9387d
Reviewed-by: hjk <hjk@qt.io>
2023-07-18 11:45:43 +00:00
Eike Ziller
d127336753 Fix that aspects read&wrote install settings
Do not give them the QSettings object that has SystemScope.
Also rename the "globalSettings" term to "installSettings" locally and
in PluginManager, and the one for aspects to just "setSettings" (like
e.g. for TerminalCommand).

Change-Id: Iad051f6e507373042014db73b83d0b16944b7374
Reviewed-by: hjk <hjk@qt.io>
2023-07-18 07:59:26 +00:00
hjk
4ab1d75ee6 Utils: Introduce a staging area for gui values
Accessing gui elements is very aspect-specific, whereas the
rules when and how values are synchronized are rather general.

Splitting the two concepts and having a permanent 'buffer' area
that is synchronized with the gui elements if and only if they
have been created helps to keep the boilerplate needed per-aspect
at a minimum.

This value could also serve as "model" in case we wanted to allow
multiple "views" in different places of the gui onto that aspect.

Change-Id: I34832512b99c53cb0e4df437ee9b4c5d17a2ad8f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-18 06:53:28 +00:00
Eike Ziller
835201060d Merge remote-tracking branch 'origin/11.0'
Change-Id: I2e0e8dd5f9b42533c665255f8539e837938846de
2023-07-13 08:28:42 +02:00
Cristian Adam
ba755e50a3 Utils: Fix inverted logic for checkableDecider (continued)
Amends 6b6b1198dd

The commit above made sure that the display of the dialog was in sync
with the checkbox in the settings dialog.

Now also the "Do not show again" checkbox in the messagebox will be
reflected in the settings dialog.

Change-Id: Ieb186b134adac09c9846a64144056b3b89d297d8
Reviewed-by: hjk <hjk@qt.io>
2023-07-12 13:12:40 +00:00
hjk
e1ca7cf53f Utils: Let registered aspects know about their containers
Will help to set up macroexpanders with less boiler plate.

Change-Id: I521af3dc9d49524cf855e82eecc0132d1bcc40db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-11 09:37:17 +00:00
hjk
96506f1f6a Utils: Further split StringAspect and FilePathAspect
... by introducing "proper" FilePathAspect::value() (and therefore
hiding the inherited StringAspect::value(() and a temporary stringValue()
for the transition period for the remaining users of the QString value.

Change-Id: I40cf4238a09a9009cda0decba1acac82bd730233
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-11 06:30:11 +00:00
hjk
ebda2068dd Revert "Utils: Move a few FilePath-only functions from String to FilePathAspect"
This reverts commit e8617dc0c0.

Downstream AppManager still uses a combined String/FilePath aspect
version.

Change-Id: I9de08785120622d76daaa7c4be20fb5abb933095
Reviewed-by: hjk <hjk@qt.io>
2023-07-10 16:17:14 +00:00
hjk
e8617dc0c0 Utils: Move a few FilePath-only functions from String to FilePathAspect
Change-Id: I682e158186a1ea7e374c9f0480e292018af07200
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-10 12:39:38 +00:00