Commit Graph

224 Commits

Author SHA1 Message Date
Alexandru Croitor
2a00686c7e TextEditor: Make copyLine action actually select the line.
Change-Id: Ibaeed5997b92b5bbe933dd8123e433fcf197e4fe
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-02-19 13:03:59 +00:00
Eike Ziller
5952165cf9 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ic4d3d94feaaa588c6244509bb3dd14c5cb646fe7
2016-02-01 16:15:48 +01:00
hjk
677effda78 Remove even more uses of deprecated typedefs
Change-Id: Icb48d484f760eb11ef2d41d8271e43f4f51c2e91
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-22 13:23:53 +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
Marc Reilly
64b172ae73 hoverhandler: add priority system to determine which tooltip is shown
Hover handlers now have a priority which is used to determine which
handler's tooltip is shown. The handler with the highest priority is
used, or, in the case of equal rankings, the first registered handler.

The base handler implements a default basic priority system based on the
diagnostic and help properties. Derived handlers can manually set the
ranking value as part of the identifyMatch() call.

A new checkToolTip() method is added so the handler can analyze whether a
tooltip is valid without it being shown.

Change-Id: I9d82fb9cc52f1d3cd53a8b197d75cd923651b79d
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-18 09:25:03 +00:00
Orgad Shaneh
3f46e3da30 TextEditor: Make TextEditorSettings all static
Move the fading indicator to the widget

Change-Id: I762c46845153c93c75ea0198c993b655559fad3b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-18 12:01:59 +00:00
Orgad Shaneh
9d3b2f0998 TextEditor: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I380120e3419d2a3c0e272f51cc3e0d5f6aaa5e9b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-12-18 11:54:12 +00:00
Allan Sandfeld Jensen
b2f2b92713 Correct CTRL+wheel zoom on touchpad
When we get fine-grained scroll events we shouldn't zoom 10% on every
event but scale zooming so they add up to 10% for every wheel click.

Task-number: QTBUG-49024
Change-Id: I08ac728bf1421148680de8fbbc76054ba2cce884
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-12-04 09:47:10 +00:00
Tobias Hunger
08ca3eb480 Snippet: Use Template engine to pre-process snippets
This enables macros in snippets as well as if/else to select/deselect
lines to have in the snippet.

Change-Id: Ic88fb3277a0f5ac803bcab486b245c688c00822a
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-13 09:15:36 +00:00
Eike Ziller
6ed775f56a Fix wrong context help if tool tip was not shown for focus widget
The tool tip never has focus, so it cannot become the IContext that is
checked for context help. So, integrate the help id into Utils::ToolTip
and check the tool tip first when checking for context help.
As a side effect the [F1] button and help id for the tool tip is now also
available for use outside of the text editors.

Task-number: QTCREATORBUG-5345
Change-Id: Id975703caf161d1183c247e8ad8bb693b90fd306
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-30 08:25:18 +00:00
David Schulz
0566b6f63c Editor: Disconnect private editor class when destructing.
Task-number: QTCREATORBUG-15010
Change-Id: Iae3fef08fe0ed42a0eb81cc724f8e5250aedc80d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-09-29 13:46:11 +00:00
Thorbjørn Lindeijer
9bf4cc61e0 TextEditor: Only use the last mouse position when updating links
Fixes building up of sluggishness when hovering text while keeping
Ctrl pressed.

To make sure link clicks are handled correctly, an immediate update
is forced in case of mouse press.

Task-number: QTCREATORBUG-12573
Task-number: QTCREATORBUG-9008
Change-Id: Ieb85d9f2a1e82167dd9a9245e4bc48766d71ae93
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-23 14:03:33 +00:00
Eike Ziller
4b1cda0f7c Merge remote-tracking branch 'origin/3.5'
Change-Id: I9baaf42531c10c32a2fa78d2504de213e77fdf82
2015-08-10 11:15:29 +02:00
Orgad Shaneh
6c13ce05af TextEditor: Fallback to last line when input line exceeds the document
Task-number: QTCREATORBUG-14782
Change-Id: I7ead94a132207ccaae661cb6aceff5387d11b818
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-08-06 13:38:04 +00:00
Vladyslav Gapchych
aab3b0fc66 TextEditor: Fixed indentation in block selection mode
Made indentation work for block selection mode the same way it does in default mode:

