Vuo  2.1.0
VuoCommandSetPublishedPortDetails.cc
Go to the documentation of this file.
1 
10 #include "VuoCommandCommon.hh"
13 #include "VuoEditorComposition.hh"
14 #include "VuoEditorWindow.hh"
15 
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 
46 {
48 }
49 
54 {
56 
57  window->resetCompositionWithSnapshot(revertedSnapshot);
58 
60 }
61 
66 {
68 
69  window->resetCompositionWithSnapshot(updatedSnapshot);
70 
72 }