Commit Graph

467 Commits

Author SHA1 Message Date
hjk
ef1653698e ProjectExplorer: Use FilePath for ProjectNode::{path,directory}
... and let the fallout trickle down a bit.

Change-Id: I1a2f79e281725c4a121cc2fbbc0377e881616ce5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:09:26 +00:00
hjk
622a03f63c Core: FilePathify MainWindow::openFiles()
Change-Id: I2d63d9099a7eb5d7c9ea9f1b7d23555a90e737ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 09:37:39 +00:00
hjk
5731965045 Utils: Use FilePath in DropSupport
Change-Id: Id048d0dab4c58be367a081bb8041214abd6dbf98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-02 06:59:53 +00:00
hjk
44e841c453 Core: Use FilePath in preferredEditorFactories
Change-Id: I16f50b2a5cabc9eed9d895ce6b46efc62fcb336c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-30 07:07:29 +00:00
hjk
64c9384cb8 Core: Use FilePath in IDocumentFactory::open()
Change-Id: I369f3bba2e0d1d33fed3a29f3c1408429cc7d8f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-30 07:07:18 +00:00
hjk
16e8cc7748 Core: Use FilePath on findDocumentFactory
Change-Id: I0308379c89f49051e8f6e753a91d756a758c5765
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:23:24 +00:00
hjk
906cfb060b Core: Use FilePath in some functions related to opening files
Change-Id: I9610855a914d315d7934996c755fb69ad399320f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:14:46 +00:00
Eike Ziller
6bc9cddb9e Merge remote-tracking branch 'origin/4.15' into 5.0
Conflicts:
	src/plugins/cmakeprojectmanager/projecttreehelper.cpp
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
2021-06-24 10:43:10 +02:00
Kai Köhne
10420d4e5e Replace Freenode with Libera.Chat
Change-Id: Ia4a54b72f522a02c734273630c8217af75e4ea92
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-06-23 14:40:50 +00:00
hjk
10af72100d Core: Update contact from freenode to libera.chat
Change-Id: Ia5dff84029dd7011ddc370e1493d02bafd41b9e2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-23 11:45:07 +00:00
Eike Ziller
f3997c565e Add clear button to build system output
in Projects mode.

Change-Id: I7ab5b460228f6c8a2c68ece87ccfbdef3608bd9c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 07:11:56 +00:00
David Schulz
95a7dc4857 Core: Use FilePaths for recent documents
Change-Id: I453e7dd2c5d8d357b651392fa7d7f0baf07173f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 04:38:36 +00:00
David Schulz
4b19decaa7 Core: Remove EditorManager::CanContainLineAndColumnNumber
In preparation of just supporting Utils::FilePath to open editors.
Opening editors at specific locations is still supported via
openEditorAt with Utils::Link, but the caller has first to parse the
file name via Utils::Link::fromString.

Change-Id: I17e5a28aeb50779cef9948fe72e37122d1020c50
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-07 10:09:04 +00:00
hjk
2ccf5e2795 Core: Use FilePath in ExternalEditor interface
Change-Id: If3360eb7db9cec373551c2eb0fcffaf3bc5460e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-28 09:13:23 +00:00
hjk
76db1e3746 Core: Add FilePath based overloads to EditorManager::openEditor{,at}
Part of the overall FilePath migration. Keep the original version for
a while to allow using code to catch up.

Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 09:55:50 +00:00
hjk
61a0b2b2b3 Add some basic contact information in a new Help->Contact dialog
Change-Id: I5a01c3d3c9fd467ed7b48869b66617adf2b11fed
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-26 16:36:07 +00:00
Orgad Shaneh
dad2b3d84b Merge remote-tracking branch 'origin/4.14'
Change-Id: I7d55c01489dfcdd26fcf3ced9f26539a09073e8c
2021-02-08 12:56:36 +02:00
Eike Ziller
8875c59021 Core: Do not remove context objects during shutdown
Like we suppress context updates during shutdown also disconnect from
the context object's destroyed signal. At that point we don't care
anymore.

This also avoids issues if the context object lives as the child of a
widget in the MainWindow geometry. These widgets (and respectively their
children) are destroyed only in the QObject destructor, i.e. after the
MainWindow itself already destroyed all its members, including the
m_contextWidgets map.

Amends 6d97c1fcb1