1. delete text if any selected
2. indent block if no text selected
3. indent last line if cursor in first column (QTCREATORBUG-12697)

Task-number: QTCREATORBUG-12697
Change-Id: I1f6b218b389f3fdc5232ec02857aa76f5ccbaaf0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-17 12:45:11 +00:00
Tasuku Suzuki
ae9ce6981c TextEditor: follow "Enable scroll wheel zooming" setting behavior
When it is disabled, scroll wheel zooming should not work.

Change-Id: Ie6a7e2620185ee4496830c614a6ccd48c9ec2427
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-01 11:46:28 +00:00
Takumi ASAKI
5088f07f39 TextEditor: Fix code completion and pasting in snippets.
Fixes case 2 and 3 of QTCREATORBUG-14633.

Task-number: QTCREATORBUG-14633
Change-Id: I19bf3c81c26f8a89a508591b0e7264251e0e6254
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-01 09:17:57 +00:00
hjk
2c07175be5 TextEditor: Avoid using Core::Id::uniqueIdentifier
... by using Core::Ids instead of ExtraSelectionKind enum.

Change-Id: I664ff2a4a03eddd8fe1150929203a1727c12dc84
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-06-24 08:23:47 +00:00
David Schulz
8a1c603c0d TextEditor: Remove unused variable.
Change-Id: I7bb08e9ded88013fd8ca3b99fadf9e3c091feb38
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-19 07:25:05 +00:00
David Schulz
c82d287cbf Editor: Highlight Search results in scrollbar.
Change-Id: I999ddeeedbd6bdd7abebf75405d7e9281a1893df
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-06-16 09:02:14 +00:00
Jochen Becher
431b25ad27 Introduce dragging for all explorer nodes.
Extend drop support with variant values. A drop may be a file drop or a
value drop or both.

Rename Utils::FileDropSupport to Utils::DropSupport and add methods to
add not only files but any QVariant value to the mime data. Project
explorer adds dragged nodes (which will be needed for future ModelEditor
plugin).

Change-Id: I799542c60fdecb3e64af0d3ba47b6caa9adbcfd7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-06-15 08:12:56 +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
David Schulz
7ce4958764 Editor: Correctly unset block selection when setting a new text cursor.
Change-Id: I7d155140c55ed145cede217f3cc97064161a5a07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-21 07:29:55 +00:00
David Schulz
f34b32abd5 Editor: Make parenthese mismatch color configurable.
Task-number: QTCREATORBUG-14357
Change-Id: I92a0d50fb8f3448195f3d38f7544a31eb695733b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-05-18 12:18:17 +00:00
David Schulz
766b222d8f Editor: Move inFindScope back to exported class.
To allow invoking it from BaseTextFind.

Task-number: QTCREATORBUG-14300
Change-Id: Id9f553d166f7b929e00238327e22d6a915957b77
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-04 07:54:14 +00:00
David Schulz
583b8dbefd Editor: Fix hihglighting current line in read only editors.
Task-number: QTCREATORBUG-10104
Change-Id: I3c4adb62c1cae61e9eb409a58359a687852023a1
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-28 07:00:15 +00:00
David Schulz
b192d18e04 TextEditor: Caching links at cursor position.
Reducing the number of calls to findLinkAt() when hovering over
text.

Task-number: QTCREATORBUG-12573
Change-Id: I679ee7d9599071e1e3ea20cc028440df6dad0d25
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-21 08:47:37 +00:00
Tobias Hunger
3b68a46ba1 TextEditor: Add methods to query the first, last and center line
... that are currently visible on the screen.

Change-Id: I6c56f376f1a34a7314584df057cf03a8e5387a08
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-04-20 07:55:47 +00:00
David Schulz
24d784b06a Editor: Draw line numbers before text marks.
Task-number: QTCREATORBUG-14178
Change-Id: Id7c29d958194b1337316cd550211c5089e719ccb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-09 07:42:37 +00:00
Eike Ziller
e56118cc1e Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/libs/extensionsystem/pluginview.cpp

