Skip to content

Commit d380380

Browse files
[Fix]Add endpoint to selected path
1 parent d7d6fc4 commit d380380

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mode/src/processing/mode/android/SDKDownloader.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,13 @@ private void createInitLayout(SDKUrlHolder downloadUrls) {
734734
if(Platform.getName()!="linux") addPackage(gc,5,packagesPanel,"Android Build Tools: ",downloadUrls.haxmVersion);
735735

736736
//SDK_Path selection Panel---------------------------------------
737+
final String endPoint = File.separator+"android"+File.separator+"sdk";
737738
JPanel downloadPathPanel = new JPanel();
738739
downloadPathPanel.setLayout(new BorderLayout());
739740
JLabel pathLabel = new JLabel("Installation Path: ");
740741
downloadPathPanel.add(pathLabel,BorderLayout.NORTH);
741742

742-
final JLabel locationLabel = new JLabel(processing.app.Base.getSketchbookFolder().getAbsolutePath());
743+
final JLabel locationLabel = new JLabel(processing.app.Base.getSketchbookFolder().getAbsolutePath()+endPoint);
743744
locationLabel.setMaximumSize(Toolkit.zoom(200,locationLabel.getHeight()));
744745
locationLabel.setPreferredSize(Toolkit.zoom(200,locationLabel.getHeight()));
745746
locationLabel.setToolTipText(locationLabel.getText());
@@ -759,7 +760,7 @@ public void actionPerformed(ActionEvent e) {
759760
fd.setVisible(true);
760761
System.setProperty("apple.awt.fileDialogForDirectories", "false");
761762
if(fd.getFile() != null){
762-
locationLabel.setText(new File(fd.getDirectory(),fd.getFile()).getAbsolutePath());
763+
locationLabel.setText(new File(fd.getDirectory(),fd.getFile()).getAbsolutePath()+endPoint);
763764
locationLabel.setToolTipText(locationLabel.getText());
764765
}
765766
} else {
@@ -769,7 +770,7 @@ public void actionPerformed(ActionEvent e) {
769770
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
770771
fc.showOpenDialog(SDKDownloader.super.rootPane); //To put it on top of the modalDialog
771772
if (fc.getSelectedFile() != null) {
772-
locationLabel.setText(fc.getSelectedFile().getAbsolutePath());
773+
locationLabel.setText(fc.getSelectedFile().getAbsolutePath()+endPoint);
773774
locationLabel.setToolTipText(locationLabel.getText());
774775
}
775776
}
@@ -787,7 +788,8 @@ public void actionPerformed(ActionEvent e) {
787788
continueButton.addActionListener(new ActionListener() {
788789
@Override
789790
public void actionPerformed(ActionEvent e) {
790-
File sdkFolder = new File(locationLabel.getText());
791+
String path = locationLabel.getText();
792+
File sdkFolder = new File(path.substring(0,path.indexOf(endPoint)));
791793
run(urlHolder,sdkFolder);
792794
createLayout();
793795
}

0 commit comments

Comments
 (0)