Changeset 632 for AE/installer2
- Timestamp:
- Jan 18, 2013, 5:12:13 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r631 r632 1 1 appname=AE Installer 2 2 appversion=0.9 02 appversion=0.91 -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r631 r632 3 3 import java.awt.BorderLayout; 4 4 import java.awt.Desktop; 5 import java.awt.GridLayout; 5 6 import java.awt.event.ActionEvent; 6 7 import java.awt.event.ItemEvent; … … 203 204 .getUpdatableTools(); 204 205 int size = 0; 205 String strMods = ""; 206 for (Mod m : mods) { 206 JPanel panPackages = new JPanel(new GridLayout(0, 1)); 207 execUpdates = new TreeSet<Mod>(); 208 execUpdates.addAll(mods); 209 execUpdates.addAll(tools); 210 for (final Mod m : mods) { 207 211 size += m.getZipSize(); 208 if (strMods.length() > 0) 209 strMods += "<br>"; 210 strMods += " - " + m.getName(); 211 } 212 String strTools = ""; 213 for (Mod m : tools) { 212 JCheckBox check = new JCheckBox("Mod: " + m.getName()); 213 check.setSelected(true); 214 check.addItemListener(new ItemListener() { 215 @Override 216 public void itemStateChanged(ItemEvent e) { 217 if (e.getStateChange() == ItemEvent.SELECTED) 218 execUpdates.add(m); 219 else 220 execUpdates.remove(m); 221 } 222 }); 223 panPackages.add(check); 224 } 225 for (final Mod m : tools) { 214 226 size += m.getZipSize(); 215 if (strTools.length() > 0)216 strTools += "<br>";217 strTools += " - " + m.getName();227 JCheckBox check = new JCheckBox("Tool: " + m.getName()); 228 check.setSelected(true); 229 panPackages.add(check); 218 230 } 219 231 if (size > 0) { 220 232 // Build info dialog content 221 String message = "<html>"; 222 message += String.format( 223 bundle.getString("updatesAvailable.text"), strMods, 224 strTools, SizeFormatter.format(size, 3)); 225 message += "</html>"; 226 227 JPanel pan = new JPanel(); 228 pan.setLayout(new BorderLayout(0, 20)); 229 JLabel lab = new JLabel(message); 230 pan.add(lab, BorderLayout.CENTER); 233 JPanel packages = new JPanel(new BorderLayout(0, 7)); 234 JLabel lblIntro = new JLabel("<html>" 235 + bundle.getString("updatesAvailable.text") 236 + "</html>"); 237 JLabel lblSize = new JLabel("<html>" 238 + String.format(bundle 239 .getString("updatesAvailableSize.text"), 240 SizeFormatter.format(size, 3)) + "</html>"); 241 packages.add(lblIntro, BorderLayout.NORTH); 242 packages.add(panPackages, BorderLayout.CENTER); 243 packages.add(lblSize, BorderLayout.SOUTH); 244 245 JPanel pan = new JPanel(new BorderLayout(0, 25)); 246 pan.add(packages, BorderLayout.CENTER); 231 247 JCheckBox checkFutureUpdates = new JCheckBox( 232 248 bundle.getString("checkOnStartup.text")); … … 247 263 JOptionPane.YES_NO_OPTION, 248 264 JOptionPane.QUESTION_MESSAGE); 249 if (res == JOptionPane.YES_OPTION) { 250 execUpdates = new TreeSet<Mod>(); 251 execUpdates.addAll(mods); 252 execUpdates.addAll(tools); 265 if (res == JOptionPane.NO_OPTION) { 266 execUpdates = null; 253 267 } 254 268 } … … 259 273 @SuppressWarnings("unused") 260 274 private void doUpdate() { 261 if (execUpdates != null ) {275 if (execUpdates != null && execUpdates.size() > 0) { 262 276 Downloader dl = new Downloader(execUpdates); 263 277 try { -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r631 r632 58 58 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. 59 59 updatesAvailable.title=Updates available 60 updatesAvailable.text=The following mods and tools have newer versions on the Depot.<br>Mods:<br>%s<br>Tools:<br>%s<br><br>Size of files to download is %s.<br>Update now? 60 updatesAvailable.text=The following mods and tools have newer versions on the Depot.<br>Check the packages you want to be updated. 61 updatesAvailableSize.text=Size of files to download is %s.<br>Update now? 61 62 checkOnStartup.text=Check for updates at startup 62 63
Note:
See TracChangeset
for help on using the changeset viewer.