Commit Graph

301 Commits

Author SHA1 Message Date
Jarek Kobus
f778880a3b Fix SideBySide diff editor icon
Broken in 033862f305.

Change-Id: I8930de03b02dcf2859b11218b25fa0099e957791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-24 10:33:08 +00:00
Jarek Kobus
f720daed91 Clear the uniqueId of diff editor when saving
Saving diff editor transforms it to patch-file
read only editor. Clearing the uniqueId
ensures we don't use it anymore for showing
e.g. current file's modifications.

Change-Id: I2010161697bbad254ce1ebe5d0bb6a1f38ae323c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-24 07:55:18 +00:00
Jarek Kobus
78c3590705 Make skipOpeningBigTextFile() public and use it in Diff Editor
Change-Id: I5e98d1ab93ac442c1f1a132a51ab838567a735a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-23 14:08:38 +00:00
Jarek Kobus
fd460a11dc Add some missing consts
Change-Id: I1c5122b893e7255237310562fcad16bc53f15fd7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-17 10:31:27 +00:00
Jarek Kobus
8c36249ffa Add missing overrides
Change-Id: I7e27a273044542537423c8f4b9ab5235c3fabc22
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-17 10:31:18 +00:00
Jarek Kobus
8224c1c95d DiffEditor: fix revert chunk for diffs of modified files
Apply chunk action doesn't make sense for that case,
will stay disabled.

Task-number: QTCREATORBUG-17136
Change-Id: Idce31b3aa9d354536a01607c10b20273158961d5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:49:08 +00:00
Jarek Kobus
344f255fa9 Reuse the Guard class
Change-Id: Ia742ab92fd7947f4d156d03e112ee32363312996
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:48:40 +00:00
Jarek Kobus
d3a743d77e Use namespace Core in diff editor plugin
Change-Id: I2409a6186d590a83ccde064c855e0261d600014e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:35 +00:00
Jarek Kobus
4ae306a5e1 Handle "Diff All Modified Files" action enablement
Also rename it to "Diff Open Files".

Task-number: QTCREATORBUG-17094
Change-Id: I370c32497fcb56cb2bd84700ef7cb4aa7ba0a573
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:29 +00:00
Jarek Kobus
1414826183 Implement diff on close, on revert and on external modification
Task-number: QTCREATORBUG-1531
Change-Id: I8c9a740d66eb7836b3df6850ac243260fd282b32
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-21 09:20:20 +00:00
Jarek Kobus
52faf32770 Drop unneeded override
Change-Id: Ia29517a56f23472d7015130abc8c8753b40afe33
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 12:11:26 +00:00
Christian Stenger
ad615ece16 DiffEditor: Fix compile with gcc 4.8 / Qt5.6
Broke with ee095ef5d5.

Change-Id: Ib8cc5a0b8d79cf6ca542eb2fc9c0a4f06e885d88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-10-07 05:31:58 +00:00
Jarek Kobus
ee095ef5d5 Implement diff for unsaved changes
Task-number: QTCREATORBUG-9732
Change-Id: I7e0f1d18046451ac1bc84b8c28113d72f63642a8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-06 14:14:03 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
Nikita Baryshnikov
0598202d3d DiffEditor: do not show reload prompt
for text document, after reverting some change in diff editor

Change-Id: I3511f00e52beffba1cce67fb6940d1b580ef99cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-07-25 14:01:26 +00:00
Jarek Kobus
adbc3f611f Show proper diff when one of diff files is missing
Task-number: QTCREATORBUG-16540
Change-Id: I185ac8e7c8be364c1e2f74bfe0af6f9e393c89be
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-25 13:29:10 +00:00
Jarek Kobus
3c1647e6b2 Refactor DiffEditorWidgets, introduce common widget controller
Reduce code repetition.

Change-Id: I416555dd83ce888088a6a259777c294a6feb35f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-25 13:28:45 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
cfc89a685e IDocument: Rename defaultPath and suggestedFileName
To fallbackSaveAsPath and fallbackSaveAsFileName. That makes it clearer
what they are for, and that they actually belong to each other.

