Commit 34ef3f24 authored by David Schulz's avatar David Schulz

CppEditor: Add action to open a preprocessor dialog

Change-Id: I5ed09f6b8a358652145012e137ab717729999aca
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent ffe50efa
......@@ -144,6 +144,7 @@ public Q_SLOTS:
void renameSymbolUnderCursor();
void renameUsages();
void findUsages();
void showPreProcessorWidget();
void renameUsagesNow(const QString &replacement = QString());
void semanticRehighlight(bool force = false);
void highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
......@@ -187,8 +188,6 @@ private Q_SLOTS:
void onCommentsSettingsChanged(const CppTools::CommentsSettings &settings);
void showPreProcessorWidget();
private:
void markSymbols(const QTextCursor &tc, const CppTools::SemanticInfo &info);
bool sortedOutline() const;
......
......@@ -41,6 +41,7 @@ const char SWITCH_DECLARATION_DEFINITION[] = "CppEditor.SwitchDeclarationDefinit
const char OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT[] = "CppEditor.OpenDeclarationDefinitionInNextSplit";
const char RENAME_SYMBOL_UNDER_CURSOR[] = "CppEditor.RenameSymbolUnderCursor";
const char FIND_USAGES[] = "CppEditor.FindUsages";
const char OPEN_PREPROCESSOR_DIALOG[] = "CppEditor.OpenPreprocessorDialog";
const char M_REFACTORING_MENU_INSERTION_POINT[] = "CppEditor.RefactorGroup";
const char UPDATE_CODEMODEL[] = "CppEditor.UpdateCodeModel";
......
......@@ -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) {
......
......@@ -81,6 +81,7 @@ public slots:
void openTypeHierarchy();
void openIncludeHierarchy();
void findUsages();
void showPreProcessorDialog();
void renameSymbolUnderCursor();
void switchDeclarationDefinition();
......
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