Commit 838c0ad9 authored by Eike Ziller's avatar Eike Ziller
Browse files

Make a few more shortcuts/actions raise the main window.



Also make registerShortcut set an application shortcut.
That is necessary when the user opened a separate editor window.

Change-Id: I366044b7acba51daca46a15a302a24b5b8e99cc1
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
(cherry picked from commit 5c8f46d2

)
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 58472687
......@@ -278,6 +278,7 @@ Command *ActionManager::registerShortcut(QShortcut *shortcut, const Id &id, cons
shortcut->setEnabled(false);
shortcut->setObjectName(id.toString());
shortcut->setParent(ICore::mainWindow());
shortcut->setContext(Qt::ApplicationShortcut);
sc->setShortcut(shortcut);
sc->setScriptable(scriptable);
sc->setContext(context);
......
......@@ -165,6 +165,7 @@ void ModeManager::activateModeType(Id type)
void ModeManager::slotActivateMode(int id)
{
m_instance->activateMode(Id::fromUniqueIdentifier(id));
ICore::raiseWindow(d->m_modeStack);
}
void ModeManager::activateMode(Id id)
......
......@@ -30,6 +30,7 @@
#include "navigationwidget.h"
#include "navigationsubwidget.h"
#include "icontext.h"
#include "icore.h"
#include "coreconstants.h"
#include "inavigationwidgetfactory.h"
#include "modemanager.h"
......@@ -266,6 +267,7 @@ void NavigationWidget::activateSubWidget(const Id &factoryId)
foreach (Internal::NavigationSubWidget *subWidget, d->m_subWidgets) {
if (subWidget->factory()->id() == factoryId) {
subWidget->setFocusWidget();
ICore::raiseWindow(this);
return;
}
}
......@@ -274,6 +276,7 @@ void NavigationWidget::activateSubWidget(const Id &factoryId)
if (index >= 0) {
d->m_subWidgets.first()->setFactoryIndex(index);
d->m_subWidgets.first()->setFocusWidget();
ICore::raiseWindow(this);
}
}
......
......@@ -275,7 +275,7 @@ void OutputPaneManager::init()
Command *cmd = ActionManager::registerAction(action, id, globalContext);
mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup");
m_actions.append(cmd->action());
m_actions.append(action);
m_ids.append(id);
cmd->setDefaultKeySequence(QKeySequence(paneShortCut(shortcutNumber)));
......@@ -289,7 +289,7 @@ void OutputPaneManager::init()
bool visible = outPane->priorityInStatusBar() != -1;
button->setVisible(visible);
connect(cmd->action(), SIGNAL(triggered()), this, SLOT(shortcutTriggered()));
connect(action, SIGNAL(triggered()), this, SLOT(shortcutTriggered()));
}
m_titleLabel->setMinimumWidth(minTitleWidth + m_titleLabel->contentsMargins().left()
......@@ -312,10 +312,12 @@ void OutputPaneManager::shortcutTriggered()
// then just give it focus.
int current = currentIndex();
if (OutputPanePlaceHolder::isCurrentVisible() && current == idx) {
if (!outputPane->hasFocus() && outputPane->canFocus())
if (!outputPane->hasFocus() && outputPane->canFocus()) {
outputPane->setFocus();
else
ICore::raiseWindow(m_outputWidgetPane);
} else {
slotHide();
}
} else {
// Else do the same as clicking on the button does.
buttonTriggered(idx);
......@@ -476,8 +478,10 @@ void OutputPaneManager::showPage(int idx, int flags)
ensurePageVisible(idx);
IOutputPane *out = m_panes.at(idx);
out->visibilityChanged(true);
if (flags & IOutputPane::WithFocus && out->canFocus())
if (flags & IOutputPane::WithFocus && out->canFocus()) {
out->setFocus();
ICore::raiseWindow(m_outputWidgetPane);
}
if (flags & IOutputPane::EnsureSizeHint)
ph->ensureSizeHintAsMinimum();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment