Changeset 608 for AE/installer2/src/net/oni2/aeinstaller/gui
- Timestamp:
- Jan 14, 2013, 6:49:25 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/gui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r606 r608 1 1 package net.oni2.aeinstaller.gui; 2 2 3 import java.awt.Desktop; 4 import java.awt.event.ActionEvent; 5 import java.awt.event.ActionListener; 6 import java.awt.event.MouseAdapter; 7 import java.awt.event.MouseEvent; 3 8 import java.io.File; 4 9 import java.io.IOException; … … 19 24 import javax.swing.JLabel; 20 25 import javax.swing.JMenu; 26 import javax.swing.JMenuItem; 21 27 import javax.swing.JOptionPane; 28 import javax.swing.JPopupMenu; 22 29 import javax.swing.JSplitPane; 23 30 import javax.swing.JTable; … … 124 131 tblMods.getSelectionModel().addListSelectionListener( 125 132 new ListSelectionListener() { 126 127 133 @Override 128 134 public void valueChanged(ListSelectionEvent e) { … … 138 144 } 139 145 }); 140 146 tblMods.addMouseListener(new MouseAdapter() { 147 private void common(MouseEvent e) { 148 int r = tblMods.rowAtPoint(e.getPoint()); 149 if (r >= 0 && r < tblMods.getRowCount()) 150 tblMods.setRowSelectionInterval(r, r); 151 else 152 tblMods.clearSelection(); 153 154 int rowindex = tblMods.getSelectedRow(); 155 if (rowindex >= 0) { 156 if (e.isPopupTrigger() 157 && e.getComponent() instanceof JTable) { 158 int modelRow = tblMods.convertRowIndexToModel(rowindex); 159 final Mod mod = (Mod) model.getValueAt(modelRow, -1); 160 161 if (mod.isLocalAvailable()) { 162 JPopupMenu popup = new JPopupMenu(); 163 JMenuItem openModFolder = new JMenuItem(bundle 164 .getString("openModFolder.text")); 165 openModFolder 166 .addActionListener(new ActionListener() { 167 @Override 168 public void actionPerformed( 169 ActionEvent arg0) { 170 try { 171 Desktop.getDesktop().open( 172 mod.getLocalPath()); 173 } catch (IOException e) { 174 e.printStackTrace(); 175 } 176 } 177 }); 178 popup.add(openModFolder); 179 popup.show(e.getComponent(), e.getX(), e.getY()); 180 } 181 } 182 } 183 } 184 185 @Override 186 public void mousePressed(MouseEvent e) { 187 common(e); 188 } 189 190 @Override 191 public void mouseReleased(MouseEvent e) { 192 common(e); 193 } 194 }); 141 195 // To get checkbox-cells with background of row 142 196 ((JComponent) tblMods.getDefaultRenderer(Boolean.class)) … … 163 217 164 218 private void exit() { 165 setVisible(false);166 219 dispose(); 220 System.exit(0); 167 221 } 168 222 … … 199 253 private void checkUpdates() { 200 254 if (Settings.getInstance().get("notifyupdates", true)) { 255 // TODO 201 256 } 202 257 } … … 365 420 } else { 366 421 HashMap<Mod, HashSet<Mod>> conflicts = ModManager.getInstance() 367 .check Conflicts(mods);422 .checkIncompabitilites(mods); 368 423 if (conflicts.size() > 0) { 369 System.err.println(" Conflictingmods: "424 System.err.println("Incompatible mods: " 370 425 + conflicts.toString()); 371 426 break; … … 377 432 378 433 if (instReady) { 434 System.out.println("Install mods: " + mods.toString()); 435 379 436 Installer.install(mods, new InstallProgressListener() { 380 437 @Override … … 462 519 break; 463 520 case MACOS: 464 params.add(new File(Paths.getEditionBasePath(), "Oni")465 .getPath());521 params.add(new File(Paths.getEditionBasePath(), 522 "Oni.app/Contents/MacOS/Oni").getPath()); 466 523 break; 467 524 case LINUX: … … 512 569 } 513 570 571 @SuppressWarnings("unused") 572 private void openEditionFolder() { 573 try { 574 Desktop.getDesktop().open(Paths.getEditionBasePath()); 575 } catch (IOException e) { 576 e.printStackTrace(); 577 } 578 } 579 514 580 @Override 515 581 public void handleAbout(ApplicationEvent event) { -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.properties
r606 r608 15 15 menu.runOniWin=Run Oni (&window) 16 16 menu.runOniWinTooltip=Run Oni in windowed mode 17 menu.openEditionFolder=Open Edition folder 18 menu.openEditionFolderTooltip=Open the Edition folder in the file explorer 17 19 menu.loadConfig=&Load configuration... 18 20 menu.loadConfigTooltip=Load configuration … … 31 33 lblModTypes.text=Mod type: 32 34 lblDownloadSize.text=Size of files to download: 35 36 openModFolder.text=Open mod folder 33 37 34 38 lblSubmitter.text=Submitter: -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r606 r608 15 15 - Action(name=runOniFull, text=menu.runOniFull, toolTipText=menu.runOniFullTooltip, icon=img.oni, onAction=[oniFull]) 16 16 - Action(name=runOniWin, text=menu.runOniWin, toolTipText=menu.runOniWinTooltip, icon=img.oni, onAction=[oniWin]) 17 - Action(name=openEditionFolder, text=menu.openEditionFolder, toolTipText=menu.openEditionFolderTooltip, icon=img.folder, onAction=[openEditionFolder]) 17 18 - Action(name=loadConfig, text=menu.loadConfig, toolTipText=menu.loadConfigTooltip, icon=img.openFile, onAction=[loadConfig]) 18 19 - Action(name=saveConfig, text=menu.saveConfig, toolTipText=menu.saveConfigTooltip, icon=img.saveFile, onAction=[saveConfig]) … … 27 28 - JMenuItem(action=runOniFull) 28 29 - JMenuItem(action=runOniWin) 30 - JSeparator() 31 - JMenuItem(action=openEditionFolder) 29 32 - JSeparator() 30 33 - JMenuItem(action=loadConfig) -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableFilter.java
r602 r608 29 29 return false; 30 30 31 if (!mod. validOnPlatform())31 if (!mod.isValidOnPlatform()) 32 32 return false; 33 33 -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r606 r608 121 121 public void reloadData() { 122 122 items.clear(); 123 items.addAll(ModManager.getInstance().getMods ());123 items.addAll(ModManager.getInstance().getModsValidAndNotMandatory()); 124 124 revertSelection(); 125 125 } -
AE/installer2/src/net/oni2/aeinstaller/gui/settings/SettingsDialog.java
r593 r608 7 7 8 8 import javax.swing.AbstractAction; 9 import javax.swing.JCheckBox; 9 10 import javax.swing.JComboBox; 10 11 import javax.swing.JComponent; … … 33 34 private LaFComboModel laFModel; 34 35 36 private JCheckBox chkNotifyOnStart; 37 35 38 /** 36 39 * Open the settings 37 40 */ 38 41 public SettingsDialog() { 39 setMinimumSize(new Dimension( 500, (int) getSize().getHeight() + 0));42 setMinimumSize(new Dimension(320, (int) getSize().getHeight() + 0)); 40 43 41 44 AbstractAction closeAction = new AbstractAction() { … … 62 65 laFModel = new LaFComboModel(); 63 66 cmbLaF.setModel(laFModel); 67 68 chkNotifyOnStart.setSelected(set.get("notifyupdates", true)); 64 69 } 65 70 … … 68 73 Settings set = Settings.getInstance(); 69 74 70 String oldLaf = set.get("lookandfeel", 71 UIManager.getLookAndFeel().getClass().getName()); 75 set.get("notifyupdates", chkNotifyOnStart.isSelected()); 76 77 String oldLaf = set.get("lookandfeel", UIManager.getLookAndFeel() 78 .getClass().getName()); 72 79 String newLaf = laFModel.getSelectedClassName(); 73 80 -
AE/installer2/src/net/oni2/aeinstaller/gui/settings/SettingsDialog.properties
r591 r608 6 6 lblLaF=GUI theme: 7 7 8 panSetupDefaults=Default values for the installations 9 lblCreateDesktop=Link auf Desktop erstellen: 10 lblDesktopFolder=Desktop-Ordner: 11 txtDesktopFolder=Relativ zum Desktop-Ordner. Z.B. "." um die Verknüpfungen direkt auf dem Desktop abzulegen, "Spiele" um die Verknüpfungen in einen Unterordner Spiele auf dem Desktop zu legen. 12 lblUnattended=<html>Schnelles Setup (obige<br>Einstellungen nicht im Setup änderbar):</html> 13 8 panCommon=Common settings 9 lblNotifyOnStart=Notify about updates on startup: 14 10 15 11 newLaF.text=A new GUI theme was selected.\nPlease restart the application in order to apply the changes. -
AE/installer2/src/net/oni2/aeinstaller/gui/settings/SettingsDialog.yml
r593 r608 10 10 - JButton(name=btnOk, text=btnOk, onAction=[save,dispose]) 11 11 - JButton(name=btnCancel, text=btnCancel, onAction=[dispose]) 12 - JPanel(name=panSetupDefaults, groupTitle=panSetupDefaults): 13 - JLabel(name=lblCreateDesktop, text=lblCreateDesktop) 14 - JCheckBox(name=chkCreateDesktop) 15 - JLabel(name=lblDesktopFolder, text=lblDesktopFolder) 16 - JTextField(name=txtDesktopFolder, toolTipText=txtDesktopFolder) 12 - JPanel(name=panCommon, groupTitle=panCommon): 13 - JLabel(name=lblNotifyOnStart, text=lblNotifyOnStart) 14 - JCheckBox(name=chkNotifyOnStart) 17 15 - MigLayout: | 18 16 [min] [grow] 19 >lblCreateDesktop chkCreateDesktop [pref] 20 >lblDesktopFolder txtDesktopFolder [pref] 17 >lblNotifyOnStart chkNotifyOnStart [pref] 21 18 - JPanel(name=panUI, groupTitle=panUI): 22 19 - JLabel(name=lblLaF, text=lblLaF) … … 27 24 - MigLayout: | 28 25 [grow] 29 pan SetupDefaults[pref]26 panCommon [pref] 30 27 panUI [pref] 31 28 >btnOk+*=1,btnCancel=1 [min]
Note:
See TracChangeset
for help on using the changeset viewer.