Commit Graph

241 Commits

Author SHA1 Message Date
jkobus
2cbb64e0f9 Fix a crash on codestylesettings
Task-number: QTCREATORBUG-10235

Instead of rely on ICodeStylePreferences::destroyed() signal,
when all other objects might be in destruction phase,
clear project code style settings explicitly, when project
closes.

Change-Id: I0dd6675d54c5495d4006acbc9ad12c95f1d0a00c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-10-07 11:06:43 +02:00
Nikolai Kosjar
11aeaea86f CppEditor: "Follow Symbol Under Cursor" for virtual functions
F2 on a virtual function call presents a list of overrides in derived
classes. The function declaration of the static type is shown
immediately at the top.

Task-number: QTCREATORBUG-9611

Change-Id: I80ce906fa06272dc9fbd1662cd17500b8c77067f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-01 14:23:00 +02:00
Orgad Shaneh
9bf1be7f22 TextEditor: Update circular clipboard on cut
Task-number: QTCREATORBUG-8713
Change-Id: Ic83c78a4caf7f768259c8f6830e7b81016c70e5e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-25 09:54:49 +02:00
Erik Verbruggen
7516ef4969 TextEditor: get CompletionAssistProvider from editor.
And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 10:15:55 +02:00
Erik Verbruggen
073e5d6632 C++: optionally let the highlighter handle ifdefed-out blocks.
Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-19 13:01:07 +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
fade19a9bf Move IEditor::createNew to IDocument::setContents
The method is for setting the contents, so it belongs to the document,
and should be named correspondingly.

Change-Id: I40363dc08f11268f530885b512e4a88e8b10d096
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-17 09:00:17 +02:00
Eike Ziller
113c5600c9 Move displayName from IEditor to IDocument
The display name is not editor instance specific, but belongs to the
document.

Change-Id: I3c936f04a86e10e6ca30063d85036d85b4b5880e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-07-10 17:26:15 +02:00
Nikolai Kosjar
10ff6769ac Core: Let IDocument also report failed file reload operations
Change-Id: I8fa02f2398f59306c49481316fdedf50a1c4e32f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-06-24 11:13:29 +02:00
jkobus
abe3951d67 Take diff colors from color scheme
Change-Id: I706612a8f89917cb57b7d1e9ecebd86b3f4bcc8d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-12 09:23:50 +02:00
Eike Ziller
2125525e77 Move openEditorAt from BaseTextEditorWidget to EditorManager
More sensible place, gotoLine is a method in IEditor anyhow.

Change-Id: I420a6bf17060c16e6f1a4f45e0bef89379fb6bf8
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-03 09:33:06 +02:00
hjk
2b93fea580 BaseTextEditor: Style fixes
Whitespace, s/e/m_editorWidget/, remove unneeded struct, remove 'inline'
when not needed...

Change-Id: I1ce76f5c4b1febe45c4a3b6404107fed7d9c6868
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-05-27 09:05:35 +02:00
jkobus
e844bee1da Add file descriptions, enable file folding
Change-Id: Ie90ac9fb74e9c4b8cfba16d065d1b8751125e83c
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-05-06 10:31:54 +02:00
jkobus
ce0efbda46 Omit separator lines when copying selected text
In addition rename int start -> startPosition and int end -> endPosition
to avoid a name clash with QTextBlock start inside
BaseTextEditorWidget::createMimeDataFromSelection().

Change-Id: I7f54e4046913b5d5d9ddd3c07fd2747b4ca6f3fb
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-24 13:17:53 +02:00
jkobus
5f5b7fa4c1 Remove unused variables
Remove unused fields and one virtual method,
rename alwaysShows -> contextChunk and revert
its logical value.

Change-Id: I11fd60202aa5b7978b772764a40c99029cac82a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-23 14:33:33 +02:00
Eike Ziller
b450b3071e TextEditors: Separate away methods that actually work on a document
Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().

Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-19 16:21:30 +02:00
Lorenz Haas
7d2a7685aa Editor: Show file encoding in editor toolbar
The file encoding is shown next to the current line in the toolbar. If
the label is clicked a dialog for encoding selection is shown.