Change-Id: Ie5b83b9db77d39a7fe9e979cc8f22b7f5b9101a3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-14 14:40:45 +00:00
Andre Hartmann
9bf7f83845 DiffEditor: Sort includes
Change-Id: If646e27683e351e4308906f58b325dc47ff83c8b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-12-22 11:54:30 +00:00
Alessandro Portale
03c07b80fd Core: Unify the close icons
Use the same image file and recolor it as needed,

Change-Id: I914819a53ca05d83ca5b88adf44706b460b48ac0
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-12-04 10:47:32 +00:00
Alessandro Portale
033862f305 Themed Icons: Introduce Utils::Icon
Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.

Icons are now listed in per-plugin *icons.h headers.

RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.

Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-25 12:30:52 +00:00
Orgad Shaneh
d8d7acbe75 Git: Scroll to active file on Show invoked from file log
Change-Id: I0935bf8b8b30ee78716a14ee0a88c21b9caf62dc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-11-03 08:45:41 +00:00
Orgad Shaneh
4b8a14e10f DiffEditor: Remove "slots"
Change-Id: I31335ffd95e4e7955966d06c78bde166ad6d5555
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-11-02 09:22:11 +00:00
Alessandro Portale
b8bdc6f669 Icon refresh: First step towards the new Qt Creator themes
http://blog.qt.io/blog/author/didesous/ announced new designs/themes
for Qt Creator. This patch replaces many of the existing toolbar icons
with recolorizable masks for better theming support.

Change-Id: I557aa485205fe2624f33724226f698c303342b40
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-10-23 16:04:52 +00:00
Orgad Shaneh
6cac3b73ab DiffEditor: Add indication on failure
Task-number: QTCREATORBUG-15051
Change-Id: If8beef268fa6390f2ff8f36996354f9685b70d80
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-15 20:38:20 +00:00
Daniel Teske
da4ab870a1 Vcs: Simplify code by using Utils::equal
Change-Id: I8c58010e85c7e2a4b8a7c01fb81ce6b528f77b7d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-07 12:26:47 +00:00
Nikita Baryshnikov
5398f4f5b1 fix metatype declaration in a few places
Change-Id: I76a12a278db8e74d935e76a5e832daf8e34df2a9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-02 08:48:20 +00:00
Orgad Shaneh
d618c05e3a DiffEditor: Support mode change in Git diff
Task-number: QTCREATORBUG-14963
Change-Id: I5d26ae810add657a94fb40a5d4437e2d17a1625a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-08-25 06:48:49 +00:00
Eike Ziller
ce96a8b80a CodePaster: Register type safe service object
Use Q_DECLARE_INTERFACE et al.
This provides a way to have the dependency on code pasting
optional in the using plugins (VCS, diff editor), while
still being able to use a nice API to perform the pasting itself.

Change-Id: Ia61e0066d552e45031f4aa7fd1f6693b68f92384
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-08 07:41:43 +00:00
Orgad Shaneh
2ad1efd876 DiffEditor: Do not leave a blank line when there are no branches
After expanding branches, notify the user in case there are none.

Change-Id: Id8a8d18933394208f8823c55124189ab37be4153
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-06 12:40:09 +00:00
Nikita Baryshnikov
b0df9dc13b DiffEditor: avoid gcc warning
overflow in implicit constant conversion

Change-Id: I8eaf55ab1e2108de44e7aa2dc832e1ee13814d3b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-07-01 12:41:34 +00:00
Eike Ziller
6dd0e79d09 Add override to IDocument hierarchy
Change-Id: I6884f59fe0f06e380254c1f8076dd561d9df4ee3
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-11 09:32:18 +00:00
Eike Ziller
fef9d7ff94 Editor manager: Abort with a single message if file is not readable.
We show a dialog that offers opening a file in a different editor type
if opening a file fails, but we should not do that if opening the file
fails because it is not readable.
With this change, documents now specify if they failed to open a file
because reading failed, or because they could not handle the file
contents.