Fixes: QTCREATORBUG-25310
Change-Id: I75db6f8783b5f62aa9805b69d4d2bba07b906a5b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-05 11:27:43 +00:00
Jarek Kobus
be1d33299e Use invokeMethod instead of single shot timer with 0 timeout
Refactor it in coreplugin.

Change-Id: I6aaad1b9270a8ff8a4a0bea6a1fff806b2fe190b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-29 15:24:41 +00:00
David Schulz
018d49f417 Core: Do not open documents for all dropped files
Only open one visible editor and add all other dropped files as
suspended documents to the document model.

Change-Id: Iade95b3891fb90c06cc8852859346bbfe10bc292
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-13 11:21:59 +00:00
Alessandro Portale
3e9385bf1b Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 08:28:25 +00:00
Eike Ziller
a40e5b5382 Core: Save less settings
Try to not save settings that weren't changed from their default, and
make it possible for defaults to change in the future.

Task-number: QTCREATORBUG-24762
Change-Id: If469b72573791bc92ed535edf00271ef09b55386
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-11 08:02:57 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
Eike Ziller
5cb5d8e585 Remove usages of Core::Id
It moved to Utils.

Change-Id: Ia4d12bb07db2d59b1cb084b2ebdea20e6e3b40ad
Reviewed-by: hjk <hjk@qt.io>
2020-09-21 13:06:21 +00:00
Antonio Di Monaco
6e4ca8b6af MainWindow: ask confirmation before closing Qt Creator
When working with multiple windows, pressing the close button multiple
times can close Qt Creator too.

This patch adds a system option, asking for a confirmation before
closing the IDE. By default it's not enabled.

Fixes: QTCREATORBUG-7637
Change-Id: Ifc5e8c97511f9227ce0634c8a7064d95775c76c2
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 14:19:45 +00:00
hjk
736e6eada0 Various Qt6 compile fixes
Task-number: QTCREATORBUG-24098
Change-Id: Ia0fe92d82d4477bd8f14ee25754b114316fc878a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-22 07:04:12 +00:00
Eike Ziller
6d97c1fcb1 Unregister deleted IContext objects automatically
Change-Id: I7b84c02c8fe1e7201431116e3d993792370fb942
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 06:54:54 +00:00
Ville Nummela
1194340b85 Disable "Save All" when there are no documents to be saved
Fixes: QTCREATORBUG-22072
Change-Id: I6c84e0004d1ada27bfcec59f509d066f1b03ca2c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-30 07:52:40 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Leena Miettinen
eecd2a5aa1 Doc: Fix QDoc warnings in Core plugin classes
Task-number: QTCREATORBUG-23620
Change-Id: Idf1fb2b3f930812c3cf18b9f8ced03fb8e0947be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-18 13:39:43 +00:00
Eike Ziller
ed5e6a4999 Add some additional shortcuts for actions
Add Cmd+Shift+- for decreasing font size on macOS.
Do not add Cmd+= for increasing size, because it conflicts with the
existing shortcut for "Replace and Find Next".

Sprinkle some Backspace shortcuts in addition to Delete for removing
items. There are (laptop) keyboards that either do not have a designated
Delete key (requiring Fn+Backspace) or where the Delete key is not
conveniently located/sized, and there is no benefit in making the
distinction in that case anyhow.

Fixes: QTCREATORBUG-706
Fixes: QTCREATORBUG-13733
Change-Id: I06274a9810b82800ec6158a883c95d2a7ae2465e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-17 09:39:37 +00:00
Eike Ziller
a6d52a6e28 Move some actions to a "View" menu
A "View" menu seems to be what many users are looking for when they want
to show or hide panes/views, so move corresponding actions there.
Window management / split actions stay in the "Window" menu.

Fixes: QTCREATORBUG-23610
Change-Id: Id683addc681de99abb35697a735fdbc9dc0d00cd
Reviewed-by: hjk <hjk@qt.io>
2020-03-06 14:01:23 +00:00
Mahmoud Badri
fb843d3442 QmlDesigner: Remove the standalone view3D window implementation
Task-number: QDS-1692
Change-Id: I6c04aaee9ab6a119cfcc22ee2e19b808bb95ae0a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-03-05 11:00:11 +00:00
hjk
95623ae011 Core: Apply new settings page pattern to Tool settings page
Since the code "belonging" to the widget was split across two
classes, but isn't now, a bit of moving was necessary.

Use the opportunity to remove now-unneeded undirections to the
model and ui members.

