separated User from Session - will be need for reconnecting

This commit is contained in:
BetaSteward 2011-06-27 21:50:35 -04:00
parent b55dd5d787
commit bdd8a2a28e
6 changed files with 46 additions and 29 deletions

View file

@ -579,26 +579,27 @@ public class DeckEditorPanel extends javax.swing.JPanel {
int ret = fcImportDeck.showOpenDialog(this);
if (ret == JFileChooser.APPROVE_OPTION) {
File file = fcImportDeck.getSelectedFile();
try {
setCursor(new Cursor(Cursor.WAIT_CURSOR));
DeckImporter importer = getDeckImporter(file.getPath());
if (importer != null) {
deck = Deck.load(importer.importDeck(file.getPath()));
if (file != null) {
try {
setCursor(new Cursor(Cursor.WAIT_CURSOR));
DeckImporter importer = getDeckImporter(file.getPath());
if (importer != null) {
deck = Deck.load(importer.importDeck(file.getPath()));
}
else {
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Unknown deck format", "Error importing deck", JOptionPane.ERROR_MESSAGE);
}
} catch (Exception ex) {
Logger.getLogger(DeckEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
}
else {
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Unknown deck format", "Error importing deck", JOptionPane.ERROR_MESSAGE);
finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
} catch (Exception ex) {
Logger.getLogger(DeckEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
}
finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
refreshDeck();
try {
if (file != null)
refreshDeck();
try {
MageFrame.getPreferences().put("lastImportFolder", file.getCanonicalPath());
} catch (IOException ex) { }
} catch (IOException ex) { }
}
}
fcImportDeck.setSelectedFile(null);
}//GEN-LAST:event_btnImportActionPerformed