Change-Id: I316199fe0a257cb085668ccb183b1590555278f2
2015-04-02 11:56:55 +02:00
Kai Koehne
46fc33d914 Don't mix iterator and const_iterator
This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.

Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-02 09:40:24 +00:00
Eike Ziller
65cd5381d9 Merge remote-tracking branch 'origin/3.4' 2015-03-26 12:51:06 +01:00
Sergey Belyashov
8b46f0d6ef Fix missing translations
Task-number: QTCREATORBUG-13649
Change-Id: I5bf7524d837d026394426239c4ab97f28574ed5a
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-24 14:43:43 +00:00
Nikita Baryshnikov
2be30c27ac TextEditorFactory use rvalue refs for creators
Change-Id: Ia54e86af1fff2da270d744526cc4a17021e48b20
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-24 11:06:23 +00:00
Sergey Belyashov
7fa58f1d99 Fix missing of some translations
Task-number: QTCREATORBUG-13649
Change-Id: I69f78b3b8d2366003bfce81a2afba0068e716d22
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-03-24 07:04:46 +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
831701bb67 Avoid storing references to rvalue FileName strings
Following 73616849, it is dangerous to store a reference to the rvalue of
toString(), since it might become dangling.

Example:

FileName foo() { return FileName::fromString(QLatin1String("/some/file")); }

void func()
{
    const QString &fileName = foo().toString();
    // fileName is now a dangling reference
}

Change-Id: I5dfad5dc8dd568a0a3c8f9f71ad93292dc26cbbe
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-02 07:27:10 +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
592ffe7377 SettingsDialog: Remove CategoryId parameter from callers
PageIds are supposed to be unique, so the CategoryId can be determined
from the PageId. Look for PageIds in the already expanded categories
first before searching through expensive categories.

Change-Id: I006beb0df6183453163ac1810fe59a306a0f52b1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-02-24 13:52:00 +00:00
Eike Ziller
5a3a940ad3 Use new mime database
Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-17 13:00:07 +00:00
Eike Ziller
a22dc36aaf Generic highlighter: Fix matching the right definition
No longer uses artificial mime types for highlighting files that do not
specify a mime type. No longer registers mime types that are specified
but that Qt Creator does not know about.

Instead, try to match the mime type, and if that fails, or if the result
does not match the file name pattern, try to match file name patterns
instead.

This also fixes the potential problem that mime types were always only
added, never removed, even if the user removed definitions and triggered
a reparse.

Also fixes that a highlight definition in the fallback location could
overwrite a highlight definition in the preferred location, if it has a
higher priority setting.

Task-number: QTCREATORBUG-13912
Change-Id: I86ce10f4f4341f6add0d2b58a04f080501d0cbf4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-17 09:55:30 +00:00
Eike Ziller
e7fb05e038 TextEditor: Simplify configuring generic highlighter
* configureMimeType -> configureGenericHighlighter, since that is what
  it actually does.
* setupAsPlainEditor -> setupGenericHighlighter, since that is what it
  actually does
* avoid multiple highlighting definition lookups
* unify code paths by not separately creating generic highlighters
  through the factories

Change-Id: I9579ca5736bbf08c01b8e41b63c6b9f36bdc725e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-02-16 15:45:36 +00:00
Eike Ziller
45e544b442 Merge remote-tracking branch 'origin/3.3'
Change-Id: I79fac4a4e8535153da1b3f73a6b1caad1513ea9c
2015-02-16 12:35:54 +01:00
Alex Trotsenko
b3d9c5e5e9 Fix TextEditor plugin compilation
Declare classes before use them in QObject::connect().

Change-Id: Id9e8b6f753b303948e0d9d1dc9a29d9592bd6807
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-13 19:12:51 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Orgad Shaneh
b556ba5002 TextEditor: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: Ief087658e2adc337ee02c49f0fb406597114df07
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-06 09:28:43 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Orgad Shaneh
c6a983d271 Core: Use FileName for file path in IDocument
Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-12 10:23:37 +01:00
Eike Ziller
b5b47f7df2 Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/cppeditor/cppdocumentationcommenthelper.cpp

Change-Id: I2cf25eba1de149765a6c44ad354d606ce9de512d
2015-01-08 10:38:20 +01:00
Maksim Klimov
8276253558 TextEditor: Highlight and animate matching parenthesis for generic highlighter
Change-Id: I78db37a91f1770513fcb5192bf45623799e14e34
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-01-07 12:38:59 +01:00