Commit Graph

206 Commits

Author SHA1 Message Date
Orgad Shaneh
10dc4f93f4 VCS: Recover clearer actions when closing commit editor
Amends commit d63bfa4a29, and recovers the
actions that were introduced in 15b176e30c
(relates to QTCREATORBUG-18799).

I keep being confused by these Yes/No myself :)

Change-Id: I0429ef9c25231b96bd595a1bfb6808b621db54e5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2023-02-18 16:58:22 +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
fa7dd2fd3b VcsBase: Convert to Tr::tr
To reduce the amount of duplicated strings for translators to handle.
The problem is not very prominent in vcsbase, but that's where we
are moving everywhere else.

Change-Id: Icb11fad3bccfea8a1408420e729566a75adccb66
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-18 15:33:59 +00:00
Tasuku Suzuki
fabb53c728 VCS: Clean up code for vcs toolbar
It has been hidden since 5d316a4919

Change-Id: Id6808dc5546bb5cf500032b4b03ab3fc06c14501
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-16 23:22:26 +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
Jarek Kobus
0313470db0 VcsBase: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I20e43625793401544e86efb627f5921c395026bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-07 21:54:39 +00:00
hjk
30312cc74a Vcs: Proliferate FilePath a bit further
Change-Id: I8490917bf0bde59b1cef2509ec14c3ca985fa43d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-11-09 15:08:19 +00:00
Orgad Shaneh
d63bfa4a29 VCS: Simplify submit editor accept/close flow
* Replace message box with an error on the output pane.
* Separate logic for accept and close.

Change-Id: Ib9fa201a1a67ee195086f7a22bc6678a9642452a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-25 19:19:40 +00:00
Orgad Shaneh
1593f869ed VCS: Remove "Commit" option when closing commit editor
Fixes: QTCREATORBUG-22233
Change-Id: I1270cc58a823b919475fc51ac5fc71b892b379b6
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-21 13:13:59 +00:00
Orgad Shaneh
2f1f80152d VCS: Remove "Do not ask again" checkbox when closing commit editor
Change-Id: Iea0cd14672eb65734921e1b57edd0780938aa60f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-21 12:24:14 +00:00
Eike Ziller
3bdb1a3edf Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/vcsbase/vcscommand.cpp

Change-Id: I2d33113bfb2ea7134550cda1de4e2c21e6711778
2022-10-18 16:51:36 +02:00
Orgad Shaneh
890b85d17e VCS: Simplify promptSubmit a bit more
+ fix regression for Git, which allowed to commit invalid commits.

Amends commit 9b61e484be.

Change-Id: I7571863bb982bfae1aa040e08f8c68010b14b147
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-18 06:31:53 +00:00
Orgad Shaneh
eaad78547c VCS: Remove "Prompt to submit" settings
Task-number: QTCREATORBUG-22233
Change-Id: Ifbfd738281066af7913357ff9e2466a6c983452c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-17 16:37:17 +00:00
Orgad Shaneh
183dfb48a7 VCS: Rename function
Change-Id: I593e1db222e2124f3db367620171f3a101b4b8eb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-14 12:24:18 +00:00
Orgad Shaneh
20cd55046f VCS: Do not prompt on close if nothing was done
Fixes: QTCREATORBUG-22233
Change-Id: I1e8240131ccb9a6583a8ae76b3f5c93799f588a5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-13 06:55:17 +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
Jarek Kobus
0da525d65c VcsBase: Cleanup some Utils:: in cpp files
We are using namespace Utils in these files.

Change-Id: I0526f7e4fff2fe0d24d1e2b9fa087298d5331955
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-13 16:01:35 +00:00
Jarek Kobus
3ec577ff17 VcsBaseSubmitEditor: Don't use QtcProcess::readDataFromProcess()
There is no big benefit of calling readDataFromProcess()
when the last argument is false. Simplify
runSubmitMessageCheckScript() and use QtcProcess::exitMessage()
for error message reporting.

