Commit Graph

1213 Commits

Author SHA1 Message Date
hjk
e6d1f08642 Drop use of Qt::DefaultLocaleShortDate
Gone in Qt 6.

Task-number: QTCREATORBUG-24098
Change-Id: Ie9fe1858406133fed6987de0e0a38fe86de15caf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-22 06:43:39 +00:00
Orgad Shaneh
92a4c0d38a VCS: Pass links to the correct VCS
Current implementation requires each VCS to connect to the referenceClicked
signal. Only Git does it, but this is conceptually wrong. If other VCSs
would connect to the same signal, all of them will act upon clicking a
link, which can result in multiple editors, most of them are likely to be
invalid anyway.

By default executes vcsDescribe. Can be extended or modified by subclasses.

Change-Id: Ib953009efd77446a4b2963f0aa8a2f3f3d26509f
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-21 06:47:20 +00:00
Orgad Shaneh
6cfd240285 OutputWindow: Do not activate links for empty reference
Change-Id: I1d4fc0f25f1882a34058c66c51376982cc70238e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-18 16:52:03 +00:00
Eike Ziller
1b431fe271 Move Id from Core to Utils
And add a compatibility wrapper for Core::Id, so we don't have to rename
all occurrences from Core::Id to Utils::Id.

This allows us to use Id also in Utils, which makes it possible to e.g.
move Core::InfoBar to Utils without work arounds.

Change-Id: I5555d05b4e52f09d501dbfe5d91252a982a97c61
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-18 05:58:23 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
hjk
361b80cb9b ExtensionSystem: Remove PluginSpec::isHiddenByDefault
Not used anymore.

Change-Id: Ic73ba3024b9e6157ff044cb23450fc9dad3c4c02
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-16 09:08:36 +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
Andre Hartmann
d1b0966996 Git: Fix filling commit selection combobox for log
Broken by commit cbb70513bf, which changed the
format for the normal log to override the highlighter.

We still need the hightlighter for the log with diff.

Therefore, a separation between highlighting
and parsing the log is needed to populate the
combobox for commit selection again.

Change-Id: I902ce548fc25875f2cd67b165283ff1236329afa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-16 19:47:46 +00:00
Andre Hartmann
9c71e41ad1 VcsOutputWindow: Modernize password obfuscation
Use QRegularExpression and the QString::replace()
function with capturing groups to replace the
existing loop.

Change-Id: Ia9c0587dcdae40cff2b09379ac3ba84db4d30ce8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-16 19:09:43 +00:00
Andre Hartmann
02d216fa13 VcsBaseEditor: Reduce scope of local variable
As suggested by cppcheck. While at it, make it const.

Change-Id: I7800291545f8f14f4d939152d9a184da6eadc1f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-16 19:03:16 +00:00
Andre Hartmann
c2c5731d50 VcsOutputWindow: Fix creating links from command output
After the refactoring of the output parsers in
1c6e4fbd32, NormalMessageFormat and
ErrorMessageFormat are no longer parsed.

To allow parsing and therefore generating links,
the command output has to be declared as stdout
or stderr, depending on the severity.

Our own log and command messages are now
(in contrast to Creator 4.12) no longer parsed for
commit hashes and links, but this is acceptable.
Parsing the command output is often more interesting.

Change-Id: I7e7a96f4ff98edd88f5d9b8abddf94363768c0a6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-15 12:05:05 +00:00
Andre Hartmann
9c1e8a99d8 VcsBaseEditor: Make link colors theme-aware
Change-Id: I5323e0cd236276a5a74e7c55f81d9d9c9795d295
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-05-12 13:36:42 +00:00
Christian Kandeler
1c6e4fbd32 Merge output formatters and output parsers
Now only one piece of code needs to be written to both linkify output in
an output pane and create tasks for it in the issues pane.
The calling sites are also simplified. For instance, until now, build
steps had to feed their output parsers manually and then push the
created tasks up the signal stack in parallel with the actual output,
which the build manager relied upon for cross-linking the output pane
content. Afterwards, the output would get forwarded to the formatter
(and parsed for ANSI escape codes a second time). In contrast, a build
step now just forwards the process output, and task parsing as well as
output formatting is done centrally further up the stack.
Concrete user-visible improvements so far:
    - File paths in compiler/linker messages are clickable links now.
    - QtTest applications now create clickable links also when run
      as part of a build step, not just in the app output pane.

Task-number: QTCREATORBUG-22665
Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-23 08:47:08 +00:00
Christian Kandeler
98ce70480a Vcs: Fix output pane
Amends c0c2df203d.

Change-Id: I77d022f2b3a4d3cab4713d9cbd2bc66102ee58a3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-17 14:52:12 +00:00
Christian Kandeler
d42920d372 OutputFormatter: Take ownership of the line parsers
For symmetry with IOutputParser.

