Commit Graph

429 Commits

Author SHA1 Message Date
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
Alessandro Portale
768f0a6209 Core: Icon-only option for the mode selection bar
This adds an icon-only mode to the mode selection bar (and action bar).
A newly introduced Action can cycle between icon+text, icon-only and
hidden.
Also, the "Window" Application menu gets a submenu with the three
styles.

Task-number: QTCREATORBUG-18845
Change-Id: I4e0c453f6d920dfbfd795b8b054f6ff392a8700a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-09 06:00:27 +00:00
Eike Ziller
f1e02c0826 Fix that menus didn't show ampersands in files names
And instead interpreted the ampersand + following character as an
accelerator key.

Task-number: QTCREATORBUG-17817
Change-Id: I327239499ce56e75fd12f2df5be60d4b04913acd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-26 12:02:15 +00:00
hjk
08ba8933c6 OutputPaneManager: Use a structure for related pieces
One vector with things handled together can be better
that keeping four vectors in sync.

Change-Id: I47865a5a2147a3795a3c820aa2676fb9611cab25
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-22 11:38:58 +00:00
hjk
310a2bf96f Core: Simplify MainWindow::init() signature
And adapt its only user.

Change-Id: Ifc1f6c7857951d6e1a68f5bc909146e9689c5428
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-12 11:21:14 +00:00
hjk
7fea244019 Core: Remove a few explicit uses of the global plugin pool
Change-Id: I8627af8fa132b727450ee703910a39485eea58ad
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-12 10:41:22 +00:00
Eike Ziller
5432dd1f5c Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/locator/locator.cpp
	src/plugins/imageviewer/imageviewerplugin.cpp
	src/plugins/remotelinux/remotelinuxplugin.cpp
	src/tools/clangbackend/source/tokeninfo.cpp
	tests/unit/unittest/data/highlightingmarks.cpp

Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
2018-02-07 11:58:23 +01:00
Eike Ziller
dcfa07ba76 ModelEditor: Move export actions to File menu
Only visible when a model editor is active

Change-Id: Ia21045188867b23815bd05432d1fd4699de8bd61
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-05 10:43:47 +00:00
Eike Ziller
e1d2d35c20 Unify zooming actions of image viewer and model editor
Change-Id: I5761ab579beda5b2cd0b725869ed216cb97e900c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-05 10:42:25 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
hjk
974022c77b Core: Reduce code path ping-pong between ICore and MainWindow
Public entry points for displaying settings dialog were in ICore,
diverting to MainWindow, and back in some cases.

Move implementation to icore.cpp instead.

Change-Id: I02cbf1dcfe6241c665d7d701b4b4af1a8a242af5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-01 13:29:58 +00:00
hjk
4c285f957b Core: Move left navigation view toggle button back to the left
Change-Id: I3f2070c6f6633b851c88d9179a4a97be1c944a7a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-30 15:30:14 +00:00
hjk
3d2db474a4 Core: Force and rely on mode creation before extensionsInitialized
cf7f898db3 broke initial mode display due to the then-intentional
delay in registration. Now change the approach: Only record
the modes and the last requested start mode and do all remaining
setup triggered from MainWindow::extensionsInitialized.

This changes behavior insofar as only the last requested mode
on startup (typical Welcome, if Welcome not loaded, Edit) will
be activated.

Change-Id: I62b28342c347938b001c6d3be6a076c5a69b560b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-29 10:43:02 +00:00
hjk
3c91777e48 Core: Detach status bar handling from global object pool
Instead of relying on addObject notification, provide a
StatusBarManager::addStatusBarWidget() method to create,
register and keep track of an IContext object.

That's essentially what was StatusBarWidget before, but does
not need to be known on the user side. For removal, this
provides a StatusBarManager::destroyStatusBarWidget(),
any not explicitly removed items are handled in response
to ICore::coreAboutToClose()

The StatusBarManager class is fully static now, could
be a namespace.

Change-Id: Ia2bd13b391c3f68c8dfd584b53524a9649cc0787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-26 10:20:38 +00:00
hjk
1963122dcd Core: Cut explicit interface between MainWindow and StatusBarManager
Mechanical in preparation of 'static pattern' and avoiding the
object pool objectAdded/objectAboutToBeRemoved use

Change-Id: I1e3fc7f67c785410686d0dc7c083024e305f4abe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-24 14:53:58 +00:00
hjk
cf7f898db3 Core: Keep track of modes in the ModeManager directly
... instead of having the indirection of the global object pool.

ModeManagerPrivate has been maintaining the list of instantiated
modes by tracking (all...) pool object additions / removals. This
can be achieved more directly by calling functions from the
IMode base constructor/destructor.

The pattern used deviates a bit from the otherwise used 'static
QList<Foo *> allFoos();' acessor pattern as there is some sorting
logic etc. associated each time a mode is appended.
Sticking to the preexisting structure seemed less effort for now.

Change-Id: Ic1b4e641e155f949248890acc48cafbe74025115
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-24 10:12:50 +00:00
Eike Ziller
ca8b727e42 Attach progress details to the toggle progress details button
The popup is corresponding to the button (and the summary progress bar),
and that automatically also moves it away from the right border a bit.

