Skip to content

Commit

Permalink
Merge pull request #5459 from entur/interactive_otp_main
Browse files Browse the repository at this point in the history
Run OTP with one key push in interactive OTP launcher
  • Loading branch information
t2gran authored Oct 31, 2023
2 parents 851d4f6 + b5d994c commit 6869fb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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();
}
}

0 comments on commit 6869fb5

Please sign in to comment.