X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2FFrameworkWizardUI.java;h=ad08749b7f6f789464008116d94bfc36d3ed0af1;hp=0e0c54c345dcb3e7f1656aeaea43b3a3a26f72c7;hb=214b0d1914b48d651b25e58f321ddb77a46903b8;hpb=b63cc1b617592ee3f26062880a3f2b1540f194db diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index 0e0c54c345..ad08749b7f 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java @@ -1807,25 +1807,19 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe **/ private void init() { - // - // Show splash screen - // - SplashScreen ss = new SplashScreen(); - ss.setVisible(true); - // // Set current workspace and check // Check if exists WORKSPACE - // // Workspace.setCurrentWorkspace(System.getenv("WORKSPACE")); - if (!Workspace.checkCurrentWorkspace()) { - JOptionPane.showConfirmDialog(null, "Workspace is not setup correctly. Please setup first.", "Warning", - JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE); - this.dispose(); - System.exit(0); - } + this.checkWorkspace(); + // + // Show splash screen + // + SplashScreen ss = new SplashScreen(); + ss.setVisible(true); + // // Init Global Data // @@ -3636,7 +3630,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe // // Get guids xref and save to file // - int result = fc.showOpenDialog(new JPanel()); + int result = fc.showSaveDialog(new JPanel()); if (result == JFileChooser.APPROVE_OPTION) { Vector v = wt.getAllModuleGuidXref(); if (v.size() < 1) { @@ -3668,7 +3662,55 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe } catch (IOException e) { Log.wrn("Fail to write file", e.getMessage()); Log.err("Fail to write file when generating guids.xref", e.getMessage()); + return; + } + + JOptionPane.showConfirmDialog(null, "File is created", "Generate guids.xref", JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); + } + } + + /** + Check if WORKSPACE Environment is valid + + **/ + private void checkWorkspace() { + switch (Workspace.checkCurrentWorkspace()) { + case Workspace.WORKSPACE_VALID: + break; + case Workspace.WORKSPACE_NOT_DEFINED: + JOptionPane + .showConfirmDialog( + null, + "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. " + + DataType.LINE_SEPARATOR + DataType.LINE_SEPARATOR + "NOTICE:" + + DataType.LINE_SEPARATOR + "This does not change the System Environment Variable." + + DataType.LINE_SEPARATOR + "It only applies to where the Wizard will manage modification and file creations.", + "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); + SwitchWorkspace sw = new SwitchWorkspace(this, true); + int result = sw.showDialog(); + if (result == DataType.RETURN_TYPE_CANCEL) { + this.dispose(); + System.exit(0); + } else if (result == DataType.RETURN_TYPE_OK) { + sw.dispose(); + break; } + case Workspace.WORKSPACE_NOT_EXIST: + JOptionPane.showConfirmDialog(null, "Defined WORKSPACE Is Not Existed", "Error", + JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); + this.dispose(); + System.exit(0); + case Workspace.WORKSPACE_NOT_DIRECTORY: + JOptionPane.showConfirmDialog(null, "Defined WORKSPACE Is Not A Directory", "Error", + JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); + this.dispose(); + System.exit(0); + case Workspace.WORKSPACE_NOT_VALID: + JOptionPane.showConfirmDialog(null, "WORKSPACE Environment Variable Is Not Valid", "Error", + JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); + this.dispose(); + System.exit(0); } } }