Change-Id: I25bb96de05c67d9116f28ae342d4aebd3c4419e6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-29 08:25:31 +00:00
Mahmoud Badri
1eb72aabef Fix Edit View 3D on top of Some widgets issue
setting the main window as the parent of a widget makes it open above
the Edit View 3D. Also other dialogs (open file dialog, options dialog,
etc) open above the 3D View now.

Task-number: QDS-1446
Change-Id: I6f6325d7b81eccb5aec3c07dfadc021a17dfd26b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-01-16 12:25:19 +00:00
Eike Ziller
7c35c447e1 Set application details earlier
The application details (name, organization, etc) were only set during
Core plugin startup, but that is too late for e.g. the plugin manager.

Change-Id: Id47d79e38dec9e586ab7b91a3080101e5fecb20d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-01-14 08:16:52 +00:00
Eike Ziller
be19b00289 Provide "Restart Now" functionality
And use it for the plugin dialog and when changing the UI language.

Change-Id: Ic767837d2526409f7ec46d7e4612a1499f19459e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-07 12:46:59 +00:00
Mahmoud Badri
f97de35dd4 Improve edit view 3D "on top" logic
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
  The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
  a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.

Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
  restart). This is not in the scope of this commit.

Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-13 12:40:43 +00:00
Kai Koehne
36ef280db5 Set QGuiApplication::applicationDisplayName property
This is used in user-visible strings e.g. in the analytics plugin.

Change-Id: I5942e915bccba01eb2c3d7049e2b789fff9e890a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-29 14:40:28 +00:00
Eike Ziller
b34102ceea Add option for shortcut visibility in context menus
Fixes: QTCREATORBUG-22502
Change-Id: I49587a6a8b575a3a1453104a829cd91ad3566d7e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-11 08:15:16 +00:00
Eike Ziller
c67ed4d35b Add global notification area and use for UI Tour info
Adds a global info bar display above the main window's status bar that
can be accessed via ICore::infoBar().

Replace the blocking "Take UI Tour" dialog by a notification there.

Fixes: QTCREATORBUG-22819
Change-Id: I733f1bfd2d1db0295754ed2e28bb202f927d0edb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-08-12 07:15:27 +00:00
hjk
4742216feb Core: Give a hint why saving of settings are requested
Not all requests are the same, handling code might want to act
differently on different request reasons.

Main driver here is the handling of the debugger/analyzer main window
state savings which depends on actual visibility of certain windows.

Change-Id: I87b2a9149e3d09d27bc14b44aace9f2e0686db04
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-03 08:25:41 +00:00
Eike Ziller
e0d38ae414 Export Wizard values to JavaScript macro
Registers a new function "value('name')", available to the wizard json
files, which returns the value of the variable "name" as a JavaScript
object. So, variables with a string value are actual JavaScript strings,
booleans are booleans, lists are lists, and dictionaries are
dictionaries.

The patch also makes it actually possible to assign JSON lists and
dictionaries to values.

This removes some hacks involving creating complex JavaScript objects
through string substitution.

Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-09 11:19:43 +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
Orgad Shaneh
9364e4b8ec Core: Modernize (minor)
Replace 2 loops with range loops, and use nullptr.

Change-Id: I9f8920bb978ed218c5ec9ca01105652ebb51d842
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-09-21 05:28:12 +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
Alessandro Portale
f36f04deba Core: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init (partially)

Change-Id: Idf10d7ffb1d98a04edc09a25c35e4e9e3abe87b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-08 16:04:21 +00:00
Eike Ziller
a8c5af56a9 Remove unneeded checks for validity of mime types
mimeTypeForFile(...) is documented to never return an invalid mime type
(it will fall back to binary if everything else fails), so remove
unneeded checks.

This also removes fallback code that used text/plain in case of invalid
mime type, which is probably a relict from the old mime implementation.

Change-Id: I88ed41fa3b81704f110f9f481b0f01424a487cbb
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-25 08:08:14 +00:00
Razi Alavizadeh
f009d5f151 CorePlugin: Switch split if remote command tries to open an already opened file
It seems more natural that remote commands
don't change current editor of active view if file
is already opened in another view.

Change-Id: Ie27de0d159cae6e63fa1d477fab59887a0e6d198
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-22 18:04:54 +00:00
Eike Ziller
6e66b2a078 Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.

Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-28 13:45:20 +00:00