Commit a0bb57f2 authored by mae's avatar mae
Browse files

remove run action in the scripteditor

the action is not needed and conflicts with Ctrl+R of the project
manager.
parent 8ee769a3
......@@ -104,6 +104,7 @@ bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configu
&& type != ProjectExplorer::ToolChain::RVCT_ARMV5
&& type != ProjectExplorer::ToolChain::RVCT_ARMV6;
#else
Q_UNUSED(configuration);
return true;
#endif
}
......
......@@ -395,7 +395,7 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable)
void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
{
QMenu *menu = createStandardContextMenu();
QMenu *menu = new QMenu();
if (Core::ActionContainer *mcontext = Core::ICore::instance()->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) {
QMenu *contextMenu = mcontext->menu();
......@@ -403,6 +403,7 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
menu->addAction(action);
}
appendStandardContextMenuActions(menu);
menu->exec(e->globalPos());
delete menu;
}
......
......@@ -40,6 +40,7 @@
#include <QtGui/QMainWindow>
#include <QtGui/QMessageBox>
#if 0
static QAction *actionFromId(const QString &id)
{
Core::Command *cmd = Core::ICore::instance()->actionManager()->command(id);
......@@ -47,22 +48,20 @@ static QAction *actionFromId(const QString &id)
return 0;
return cmd->action();
}
#endif
namespace QtScriptEditor {
namespace Internal {
QtScriptEditorActionHandler::QtScriptEditorActionHandler()
: TextEditor::TextEditorActionHandler(QLatin1String(QtScriptEditor::Constants::C_QTSCRIPTEDITOR),
Format),
m_runAction(0)
Format)
{
}
void QtScriptEditorActionHandler::createActions()
{
TextEditor::TextEditorActionHandler::createActions();
m_runAction = actionFromId(QLatin1String(QtScriptEditor::Constants::RUN));
connect(m_runAction, SIGNAL(triggered()), this, SLOT(run()));
}
......
......@@ -47,9 +47,6 @@ private:
private slots:
void run();
private:
QAction *m_runAction;
};
} // namespace Internal
......
......@@ -34,8 +34,6 @@ namespace QtScriptEditor {
namespace Constants {
const char * const M_CONTEXT = "Qt Script Editor.ContextMenu";
const char * const RUN = "QtScriptEditor.Run";
const char * const RUN_SEP = "QtScriptEditor.Run.Separator";
const char * const C_QTSCRIPTEDITOR = "Qt Script Editor";
const char * const C_QTSCRIPTEDITOR_MIMETYPE = "application/javascript";
......
......@@ -145,18 +145,8 @@ void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEdit
void QtScriptEditorPlugin::registerActions()
{
Core::ActionManager *am = Core::ICore::instance()->actionManager();
Core::ActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT);
QAction *action = new QAction(this);
action->setSeparator(true);
Core::Command *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext);
mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
action = new QAction(tr("Run"), this);
cmd = am->registerAction(action, QtScriptEditor::Constants::RUN, m_scriptcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
// Core::ActionManager *am = Core::ICore::instance()->actionManager();
// Core::ActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT);
}
Q_EXPORT_PLUGIN(QtScriptEditorPlugin)
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