Change-Id: I4ddaf3e72a2b5d49b47a2024da84862d92ab49fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-05 15:43:31 +00:00
hjk
152b14207c Replace QtcProcess::stopProcess() by stop() plus waitForFinished
... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 08:26:10 +00:00
Artem Sokolovskii
646254f460 VCSbase: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I1088047513e7660907182e80303607d8c48919f5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-23 08:49:43 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
Jarek Kobus
d22505c41f Use refactored ProcessMode
This patch needs to be applied together with the parent change.

There are 3 basic cases:
1. The user doesn't write anything to the write channel:
   You don't need to call closeWriteChannel manually anymore.
   By default the QtcProcess you create is in ProcessMode::Reader mode.
   Internally it opens the process in ReadOnly mode and
   closes the write channel just after starting.
2. The user writes some initial data (after being started)
   and then closes the write channel:
   All what is needed now it to set the write data
   (QtcProcess::setWriteData) before calling start.
   You also use the default ProcessMode::Reader mode.
   Internally it opens the process in ReadWrite mode
   and writes the writeData asynchonously when the process
   already started. After writing the data it closes the
   write channel automatically.
3. The user writes the data also after calling start.
   All you need now is to create a process with
   ProcessMode::Writer mode. In this mode the write
   channel is not closed.
   Internally it opens the process in ReadWrite mode
   as some writers also read the data from the process.

All the code base is adapted here to the above rules.

Change-Id: Id103019d1d71a3012fd1eade226fe96b9aaa48c2
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:31 +00:00
hjk
ff57cb548d Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:33 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
hjk
8b4cd1e0aa VcsBase: Use QtcProcess in VcsBaseSubmitEditor
Replaces uses of SynchronousProcess helper functions.

Change-Id: I015306a7265248253bc37b297600adf746be9f5d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-05 12:27:23 +00:00
hjk
8e507c215b VCS: Aspectify common settings page
Change-Id: Ib860e40ba476b428c92766312bced2950d0390ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-24 11:58:58 +00:00
hjk
78b4449692 CVS: Aspectify settings
Change-Id: Ib5170405b33b3e521470407065e85c95dad6163b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-19 14:00:00 +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
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
hjk
7f37c503db Vcs: Move responsibility to set editor parameters to editor factory
So it doesn't need to be named twice in the editor factory setup.

This intentially includes a de-optimiztion: storing the parameters
by value, not by pointer. That's more natural, does not need to
keep the parameters alive on the caller side, and it's uncritical
in this context.

Change-Id: I92867d3f2f75c38911ae82d3eeb4759cba71b723
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-06 07:03:44 +00:00
hjk
b8fe25db25 Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call
ping-pong inbetween, for code-sharing-by-inheritance. Merge
them by making VcsBasePlugin inherit IVersionControl and
merge the derived classes below.

Size of this patch is hard to avoid as all seven systems have to
move simultaneously. Non-necessary potential follow-up cleanup
have been left out on purpose.

Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:36:23 +00:00
hjk
1cd936c531 Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out
the actual IPlugin related pieces into new *Plugin classes.

Shift the construction of the PluginPrivate to initialize(),
following the general pattern.

I tried to keep the patch as mechanical as possible, giving
room to some obvious but less mechanical cleanup needs,
that are intentionally left out of this here.

Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:47:28 +00:00
Sona Kurazyan
82bcf4e9f5 Remove usages of deprecated APIs
Replaced:
  QPalette::ColorRole::Background -> QPalette::ColorRole::Window
  QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText
  Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole
  QFontMetrics::width() -> QFontMetrics::horizontalAdvance()

Task-number: QTBUG-76491
Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-03 09:15:30 +00:00
Eike Ziller
857b299356 VcsBase: Make dependency on CppTools optional
The VcsBaseSubmitEditor uses CppModelManager to collect the symbol names
from the affected files for completion in the commit message.

Move the C++ code model code into CppModelManager, register it in the
plugin manager, and call it via QObject means from the submit editor.

This avoids a hard dependency from VcsBase to CppTools.

