Commit Graph

369 Commits

Author SHA1 Message Date
Eike Ziller
418dcfbcbb Help: Avoid multiple lookups of help id for context help
Context help would first query the database with potential IDs, and
afterwards the help plugin would look up the links for the resulting ID
again.
Pass the HelpItem (which potentially contains the cached links) directly
to context help.

Change-Id: I73bddcd3cd4eacaea412b98d53c5e5354a31f3d5
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-29 07:57:19 +00:00
Eike Ziller
bbe0cd68fa Help: Remove unused method and related code
Change-Id: I4c4641290eceb441339cc237ee74a52c1018e3ae
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-25 08:23:11 +00:00
Eike Ziller
379aef60f9 Help: Unify showing a specific help url
Makes code paths easier to follow.

Change-Id: I6056862c15dbbaa8c63f0633ba70a178cfa910f6
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-25 08:23:03 +00:00
Eike Ziller
809416c993 Help: Simplify and unify code
The help widget doesn't need to resolve the external help viewer
instance manually, we have an entrypoint for that already.

Change-Id: I6875c434428baac3f1883813207cf318d7d3dc09
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-24 14:03:38 +00:00
Eike Ziller
3c5650e514 Add macOS touch bar support
Introduce a generic Utils::TouchBar that implements a touch bar for
macOS based on QAction. Touch bars can be nested, and one is set to be
the application's top level touch bar.

Also add an ActionContainer for the touch bar. That allows us to manage
the layout of the touch bar the same way we do with menus.

Since the touch bar is an input device with very limited space, a
command in the touch bar needs to be specifically styled for the touch
bar by setting either touchBarText or touchBarIcon (or both).

Touch bars can be nested by nesting the ActionContainers. A nested touch
bar ActionContainer needs to specify an icon and/or text to show in the
touch bar button that opens that sub-bar.

Commands are only shown in the touch bar if they are valid within the
current context.

Implementation-wise we cannot use the standard NSPopoverTouchBarItem for
nesting touch bar levels. We cannot hide items in the touch bar, because
hidden items still take up space in the touch bar. So we need to rebuild
the touch bar regularly. Since the items we show are very dynamic, every
time the items in the toplevel bar change because of a context change,
any opened sub-level touch bar closes. That is why we maintain a stack of
touch bar levels ourselves, replacing the main touch bar with the current
level, and managing opening and closing the levels manually.

This patch adds buttons for Help, Bookmarks, Header/Source, Follow
(Symbol), Decl/Def, and a sub-bar for the debugger actions.

Fixes: QTCREATORBUG-21263
Change-Id: Ib63e610f21a993f1d324fe23c83a7f2224f434ac
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-01-15 14:33:56 +00:00
Daniel Wingerd
2710a9b0e5 help plugin: specify bgcolor for html
Change-Id: I5ffd9851d6bc43510f4eb3ad903055544d83b8b0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-14 10:46:35 +00:00
Daniel Wingerd
b8a4050bab help plugin: strip html from a translatable string
Change-Id: I4c147c969ae04c50ca2d6fd40143919236f97679
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-14 10:44:18 +00:00
Alessandro Portale
901b2be036 HelpPlugin: Modernize
modernize-use-*

Change-Id: Ie0058675c1336377326089dbc093436130f1fe03
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-12 11:10:38 +00:00
Leena Miettinen
5562cc7cfb Help: Add ellipsis to a menu item label that leads to a web site
Change-Id: Id273a8508c8393580c6b9222f95aa4033e9eca9a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-10-19 12:28:58 +00:00
Eike Ziller
b9db5ea86e Move documentationPath() from Core::ICore to Core::HelpManager
It is documentation related API, so it belongs there.

Change-Id: I5d1676f251e6deb92050ddedac19bf3c332aab54
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-20 07:19:49 +00:00
Eike Ziller
2c17fbe8dd Make Core independent from QtHelp
We don't want various plugins to depend on the Help plugin,
but we also do not want Core to depend on QtHelp.
For example when turning the Help plugin off, documentation should
actually no longer be registered through QtHelp. So we need
parts of the interface in Core, which must then be delegated
to the actual implementation in Help.