Task-number: QTCREATORBUG-22665
Change-Id: I92e93b32e87ff4f3fa163a2d2fe13768e56bfa24
Reviewed-by: hjk <hjk@qt.io>
2020-04-15 09:07:17 +00:00
Christian Kandeler
c0c2df203d Utils: Split up OutputFormatter class
An OutputFormatter takes some string and prints it into a text edit.
In addition, it can ask any number of registered OutputLineParsers
whether they think any special formatting should be applied to the
current line.
This mechanism is now properly modeled by our class design, rather than
being hidden in a monolithic class where everything had the same type,
no matter what its purpose was.
Prospective contributors can now simply be pointed to the
OutputLineParser class and will see at one glance what they have to do.

Change-Id: I9844499f062c94fb038ce73fd6f26576910148c2
Reviewed-by: hjk <hjk@qt.io>
2020-04-14 14:15:26 +00:00
Christian Kandeler
0f16378188 OutputFormatter: Do all formatting centrally
Instead of working directly on the text edit, the specialized
OutputFormatter classes now simply ask the base class to do it for them.
In practice, the request currently always is "turn this part of the text
into a link", but the interface can be extended to other types of
formatting, should that ever be required.
This is a win/win situation: Derived classes no longer have to fiddle
with QTextCursor & friends (nor do they have to call any base class
functions), while the base class can make strong assumptions about what
the derived class does to the text edit (i.e.: nothing).

Change-Id: Icc4bc52d4001b0359247563e39a206fa274833d7
Reviewed-by: hjk <hjk@qt.io>
2020-04-14 09:46:34 +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
Eike Ziller
10114dc036 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/android/androidmanifesteditorwidget.cpp

Change-Id: I8143d9e02837dcd78a637da7b333a6eeebb105cb
2020-04-07 11:13:58 +02:00
Andre Hartmann
93e788fd19 VcsOutputFormatter: Allow ranges with three dots also
This can, for example happen after a forced push to Gitlab.
The VCS output looks like this in that case:

  + 7c145ae...c301cc6 master -> master (forced update)

Change-Id: I84bec1a6cf2bf875732461f767ebbf4703cdbadb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-06 10:28:09 +00:00
Eike Ziller
ee2840d5b8 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ic741fdedc168430e5be6cb1645d9329dbc7a6b08
2020-03-23 09:35:54 +01:00
Andre Hartmann
59f6c6282c VCS: Capture more hashes with suffixes
Recognize multiple trailing carets and
tilde/number combinations too.

Amends 098ee51a9b

Change-Id: I91ea33f7e2dae61f18c2899c949034ebedca0157
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-03-21 18:50:48 +00:00
Christian Kandeler
04a99c1de1 Remove the limitation that output formatters have to be exclusive
Introduce an aggregating output formatter that forwards its input to a
sub-formatter that feels responsible for it, or otherwise lets the base
class handle it.
Our output panes now use such an aggregating formatter.
In particular, this means that in the future, we won't have to stuff all
run control output formatting into the Qt output formatter anymore.

Change-Id: I5498f200a61db10ccff3ec8974c6825da7f7072d
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:48:15 +00:00
Eike Ziller
d80f3972a4 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ia8254720b2ba6e3e7b859017e1c2b6e289bed771
2020-03-20 08:16:19 +01:00
Andre Hartmann
098ee51a9b VCS: Capture hashes with trailing caret
The Push-to-Gerrit dialog calls

  git branch -r --contains 3fa72ff^

for example.

Change-Id: I6c0bd792dd5bf85dec61fa576fbd8bba3aa9f06d
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-03-20 06:08:30 +00:00
Christian Kandeler
0ff5bf75e1 Move some code from OutputWindow to OutputFormatter
That's where it belongs: The logic there is applicable to all output
formatters, not just those used via an output window.

Change-Id: Idf4ca8d22631ca96feb97553f28724c0275e0bf8
Reviewed-by: hjk <hjk@qt.io>
2020-03-17 09:39:12 +00:00
Eike Ziller
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
Andre Hartmann
41cb713370 SubmitEditorWidget: Inline two small functions
Change-Id: Ia9b2c451a587d418ccf39707c25d8aff062f6ed8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-29 18:21:29 +00:00
Orgad Shaneh
ba87fb2083 Git: Add actions for changes in output window context menu
Change-Id: I5aa46f87b82670286ac225d71a3a045133976e86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:53:51 +00:00
Orgad Shaneh
ab3e2ac0fc VcsBaseEditor: Fix tr context for Copy action
This amends commit 7677e3e197368bd206dc565368cb3f33d951d092.

