Skip to content

Commit d996137

Browse files
SG-40514: Add env var to bypass Clear All confirmation dialog (#1017)
### SG-40514: Add env var to bypass Clear All confirmation dialog ### Linked issues Fixes NA ### Describe the reason for the change. The reason for this change is that we are adding Annotation automation tests and in order to test the "Clear Annotations on All The Frames" functionality, we needed a way to bypass the confirmation dialog. ### Summarize your change. This commit adds a new env var which when defined, will skip the confirmation dialog when executing the function : "Clear Annotations on All The Frames". `export RV_SKIP_CONFIRMATIONS=1 ` Note that for efficiency, it is evaluated in the annotate_mode constructor. ### Describe what you have tested and on which operating system. Successfully tested on macOS. ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
1 parent 5693d82 commit d996137

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/plugins/rv-packages/annotate/annotate_mode.mu

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ class: AnnotateMinorMode : MinorMode
171171

172172
char _cursorChar;
173173

174-
int _hideDrawPane;
174+
int _hideDrawPane;
175+
bool _skipConfirmations;
175176

176177
// filtering control based on time and dx/dy deltas during drag events
177178
// to prevent sending ridiculous number of mouse/tablet events if using
@@ -1651,27 +1652,28 @@ class: AnnotateMinorMode : MinorMode
16511652

16521653
method: clearAllSlot (void; bool checked)
16531654
{
1654-
let answer = alertPanel(true, InfoAlert, "Clear all annotations from the current timeline?", nil, "OK", "Cancel", nil);
1655-
1656-
if (answer != 0)
1655+
if (!_skipConfirmations)
16571656
{
1658-
return;
1657+
let answer = alertPanel(true, InfoAlert, "Clear all annotations from the current timeline?", nil, "OK", "Cancel", nil);
1658+
1659+
if (answer != 0)
1660+
{
1661+
return;
1662+
}
16591663
}
1660-
else
1664+
1665+
for_each(node; nodes())
16611666
{
1662-
for_each(node; nodes())
1667+
let annotatedFrames = findAnnotatedFrames(node);
1668+
for_each(frame; annotatedFrames)
16631669
{
1664-
let annotatedFrames = findAnnotatedFrames(node);
1665-
for_each(frame; annotatedFrames)
1666-
{
1667-
clearPaint(node, frame);
1668-
clearPaint(node, sourceFrame(frame));
1669-
}
1670+
clearPaint(node, frame);
1671+
clearPaint(node, sourceFrame(frame));
16701672
}
1671-
1672-
updateFrameDependentState();
1673-
redraw();
16741673
}
1674+
1675+
updateFrameDependentState();
1676+
redraw();
16751677
}
16761678

16771679
method: redoSlot (void; bool checked)
@@ -2078,6 +2080,7 @@ class: AnnotateMinorMode : MinorMode
20782080
_hideDrawPane = 0;
20792081
_userSelectedNode = "";
20802082
_disabledTooltipMessage = "This tool is currently unavailable";
2083+
_skipConfirmations = system.getenv("RV_SKIP_CONFIRMATIONS", nil) neq nil;
20812084

20822085
let m = mainWindowWidget(),
20832086
g = QActionGroup(m);

0 commit comments

Comments
 (0)