As positive side-effects the interface in Core will be slimmer,
and the code in the Help plugin can later be simplified, too,
because then we don't have the "Core" and the "Gui" help engines
separated in different plugins anymore, which should remove the
need for some setup indirections.

Task-number: QTCREATORBUG-20381
Change-Id: I634c5811c45d6a3dfd6ddc682cae270e38384cbf
Reviewed-by: hjk <hjk@qt.io>
2018-09-04 11:21:18 +00:00
Eike Ziller
8fa449126c Fix context of Locator input
- In the main window, the locator input (actually the status bar)
  visually feels like being part of the mode widget, so give
  it its context.
- In extra editor windows, the whole editor window should have
  "editor manager" context, so that is also active for the locator
  input.

Task-number: QTCREATORBUG-20626
Task-number: QTCREATORBUG-20071
Change-Id: Ib68d6a8177446572ea59c3cc057eca0706173e11
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:55:25 +00:00
Robert Loehning
2d7d0abd2d Help: Make "System Information" a QDialog again
Making it a QWindow meant that Alt-Tab will lead to the main window and
right back to "System Information" because this is modal. This
incovenience outweighs the convenience of having a "Maximize" button.

This reverts a part of 40d7399755

Task-number: QTCREATORBUG-20513
Change-Id: Idcea54ee2f60f9f7efde7d25ce0c305b87f445dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-08 10:46:06 +00:00
Eike Ziller
da18fc1f50 Help: Use nullptr and fix a few warnings
Change-Id: I7f7307a765d8755bf96b0cad1210e61df0a0199f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-19 12:07:59 +00:00
Eike Ziller
454e9ee5ca Add Context Help to text editor context menu
For this make the default context menu for the text editor extensible
and add the context help item from the help plugin, which now has an
optional dependency on the text editor to ensure correct loading order
if both are present.

Task-number: QTCREATORBUG-55
Change-Id: I378a491ba3700e65fc262bdb10c8ead5ad62cb33
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-29 08:26:24 +00:00
hjk
d3eb585db9 Help: Pimpl plugin and avoid use of global object pool
Create a HelpPluginPrivate class, move all previously private
HelpPlugin data and code there.

Make it live from HelpPlugin::initialize() to HelpPlugin destruction,
so it can be used to handle life time of data members automatically,
making use of IPlugin::addAutoRemovedObject unneeded.

Change-Id: I9e381ca20b98f4d9c06687c11b81a64e69ceeb96
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-05 12:42:27 +00:00
Nikolai Kosjar
dd06a4188d Core: Return context help id by callback
...to support asynchronous providers.

Change-Id: I483489c74e7886d5bc2bf00b65540c3d2c7afee0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-18 13:54:02 +00:00
Alexandru Croitor
b23dab3ba2 Avoid double deletion of HelpWidget when quitting application via Dock
HelpWidgets that are created to be shown in an external window, had
two different places where they were deleted:
1) When the widget was closed (due to Qt::WA_DeleteOnClose)
2) In HelpPlugin::aboutToShutdown via manual delete call

In certain circumstances (when the WebEngine backend was used)
this caused a double delete. Specifically, after opening an external
help window, and closing the MainWindow, the application did not quit
due to QTBUG-62596.

Now if the help window were left open, and the application was quit
via the macOS Dock, this caused a crash.

When the application quits, it calls the HelpPlugin::aboutToShutdown,
which deletes the HelpWidget. This in turn destroys the WebEngine
view, which destroys the underlying QQuickWidget, which destroys
a QQuickRenderControl, which calls
QQuickRenderControlPrivate::windowDestroyed, which handles all
posted QEvent::DeferredDelete events, which in turn triggers the
deletion of the same HelpWidget due to the
Qt::WA_DeleteOnClose attribute.

The solution is to remove the Qt::WA_DeleteOnClose attribute, and only
delete the external HelpWidget on shutdown, and not on CloseEvent.

Task-number: QTBUG-63945
Task-number: QTCREATORBUG-19582
Change-Id: I5b73ff7fe52e7e1259a8aa98c97c9dbedd5e3c20
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-17 16:24:43 +00:00
Eike Ziller
8e3efd92c6 Fix Get Started Now (and other links)
If we do not specify the correct documentation URL including the version
number, QtHelp will look for any documentation that has the given path.
Since we now register Qbs documentation, and that also has a file
"doc/index.html", the Get Started Now button could open the Qbs manual
instead of the Qt Creator one.
Specify the full documentation URL including version number to ensure
that QtHelp opens the right page.

