Changeset 640 for AE/installer2
- Timestamp:
- Jan 20, 2013, 7:02:43 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 1 added
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r639 r640 1 1 appname=AE Installer 2 2 appversion=0.9 62 appversion=0.97 -
AE/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r637 r640 40 40 private static ResourceBundle basicBundle = ResourceBundle 41 41 .getBundle("net.oni2.aeinstaller.AEInstaller"); 42 private static ResourceBundle startupBundle = ResourceBundle43 .getBundle("net.oni2.aeinstaller.localization. Startup");42 private static ResourceBundle globalBundle = ResourceBundle 43 .getBundle("net.oni2.aeinstaller.localization.Global"); 44 44 45 45 private static Application app = null; … … 93 93 SwingJavaBuilder.getConfig().addResourceBundle(imagesBundle); 94 94 SwingJavaBuilder.getConfig().addResourceBundle(basicBundle); 95 SwingJavaBuilder.getConfig().addResourceBundle( startupBundle);95 SwingJavaBuilder.getConfig().addResourceBundle(globalBundle); 96 96 SwingJavaBuilder.getConfig().setMarkInvalidResourceBundleKeys(true); 97 97 SwingJavaBuilder.getConfig().addType("JToolBarSeparator", … … 164 164 dlUrl = "http://www.go-mono.com/mono-downloads/download.html"; 165 165 } 166 hll.setText( startupBundle166 hll.setText(globalBundle 167 167 .getString("dotNetMissing.text") 168 168 .replaceAll( … … 170 170 String.format("<a href=\"%s\">%s</a>", dlUrl, dlUrl))); 171 171 JOptionPane.showMessageDialog(null, hll, 172 startupBundle.getString("dotNetMissing.title"),172 globalBundle.getString("dotNetMissing.title"), 173 173 JOptionPane.ERROR_MESSAGE); 174 174 return; … … 177 177 if (!Installer.verifyRunningDirectory()) { 178 178 JOptionPane.showMessageDialog(null, 179 startupBundle.getString("invalidPath.text"),180 startupBundle.getString("invalidPath.title"),179 globalBundle.getString("invalidPath.text"), 180 globalBundle.getString("invalidPath.title"), 181 181 JOptionPane.ERROR_MESSAGE); 182 182 if (!Settings.isDebug()) { … … 188 188 if (offline) { 189 189 JOptionPane.showMessageDialog(null, 190 startupBundle.getString("offlineMode.text"),191 startupBundle.getString("offlineMode.title"),190 globalBundle.getString("offlineMode.text"), 191 globalBundle.getString("offlineMode.title"), 192 192 JOptionPane.INFORMATION_MESSAGE); 193 193 } -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/Mod.java
r639 r640 19 19 import net.oni2.aeinstaller.backend.depot.model.NodeMod; 20 20 import net.oni2.aeinstaller.backend.depot.model.TaxonomyTerm; 21 import net.oni2.aeinstaller.backend.oni.Installer; 21 22 22 23 /** … … 205 206 */ 206 207 public boolean isInstalled() { 207 return ModManager.getInstance().isModInstalled(this); 208 if (tool) 209 return Installer.getInstalledTools().contains(packageNumber); 210 else 211 return ModManager.getInstance().isModInstalled(this); 208 212 } 209 213 -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/ModManager.java
r637 r640 126 126 m.getTypes().add(localType); 127 127 } 128 mods.put(m.getPackageNumber(), m); 128 if (m.isTool()) 129 tools.put(m.getPackageNumber(), m); 130 else 131 mods.put(m.getPackageNumber(), m); 129 132 } 130 133 -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r639 r640 122 122 + SwingJavaBuilder.getConfig().getResource("appversion")); 123 123 124 setSize(getWidth() +150, getHeight());124 setSize(getWidth() + 150, getHeight()); 125 125 contents.setDividerLocation(500); 126 126 contents.setResizeWeight(0.4); … … 384 384 toolsMenuItems.clear(); 385 385 for (Mod m : ModManager.getInstance().getInstalledTools()) { 386 if (m.getExeFile() != null && m.getExeFile().exists()) { 386 File exe = m.getExeFile(); 387 if (exe != null && exe.exists()) { 387 388 JMenuItem item = new JMenuItem(); 388 389 final Vector<String> params = new Vector<String>(); 389 params.add(m.getExeFile().getPath()); 390 if (exe.getName().toLowerCase().endsWith(".jar")) { 391 File jre = null; 392 if (Settings.getPlatform() == Platform.WIN) 393 jre = new File(System.getProperties().getProperty( 394 "java.home"), "bin/javaw.exe"); 395 else 396 jre = new File(System.getProperties().getProperty( 397 "java.home"), "bin/java"); 398 params.add(jre.getPath()); 399 params.add("-jar"); 400 } 401 params.add(exe.getPath()); 390 402 final File wd = m.getWorkingDir(); 391 403 Icon ico = null; -
AE/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.java
r637 r640 6 6 import java.util.ResourceBundle; 7 7 import java.util.TreeMap; 8 import java.util.TreeSet; 8 9 9 10 import javax.swing.AbstractAction; … … 23 24 import javax.swing.event.ListSelectionListener; 24 25 26 import net.oni2.aeinstaller.backend.Settings; 25 27 import net.oni2.aeinstaller.backend.SizeFormatter; 26 28 import net.oni2.aeinstaller.backend.mods.Mod; … … 28 30 import net.oni2.aeinstaller.backend.oni.Installer; 29 31 import net.oni2.aeinstaller.gui.HTMLLinkLabel; 32 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 30 33 31 34 import org.javabuilders.BuildResult; … … 45 48 46 49 private JSplitPane contents; 47 50 48 51 private JList lstTools; 49 52 53 private JLabel lblTitleVal; 50 54 private JLabel lblSubmitterVal; 51 55 private JLabel lblCreatorVal; … … 101 105 @SuppressWarnings("unused") 102 106 private void install() { 103 // TODO: care for offline mode 104 JOptionPane.showMessageDialog(this, "install", "todo", 105 JOptionPane.INFORMATION_MESSAGE); 106 } 107 Object o = lstTools.getSelectedValue(); 108 if (o instanceof Mod) { 109 Mod theMod = (Mod) o; 107 110 108 @SuppressWarnings("unused") 109 private void installDone() { 111 if (theMod.isInstalled()) { 112 TreeSet<Mod> tools = new TreeSet<Mod>(); 113 tools.add(theMod); 114 Installer.uninstallTools(tools); 115 } else { 116 if (!theMod.isLocalAvailable()) { 117 if (Settings.getInstance().isOfflineMode()) { 118 JOptionPane.showMessageDialog(this, 119 bundle.getString("offlineMode.text"), 120 bundle.getString("offlineMode.title"), 121 JOptionPane.WARNING_MESSAGE); 122 return; 123 } 124 125 TreeSet<Mod> toDownload = new TreeSet<Mod>(); 126 toDownload.add(theMod); 127 128 Downloader dl = new Downloader(toDownload); 129 try { 130 dl.setVisible(true); 131 if (!dl.isFinished()) 132 return; 133 } finally { 134 dl.dispose(); 135 } 136 } 137 138 TreeSet<Mod> tools = new TreeSet<Mod>(); 139 tools.add(theMod); 140 Installer.installTools(tools); 141 } 142 } 143 valueChanged(null); 110 144 } 111 145 112 146 @Override 113 147 public void valueChanged(ListSelectionEvent evt) { 148 lblTitleVal.setText(""); 114 149 lblSubmitterVal.setText(""); 115 150 lblCreatorVal.setText(""); … … 123 158 if (lstTools.getSelectedValue() instanceof Mod) { 124 159 Mod m = (Mod) lstTools.getSelectedValue(); 125 lblSubmitterVal.setText(m.getName()); 160 lblTitleVal.setText(m.getName()); 161 lblSubmitterVal.setText(m.getSubmitter()); 126 162 lblCreatorVal.setText(m.getCreator()); 127 163 lblDescriptionVal.setText(m.getDescription()); … … 130 166 lblDownloadSizeVal.setText(SizeFormatter.format(m.getZipSize(), 3)); 131 167 btnInstall.setEnabled(true); 132 if ( Installer.getInstalledTools().contains(m.getPackageNumber())) {168 if (m.isInstalled()) { 133 169 btnInstall.setText(bundle.getString("btnInstall.un.text")); 134 170 btnInstall.setToolTipText(bundle -
AE/installer2/src/net/oni2/aeinstaller/gui/toolmanager/ToolManager.yml
r626 r640 16 16 scrollTools [grow] 17 17 - JPanel(name=panInfo): 18 - JLabel(name=lblTitle, text=lblTitle.text) 19 - JLabel(name=lblTitleVal) 18 20 - JLabel(name=lblSubmitter, text=lblSubmitter.text) 19 21 - JLabel(name=lblSubmitterVal) … … 29 31 - JLabel(name=lblDownloadSize, text=lblDownloadSize.text) 30 32 - JLabel(name=lblDownloadSizeVal) 31 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, enabled=false, onAction=[install ,installDone])33 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, enabled=false, onAction=[install]) 32 34 - MigLayout: | 33 35 [min] [grow] 36 >lblTitle lblTitleVal [min] 34 37 >lblSubmitter lblSubmitterVal [min] 35 38 >lblCreator lblCreatorVal [min] -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r639 r640 57 57 installDone.text=You can now play AE Oni. 58 58 59 offlineMode.title=Offline mode60 offlineMode.text=AEI is running in offline mode.\nNo updates or downloads of new mods are possible.\nPlease restart AEI when you have internet connection to update or download new packages.61 59 updatesAvailable.title=Updates available 62 60 updatesAvailable.text=The following mods and tools have newer versions on the Depot.<br>Check the packages you want to be updated. -
AE/installer2/src/net/oni2/aeinstaller/localization/ToolManager.properties
r637 r640 6 6 btnInstall.un.tooltip=Uninstall this tool 7 7 8 lblTitle.text=Name: 8 9 lblSubmitter.text=Submitter: 9 10 lblCreator.text=Creator:
Note:
See TracChangeset
for help on using the changeset viewer.