Commit Graph

284 Commits

Author SHA1 Message Date
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
Eike Ziller
bf7da428fb Merge remote-tracking branch 'origin/3.4' 2015-03-16 10:27:16 +01:00
Tobias Hunger
1c8b691620 DiffEditor: Do not soft-assert when saving
Do not soft-assert when saving a diff that was saved before.

Change-Id: Iebe06f2bf2ab966869181e0237ed6cc69b2f6045
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-03-13 12:58:59 +00:00
Eike Ziller
6433af534d Merge remote-tracking branch 'origin/3.4'
Conflicts:
	qtcreator.pri

Change-Id: Iacd9f2afb843f06d457914a3b842dfc606e3adf3
2015-03-12 16:49:57 +01:00
Tobias Hunger
b1a71f7b96 DiffEditor: Fix line number forcing
Change-Id: I876c8ca6bc442cec853c41c48eb2be83def4558c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-11 12:26:43 +00:00
Tobias Hunger
f4a1f7460e DiffEditor: Fill in file combobox on new splits
Change-Id: Ic444a9544e3c032a1908673c349e00bec95891dd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-03-11 12:11:30 +00:00
Tobias Hunger
25c663da44 DiffEditor: Remove dead code
Change-Id: I7d29bfc944e32ad03f237946b4bea08d1a9502c5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-11 10:04:28 +00:00
Tobias Hunger
1842cd7793 DiffEditor: Fix sync toggle
Use more QActions in the ToolBar. Those seem to work better
than the bare widgets.

Move "ignore WS" after the Context Lines spinbox so that we
can make the editor smaller while keeping the pop-up menu working.

Change-Id: I00d707c6ee1fb8d90fef5aa5ec5abb7149d4e6a0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-03-11 10:03:41 +00:00
Eike Ziller
23ec56516e Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/plugins/coreplugin/coreplugin.cpp

Change-Id: I9aa6c61412e2ef4a91efe028296bcc2d075856d7
2015-03-11 10:35:49 +01:00
Tobias Hunger
3d360653cf Clean headers of the DiffEditor plugin.
Change-Id: I1c49527f010acbece31849127fc4d182678b6f37
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-10 14:28:13 +00:00
Tobias Hunger
dbe535b3c7 DiffEditor: WS only change
Change-Id: I845f492c27d2149ed01e175af5f974f86c7bd1d6
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-10 11:51:37 +00:00
Tobias Hunger
b2b8b867d6 DiffEditor: Refactor the user-facing parts
* Move all data handling into DiffEditorDocument
* Move much of the logic of how to update views into the
  DiffEditor.
* Introduce a base class for the different views on the diff
  to implement.
* Remove DiffEditorGuiController
* Make DiffEditorController smaller and merge the DiffEditorReloader
  into the class
* Simplify communication between the classes involved
* Make much of the implementation private to the plugin

Change-Id: I7ccb9df6061923bcb34cf3090d6d8331895e83c7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-03-10 10:25:52 +00:00
Nikita Baryshnikov
3cd0463f32 Remove aggregation dependency from project files
Change-Id: Idfd3941f47b71d6b84306d88604b744e3585e4af
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-03-09 14:25:34 +00:00
Friedemann Kleint
54da18eaaa Clean exported headers of the Core plugin.
Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 07:18:14 +00:00
Orgad Shaneh
aee35662a2 Prefix duplicate names in Open Documents to make them unique
If a document has a file name associated with it then the prefix is
composed from path components (subdirectories), starting from the one
where the file is located and going up the parents until the resulting
name becomes unique among other open documents.

If a document doesn't have an associated file name, then a sequential
number (starting from 1) is appended to the display name of the
document.

This feature is useful when working with big projects that have lots
of idendical file names across different subdirectories (e.g.
Makefile.in, main.cpp, etc.) that need to be edited at the same
time. It allows to easily recognize such a file when switching
between documents in the editor, w/o the need to place the
mouse pointer over the name entry to get its full path.

Started-by: Dmitriy Kuminov <coding@dmik.org>
Task-number: QTCREATORBUG-10185
Change-Id: I633ea6d9b9b4fce8b67335dbcce1bda29254efde
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-26 14:56:25 +00:00
Friedemann Kleint
fe2addf515 Clean exported headers of the TextEditor plugin.
Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-26 13:15:29 +00:00
hjk
7f001dab1b Core: Make Context parameter to registerAction optional
... and default to C_GLOBAL. A rather common case.
Similar for ActionContainer::addSeparator().

Change-Id: I7f9ba573af201c0a472132d5a494ad17cc4175b7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-26 10:09:03 +00:00
Tobias Hunger
3232af6272 DiffEditor: Fix selection of next view
Change-Id: I3754bb3637fc89d4c9ef2939db25dd1fda9d3243
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-02-23 15:02:29 +00:00