Changeset 852 for java/installer2/src/net
- Timestamp:
- May 3, 2013, 2:25:21 PM (12 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r849 r852 21 21 import javax.swing.UIManager.LookAndFeelInfo; 22 22 23 import net.oni2.ProxySettings; 23 24 import net.oni2.SettingsManager; 24 25 import net.oni2.aeinstaller.backend.CaseInsensitiveFile; 25 26 import net.oni2.aeinstaller.backend.Paths; 27 import net.oni2.aeinstaller.backend.RuntimeOptions; 26 28 import net.oni2.aeinstaller.backend.SizeFormatter; 27 29 import net.oni2.aeinstaller.backend.oni.OniSplit; … … 47 49 public class AEInstaller2 { 48 50 49 private static ResourceBundle imagesBundle; 50 private static ResourceBundle basicBundle; 51 private static ResourceBundle imagesBundle = ResourceBundle 52 .getBundle("net.oni2.aeinstaller.Images"); 53 private static ResourceBundle basicBundle = ResourceBundle 54 .getBundle("net.oni2.aeinstaller.AEInstaller"); 51 55 private static ResourceBundle globalBundle; 52 56 … … 82 86 } 83 87 } 84 imagesBundle = ResourceBundle.getBundle("net.oni2.aeinstaller.Images");85 basicBundle = ResourceBundle86 .getBundle("net.oni2.aeinstaller.AEInstaller");87 88 globalBundle = UTF8ResourceBundleLoader 88 89 .getBundle("net.oni2.aeinstaller.localization.Global"); … … 116 117 Paths.getDownloadPath().mkdirs(); 117 118 118 boolean debug = false;119 boolean useWd = false;120 boolean noCacheUpdate = false;121 boolean offline = false;122 119 for (String a : args) { 123 120 if (a.equalsIgnoreCase("-debug")) 124 debug = true;121 RuntimeOptions.setDebug(true); 125 122 if (a.equalsIgnoreCase("-nocacheupdate")) 126 noCacheUpdate = true;123 RuntimeOptions.setNoCacheUpdateMode(true); 127 124 if (a.equalsIgnoreCase("-offline")) 128 offline = true;125 RuntimeOptions.setOfflineMode(true); 129 126 if (a.equalsIgnoreCase("-usewd")) 130 useWd = true;131 } 132 if (! debug) {127 RuntimeOptions.setUseWorkingDir(true); 128 } 129 if (!RuntimeOptions.isDebug()) { 133 130 try { 134 131 PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(), … … 141 138 } 142 139 143 SettingsManager.setDebug(debug);144 SettingsManager.deserializeFromFile(Paths.getSettingsFilename());145 SettingsManager.setDebug(debug);146 SettingsManager.setUseWorkingDir(useWd);147 SettingsManager.getInstance().setNoCacheUpdateMode(noCacheUpdate);148 149 initBundles();150 151 140 if (PlatformInformation.getPlatform() == Platform.MACOS) 152 141 initMacOS(); 142 143 SettingsManager.deserializeFromFile(Paths.getSettingsFilename()); 144 145 if (Paths.getProxySettingsFilename().exists()) { 146 ProxySettings.deserializeFromFile(Paths.getProxySettingsFilename()); 147 } 148 149 initBundles(); 153 150 154 151 SwingJavaBuilder.getConfig().addResourceBundle(imagesBundle); … … 242 239 globalBundle.getString("invalidPath.title"), 243 240 JOptionPane.ERROR_MESSAGE); 244 if (! SettingsManager.isDebug()) {241 if (!RuntimeOptions.isDebug()) { 245 242 return; 246 243 } 247 244 } 248 245 249 if (!offline) { 250 offline = !DepotManager.getInstance().checkConnection(); 251 } 252 if (offline) { 246 if (!RuntimeOptions.isOfflineMode()) { 247 RuntimeOptions.setOfflineMode(!DepotManager.getInstance() 248 .checkConnection()); 249 } 250 if (RuntimeOptions.isOfflineMode()) { 253 251 JOptionPane.showMessageDialog(null, 254 252 globalBundle.getString("offlineModeStartup.text"), … … 256 254 JOptionPane.INFORMATION_MESSAGE); 257 255 } 258 SettingsManager.getInstance().setOfflineMode(offline); 259 260 if (!offline) { 256 257 if (!RuntimeOptions.isOfflineMode()) { 261 258 SVN svn = new SVN(); 262 259 try { -
java/installer2/src/net/oni2/aeinstaller/backend/Paths.java
r779 r852 4 4 import java.io.UnsupportedEncodingException; 5 5 import java.net.URLDecoder; 6 7 import net.oni2.SettingsManager;8 6 9 7 /** … … 27 25 28 26 /** 27 * @return Proxy settings filename of AEI 28 */ 29 public static File getProxySettingsFilename() { 30 return new File(getPrefsPath(), "AEI-ProxySettings.xml"); 31 } 32 33 /** 29 34 * Get the Jar path 30 35 * … … 32 37 */ 33 38 public static File getInstallerPath() { 34 if ( SettingsManager.isDebug() || SettingsManager.getUseWorkingDir()) {39 if (RuntimeOptions.isDebug() || RuntimeOptions.getUseWorkingDir()) { 35 40 String wd = System.getProperty("user.dir"); 36 41 return new File(wd); -
java/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r840 r852 50 50 import net.oni2.aeinstaller.backend.ImageResizer; 51 51 import net.oni2.aeinstaller.backend.Paths; 52 import net.oni2.aeinstaller.backend.RuntimeOptions; 52 53 import net.oni2.aeinstaller.backend.SizeFormatter; 53 54 import net.oni2.aeinstaller.backend.oni.OniLauncher; … … 217 218 DepotManager.loadFromCacheFile(Paths.getDepotCacheFilename()); 218 219 219 if (! SettingsManager.getInstance().isOfflineMode()220 && ! SettingsManager.getInstance().isNoCacheUpdateMode()) {220 if (!RuntimeOptions.isOfflineMode() 221 && !RuntimeOptions.isNoCacheUpdateMode()) { 221 222 long start = new Date().getTime(); 222 223 … … 240 241 if ((evtSource != this) 241 242 || SettingsManager.getInstance().get("notifyupdates", true)) { 242 if ( SettingsManager.getInstance().isOfflineMode()) {243 if (RuntimeOptions.isOfflineMode()) { 243 244 if (evtSource != this) { 244 245 JOptionPane.showMessageDialog( … … 584 585 @SuppressWarnings("unused") 585 586 private void checkCorePackages() { 586 if (! SettingsManager.getInstance().isOfflineMode()) {587 if (!RuntimeOptions.isOfflineMode()) { 587 588 TreeSet<Package> tools = new TreeSet<Package>(); 588 589 for (Package m : PackageManager.getInstance().getCoreTools()) { … … 649 650 } 650 651 651 if (toDownload.size() > 0 652 && SettingsManager.getInstance().isOfflineMode()) { 652 if (toDownload.size() > 0 && RuntimeOptions.isOfflineMode()) { 653 653 installState = EInstallState.OFFLINE; 654 654 break; -
java/installer2/src/net/oni2/aeinstaller/gui/settings/SettingsDialog.java
r840 r852 14 14 import javax.swing.UIManager; 15 15 16 import net.oni2.ProxySettings; 16 17 import net.oni2.SettingsManager; 18 import net.oni2.aeinstaller.backend.Paths; 17 19 import net.oni2.resourcebundle.UTF8ResourceBundleLoader; 18 20 … … 100 102 JOptionPane.INFORMATION_MESSAGE); 101 103 } 104 105 ProxySettings prox = ProxySettings.getInstance(); 106 prox.serializeToFile(Paths.getProxySettingsFilename()); 102 107 103 108 return true; -
java/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.java
r840 r852 18 18 19 19 import net.oni2.SettingsManager; 20 import net.oni2.aeinstaller.backend.RuntimeOptions; 20 21 import net.oni2.aeinstaller.backend.oni.management.tools.ToolsManager; 21 22 import net.oni2.aeinstaller.backend.packages.Package; … … 103 104 } else { 104 105 if (!selectedPackage.isLocalAvailable()) { 105 if ( SettingsManager.getInstance().isOfflineMode()) {106 if (RuntimeOptions.isOfflineMode()) { 106 107 JOptionPane.showMessageDialog(this, 107 108 bundle.getString("offlineMode.text"),
Note:
See TracChangeset
for help on using the changeset viewer.