Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5761: Copy command is now sending an operation message to give feedb…
…ack in the status bar
- Loading branch information
1 parent
d9f8b63
commit 9e33286
Showing
5 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#pragma once | ||
|
||
#include "imessagebus.h" | ||
#include "iradiant.h" | ||
#include "messages/MapOperationMessage.h" | ||
|
||
namespace test | ||
{ | ||
|
||
// Listens for MapOperationMessages | ||
class MapOperationMonitor | ||
{ | ||
private: | ||
std::size_t _msgSubscription; | ||
bool _messageReceived; | ||
std::string _lastReceivedMessage; | ||
|
||
public: | ||
MapOperationMonitor() : | ||
_messageReceived(false) | ||
{ | ||
// Subscribe to the event asking for the target path | ||
_msgSubscription = GlobalRadiantCore().getMessageBus().addListener( | ||
radiant::IMessage::Type::MapOperationFinished, | ||
radiant::TypeListener<map::OperationMessage>( | ||
[this](map::OperationMessage& msg) | ||
{ | ||
_messageReceived = true; | ||
_lastReceivedMessage = msg.getMessage(); | ||
})); | ||
} | ||
|
||
bool messageReceived() const | ||
{ | ||
return _messageReceived; | ||
} | ||
|
||
const std::string& getLastReceivedMessage() const | ||
{ | ||
return _lastReceivedMessage; | ||
} | ||
|
||
~MapOperationMonitor() | ||
{ | ||
GlobalRadiantCore().getMessageBus().removeListener(_msgSubscription); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters