Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Partially reverts 6a142dfd95
Looks like this was used by 3rdparty plugin(s) for a mode that is only
useful for some time and then should not be shown again.
Re-add removeMode from before 5.0, but do not trigger that automatically
from the mode destructor, so it doesn't interfere at shutdown.
This patch is just a binary compatible partial revert. Since removeMode
is broken in several aspects (e.g. corresponding commands are not
removed) and we don't really support adding and removing modes during
runtime, this should be replaced later on by a different way to handle
the usecase, like a "visible" property for modes, which could be useful
in other ways too.
Fixes: QTCREATORBUG-26270
Change-Id: Ief2a36d94bd09b0511a14f528b33fdbcc4c4222b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
After the 867c0b8d8a53974074b1fff5b132f3ae9f150066 got integrated
into qtbase, Qt started issuing a warning on Creator shutdown.
The reason is that mode's widget might be deleted before the
mode's destruction. Deleting the mode's widget removes it automatically
from the contained stacked layout of the mode manager. This
means that the indices inside the stacked layout and those inside
the ModeManager's d->m_modes list are now out of sync.
FancyTabWidget::removeTab() can't find the right widget for the
passed index now or returns wrong widget for it.
The fix is to remove removeMode() method (and in turn some more
unused now). The context objects don't need to be removed on
shutdown, and the remaining mode's widgets will be deleted
by Qt itself when the main windows is destroyed.
Fixes: QTCREATORBUG-25925
Change-Id: I70c2773eea2984c5d06ce3bf71a4271b267efbe0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It was not possible to return false from
ProjectExplorerPlugin::initialize() without triggering crashes.
Change-Id: I96b2f80c835e69769f64f9b9c61f473e9ff88623
Reviewed-by: hjk <hjk@qt.io>
- 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>
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>
... instead of adding-by-index. This amends 3d2db474.
Also, simplify the shortcut setting, the loop is not needed
anymore as the mode order is fixed now.
Change-Id: I87959f8b5bc5c3a0cd0ca240fb8709db75aed105
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
... 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>
Setting the mode means resetting all of the UI and repainting the
whole window. This can be painfully slow if the window contains some
large graphical objects, like QML profiler trace.
Change-Id: I64835de49e482826a54e3a844d59bc747ca38370
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
If modes provide a QMenu, a little arrow is shown next to the mode icon.
If the user clicks there, the menu is shown instead of changing the
mode.
Limitations: Modes need to provide some QMenu instance already when they
are added to the object pool. Setting or removing the menu later will
not update the UI.
Change-Id: Ic4ef709e6200afcff14f41054a5dd98c37b0b849
Reviewed-by: hjk <hjk@theqtcompany.com>
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>
... 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>
Breaks BC with MSVC2010.
This partially reverts commit fe8ed7f5a6.
Change-Id: I36f995f992f3d12f16900c6dbe1dc94123c188bd
Reviewed-by: hjk <hjk121@nokiamail.com>
This was broken in d52ee686d1.
Task-number: QTCREATORBUG-13098
Change-Id: Ia075e13fdd00e561b78058a3cab0cb02d2eb5fe6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
No-one is using the aggregated IMode, everyone is deriving from IMode
Change-Id: Ic4f21ce983924afe80cc2180101aae838b9f590d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Remove saving settings on auto-save, and only save settings when
switching away from projects mode, instead of any mode switch.
Change-Id: I3369b7f5ee785467d57c47e1a194a8ef989b98fb
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Registering QShortcuts doesn't solve any problem that is not already
solved by registering QActions, and shortcuts are in fact much more
limited (not being able to register multiple shortcuts for different
contexts).
Change-Id: I9478e601b2cbc3c5e12fb5baee43cacc20d0fb9c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This is especially annoying when starting Qt Creator with a session or
project from the command line.
ModeManager::setFocusToCurrentMode() should really only set the focus.
Callers that also want to raise the main window (none at the moment)
should do that explicitly.
Change-Id: Ib9c3026184bd25a6e2cd4bb557bd9981ce91d569
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
This change
* Removes IMode::type, ModeManager::activateModeType, and
IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
instead
* Adapts the mode switching code in EditorManager to handle multiple
windows, for example switching to edit mode should only happen if
the editor/view is in the main window. Otherwise the editor window
should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
make the current editor visible by default, introducing
DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
used
One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.
Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
Instead of using the actual visibility state of the widget, which might
have screwed things up if for some reason the widget itself was not
visible the moment settings are saved.
Change-Id: I7ae89259dc925f799bca413b537b65e9e689e1b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Also make registerShortcut set an application shortcut.
That is necessary when the user opened a separate editor window.
Change-Id: I366044b7acba51daca46a15a302a24b5b8e99cc1
Reviewed-by: David Schulz <david.schulz@digia.com>
(cherry picked from commit 5c8f46d25d)
Reviewed-by: Eike Ziller <eike.ziller@digia.com>