Skip to content

Commit 7a0db88

Browse files
committed
Clear selections when log entry editor is cancelled
1 parent 178ee0f commit 7a0db88

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/write/LogEntryEditorController.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import javafx.scene.layout.VBox;
3636
import javafx.scene.paint.Color;
3737
import org.phoebus.framework.jobs.JobManager;
38+
import org.phoebus.framework.selection.Selection;
39+
import org.phoebus.framework.selection.SelectionService;
3840
import org.phoebus.logbook.*;
3941
import org.phoebus.logbook.olog.ui.HelpViewer;
4042
import org.phoebus.logbook.olog.ui.LogbookUIPreferences;
@@ -376,10 +378,14 @@ public void onChanged(Change<? extends String> change) {
376378
}
377379

378380
/**
379-
* Handler for Cancel button
381+
* Handler for Cancel button. Note that any selections in the {@link SelectionService} are
382+
* cleared to prevent next launch of {@link org.phoebus.logbook.olog.ui.menu.SendToLogBookApp}
383+
* to pick them up.
380384
*/
381385
@FXML
382386
public void cancel() {
387+
// Need to clear selections.
388+
SelectionService.getInstance().clearSelection("");
383389
((LogEntryEditorStage) cancelButton.getScene().getWindow()).handleCloseEditor(isDirty, root);
384390
}
385391

0 commit comments

Comments
 (0)