forked from qt-creator/qt-creator
Move File System view to Core plugin
So it can be accessed from a wider range of places. Change-Id: I282883addecf7bb070a65d9f4f7b8e6e2e4b5e47 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -83,6 +83,8 @@ add_qtc_plugin(Core
|
|||||||
find/searchresultwindow.cpp find/searchresultwindow.h
|
find/searchresultwindow.cpp find/searchresultwindow.h
|
||||||
find/textfindconstants.h
|
find/textfindconstants.h
|
||||||
findplaceholder.cpp findplaceholder.h
|
findplaceholder.cpp findplaceholder.h
|
||||||
|
foldernavigationwidget.cpp
|
||||||
|
foldernavigationwidget.h
|
||||||
generalsettings.cpp generalsettings.h generalsettings.ui
|
generalsettings.cpp generalsettings.h generalsettings.ui
|
||||||
generatedfile.cpp generatedfile.h
|
generatedfile.cpp generatedfile.h
|
||||||
helpitem.cpp helpitem.h
|
helpitem.cpp helpitem.h
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "coreplugin.h"
|
#include "coreplugin.h"
|
||||||
#include "designmode.h"
|
#include "designmode.h"
|
||||||
#include "editmode.h"
|
#include "editmode.h"
|
||||||
|
#include "foldernavigationwidget.h"
|
||||||
#include "helpmanager.h"
|
#include "helpmanager.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
#include "idocument.h"
|
#include "idocument.h"
|
||||||
@@ -104,6 +105,7 @@ CorePlugin::~CorePlugin()
|
|||||||
Find::destroy();
|
Find::destroy();
|
||||||
|
|
||||||
delete m_locator;
|
delete m_locator;
|
||||||
|
delete m_folderNavigationWidgetFactory;
|
||||||
delete m_editMode;
|
delete m_editMode;
|
||||||
|
|
||||||
DesignMode::destroyModeIfRequired();
|
DesignMode::destroyModeIfRequired();
|
||||||
@@ -176,6 +178,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
m_editMode = new EditMode;
|
m_editMode = new EditMode;
|
||||||
ModeManager::activateMode(m_editMode->id());
|
ModeManager::activateMode(m_editMode->id());
|
||||||
|
|
||||||
|
m_folderNavigationWidgetFactory = new FolderNavigationWidgetFactory;
|
||||||
|
|
||||||
IWizardFactory::initialize();
|
IWizardFactory::initialize();
|
||||||
|
|
||||||
// Make sure we respect the process's umask when creating new files
|
// Make sure we respect the process's umask when creating new files
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "foldernavigationwidget.h"
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
@@ -39,6 +40,9 @@ class PathChooser;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
|
class FolderNavigationWidgetFactory;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class EditMode;
|
class EditMode;
|
||||||
@@ -92,6 +96,7 @@ private:
|
|||||||
MainWindow *m_mainWindow = nullptr;
|
MainWindow *m_mainWindow = nullptr;
|
||||||
EditMode *m_editMode = nullptr;
|
EditMode *m_editMode = nullptr;
|
||||||
Locator *m_locator = nullptr;
|
Locator *m_locator = nullptr;
|
||||||
|
FolderNavigationWidgetFactory *m_folderNavigationWidgetFactory;
|
||||||
Utils::Environment m_startupSystemEnvironment;
|
Utils::Environment m_startupSystemEnvironment;
|
||||||
Utils::EnvironmentItems m_environmentChanges;
|
Utils::EnvironmentItems m_environmentChanges;
|
||||||
};
|
};
|
||||||
|
@@ -111,7 +111,8 @@ SOURCES += corejsextensions.cpp \
|
|||||||
menubarfilter.cpp \
|
menubarfilter.cpp \
|
||||||
welcomepagehelper.cpp \
|
welcomepagehelper.cpp \
|
||||||
dialogs/codecselector.cpp \
|
dialogs/codecselector.cpp \
|
||||||
plugininstallwizard.cpp
|
plugininstallwizard.cpp \
|
||||||
|
foldernavigationwidget.cpp
|
||||||
|
|
||||||
HEADERS += corejsextensions.h \
|
HEADERS += corejsextensions.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
@@ -225,7 +226,8 @@ HEADERS += corejsextensions.h \
|
|||||||
editormanager/ieditorfactory_p.h \
|
editormanager/ieditorfactory_p.h \
|
||||||
welcomepagehelper.h \
|
welcomepagehelper.h \
|
||||||
dialogs/codecselector.h \
|
dialogs/codecselector.h \
|
||||||
plugininstallwizard.h
|
plugininstallwizard.h \
|
||||||
|
foldernavigationwidget.h
|
||||||
|
|
||||||
FORMS += dialogs/newdialog.ui \
|
FORMS += dialogs/newdialog.ui \
|
||||||
dialogs/saveitemsdialog.ui \
|
dialogs/saveitemsdialog.ui \
|
||||||
|
@@ -71,6 +71,8 @@ Project {
|
|||||||
"fileutils.h",
|
"fileutils.h",
|
||||||
"findplaceholder.cpp",
|
"findplaceholder.cpp",
|
||||||
"findplaceholder.h",
|
"findplaceholder.h",
|
||||||
|
"foldernavigationwidget.cpp",
|
||||||
|
"foldernavigationwidget.h",
|
||||||
"generalsettings.cpp",
|
"generalsettings.cpp",
|
||||||
"generalsettings.h",
|
"generalsettings.h",
|
||||||
"generalsettings.ui",
|
"generalsettings.ui",
|
||||||
|
@@ -90,8 +90,7 @@ const char ADDNEWFILE[] = "QtCreator.FileSystem.AddNewFile";
|
|||||||
const char RENAMEFILE[] = "QtCreator.FileSystem.RenameFile";
|
const char RENAMEFILE[] = "QtCreator.FileSystem.RenameFile";
|
||||||
const char REMOVEFILE[] = "QtCreator.FileSystem.RemoveFile";
|
const char REMOVEFILE[] = "QtCreator.FileSystem.RemoveFile";
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace Core {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
static FolderNavigationWidgetFactory *m_instance = nullptr;
|
static FolderNavigationWidgetFactory *m_instance = nullptr;
|
||||||
|
|
||||||
@@ -100,6 +99,13 @@ QVector<FolderNavigationWidgetFactory::RootDirectory>
|
|||||||
|
|
||||||
Utils::FilePath FolderNavigationWidgetFactory::m_fallbackSyncFilePath;
|
Utils::FilePath FolderNavigationWidgetFactory::m_fallbackSyncFilePath;
|
||||||
|
|
||||||
|
FolderNavigationWidgetFactory *FolderNavigationWidgetFactory::instance()
|
||||||
|
{
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
static QWidget *createHLine()
|
static QWidget *createHLine()
|
||||||
{
|
{
|
||||||
auto widget = new QFrame;
|
auto widget = new QFrame;
|
||||||
@@ -240,6 +246,10 @@ static bool isChildOf(const QModelIndex &index, const QModelIndex &parent)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class FolderNavigationWidget
|
\class FolderNavigationWidget
|
||||||
|
|
||||||
@@ -686,12 +696,6 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
if (m_fileSystemModel->flags(current) & Qt::ItemIsEditable)
|
if (m_fileSystemModel->flags(current) & Qt::ItemIsEditable)
|
||||||
menu.addAction(Core::ActionManager::command(RENAMEFILE)->action());
|
menu.addAction(Core::ActionManager::command(RENAMEFILE)->action());
|
||||||
newFolder = menu.addAction(tr("New Folder"));
|
newFolder = menu.addAction(tr("New Folder"));
|
||||||
if (!isDir && Core::DiffService::instance()) {
|
|
||||||
menu.addAction(
|
|
||||||
TextEditor::TextDocument::createDiffAgainstCurrentFileAction(&menu, [filePath]() {
|
|
||||||
return filePath;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
@@ -956,5 +960,4 @@ void DelayedFileCrumbLabel::setScrollBarOnce() const
|
|||||||
that->m_bar.clear();
|
that->m_bar.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
@@ -25,7 +25,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/inavigationwidgetfactory.h>
|
#include "core_global.h"
|
||||||
|
#include "inavigationwidgetfactory.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
@@ -51,12 +53,13 @@ class QModelIndex;
|
|||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace Core {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class DelayedFileCrumbLabel;
|
class DelayedFileCrumbLabel;
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
class FolderNavigationWidgetFactory : public Core::INavigationWidgetFactory
|
class CORE_EXPORT FolderNavigationWidgetFactory : public Core::INavigationWidgetFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -69,6 +72,8 @@ public:
|
|||||||
QIcon icon;
|
QIcon icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static FolderNavigationWidgetFactory *instance();
|
||||||
|
|
||||||
FolderNavigationWidgetFactory();
|
FolderNavigationWidgetFactory();
|
||||||
|
|
||||||
Core::NavigationView createWidget() override;
|
Core::NavigationView createWidget() override;
|
||||||
@@ -99,7 +104,7 @@ private:
|
|||||||
static Utils::FilePath m_fallbackSyncFilePath;
|
static Utils::FilePath m_fallbackSyncFilePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FolderNavigationWidget : public QWidget
|
class CORE_EXPORT FolderNavigationWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool autoSynchronization READ autoSynchronization WRITE setAutoSynchronization)
|
Q_PROPERTY(bool autoSynchronization READ autoSynchronization WRITE setAutoSynchronization)
|
||||||
@@ -136,8 +141,7 @@ private:
|
|||||||
void setRootAutoSynchronization(bool sync);
|
void setRootAutoSynchronization(bool sync);
|
||||||
void setHiddenFilesFilter(bool filter);
|
void setHiddenFilesFilter(bool filter);
|
||||||
void selectBestRootForFile(const Utils::FilePath &filePath);
|
void selectBestRootForFile(const Utils::FilePath &filePath);
|
||||||
void handleCurrentEditorChanged(Core::IEditor *editor);
|
void handleCurrentEditorChanged(Core::IEditor *editor); void selectFile(const Utils::FilePath &filePath);
|
||||||
void selectFile(const Utils::FilePath &filePath);
|
|
||||||
void setRootDirectory(const Utils::FilePath &directory);
|
void setRootDirectory(const Utils::FilePath &directory);
|
||||||
int bestRootForFile(const Utils::FilePath &filePath);
|
int bestRootForFile(const Utils::FilePath &filePath);
|
||||||
void openItem(const QModelIndex &index);
|
void openItem(const QModelIndex &index);
|
||||||
@@ -155,11 +159,10 @@ private:
|
|||||||
QToolButton *m_toggleRootSync = nullptr;
|
QToolButton *m_toggleRootSync = nullptr;
|
||||||
QComboBox *m_rootSelector = nullptr;
|
QComboBox *m_rootSelector = nullptr;
|
||||||
QWidget *m_crumbContainer = nullptr;
|
QWidget *m_crumbContainer = nullptr;
|
||||||
DelayedFileCrumbLabel *m_crumbLabel = nullptr;
|
Internal::DelayedFileCrumbLabel *m_crumbLabel = nullptr;
|
||||||
|
|
||||||
// FolderNavigationWidgetFactory needs private members to build a menu
|
// FolderNavigationWidgetFactory needs private members to build a menu
|
||||||
friend class FolderNavigationWidgetFactory;
|
friend class FolderNavigationWidgetFactory;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Core
|
||||||
} // namespace ProjectExplorer
|
|
@@ -82,7 +82,6 @@ add_qtc_plugin(ProjectExplorer
|
|||||||
filesinallprojectsfind.h
|
filesinallprojectsfind.h
|
||||||
filesinallprojectsfind.cpp
|
filesinallprojectsfind.cpp
|
||||||
filterkitaspectsdialog.cpp filterkitaspectsdialog.h
|
filterkitaspectsdialog.cpp filterkitaspectsdialog.h
|
||||||
foldernavigationwidget.cpp foldernavigationwidget.h
|
|
||||||
gccparser.cpp gccparser.h
|
gccparser.cpp gccparser.h
|
||||||
gcctoolchain.cpp gcctoolchain.h
|
gcctoolchain.cpp gcctoolchain.h
|
||||||
gcctoolchainfactories.h
|
gcctoolchainfactories.h
|
||||||
|
@@ -63,7 +63,6 @@
|
|||||||
#include "devicesupport/sshsettingspage.h"
|
#include "devicesupport/sshsettingspage.h"
|
||||||
#include "editorsettingspropertiespage.h"
|
#include "editorsettingspropertiespage.h"
|
||||||
#include "filesinallprojectsfind.h"
|
#include "filesinallprojectsfind.h"
|
||||||
#include "foldernavigationwidget.h"
|
|
||||||
#include "jsonwizard/jsonwizardfactory.h"
|
#include "jsonwizard/jsonwizardfactory.h"
|
||||||
#include "jsonwizard/jsonwizardgeneratorfactory.h"
|
#include "jsonwizard/jsonwizardgeneratorfactory.h"
|
||||||
#include "jsonwizard/jsonwizardpagefactory_p.h"
|
#include "jsonwizard/jsonwizardpagefactory_p.h"
|
||||||
@@ -117,6 +116,7 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/fileutils.h>
|
#include <coreplugin/fileutils.h>
|
||||||
#include <coreplugin/findplaceholder.h>
|
#include <coreplugin/findplaceholder.h>
|
||||||
|
#include <coreplugin/foldernavigationwidget.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <coreplugin/idocumentfactory.h>
|
#include <coreplugin/idocumentfactory.h>
|
||||||
@@ -665,7 +665,6 @@ public:
|
|||||||
CustomParsersSettingsPage m_customParsersSettingsPage;
|
CustomParsersSettingsPage m_customParsersSettingsPage;
|
||||||
|
|
||||||
ProjectTreeWidgetFactory m_projectTreeFactory;
|
ProjectTreeWidgetFactory m_projectTreeFactory;
|
||||||
FolderNavigationWidgetFactory m_folderNavigationWidgetFactory;
|
|
||||||
DefaultDeployConfigurationFactory m_defaultDeployConfigFactory;
|
DefaultDeployConfigurationFactory m_defaultDeployConfigFactory;
|
||||||
|
|
||||||
IDocumentFactory m_documentFactory;
|
IDocumentFactory m_documentFactory;
|
||||||
@@ -2934,7 +2933,8 @@ ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() {}
|
|||||||
|
|
||||||
void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
|
void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
|
||||||
{
|
{
|
||||||
connect(&m_folderNavigationWidgetFactory,
|
auto folderNavigationWidgetFactory = FolderNavigationWidgetFactory::instance();
|
||||||
|
connect(folderNavigationWidgetFactory,
|
||||||
&FolderNavigationWidgetFactory::aboutToShowContextMenu,
|
&FolderNavigationWidgetFactory::aboutToShowContextMenu,
|
||||||
this,
|
this,
|
||||||
[this](QMenu *menu, const FilePath &filePath, bool isDir) {
|
[this](QMenu *menu, const FilePath &filePath, bool isDir) {
|
||||||
@@ -2955,7 +2955,7 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(&m_folderNavigationWidgetFactory,
|
connect(folderNavigationWidgetFactory,
|
||||||
&FolderNavigationWidgetFactory::fileRenamed,
|
&FolderNavigationWidgetFactory::fileRenamed,
|
||||||
this,
|
this,
|
||||||
[](const FilePath &before, const FilePath &after) {
|
[](const FilePath &before, const FilePath &after) {
|
||||||
@@ -2979,7 +2979,7 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(&m_folderNavigationWidgetFactory,
|
connect(folderNavigationWidgetFactory,
|
||||||
&FolderNavigationWidgetFactory::aboutToRemoveFile,
|
&FolderNavigationWidgetFactory::aboutToRemoveFile,
|
||||||
this,
|
this,
|
||||||
[](const FilePath &filePath) {
|
[](const FilePath &filePath) {
|
||||||
@@ -3846,7 +3846,8 @@ void ProjectExplorerPluginPrivate::showInFileSystemPane()
|
|||||||
{
|
{
|
||||||
Node *currentNode = ProjectTree::currentNode();
|
Node *currentNode = ProjectTree::currentNode();
|
||||||
QTC_ASSERT(currentNode, return );
|
QTC_ASSERT(currentNode, return );
|
||||||
QWidget *widget = NavigationWidget::activateSubWidget(m_folderNavigationWidgetFactory.id(),
|
QWidget *widget
|
||||||
|
= NavigationWidget::activateSubWidget(FolderNavigationWidgetFactory::instance()->id(),
|
||||||
Side::Left);
|
Side::Left);
|
||||||
if (auto *navWidget = qobject_cast<FolderNavigationWidget *>(widget))
|
if (auto *navWidget = qobject_cast<FolderNavigationWidget *>(widget))
|
||||||
navWidget->syncWithFilePath(currentNode->filePath());
|
navWidget->syncWithFilePath(currentNode->filePath());
|
||||||
|
@@ -85,7 +85,6 @@ HEADERS += projectexplorer.h \
|
|||||||
applicationlauncher.h \
|
applicationlauncher.h \
|
||||||
runsettingspropertiespage.h \
|
runsettingspropertiespage.h \
|
||||||
projecttreewidget.h \
|
projecttreewidget.h \
|
||||||
foldernavigationwidget.h \
|
|
||||||
buildprogress.h \
|
buildprogress.h \
|
||||||
projectnodes.h \
|
projectnodes.h \
|
||||||
sessiondialog.h \
|
sessiondialog.h \
|
||||||
@@ -239,7 +238,6 @@ SOURCES += projectexplorer.cpp \
|
|||||||
applicationlauncher.cpp \
|
applicationlauncher.cpp \
|
||||||
runsettingspropertiespage.cpp \
|
runsettingspropertiespage.cpp \
|
||||||
projecttreewidget.cpp \
|
projecttreewidget.cpp \
|
||||||
foldernavigationwidget.cpp \
|
|
||||||
buildprogress.cpp \
|
buildprogress.cpp \
|
||||||
projectnodes.cpp \
|
projectnodes.cpp \
|
||||||
sessiondialog.cpp \
|
sessiondialog.cpp \
|
||||||
|
@@ -74,7 +74,6 @@ Project {
|
|||||||
"fileinsessionfinder.cpp", "fileinsessionfinder.h",
|
"fileinsessionfinder.cpp", "fileinsessionfinder.h",
|
||||||
"filesinallprojectsfind.cpp", "filesinallprojectsfind.h",
|
"filesinallprojectsfind.cpp", "filesinallprojectsfind.h",
|
||||||
"filterkitaspectsdialog.cpp", "filterkitaspectsdialog.h",
|
"filterkitaspectsdialog.cpp", "filterkitaspectsdialog.h",
|
||||||
"foldernavigationwidget.cpp", "foldernavigationwidget.h",
|
|
||||||
"gccparser.cpp", "gccparser.h",
|
"gccparser.cpp", "gccparser.h",
|
||||||
"gcctoolchain.cpp", "gcctoolchain.h",
|
"gcctoolchain.cpp", "gcctoolchain.h",
|
||||||
"gcctoolchainfactories.h",
|
"gcctoolchainfactories.h",
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include "buildconfiguration.h"
|
#include "buildconfiguration.h"
|
||||||
#include "deployconfiguration.h"
|
#include "deployconfiguration.h"
|
||||||
#include "editorconfiguration.h"
|
#include "editorconfiguration.h"
|
||||||
#include "foldernavigationwidget.h"
|
|
||||||
#include "kit.h"
|
#include "kit.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
@@ -37,6 +36,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
#include <coreplugin/foldernavigationwidget.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <coreplugin/imode.h>
|
#include <coreplugin/imode.h>
|
||||||
|
@@ -34,15 +34,18 @@
|
|||||||
#include "outlinefactory.h"
|
#include "outlinefactory.h"
|
||||||
#include "plaintexteditorfactory.h"
|
#include "plaintexteditorfactory.h"
|
||||||
#include "snippets/snippetprovider.h"
|
#include "snippets/snippetprovider.h"
|
||||||
|
#include "textdocument.h"
|
||||||
#include "texteditor.h"
|
#include "texteditor.h"
|
||||||
#include "texteditoractionhandler.h"
|
#include "texteditoractionhandler.h"
|
||||||
#include "texteditorsettings.h"
|
#include "texteditorsettings.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/diffservice.h>
|
||||||
#include <coreplugin/externaltoolmanager.h>
|
#include <coreplugin/externaltoolmanager.h>
|
||||||
|
#include <coreplugin/foldernavigationwidget.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <texteditor/icodestylepreferences.h>
|
#include <texteditor/icodestylepreferences.h>
|
||||||
@@ -165,13 +168,26 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
tr("Text", "SnippetProvider"));
|
tr("Text", "SnippetProvider"));
|
||||||
|
|
||||||
d->createStandardContextMenu();
|
d->createStandardContextMenu();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorPluginPrivate::extensionsInitialized()
|
void TextEditorPluginPrivate::extensionsInitialized()
|
||||||
{
|
{
|
||||||
connect(&settings, &TextEditorSettings::fontSettingsChanged,
|
connect(FolderNavigationWidgetFactory::instance(),
|
||||||
this, &TextEditorPluginPrivate::updateSearchResultsFont);
|
&FolderNavigationWidgetFactory::aboutToShowContextMenu,
|
||||||
|
this,
|
||||||
|
[](QMenu *menu, const FilePath &filePath, bool isDir) {
|
||||||
|
if (!isDir && Core::DiffService::instance()) {
|
||||||
|
menu->addAction(TextEditor::TextDocument::createDiffAgainstCurrentFileAction(
|
||||||
|
menu, [filePath]() { return filePath; }));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(&settings,
|
||||||
|
&TextEditorSettings::fontSettingsChanged,
|
||||||
|
this,
|
||||||
|
&TextEditorPluginPrivate::updateSearchResultsFont);
|
||||||
|
|
||||||
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
updateSearchResultsFont(TextEditorSettings::fontSettings());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user