Commit Graph

184 Commits

Author SHA1 Message Date
hjk
f08ff20e94 Vcs: Move some static functions from *EditorWidget to *Editor
Change-Id: Ic7c0a3bca982f5728e28ff9f3e1e054b5a902ea9
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-28 15:09:28 +02:00
hjk
2481e71d18 Vcs: Move editor construction over to new scheme
Change-Id: I491b9f37bfe15ebc800fedd5c683bfaf24e63889
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-21 11:50:27 +02:00
hjk
cb35594800 TextEditor: Centralize settings connections setup
All editors did that manually, with varying approaches. Connect once
when the document is made known to the EditorWidget instead.

Change-Id: Ib0828b08158539859f6f89c8080435a027aa06ed
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-20 13:28:44 +02:00
hjk
c5fae0e8da TextEditor: Further *Editor/*EditorWidget disentangling
In most cases, the *Editor constructor does not need to
access the *EditorWidget.

Change-Id: I1f5c076a0f723d5d82b398e8c250c7bd1d47eb17
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-19 10:32:12 +02:00
hjk
d2ec7d80d9 TextEditor: Merge the two sets of *EditorWidget constructors
Change-Id: I45d87d0be722ac36d64af222f03f8cb76242c9df
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-19 09:19:33 +02:00
hjk
d7c2b0b681 TextEditor: Consolidate document access functions.
There was document(), textDocument() and baseTextDocument().
Two should be enough...

Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-08-04 10:43:56 +02:00
hjk
a9b7045803 TextEditor: Move toolbar widgets from *Editor to *Widget
Lifetime is coupled to the widgets, not the editor.

Change-Id: I01560bbdd6c399376d3a4184f0eb83e4153f830e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-08-01 17:57:26 +02:00
hjk
f5b0bd32b2 TextEditor: Remove one stack of EditorWidget constructors
There are conceptually only two: one that operates a new document,
and one that shares one. Being explicit makes moving data over to
the Editor hierarchy easier. Convenience can be re-added there,
later.

Change-Id: I9b34ff26628c99ffff01201dcf99332d5e7253e9
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-08-01 14:10:23 +02:00
hjk
bf5e43be94 TextEditor: Merge ITextEditor and BaseTextEditor
Adjust all callers, de-export BaseTextEditorAnimator

Change-Id: I2329d976c1398e2449844bb480a4d4ed29859506
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 13:45:55 +02:00
Orgad Shaneh
342cb69dda Core: Add a convenience findTopLevelForDirectory to VcsManager
Change-Id: If5a846e0793b25b738084cacb8dba51fb80399d4
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-03 10:22:37 +02:00
Tobias Hunger
0f17cb8046 VCS: Allow for more email addresses
This is far from correct and will not accept a wide set of valid
email addresses, but it is better than what we used to have and
so far only one person complained about that.

Task-number: QTCREATORBUG-12472
Change-Id: I0d7ed19c9811af0ce28218c40d79988d26cb588b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-06-23 11:15:32 +02:00
Tobias Hunger
0cb50a9b30 VCS: Store QRegExp instead of recreating it on every cursor move
Change-Id: Id2eec876d84acb783e850d184a194b4d6a963259
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-06-20 11:11:17 +02:00
jkobus
48aefde7ba Move patch command out of VcsPlugin
It will be needed soon inside DiffEditor plugin.
Move "Patch command" setting out of Version Control | General
into Environment | General | System.

Introduce PatchTool class, which hold the patch command
setting and a method for applying patches (runPatch() - moved
from VcsBasePlugin).

Change-Id: I9de94358ccd5c6e31ac2beefc27305c5111d67bb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2014-05-20 11:56:40 +02:00
hjk
6e584b5b49 DocumentModel: Make interface static
Move item model implementation to private, adjust user code.

Change-Id: Ifbe94e7c7b9b1e8be1b4c531958dbd7a9413af13
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-13 11:48:30 +02:00
Eike Ziller
5dd8d7cd9c Editors: Move id() from editor to document.
Change-Id: Ib81076842ab1c16832224790194b001206404d64
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-03-05 16:27:52 +01:00
hjk
6c6f47f86c Core: Make IEditor::id a value member and adjust users
Change-Id: I47e457c4a1821c515cd8a740d27bfe005a0c09e6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-25 10:36:25 +01:00
jkobus
73cf43f323 Add DiffEditorManager, refactoring.
GitDiffSwitcher operates now on IDocument.
GitDiffHandler operates now on DiffEditorController.
"source" property now attached to editor's document (VcsBasePlugin).

Change-Id: Ie2570a597b8b992ac1dc33b9179eca459c8a751a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2014-02-18 13:46:49 +01:00
Eike Ziller
3422995521 VCS editors: Fix revision markers
Resets the revisions when setting the contents of text editor documents
in general.

Task-number: QTCREATORBUG-11356
Change-Id: I4069d629d8a612d42c7deae707300d50690e2db7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-29 10:04:47 +01:00
Eike Ziller
355f104d0e BaseTextEditor: Remove some unnecessary indirections through widget
Change-Id: I4f71448d6788a4e553b1495b72263a004e65d8c0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 09:05:06 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
jkobus
0d13028440 Refactor source property
Get rid of source property out of DiffEditorWidget,
attach dynamic property when it's needed instead.

Change-Id: I6641a7b55c42b4eceba78c2e28f5140b40fe0fa5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-12-19 14:06:51 +01:00
Tobias Hunger
1b53f75d62 VcsBase: Abort commands when closing VcsBaseEditorWidget
This prevents the crashes when the command signals a state change
after the managing editor was closed.

Task-number: QTCREATORBUG-10343
Change-Id: I57e34c49d5ef8b5693bec6ac0ebc9d87afa99dc9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-10-14 15:51:23 +02:00
Orgad Shaneh
5e585b9eee Git: Support annotate revision for renamed files
Change-Id: I6993cdd6f91f29b6f4e990cc5ba332ff63f7ed9f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-10-10 19:00:01 +02:00
Orgad Shaneh
2da85dc686 VCS: Rename diffBaseDirectory -> workingDirectory
Can have other usages than diff

Change-Id: Ieb01a88eb95503ac89b2f2c1120eddf404cdce5a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-10-10 18:59:50 +02:00
Orgad Shaneh
7b08d993bf VCS: Pass workingDirectory for annotate
Required for supporting renames on annotate.

The renamed file (and possibly its parent directory) doesn't exist
anymore, so it shouldn't be passed as a working directory.

Change-Id: I809e8df17c1dc5199e533b525244a668eccbcd5f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-10-10 18:59:43 +02:00
Orgad Shaneh
003e25d488 VCS: Abort previous command for the same editor
It is very common to have output from a previous (longer) command appear
instead of the newly created one.

For example: Open a log. Check "Show Diff" and immediately uncheck it.
If this is done fast enough (or with a high Log Count limit) the output
with the diff will appear instead of the normal log.

Change-Id: Ie64cc4a383a261f5328a4d0486eec93f73766679
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-30 16:36:00 +02:00
Eike Ziller
63ff745213 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/libs/extensionsystem/pluginmanager.cpp
	src/libs/extensionsystem/pluginspec.cpp
	src/plugins/coreplugin/basefilewizard.cpp
	src/plugins/coreplugin/coreplugin.pro
	src/plugins/coreplugin/coreplugin.qbs
	src/plugins/coreplugin/editormanager/ieditor.cpp
	src/plugins/coreplugin/externaltool.cpp
	src/plugins/coreplugin/icore.cpp
	src/plugins/cpptools/cppmodelmanager.cpp
	src/plugins/fakevim/fakevimhandler.cpp
	src/plugins/find/ifindfilter.cpp
	src/plugins/projectexplorer/buildstep.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.cpp
	src/plugins/vcsbase/vcsbaseeditor.cpp
	tests/system/suite_debugger/tst_simple_analyze/test.py

Change-Id: I11dc9e60bfc14bad4f8af747d041fc7678a07c17
2013-09-27 10:44:32 +02:00
Francois Ferrand
367cfc8419 Git: Support staging a single chunk.
Add context menu in diff editor to stage/unstage a single chunk from the diff.

Task-number: QTCREATORBUG-5875
Change-Id: Ic244a0d84b5ed5f66b90d7fe8784fc1b8041d183
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-26 23:10:59 +02:00
Tobias Hunger
0479abdcd7 QDoc: Fix QDoc warnings
This patch fixes ~1100 warnings from qdoc

Change-Id: Ia9555db675acbf8083b2f87d9855a62a3a34ccb9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-09-26 09:56:22 +02:00
hjk
ca15d0aa95 Apply static pattern to TextEditorSetting
Change-Id: I4e6f573d893c0aa2bb4ca9812fc8db2961dac172
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-20 10:28:22 +02:00
Orgad Shaneh
9df379e0dc Git: Fix crash on diff
Task-number: QTCREATORBUG-10138
Change-Id: I7c7f054e6253c677b52a3ea24d7ace562f1ad4af
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-09-12 13:02:55 +02:00
Leena Miettinen
ae72d4f88a Doc: edit vcsbase docs
Remove \brief for \enum and \fn commands.
Use standard wording. Edit for style and grammar.

Change-Id: I338567241ddc7f90feaaf058dcd4dc9afdb8ca93
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-10 16:36:44 +02:00
hjk
aadb6f16af SessionManager: Apply 'static' pattern
Change-Id: I370f72fcf7a24216ee189979ce6b5c8bfc5f4140
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-05 12:28:12 +02:00
hjk
267e441af4 Apply 'static' pattern to VcsManager
Adapt user and surrounding code.

Change-Id: Id2648f82a9cbbd0ad0bfb91f6958b8cee7ea29cc
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-03 12:01:24 +02:00
hjk
4a24df38a3 EditorManager: Use static pattern, adjust surrounding code
Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-08-30 11:22:56 +02:00
jkobus
e8801167aa Add common interface for text formats inside syntax highlighter
Change-Id: I87f64446161a57aea0896f68e4eafacef791969b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-26 13:39:40 +02:00
Orgad Shaneh
0c50c5a1d3 VCS: Consolidate codec handling
Change-Id: I2c9a5031b63f0bc3e884739be680d051d7cf1ab4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-19 13:56:34 +02:00
Eike Ziller
8c2e3fd2cb Fix usage of EditorManager::editorsForFileName
And move to using the corresponding method in document model.

Change-Id: I80b12ceab8a91c5393b9c0422d660a8896ae09d8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-18 14:51:39 +02:00
Eike Ziller
bc88c0b89e VCS: Use documents instead of editors a bit more.
This patch mostly gets rid of EditorManager::openedEditors usage. The
VCS editors should have a better widget<>document separation, also to
make it possible to split/duplicate them, but that's for another time.

Change-Id: Idd92a6a4884ff69fba4f4793d182aa7ff68d79e4
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-18 14:51:03 +02:00
Eike Ziller
7808266fca TextEditors: Remove useless duplicated (set)textCodec methods
They are duplicated from TextDocument::(set)codec. The default
implementation of the duplicated methods was just delegating to the text
document. The override of setTextCodec in QmlJsEditor was useless, since
it was only called from EditorConfiguration::configureEditor with the
ITextEditor::TextCodecFromProjectSetting flag anyhow, which made the
overridden method in QmlJsEditor be the same as the fallback.
Aside from that, the duplicated methods wouldn't have belonged to the
*editor* anyhow, but to the document.

Change-Id: Ib43c28210b6bf88726159d751a4905a1d062f80e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-17 09:05:41 +02:00
Eike Ziller
624d9e2c4c Move IEditor::isTemporary to IDocument
It's a property of the document implementation, not of the specific
editor instance working on it.

Change-Id: I5c3dd054e21b646e2d94b891916a096d045923f8
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-12 16:43:54 +02:00
Eike Ziller
21f63c24c7 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I1310d473584f1e2cd44008d45747c868103bbde1
2013-07-12 10:39:18 +02:00
Orgad Shaneh
d31efc22e8 VCS: Stop on file pattern when building a chunk
Task-number: QTCREATORBUG-9782
Change-Id: I0e50c5c2696ad9cfe4e8a56c28cb17a2ee039b4f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-11 12:50:40 +02:00
Orgad Shaneh
51a9d5065a VCS: Support chunks without comma
Git submodule is reported as @@ -1 +1 @@

Change-Id: Ic7a619b0f4c8eb505b75529501dcd18723de2465
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-10 12:50:16 +02:00
Eike Ziller
dd43d9908f Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.

Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 13:51:42 +02:00
Orgad Shaneh
20e9b33741 VCS: Use relative path for apply/revert chunk
Task-number: QTCREATORBUG-9715

Change-Id: I3bfaea3922ace396230ef5e215712a9f3459808b
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-03 13:34:38 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Eike Ziller
7c8db79817 Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
  IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
  instead
* Adapts the mode switching code in EditorManager to handle multiple
  windows, for example switching to edit mode should only happen if
  the editor/view is in the main window. Otherwise the editor window
  should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
  make the current editor visible by default, introducing
  DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
  used

One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.

Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-05 09:43:14 +02:00
Orgad Shaneh
a91219c636 VCS: Fix context menu for custom editors
Change-Id: I44718dce73bbcd376d90fdf40f4bb5ab4c57443a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-06-03 10:40:50 +02:00