Vuo
2.3.2
editor
VuoCommandSetCommentText.cc
Go to the documentation of this file.
1
10
#include "
VuoCommandCommon.hh
"
11
#include "
VuoCommandSetCommentText.hh
"
12
#include "
VuoComment.hh
"
13
#include "
VuoCompilerComment.hh
"
14
#include "
VuoEditorComposition.hh
"
15
#include "
VuoEditorWindow.hh
"
16
#include "
VuoRendererComment.hh
"
17
21
VuoCommandSetCommentText::VuoCommandSetCommentText
(
VuoRendererComment
*comment,
string
text,
VuoEditorWindow
*window)
22
:
VuoCommandCommon
(window)
23
{
24
setText(QApplication::translate(
"VuoEditorWindow"
,
"Set Comment Content"
));
25
this->window = window;
26
this->revertedSnapshot = window->
getComposition
()->
takeSnapshot
();
27
28
// Start of command content.
29
{
30
comment->
setContent
(text);
31
}
32
// End of command content.
33
34
this->updatedSnapshot = window->
getComposition
()->
takeSnapshot
();
35
36
setDescription
(
"Set %s text to %s"
,
37
comment->
getBase
()->
getCompiler
()->
getGraphvizIdentifier
().c_str(),
38
text.c_str());
39
}
40
44
int
VuoCommandSetCommentText::id
()
const
45
{
46
return
VuoCommandCommon::setCommentTextCommandID
;
47
}
48
52
void
VuoCommandSetCommentText::undo
()
53
{
54
VuoCommandCommon_undo
;
55
56
window->
resetCompositionWithSnapshot
(revertedSnapshot);
57
}
58
62
void
VuoCommandSetCommentText::redo
()
63
{
64
VuoCommandCommon_redo
;
65
66
window->
resetCompositionWithSnapshot
(updatedSnapshot);
67
}
Generated on Sat Jun 19 2021 10:17:42 for Vuo by
1.9.1