Change-Id: Ia77103fe2763dd208d3b9a279a8301f7f5799c8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-12 07:32:34 +00:00
Eike Ziller
9297ee92c6 Help: Fix destination of index locator filter
When using locator in the external help window, open help pages or show
the topic chooser in the external help window, not the main window.

Change-Id: I792223147f1eb00addafb2618017536c126c71dd
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-27 12:15:11 +00:00
Eike Ziller
6afc0c3eb6 Help: Add method for showing URL in specific viewer
That centralizes all the focus setting, raising of windows, etc. This
was for example already done wrong when opening links in help mode and
external window.

Change-Id: I5036b5caa751d1f36dc442078624a31fb8f573ee
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-13 10:49:16 +00:00
Eike Ziller
be3dbd4c53 Help: Do not unnecessarily open help mode
When using the "Web Search" locator filter ('r') or "Get Help Online"
from the context menu on build errors in the issues pane, we already
know that we want to show the URL in an external browser, not help mode.

Task-number: QTCREATORBUG-17795
Change-Id: Ie7faa527907124251a60e7618747d81a6003fa19
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-13 10:06:07 +00:00
Eike Ziller
c8affd6e74 Help: Remove trivial slots
Use one-line lambdas

Change-Id: I85d1fe33283b6c517a1942d833d6b127002540f5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-07-12 14:07:00 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
Tobias Hunger
bd6742a45e Help: Clean up code
Change-Id: I743e799d1414a6d27b468c938c450487edcef0f4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-29 15:23:24 +00:00
Eike Ziller
b64bb0a7e3 Help: Fix that help viewer opened even if URL is opened in browser
After we constructed the online URL for Qt/Qt Creator documentation that
is not installed locally, we can just open that via desktop services
instead of bothering built-in help viewers.

Change-Id: Ic8a37bc22d34af881b5daf87534d59db4d331e44
Task-number: QTCREATORBUG-16111
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2016-10-10 11:09:03 +00:00
Alessandro Portale
40d7399755 Help: Small improvements for System Info dialog
1) Make the font non-proportional, since qtDiag's output is formatted
with spaces
2) Make the dialog a window with maximize buttons
3) Fix the formatting for unloaded plugins

Change-Id: I911871b1ffc9dceebcbb04f544cc6d580b95c54e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-28 09:39:29 +00:00
Eike Ziller
a416a5b6e3 Help: Option to open links in window
Task-number: QTCREATORBUG-16842
Change-Id: I420f48a00c56ebc89bade7e91ceb8ec391316e36
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-09-23 11:26:07 +00:00
Eike Ziller
b547b5b078 Help: Remove QtWebKit backend
QtWebKit is gone, removing it is better than letting it rot.

Change-Id: Ie0a43f9aed028edb76b2e9f2dac0b4a9be8ce05d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-14 10:07:39 +00:00
Eike Ziller
c635c6b50a Merge remote-tracking branch 'origin/4.1'
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ExtendedFunctionButton.qml
	src/plugins/android/androidrunner.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h
	tests/system/suite_WELP/tst_WELP03/test.py

Change-Id: Ibac4d71d4f4dbe1e4f05052d2f8a2dcfd82edd4c
2016-09-13 12:15:09 +02:00
Eike Ziller
e4e30b24e0 Help: Fix online documentation path
When trying to open pages that should be in the installed documentation,
but are not, we try to open the page from the online documentation in
the external browser (e.g. for the links from Welcome mode). Looks like
the online documentation moved.

Change-Id: I7a8eaf37783661dc4751a12b65efeac419d3a802
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-12 09:10:03 +00:00
Eike Ziller
f38531effb Add a menu entry for copying system information
Which outputs the information from qtdiag, installed plugins,
and general Qt Creator build information.

