Vuo  2.3.2
VuoCommandSetCommentText.cc
Go to the documentation of this file.
1 
10 #include "VuoCommandCommon.hh"
12 #include "VuoComment.hh"
13 #include "VuoCompilerComment.hh"
14 #include "VuoEditorComposition.hh"
15 #include "VuoEditorWindow.hh"
16 #include "VuoRendererComment.hh"
17 
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 
45 {
47 }
48 
53 {
55 
56  window->resetCompositionWithSnapshot(revertedSnapshot);
57 }
58 
63 {
65 
66  window->resetCompositionWithSnapshot(updatedSnapshot);
67 }