Vuo
2.0.3
editor
VuoCommandSetNodeTitle.cc
Go to the documentation of this file.
1
10
#include "
VuoCommandCommon.hh
"
11
#include "
VuoCommandSetNodeTitle.hh
"
12
#include "
VuoEditorComposition.hh
"
13
#include "
VuoEditorWindow.hh
"
14
18
VuoCommandSetNodeTitle::VuoCommandSetNodeTitle
(
VuoCompilerNode
*node,
string
title,
VuoEditorWindow
*window)
19
:
VuoCommandCommon
(window)
20
{
21
setText(QApplication::translate(
"VuoEditorWindow"
,
"Set Node Title"
));
22
this->window = window;
23
this->revertedSnapshot = window->
getComposition
()->
takeSnapshot
();
24
25
// Start of command content.
26
{
27
node->
getBase
()->
getRenderer
()->
setTitle
(title);
28
}
29
// End of command content.
30
31
this->updatedSnapshot = window->
getComposition
()->
takeSnapshot
();
32
33
setDescription
(
"Set node %s title to '%s'"
,
34
node->
getIdentifier
().c_str(),
35
title.c_str());
36
}
37
41
int
VuoCommandSetNodeTitle::id
()
const
42
{
43
return
VuoCommandCommon::setNodeTitleCommandID
;
44
}
45
49
void
VuoCommandSetNodeTitle::undo
()
50
{
51
VuoCommandCommon_undo
;
52
53
window->
resetCompositionWithSnapshot
(revertedSnapshot);
54
window->
getComposition
()->
updatePortPopovers
();
55
}
56
60
void
VuoCommandSetNodeTitle::redo
()
61
{
62
VuoCommandCommon_redo
;
63
64
window->
resetCompositionWithSnapshot
(updatedSnapshot);
65
window->
getComposition
()->
updatePortPopovers
();
66
}
Generated on Tue Apr 28 2020 16:53:59 for Vuo by
1.8.17