From d1e74d4374cb0ca21ff1458a773290bfceee902d Mon Sep 17 00:00:00 2001 From: Oleh Kuznetsov Date: Tue, 26 Nov 2024 13:46:51 +0000 Subject: [PATCH] Add "Skip Device Validation" checkbox to capture dialog --- .../src/main/com/google/gapid/util/Flags.java | 2 +- .../com/google/gapid/views/TracerDialog.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gapic/src/main/com/google/gapid/util/Flags.java b/gapic/src/main/com/google/gapid/util/Flags.java index 6a3d82dac..c29fec3e9 100644 --- a/gapic/src/main/com/google/gapid/util/Flags.java +++ b/gapic/src/main/com/google/gapid/util/Flags.java @@ -222,7 +222,7 @@ public boolean isSpecified() { return specified; } - void setValue(String value) { + public void setValue(String value) { this.value = parser.parse(value); this.specified = true; } diff --git a/gapic/src/main/com/google/gapid/views/TracerDialog.java b/gapic/src/main/com/google/gapid/views/TracerDialog.java index b8041897b..af488d0d0 100644 --- a/gapic/src/main/com/google/gapid/views/TracerDialog.java +++ b/gapic/src/main/com/google/gapid/views/TracerDialog.java @@ -343,6 +343,7 @@ private static class TraceInput extends Composite { private final Label startUnit; private final Button useAndroidFrameBoundaryExtension; private final Button withoutBuffering; + private final Button skipDeviceValidation; private final Button includeUnsupportedExtensions; private final Button loadValidationLayer; private final Button clearCache; @@ -425,7 +426,22 @@ public TraceInput(Composite parent, TraceType type, Models models, Widgets widge logFailure(LOG, Scheduler.EXECUTOR.schedule(refreshDevices, 300, TimeUnit.MILLISECONDS)); }); - // Align label with first line of text. + Label skipDeviceValidationLabel = createLabel(mainGroup, ""); + Composite skipDeviceValidationComposite = withLayoutData(createComposite(mainGroup, + withMarginOnly(new GridLayout(2, false), 0, 0)), + new GridData(SWT.FILL, SWT.FILL, true, false)); + + skipDeviceValidation = withLayoutData(createCheckbox(skipDeviceValidationComposite, "Skip Device Validation", Devices.skipDeviceValidation.get()), new GridData(SWT.END, SWT.FILL, false, false)); + skipDeviceValidation.addListener(SWT.Selection, e -> { + if(skipDeviceValidation.getSelection()) { + Devices.skipDeviceValidation.setValue("true"); + } else { + Devices.skipDeviceValidation.setValue("false"); + } + logFailure(LOG, Scheduler.EXECUTOR.schedule(refreshDevices, 300, TimeUnit.MILLISECONDS)); + }); + + // Align label with first line of text. withLayoutData(createLabel(mainGroup, "Validation:"), withIndents(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING), 0, 12)); deviceValidationView = new DeviceValidationView(mainGroup, this.models, widgets);