Vuo
2.0.2
editor
VuoCommandSetPublishedPortDetails.cc
Go to the documentation of this file.
1
10
#include "
VuoCommandCommon.hh
"
11
#include "
VuoCommandSetPublishedPortDetails.hh
"
12
#include "
VuoCompilerPublishedPortClass.hh
"
13
#include "
VuoEditorComposition.hh
"
14
#include "
VuoEditorWindow.hh
"
15
20
VuoCommandSetPublishedPortDetails::VuoCommandSetPublishedPortDetails
(
VuoRendererPublishedPort
*port,
21
json_object
*details,
22
VuoEditorWindow
*window)
23
:
VuoCommandCommon
(window)
24
{
25
setText(QApplication::translate(
"VuoEditorWindow"
,
"Set Published Port Details"
));
26
this->window = window;
27
this->revertedSnapshot = window->
getComposition
()->
takeSnapshot
();
28
29
// Start of command content.
30
{
31
static_cast<
VuoCompilerPublishedPortClass
*
>
(port->
getBase
()->
getClass
()->
getCompiler
())->updateDetails(details);
32
}
33
// End of command content.
34
35
this->updatedSnapshot = window->
getComposition
()->
takeSnapshot
();
36
37
setDescription
(
"Set published port '%s' details to %s"
,
38
port->
getBase
()->
getClass
()->
getName
().c_str(),
39
json_object_to_json_string(details));
40
}
41
45
int
VuoCommandSetPublishedPortDetails::id
()
const
46
{
47
return
VuoCommandCommon::setPublishedPortDetailsCommandID
;
48
}
49
53
void
VuoCommandSetPublishedPortDetails::undo
()
54
{
55
VuoCommandCommon_undo
;
56
57
window->
resetCompositionWithSnapshot
(revertedSnapshot);
58
59
window->
getComposition
()->
updateCompositionsThatContainThisSubcomposition
(revertedSnapshot);
60
}
61
65
void
VuoCommandSetPublishedPortDetails::redo
()
66
{
67
VuoCommandCommon_redo
;
68
69
window->
resetCompositionWithSnapshot
(updatedSnapshot);
70
71
window->
getComposition
()->
updateCompositionsThatContainThisSubcomposition
(updatedSnapshot);
72
}
Generated on Thu Mar 19 2020 23:15:57 for Vuo by
1.8.17