Task-number: QTCREATORBUG-14495
Change-Id: I5d4b7cfa74b87ef21b9b55bc30b3ebe2f8238dfa
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2015-06-10 15:32:55 +00:00
Christian Kandeler
ccbc7f9ec1 DiffEditor: Silence warning about unused variable.
Change-Id: I18a6dd021bb29ca5eaa7727213c80458d903ee6c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-10 12:59:53 +00:00
Eike Ziller
4f927e4c87 Move "open" from IEditor to IDocument
For non-editor documents it currently is not used, but for editors it
makes more sense to have that on the document instead of the editor.
Most actual implementations of "open" were done in the documents already
anyhow, because it is needed for reloading.

Change-Id: I29d4df2078995cbe80172b51a9bebeecb3afad3c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-06-10 11:21:17 +00:00
Eike Ziller
e00aa54f4e Add override keyword to IEditor & TextEditorWidget implementations
Change-Id: I403101d788d9edfea5c5c9440ab4f39ad00e81f7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-09 04:17:42 +00:00
Tobias Hunger
ad9dc94eae DiffEditor: Parse git diffs properly
Do not put filenames into a regular expression and then hope for
the best... any file with any character in its name that has a
special meaning for a regexp will break the parsing.

Task-number: QTCREATORBUG-14322
Change-Id: Ifab513d675168aff041f20d2b3f06a8d27919aa7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-27 07:26:18 +00:00
Tobias Hunger
94af581dd8 Git: Make git show a bit more robust
Change-Id: I5d0dc3bb43753f7b2ac9c308944f327537547d76
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-23 15:52:00 +00:00
Tobias Hunger
5c60bb9dd5 DiffEditor: When jumping to a file then put that block to the top
When jumping to a file via the dropdown box: Have that block be
scrolled to the top of the view, not to the center. This is way
less confusing.

Change-Id: I5c629dda1af8bff76ca93a70357aa35c8efcb37a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-17 08:24:31 +00:00
Nikita Baryshnikov
147dad8944 DiffEditorManager simplify
by using EditorManager::openEditorWithContents

Change-Id: I2850648bff0f5b8f01254b9c7ce9539c1262f576
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-13 12:33:01 +00:00
Eike Ziller
11590a8c5f Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.cpp

Change-Id: I09c5a047f7d91fecfc58c78df438afcdcdc0a8d7
2015-04-13 10:53:03 +02:00
Nikita Baryshnikov
1d23de641f GitClient: fix diff when committing
When a commit has several files, opening diff for the first file
works, but trying to open another diff without closing the previous
one doesn't refresh the diff editor.

Change-Id: Ia973cb70f2355a89b70787dd97042ef9f751d9d6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
2015-04-12 09:56:56 +00:00
Tobias Hunger
ee7d0a7bf7 DiffEditor: Do not load settings when splitting views
Change-Id: I7fac89714ff9a603af29e19664b091e5e62be22f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-04-10 14:14:57 +00:00
Nikita Baryshnikov
27aad7dfca DiffEditorManager fix typo in assert
Change-Id: I8582fdb790f5541263eb17d1fa9418c3a48f88f6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-06 12:44:03 +00:00
Eike Ziller
9790d8aa00 Merge remote-tracking branch 'origin/3.4' 2015-03-24 07:40:21 +01:00
Tobias Hunger
fb6d7ce91b Remove some duplicate includes
Change-Id: If7bae084cd34c6fb0fe77f9227d9848517c0e691
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-20 14:45:04 +00:00
Eike Ziller
aee54f9df5 Merge remote-tracking branch 'origin/3.4' 2015-03-19 16:00:28 +01:00
Leena Miettinen
9e2501c3a2 DiffEditor: use sentence style capitalization for labels
Change-Id: I3d8142d934b126bf13cab4729f6ed3f46cadbcea
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-16 14:59:58 +00:00