ui: Added shortcuts for navigating to next and previous reference in code view
* Added new class QtCodeNavigator between QtCodeView and QtCodeFileList that handles active ids and navigation * Pass all files as initially collapsed to code view and decide in QtCodeNavigator which ones show content * Rewrote requesting of active snippet display to top down approach * Display other locations focused when active location changes * Show corresponding edges when navigating references
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "settings/ProjectSettings.h"
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageCodeReference.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageFind.h"
|
||||
#include "utility/messaging/type/MessageInterruptTasks.h"
|
||||
@@ -432,6 +433,16 @@ void QtMainWindow::findFulltext()
|
||||
MessageFind(true).dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::codeReferencePrevious()
|
||||
{
|
||||
MessageCodeReference(MessageCodeReference::REFERENCE_PREVIOUS).dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::codeReferenceNext()
|
||||
{
|
||||
MessageCodeReference(MessageCodeReference::REFERENCE_NEXT).dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::overview()
|
||||
{
|
||||
MessageSearch(std::vector<SearchMatch>(1, SearchMatch::createCommand(SearchMatch::COMMAND_ALL))).dispatch();
|
||||
@@ -602,6 +613,11 @@ void QtMainWindow::setupEditMenu()
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Code Reference Next"), this, SLOT(codeReferenceNext()), QKeySequence(Qt::CTRL + Qt::Key_G));
|
||||
menu->addAction(tr("Code Reference Previous"), this, SLOT(codeReferencePrevious()), QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_G));
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("&To overview"), this, SLOT(overview()), QKeySequence::MoveToStartOfDocument);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
@@ -115,6 +115,8 @@ public slots:
|
||||
|
||||
void find();
|
||||
void findFulltext();
|
||||
void codeReferencePrevious();
|
||||
void codeReferenceNext();
|
||||
void overview();
|
||||
|
||||
void closeWindow();
|
||||
|
||||
Reference in New Issue
Block a user