Skip to content

Commit

Permalink
Added "Test" option to the addons dialog which shows the console, in …
Browse files Browse the repository at this point in the history
…addition to launching.
  • Loading branch information
sk89q committed Mar 20, 2012
1 parent f402e37 commit 052f9be
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/com/sk89q/mclauncher/AddonManagerDialog.java
Expand Up @@ -480,7 +480,7 @@ private JPanel buildButtons() {


panel.add(Box.createHorizontalGlue()); panel.add(Box.createHorizontalGlue());


JButton launchBtn = new JButton("Launch"); JButton launchBtn = new JButton("Launch...");
panel.add(launchBtn); panel.add(launchBtn);
launchBtn.addActionListener(new ActionListener() { launchBtn.addActionListener(new ActionListener() {
@Override @Override
Expand All @@ -494,6 +494,21 @@ public void actionPerformed(ActionEvent e) {


panel.add(Box.createHorizontalStrut(3)); panel.add(Box.createHorizontalStrut(3));


JButton testBtn = new JButton("Test...");
panel.add(testBtn);
testBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
saveAddonsProfile();
Launcher.getInstance().getOptions().save();
self.dispose();
launcherFrame.setShowConsole(true);
launcherFrame.launch();
}
});

panel.add(Box.createHorizontalStrut(3));

JButton okBtn = new JButton("Close"); JButton okBtn = new JButton("Close");
Dimension pref = okBtn.getPreferredSize(); Dimension pref = okBtn.getPreferredSize();
okBtn.setPreferredSize(new Dimension(Math.max(pref.width, 80), okBtn.setPreferredSize(new Dimension(Math.max(pref.width, 80),
Expand All @@ -508,7 +523,7 @@ public void actionPerformed(ActionEvent e) {
} }
}); });


UIUtil.equalWidth(launchBtn, okBtn); UIUtil.equalWidth(launchBtn, testBtn, okBtn);


return panel; return panel;
} }
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/sk89q/mclauncher/LauncherFrame.java
Expand Up @@ -246,6 +246,18 @@ public void setAutoConnect(String address) {
} }
} }


/**
* Set whether the console should be shown.
*
* @param show true to show the console
*/
public void setShowConsole(boolean show) {
if (show) {
expandBtn.doClick();
}
showConsoleCheck.setSelected(show);
}

/** /**
* Open the options window. * Open the options window.
* *
Expand Down

0 comments on commit 052f9be

Please sign in to comment.