Task-number: QTCREATORBUG-19308
Change-Id: Ie6f72f19552285586395776b175ca142f56c7d6e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-08 08:11:35 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Eike Ziller
5cf580c1f3 macOS: Fix issue with saving settings (work around Qt bug)
When closing the application via Quit from the application's context
menu in the dock, Qt sends the closeEvent twice, leading to funny issues
(QTBUG-43344).
Remember if we already successfully went through the closeEvent, and
skip it in that case.

Task-number: QTCREATORBUG-18798
Change-Id: I8c54f0695b1af2572fa0ade7487a6a993022946b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-28 13:44:49 +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
Eike Ziller
dae2556d2f Merge remote-tracking branch 'origin/4.3'
Change-Id: I44511e06986b7df6007be7daf7051c895a10794b
2017-04-21 15:30:00 +02:00
Eike Ziller
5b3ed3f9cb Remove unused "suppressed" property from navigation widget
Change-Id: I7e94b258991b9211156c75a4475b468b585b00f5
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-20 12:34:15 +00:00
Thomas Hartmann
cbf8e0b2d6 Fix Shortcut for right sidebar
Ctrl+0 was confliciting with "Reset Font Size".

Task-number: QTCREATORBUG-17857
Change-Id: I280c65446fd1f8ce3af66b06760ed7b9b210e8c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-19 14:51:36 +00:00
Thomas Hartmann
c50fbf2450 Fix Toggle Right Sidebar shortcut on Windows
Ctrl+0 is used for the left sidebar on Mac,
so it should be save to use it for the right
sidebar on Linux/Windows.
The original shortcut (Ctrl+Shift+0) is used by Windows 10
and therefore does not work.

Task-number: QTCREATORBUG-17857
Change-Id: I832135c3779508b9789b5be4757e1bbc9bd255eb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-04-12 16:18:44 +00:00
Serhii Moroz
69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +00:00
hjk
3f5caf4cdc Utils: Wrap MimeDatabase into static functions
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.

Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-03 07:57:54 +00:00
Tim Jenssen
1b62ce2a98 use direct member initialization
Change-Id: I74cae303ba3b7df771b16dd203e8b5fbc9adb398
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-25 10:44:51 +00:00
hjk
b662a59437 Core: Make initial default window wider
The new project window works better with 1280 pixel. Assume that is
a good default width in 2016.

Change-Id: I0c96db1bd279f6587e69c36ca01d1cd4f5243769
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-05 15:18:40 +00:00
Eike Ziller
90fb7c79d8 Raise version dialog if it already is open
Also register it as a window for the Window menu.

Task-number: QTCREATORBUG-14604
Change-Id: Ib52dcc193bf480ade14ca7c34b4dc10d6ec8fc4a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-25 11:31:59 +00:00
Eike Ziller
94a58b4653 File > New: Bring existing dialog to foreground
Task-number: QTCREATORBUG-16932
Change-Id: I1a90ab01825b5cd2f439395cbdf4400075943dc4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 08:16:55 +00:00
Eike Ziller
9c9485e15b ICore: Remove unused methods
Some didn't even have implementations anymore

Change-Id: I376cb12006c9b3ec8f6b2a75c38275cd92d2bbf6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 08:16:41 +00:00
Eike Ziller
2f9a721fbf Recent Sessions/Projects/Files: Clean up accelerators
Don't show them for sessions on macOS, don't show any numbers > 9, and
don't use colons.

Change-Id: I34a60631e5d11a98f22cfcf374f8cec1a2964658
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-09-30 07:31:20 +00:00
Eike Ziller
2f4e2e565a macOS: Do not show numbers in recent files & projects
There are no accelerators on macOS, so these numbers are unnecessary
noise.

Change-Id: I0402dd961dbe955837e0aa70b92aef33f61d61bd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Serhii Moroz <frost.asm@gmail.com>
2016-09-16 07:02:30 +00:00
Eike Ziller
b554829fd8 Core: Fix that core settings like shortcuts were only saved at shutdown
Save them also whenever a settings save is requested, which e.g. also
happens when closing the options dialog.

Change-Id: Ic20f1007381a4d0a8157f17fd24c0d8ea24907ee
Task-number: QTCREATORBUG-16576
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-12 07:10:12 +00:00
Tim Jenssen
09a965cf6c move QTCREATORLOGO_BIG back to coreplugin
It was a regression from the "Move icons to Utils" commit which
broke qbs builds.
QTCREATORLOGO_BIG aka QtProject-qtcreator.png is only used in
coreplugin and have some not moved install logic inside
coreplugin.pro

Change-Id: I8258b845108f8801581d7ee8d6771808b306a602
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-05 12:42:58 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
Serhii Moroz
cda7a3188f Welcome: Added keyboard hotkeys to open sessions and recent projects
Change-Id: Ia7c1ec11b2fa3e4b61b842fd1e9e4df7aa6f7be3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-28 15:04:55 +00:00