Change-Id: Ib07dc2a8110a8e09f43c035989d9ffa84e0427d3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:44:55 +00:00
Orgad Shaneh
a01035fefb VcsBaseEditor: Highlight default actions on context menu
Change-Id: Idc493658dbc829394bd2898a59ba5686036bc3fe
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 09:39:14 +00:00
Orgad Shaneh
d9ca238ffe VcsBaseEditor: Remove default actions when right-clicking a reference
Change-Id: I2e8abd4487756be2535934ca8ab4d6b9105e6088
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 07:06:49 +00:00
Orgad Shaneh
9455b144b2 VcsBaseEditor: Remove unused functions
Change-Id: Ida1df50aee0c146d8070e62292163d34cd53f65a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-28 07:02:44 +00:00
Eike Ziller
0585ad0f64 Merge remote-tracking branch 'origin/4.12'
Change-Id: I4523ea36332772a310fd462df55683c93c61bb18
2020-02-27 09:41:05 +01:00
Orgad Shaneh
f15d6d0baf VCS: Set repository for VcsCommand
Makes file names right-clickable.

Change-Id: I96ba21e73d54819148f13fcb033a144146b00418
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-26 10:56:52 +00:00
Eike Ziller
61dc14b67f Merge remote-tracking branch 'origin/4.12'
Change-Id: I3e7049da2c3da6f784e3cb3407c22ada556e5d24
2020-02-26 08:35:05 +01:00
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.

AA_DisableWindowContextHelpButton was added in Qt 5.10.

Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 13:26:44 +00:00
hjk
989b44d911 VcsBase: Don't use QObject inheritance in VcsEditorFactory
The only remaining use is a setProperty that's never read back
anymore after 9c96a1c4d.

Change-Id: I2c49b044bb97a123e72070df5e83909c53e40881
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-24 12:57:14 +00:00
Orgad Shaneh
de5f4d1160 VCS: Fix broken annotation changes detection
isValid() is true for empty regexp...

Change-Id: I0af92574181736d5dde2ca48d3a8ab75ff6f14dc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-24 08:32:03 +00:00
Orgad Shaneh
a83f0c5d74 VCS: Replace QRegExp with QRegularExpression in VcsBaseEditor
Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-21 08:28:34 +00:00
Orgad Shaneh
3c0b89f697 VCS: Refactor annotationChanges() in VcsBaseEditor
Devirtualize the function, and use QRegularExpression with globalMatch.

Change-Id: I18c92cb37b535c616f03f45dff8b18249c961d5d
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 10:42:31 +00:00
Orgad Shaneh
3cdbd8683d VCS: Fix connect failure
QObject::connect(Git::Internal::GitSubmitEditorWidget, Git::Internal::GitSubmitEditor): invalid null parameter

Change-Id: Iaf9a46d9922c7d4e124b94146d85bc5374a2195c
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 10:11:52 +00:00
Andre Hartmann
937e2b56e7 VcsOutputFormatter: Fix multiple regexp matches
Fixes: QTCREATORBUG-23614
Change-Id: I86e548a1f727113782afbc6b934d6dddc92c92ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-18 19:19:26 +00:00
Orgad Shaneh
1b2aa56f15 Git: Add grep and pickaxe filters
Fixes: QTCREATORBUG-22512
Change-Id: I98eed9a7f9da15e163804a0fd81713149a06c5b0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-17 13:11:52 +00:00
Andre Hartmann
4cbb24906f Git: Allow clicking references in VcsOutputWindow
Fixes: QTCREATORBUG-16477
Change-Id: If1f36bec0826a3116e5261a270cd63a1536e13f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-16 19:13:53 +00:00
hjk
e4a639c076 Vcs: Remove unneeded VcsBaseClient::StatusItem ctor implementation
Change-Id: Idab6f76e86b9ea50b345547017640253a9183126
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 16:42:38 +00:00
Eike Ziller
c3911002fd Merge remote-tracking branch 'origin/master' into 4.12
Change-Id: I60aa7c97c13144d3c31989244517c21a72202ab9
2020-02-13 09:10:52 +01:00
Orgad Shaneh
f2cd459ec5 VCS: Abstract multi-choice settings in editor config
Change-Id: Iafc089f5ad3796348ab9521b71b31cb645238292
Reviewed-by: hjk <hjk@qt.io>
2020-02-13 07:58:14 +00:00
hjk
9c96a1c4de Vcs: Make VcsBaseEditorWidget::test* operate on factories directly
Saves re-discovery by id.

Change-Id: I026c1388d02f125147a9b4f5367d7a1a266bff3c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 07:10:21 +00:00
hjk
1e3b7475f6 Vcs: Remove some indirection in BaseVcsSubmitEditorFactory
Change-Id: I6ddc818412c9104a06495e2dd8f245de1132e7c2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-13 06:56:32 +00:00