Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run OTP with one key push in interactive OTP launcher #5459

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public class MainView {

private final DataSourcesView dataSourcesView;
private final OptionsView optionsView;
private final StartOtpButtonView startOtpButtonView;
private final Runnable otpStarter;
private final Model model;

Expand All @@ -139,7 +140,7 @@ public MainView(Runnable otpStarter, Model model) throws HeadlessException {
);
this.dataSourcesView = new DataSourcesView(model);
this.optionsView = new OptionsView(model);
StartOtpButtonView startOtpButtonView = new StartOtpButtonView();
this.startOtpButtonView = new StartOtpButtonView();

innerPanel.add(sourceDirectoryView.panel(), CONFIG_SOURCE_DIR_PANEL_CONSTRAINTS);
innerPanel.add(dataSourcesView.panel(), CONFIG_DIRS_PANEL_CONSTRAINTS);
Expand Down Expand Up @@ -176,6 +177,8 @@ public void start() {
mainFrame.pack();
mainFrame.setLocationRelativeTo(null);
mainFrame.setVisible(true);

startOtpButtonView.grabFocus();
}

private void startOtp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ public void addActionListener(ActionListener l) {
Box panel() {
return panel;
}

void grabFocus() {
startOtpBtn.grabFocus();
}
}