Task-number: QTCREATORBUG-8376
Change-Id: I9adee76a31929de5f698d14fe5ca5abce3cc4633
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-18 15:53:53 +02:00
Lorenz Haas
e89c30feb8 BaseEditor: Open locator "l <line:column>" on toolbar line widget click
Task-number: QTCREATORBUG-8811
Change-Id: Ia3ece9efb7e2c6d227ab3395aca636a27f667f0d
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-18 11:23:23 +02:00
jkobus
186c457d6c Implement expanding / shrinking skipped lines
Change-Id: I6921b7a39288f6a9747574b1a8e75d571f4723ce
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-15 18:09:35 +02:00
jkobus
77abd02787 Get rid of QChar::LineSeparator
It was causing troubles while scrolling. Replace it with
\n and hack selection. Simplify the code. Now every line
is a separate block. Prepare for expanding skipped lines.

Change-Id: I8d305681c575abdaaf9cdbf26de864dd3a906d3a
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-12 14:55:08 +02:00
Friedemann Kleint
3a806d4252 Clean headers in TextEditor.
Change-Id: Ie679e7e9d0d20a0f71dcc1fcf0f7d8305eeeeced
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-03-27 07:15:31 +01:00
Nikolai Kosjar
1e59df6fb0 TextEditor: Simplify testing of code assistant
Change-Id: I6f16dd775a7c5d8eaa4944d6050bf979be83a303
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-03-20 13:45:02 +01:00
Mitch Curtis
e53ae81858 CPP, QmlJs editors: don't indent when moving commented lines up/down.
Currently, pressing Ctrl + Shift + Up/Down with a commented block of
text selected will indent that block if the line two lines above the
block is indented. This is undesirable, because the indenting for that
block is incorrect when it is uncommented. See the following example:

Step 1:
void f()
{
    int x;

//    int y;
}

Step 2 - After Ctrl + Shift + Up:
void f()
{
    int x;
    //    int y;

}

Step 3 - After uncommenting the block:
void f()
{
    int x;
        int y;

}

This patch tells the CPP and QmlJs editors not to indent commented
blocks when moving them. Blocks that are not entirely within comments
(excluding whitespace) are not affected.

Tested with (C++ and JavaScript, respectively):
http://paste.kde.org/688778/
http://paste.kde.org/688784/

Change-Id: I35414e6dfd5a1084fd997594e711ea9932231981
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-03-08 15:15:53 +01:00
David Schulz
6ef0cf1a30 Editor: Refactor Open Link in Next Split.
Cleanup code and added shortcuts and menu entries for
- open header/source in next split
- follow symbol under cursor in next split
- open declaration/definition in next split

Change-Id: I2c4347749d26669d88b7c2968f30f60710f442b1
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-02-14 09:46:16 +01:00
David Schulz
45b021331e Editor: Renaming Link members.
Change-Id: I1ae21152ee7b8e2a9323322575de23d77c260c72
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-02-11 16:00:52 +01:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
	src/plugins/qmldesigner/designercore/include/widgetqueryview.h
	src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
	src/plugins/qnx/bardescriptormagicmatcher.h
	src/plugins/qt4projectmanager/profilekeywords.cpp
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h

Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
2013-01-31 16:25:33 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
Jarek Kobus
d3286c2ce0 Add some methods which will be needed by diff editor
Change-Id: Iae85e123a5b72e85b8b55359267bc1b2810a640b
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-01-22 16:05:15 +01:00
Christian Stenger
e2306b0537 Editor: Compile fix
Change-Id: I61ac997547b6cbeec6c4acaa464162237bb56911
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-01-11 16:45:32 +01:00
Petar Perisin
39e9c5ef20 Editor: Allow to open links in a new split.
This changes current behavior while opening links. Link is now opened in
next split by default. If you use CTRL+Click to open links, it will also
open in next split. However, by using CTRL+ALT+click it will open in
current split.

There are two new checkboxes in Tools/Options/Text Editor/Display:
- "Open Links in New Split" - if it is checked, links will not be opened
in current split. However, if document with link is already opened, it
will be used to open the split
- "Force open links in next split" - Links will always open in next
split, even if their document is already opened somewhere else.

Task-number: QTCREATORBUG-8117
Change-Id: Ib99075b55d9e9683ed2c2386767227457de0a3fc
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-01-11 12:48:44 +01:00
Debao Zhang
4a32f1d821 use QSharedPointer instead of QRefCountPointer
Change-Id: Ie670448bf924e02720eae6db33f2a346e8ac0001
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-01-09 08:59:28 +01:00
Orgad Shaneh
7fa69afa6c Use Core::Id for language
Change-Id: I0077558e9e2cf5aa06ac921cb45224e29aa85c9b
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 08:32:44 +01:00
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Daniel Teske
4083c11002 Optimize painting after changing marks
Change-Id: Ib9e225bc063df82fcb351ff1e2572aa2d663b8a7
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-09-11 15:45:55 +02:00
Christian Stenger
f3e92100cb Editor: Fix transformSelection() for block selection
Task-number: QTCREATORBUG-7643

