forked from qt-creator/qt-creator
CppEditor: Add action to open a preprocessor dialog
Change-Id: I5ed09f6b8a358652145012e137ab717729999aca Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -210,6 +210,13 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
|
||||
contextMenu->addAction(cmd);
|
||||
cppToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *openPreprocessorDialog = new QAction(tr("Additional Preprocessor Directives"), this);
|
||||
cmd = ActionManager::registerAction(openPreprocessorDialog,
|
||||
Constants::OPEN_PREPROCESSOR_DIALOG, context);
|
||||
cmd->setDefaultKeySequence(QKeySequence());
|
||||
connect(openPreprocessorDialog, SIGNAL(triggered()), this, SLOT(showPreProcessorDialog()));
|
||||
cppToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *switchDeclarationDefinition = new QAction(tr("Switch Between Function Declaration/Definition"), this);
|
||||
cmd = ActionManager::registerAction(switchDeclarationDefinition,
|
||||
Constants::SWITCH_DECLARATION_DEFINITION, context, true);
|
||||
@@ -354,6 +361,13 @@ void CppEditorPlugin::findUsages()
|
||||
editor->findUsages();
|
||||
}
|
||||
|
||||
void CppEditorPlugin::showPreProcessorDialog()
|
||||
{
|
||||
CPPEditorWidget *editor = qobject_cast<CPPEditorWidget*>(EditorManager::currentEditor()->widget());
|
||||
if (editor)
|
||||
editor->showPreProcessorWidget();
|
||||
}
|
||||
|
||||
void CppEditorPlugin::onTaskStarted(Core::Id type)
|
||||
{
|
||||
if (type == CppTools::Constants::TASK_INDEX) {
|
||||
|
||||
Reference in New Issue
Block a user