]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
modify output path
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / FirstPanel.java
index 83cf9b60d2d56b9dd82645b709e781d01ffe89b4..c35077f0c468c4baabcb7f22835a87bce1fb4df7 100644 (file)
@@ -24,7 +24,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         */\r
        private static final long serialVersionUID = 207759413522910399L;\r
        \r
-       private String modulepath;\r
+       private String startpath;\r
        private ModuleInfo mi;\r
        \r
        private JButton moduleButton, goButton, msaEditorButton, criticButton;\r
@@ -158,7 +158,8 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
        //---------------------------------------------------------------------------------------//\r
 \r
-       public String getFilepath() {\r
+       public String getFilepath(String title) {\r
+               fc.setDialogTitle(title);\r
                if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\r
                        log.append(fc.getSelectedFile().getAbsolutePath() + "\n");\r
                        return fc.getSelectedFile().getAbsolutePath();\r
@@ -170,12 +171,13 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
     public void actionPerformed(ActionEvent e) {\r
         if ( e.getSource() == moduleButton ) {\r
-               modulepath = getFilepath();\r
+               startpath = getFilepath("Please choose a starting path");\r
+               moduletext.setText(startpath);\r
         }\r
         if ( e.getSource() == goButton ) {\r
                try {\r
-                       logfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "migration.log")));\r
-                       ModuleInfo.triger(modulepath);\r
+                       logfile = new PrintWriter(new BufferedWriter(new FileWriter(startpath.replaceAll(Common.strseparate, "$1") + File.separator + "migration.log")));\r
+                       ModuleInfo.triger(startpath);\r
                        logfile.flush();\r
                } catch (Exception en) {\r
                        println(en.getMessage());\r
@@ -190,7 +192,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         }\r
         if ( e.getSource() == criticButton) {\r
                try {\r
-                       Critic.fireAt(modulepath);\r
+                       Critic.fireAt(startpath);\r
                } catch (Exception en) {\r
                        println(en.getMessage());\r
                }\r