Change-Id: I26f9a3637a39a26e82b72de1143e31b5e55b076e
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-09-03 10:10:36 +02:00
Eike Ziller
d9f8a25f80 Merge remote-tracking branch 'origin/2.6' 2012-08-02 07:41:18 +02:00
Orgad Shaneh
93756975e1 Context cleanup
Change-Id: I5e228acda32e8924d6a9bed13ea34182fff1dbb1
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-01 10:43:15 +02:00
Konstantin Tokarev
b0da247604 Unified contextMenuEvent implementations of editor widgets.
Change-Id: Ie5dbde8d0443a65a8e96853002c8bdafd2c0d729
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-07-30 10:21:42 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Francois Ferrand
6defb83d03 TextEditor: menu for pasting from clipboard history.
Add new action to show a menu of recent clipboard history. When an item
is selected, the item is pasted.

Change-Id: Id7e1a90730404fb63762bf1f20678484ec34cd2b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-06-05 12:08:00 +02:00
Konstantin Tokarev
7ae82b9f94 Added TextEditor commands FollowSymbol and JumpToFile.
Most of editors have "jump to file" or "follow symbol" actions. This
patch reduces amount of related boilerplate code.

New actions are made optional to prevent shortcut clash (both use F2).

Change-Id: I2af580ed9d6789df25f4487ba001f3b83887c504
Reviewed-by: hjk <qthjk@ovi.com>
2012-03-28 08:38:41 +02:00
Yuchen Deng
012ff2d22a Editor: Add feature for set/unset UTF-8 BOM
Change-Id: Iec7e36b1d7a526d7fa8a8096110b91f9c4cc44f9
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-15 11:11:03 +01:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +01:00
Erik Verbruggen
3aab8beaf4 Supply c++11 flags and per-project info to c++ code model.
A manual squash/merge of the changes below, plus a couple of subsequent
code fixes.

59085aa5fbb99e2d786cd2c1a06c24a111ccb49f:
    Modify CppModel::ProjectInfo

    Adding per project node information, to pass on the correct
    defines/includes for each file, instead of aggregating them incorrectly.

    Also split up SOURCES and OBJECTIVE_SOURCES.

    Also ask the toolchain to convert the compilerflags to flags the
    codemodel understands, for now only gcc and only c++11.

    Also make the toolchain aware of the flags used to compile, so that it
    can emit the correct defines.

    Note: No header files are passed on.

74028802314cd4e75b41b46407433e07090a304d:
    GCC: Evaluate cxxflags when checking for predefined macros

ebaaa4957e4c02cc9637a998eddae1d0acd74f83:
    MSVC: Take cxxflags into account when checking for predefined macros

9bfce7e889bcf7bcc47bf880e3ea25945ca7d0d7:
    Compile fixes

Change-Id: I9de94ad038dfc5dc1987732e84b13fb4419c96f5
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-16 15:17:17 +01:00
Daniel Teske
bb4f25b748 Rename BaseTextEditorPrivate to BaseTextEditorWidgetPrivate
As it is the private class of BaseTextEditorWidget.

Change-Id: I49c9b4e85cffbca3d0a61dd82e93596e7bf29376
Reviewed-by: hjk <qthjk@ovi.com>
2012-02-16 13:59:47 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Adam Treat
fe9eeece40 Adds two actions to indent and unindent a selection.
Add actions to the basetexteditor to indent and unindent a selection.  These actions
are equivalent to Key_Tab and Key_BackTab respectively.  The advantage of having
actions here is the user can override them and assign any key binding they want.
Thus, I could assign Ctrl+I and Shift+Ctrl+I to them and have the same behavior
as Kate.

Change-Id: I0a305a7b45018072a78f2880ea15650ea92095a1
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-02-10 12:42:29 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
Bojan Petrovic
a138465848 C++: Select All select the symbol while renaming symbol
https://bugreports.qt.nokia.com//browse/QTCREATORBUG-5520

Change-Id: Ifb163adb2609e17cdbc3df1e90b7e583c75fac49
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-01-20 15:27:09 +01:00