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:
Eberhard Graether
2016-08-09 13:29:14 +02:00
parent 210c5b1245
commit d0a063a3b6
32 changed files with 1037 additions and 599 deletions
@@ -0,0 +1,41 @@
#ifndef MESSAGE_CODE_REFERENCE_H
#define MESSAGE_CODE_REFERENCE_H
#include "utility/messaging/Message.h"
class MessageCodeReference
: public Message<MessageCodeReference>
{
public:
enum ReferenceType
{
REFERENCE_PREVIOUS,
REFERENCE_NEXT
};
MessageCodeReference(ReferenceType type)
: type(type)
{
}
static const std::string getStaticType()
{
return "MessageCodeReference";
}
virtual void print(std::ostream& os) const
{
if (type == REFERENCE_PREVIOUS)
{
os << "previous";
}
else
{
os << "next";
}
}
const ReferenceType type;
};
#endif // MESSAGE_CODE_REFERENCE_H
+2 -2
View File
@@ -2,9 +2,9 @@
#define MESSAGE_REDO_H
#include "utility/messaging/Message.h"
#include "utility/types.h"
class MessageRedo: public Message<MessageRedo>
class MessageRedo
: public Message<MessageRedo>
{
public:
MessageRedo()
@@ -0,0 +1,33 @@
#ifndef MESSAGE_SHOW_REFERENCE_H
#define MESSAGE_SHOW_REFERENCE_H
#include "utility/messaging/Message.h"
#include "utility/types.h"
class MessageShowReference
: public Message<MessageShowReference>
{
public:
MessageShowReference(size_t refIndex, Id tokenId, Id locationId)
: refIndex(refIndex)
, tokenId(tokenId)
, locationId(locationId)
{
}
static const std::string getStaticType()
{
return "MessageShowReference";
}
virtual void print(std::ostream& os) const
{
os << "index: " << refIndex << " token: " << tokenId << " location: " << locationId;
}
const size_t refIndex;
const Id tokenId;
const Id locationId;
};
#endif // MESSAGE_SHOW_REFERENCE_H
+2 -2
View File
@@ -2,9 +2,9 @@
#define MESSAGE_UNDO_H
#include "utility/messaging/Message.h"
#include "utility/types.h"
class MessageUndo: public Message<MessageUndo>
class MessageUndo
: public Message<MessageUndo>
{
public:
MessageUndo()