Task-number: QTCREATORBUG-16135
Change-Id: I618b9883369bae45006bb109f8757e89b091b882
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-05 13:00:54 +00:00
Eike Ziller
8c94419a0b Help: Remove unnecessary QLatin1Strings
Change-Id: Ia5c83d5e2c392873f400f3db396b9c355cdd4192
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-21 06:12:22 +00:00
Orgad Shaneh
d01adc134d Help: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: Ied9c7fcc031e530c41b342de950e2f0ac730bbb1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-30 12:12:00 +00:00
Eike Ziller
090c106929 Fix Ctrl+M (bookmark) in editor when help mode is visible
For external windows we need to separate the contexts in which help
mode's "add bookmark" and editor's "toggle bookmark" are present.

Task-number: QTCREATORBUG-16286
Change-Id: I2a7a28c75dc53e1dd0b21c0a8833bd4594d5afad
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-28 07:52:03 +00:00
Eike Ziller
9b7fa05bf3 Fix after changing ModeManager::currentModeChanged
Change-Id: Id71b0992fef9c0cb544d68078fb2b654777f0a2e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-13 07:48:33 +00:00
hjk
5e47d35fcd Use Core::Id in ModeManager interface
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.

Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-04-08 10:38:49 +00:00
Eike Ziller
368a718d3d Add QtWebEngine backed help viewer backend
Supports most features. Defined priority for help viewers:
"qtwebkit" > "qtwebengine" > "textbrowser".

Task-number: QTCREATORBUG-13910
Change-Id: I59b4231ef93fdf9df46436850ed3743b5916f9cd
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-18 15:32:04 +00:00
Eike Ziller
727b918773 Help: Fix issues with scrolling to right position
The different viewer backends have different issues with scrolling to
the right position if the URL contains an anchor. In all combinations of
"viewer was visible/invisible when help was requested" and "viewer last
showed the same/a different page then the requested URL".

Move the special logic from help plugin to the viewer backends.

Task-number: QTCREATORBUG-15548
Change-Id: I962c90695ceaee48800a3590676e1d28343cf790
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-03 15:10:57 +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
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
Eike Ziller
d0e510f362 Help: Remove funny restriction
There is no reason why some part of the help mode couldn't provide
help.

Change-Id: I9c28dc1dacf122e5f3828144a0e386a9f7e2b6c2
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-08-21 08:49:52 +00:00
Eike Ziller
3858c33d74 Merge remote-tracking branch 'origin/3.4'
Change-Id: I35ba4cc7f7052699c3006545514c866be3cb5fdd
2015-05-26 15:12:42 +02:00
Eike Ziller
19dca2adc4 Help: Fix QDesktopServices url handler for qthelp urls
Change-Id: If55a35fcd0960bd7ac215493ccc7e4118a8c3187
Task-number: QTCREATORBUG-14459
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-05-18 11:38:20 +00:00
Eike Ziller
9724cf6891 Help: Work around issue with Visual Studio < 2013
Visual Studio before 2013 had bugs in bool conversion of std::function,
leading to "true" in some cases where it shouldn't.

Task-number: QTCREATORBUG-14399
Change-Id: I8a1ad2f952247049355e11337ddf99f380ebde98
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-12 05:08:18 +00:00
Eike Ziller
5e0f0268ae Help: Do not save settings in help database
Using the help database is not necessary, does not follow our style,
and is less reliable (with all the setupEngine mess).

Change-Id: Icb7f63a6b349458011e1b068bdf0954b78d3281f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-24 08:32:38 +00:00
Ulf Hermann
05edc86cad Help: Remove extra event processing
It's not clear why we need it there, it's generally not advisable to do
qApp->processEvents() and in this case it clearly creates problems.

Change-Id: I2707ef0ec98ee761078283ee3ce3f76f9da95f31
Task-number: QTCREATORBUG-14215
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-15 10:35:15 +00:00
Eike Ziller
7b8d670bd8 Help: Fix that bookmarks were not restored
We have to make sure that the help engine is properly set up before
trying to read the bookmark data.

Change-Id: Id57cce5f538472eeac17b39a3640bf2ed77fa56a
Task-number: QTCREATORBUG-14106
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-13 07:19:38 +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
Eike Ziller
767f0ef58b Merge remote-tracking branch 'origin/3.3' into 3.4
Conflicts:
	doc/api/coding-style.qdoc

Change-Id: Id40eb253a2e3e2357276ee76085127da10597bdb
2015-02-25 10:15:28 +01:00