Commit d4de7d47 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Fixed standard text editor actions for generic project files editor

parent 383178ff
......@@ -5,6 +5,7 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorsettings.h>
using namespace GenericProjectManager;
......@@ -12,7 +13,7 @@ using namespace GenericProjectManager::Internal;
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesEditable
// ProjectFilesFactory
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesFactory::ProjectFilesFactory(Manager *manager,
......@@ -114,6 +115,8 @@ ProjectFilesEditor::ProjectFilesEditor(QWidget *parent, ProjectFilesFactory *fac
Manager *manager = factory->manager();
ProjectFilesDocument *doc = new ProjectFilesDocument(manager);
setBaseTextDocument(doc);
handler->setupActions(this);
}
ProjectFilesEditor::~ProjectFilesEditor()
......
......@@ -33,8 +33,6 @@
#include "qt4projectmanager.h"
#include "qt4projectmanagerconstants.h"
#include "profileeditorfactory.h"
#include "proeditormodel.h"
#include "procommandmanager.h"
#include <coreplugin/uniqueidmanager.h>
#include <texteditor/fontsettings.h>
......@@ -42,17 +40,14 @@
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <QtCore/QDebug>
#include <QtCore/QFileInfo>
#include <QtGui/QHeaderView>
#include <QtGui/QTextEdit>
using namespace ExtensionSystem;
using namespace Core;
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
using namespace ProjectExplorer;
//
// ProFileEditorEditable
//
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
: BaseTextEditorEditable(editor)
......@@ -63,11 +58,29 @@ ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
}
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()
QList<int> ProFileEditorEditable::context() const
{
return new ProFileEditorEditable(this);
return m_context;
}
Core::IEditor *ProFileEditorEditable::duplicate(QWidget *parent)
{
ProFileEditor *ret = new ProFileEditor(parent, qobject_cast<ProFileEditor*>(editor())->factory(),
qobject_cast<ProFileEditor*>(editor())->actionHandler());
ret->duplicateFrom(editor());
ret->initialize();
return ret->editableInterface();
}
const char *ProFileEditorEditable::kind() const
{
return Qt4ProjectManager::Constants::PROFILE_EDITOR;
}
//
// ProFileEditorEditor
//
ProFileEditor::ProFileEditor(QWidget *parent, ProFileEditorFactory *factory, TextEditor::TextEditorActionHandler *ah)
: BaseTextEditor(parent), m_factory(factory), m_ah(ah)
{
......@@ -85,18 +98,9 @@ ProFileEditor::~ProFileEditor()
{
}
QList<int> ProFileEditorEditable::context() const
{
return m_context;
}
Core::IEditor *ProFileEditorEditable::duplicate(QWidget *parent)
TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface()
{
ProFileEditor *ret = new ProFileEditor(parent, qobject_cast<ProFileEditor*>(editor())->factory(),
qobject_cast<ProFileEditor*>(editor())->actionHandler());
ret->duplicateFrom(editor());
ret->initialize();
return ret->editableInterface();
return new ProFileEditorEditable(this);
}
void ProFileEditor::initialize()
......@@ -109,11 +113,6 @@ void ProFileEditor::initialize()
setFontSettings(settings->fontSettings());
}
const char *ProFileEditorEditable::kind() const
{
return Qt4ProjectManager::Constants::PROFILE_EDITOR;
}
void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs)
{
TextEditor::BaseTextEditor::setFontSettings(fs);
......@@ -133,6 +132,10 @@ void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs)
highlighter->rehighlight();
}
//
// ProFileDocument
//
ProFileDocument::ProFileDocument(Qt4Manager *manager)
: TextEditor::BaseTextDocument(), m_manager(manager)
{
......
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