aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/bookmarkmanager.h
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2024-01-17 14:48:52 +0100
committerhjk <hjk@qt.io>2024-01-18 06:51:36 +0000
commitef8323ee96dd59d3c0b1b778e3bd937554eed473 (patch)
tree6bd924753de595499f1c774e5103c29d2dcd28fc /src/plugins/texteditor/bookmarkmanager.h
parent89d5c69a79796da53ecb69801bebb8c3d3043a9f (diff)
TextEditor: Move bookmark related action setup
... to BookMarkManager. For less coupling. Change-Id: I51c88fc9ee9a3456b1075bbe4c7ad039fc6f1889 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/bookmarkmanager.h')
-rw-r--r--src/plugins/texteditor/bookmarkmanager.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/texteditor/bookmarkmanager.h b/src/plugins/texteditor/bookmarkmanager.h
index c83763d870..2e36445e69 100644
--- a/src/plugins/texteditor/bookmarkmanager.h
+++ b/src/plugins/texteditor/bookmarkmanager.h
@@ -3,9 +3,11 @@
#pragma once
+#include <coreplugin/inavigationwidgetfactory.h>
+#include <coreplugin/actionmanager/actionmanager.h>
+
#include <utils/itemviews.h>
#include <utils/fileutils.h>
-#include <coreplugin/inavigationwidgetfactory.h>
#include <QAbstractItemModel>
#include <QMultiMap>
@@ -14,13 +16,9 @@
#include <QPixmap>
#include <QStyledItemDelegate>
-namespace Core { class IContext; }
-
namespace TextEditor::Internal {
class Bookmark;
-class BookmarksPlugin;
-class BookmarkContext;
class BookmarkManager final : public QAbstractItemModel
{
@@ -79,9 +77,7 @@ public:
void editByFileAndLine(const Utils::FilePath &fileName, int lineNumber);
bool gotoBookmark(const Bookmark *bookmark) const;
-signals:
- void updateActions(bool enableToggle, int state);
- void currentIndexChanged(const QModelIndex &);
+ void requestContextMenu(const Utils::FilePath &filePath, int lineNumber, QMenu *menu);
private:
void updateActionStatus();
@@ -101,6 +97,20 @@ private:
QList<Bookmark *> m_bookmarksList;
QItemSelectionModel *m_selectionModel;
+ Core::Menu m_bookmarkMenu;
+
+ QAction *m_toggleAction = nullptr;
+ QAction *m_editAction = nullptr;
+ QAction *m_prevAction = nullptr;
+ QAction *m_nextAction = nullptr;
+ QAction *m_docPrevAction = nullptr;
+ QAction *m_docNextAction = nullptr;
+
+ QAction m_editBookmarkAction;
+ QAction m_bookmarkMarginAction;
+
+ int m_marginActionLineNumber = 0;
+ Utils::FilePath m_marginActionFileName;
};
class BookmarkViewFactory : public Core::INavigationWidgetFactory