Change-Id: I2fb34dbef153c1414820d711e7fc5596bcac1691
Reviewed-by: hjk <hjk@qt.io>
2019-08-15 06:27:29 +00:00
hjk
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +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
Eike Ziller
d7929eaf59 Fix usage of deprecated API QMessageBox::standardIcon
Instead use the style to get the icon and get the pixmap from there.
Emulates what QMessageBox::setIcon(QMessageBox::Icon) does.

Change-Id: Ic20d55070d510773eb194dc695689954b4862a2f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-03-28 07:40:36 +00:00
Robert Loehning
cb6fb2cf91 VCS: Improve misleading comment
Change-Id: I7d3b03219014fda3ad9bcef97ee607a05484e6bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-03-02 17:43:19 +00:00
Orgad Shaneh
620086109a VCS: Make "Keep Editing" the default only when closing the editor
If the prompt is displayed on button press, the default is Commit.

Task-number: QTCREATORBUG-18799
Change-Id: I706a2700e08bb45f44019a0fe8d44365438ee9f3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-01-21 14:00:49 +00:00
Orgad Shaneh
06da56335a VCS: Add mnemonic for Close when closing submit editor on Windows
The default style on Windows doesn't have mnemonics.

Task-number: QTCREATORBUG-18799
Change-Id: I785ff327a4099cd56cdc081ebdaa14734d9a82a3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-01-21 14:00:24 +00:00
Orgad Shaneh
650153b8cf VCS: Purge unused VcsProjectCache
Its only use was removed in 28e8960a1e
(version 4.3.1).

Change-Id: Ibc20bfb0dc57e3ba427cd08b527959b7b1a26646
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-01-21 06:53:31 +00:00
Alessandro Portale
5f5e82b0b6 Fix warning: "Don't call QList::front() on temporary"
..using constFirst, instead.

[-Wclazy-detaching-temporary]

Change-Id: I66bd9c19d56dc5dcc7ee0a1f68f4bfd2a3af7326
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-17 10:04:42 +00:00
Orgad Shaneh
15b176e30c VCS: Improve dialog on submit prompt
The dialog appears when closing the commit dialog without committing,
or when "prompt to submit" setting is enabled.

Fixes: QTCREATORBUG-18799
Change-Id: I8eb20becbcee7281b9f673a35ec698c6f8e04a40
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 18:35:44 +00:00
Orgad Shaneh
96529a27c5 VCS: Add reason text when submit validation fails
Change-Id: If4c8d5d1d5dc5386e49b29be59786dc53cfaaaa3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-11-10 16:05:05 +00:00
Orgad Shaneh
1486359251 Core: Change IEditor::document() to const
All the implementations are const.

Change-Id: Ib9753fe764dd482d4f4392eec70878d42edc737a
Reviewed-by: hjk <hjk@qt.io>
2018-09-26 06:20:51 +00:00
Orgad Shaneh
8f65486dfc VCSBase: Modernize
override, auto, nullptr, member initializers.

Change-Id: Ie21b8f4a4d6673947d82619bc3de677fcea63d7f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-20 07:02:17 +00:00
Orgad Shaneh
f1f506b479 VCS: Remove unused unregisterActions functions
Change-Id: I4c7a0dfc93f27f93cdbd84d7e027e63db05341e8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:26:02 +00:00
Alessandro Portale
9a7e1cd6c6 VcsBase: Modernize the icons
Use themable, HighDPI enabled icons for commit and diff.
Re-use an existing red cross for the removesubmitfield.

Change-Id: I43f46db96d07de9a7e166937d470d48e45d7f3fb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-10-09 13:20:20 +00:00
Orgad Shaneh
6c70f22ada VCS: Preserve selections in commit editor on refresh
Task-number: QTCREATORBUG-18483
Change-Id: I749f2d4d583f197e7b5b6f69116c3a196e85484b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-07-01 19:25:35 +00:00
Orgad Shaneh
28e8960a1e VCS: Filter out untracked files only if they don't appear in any project
Change-Id: I9a87f082467f4688c1ebe5dd5e832c9e5a684ca1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-14 15:01:12 +00:00