Changeset 21cbbb6


Ignore:
Timestamp:
Jul 17, 2010, 10:50:52 AM (8 years ago)
Author:
Michael Seifert <mseifert@…>
Branches:
master
Children:
062a7a9
Parents:
b1546e6
Message:

Replay parsing can be continued upon next startup

Location:
src/main/java/de/erichseifert/warp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/erichseifert/warp/WARP.java

    rb1546e6 r21cbbb6  
    8080                        }
    8181
     82                        Settings.getInstance().setParsingComplete(true);
     83
    8284                        // FIXME: Find better solution
    8385                        replayFiles = null;
     
    145147                // Store selected directory for the next startup
    146148                Settings.getInstance().setReplayDir(dir.getPath());
     149                Settings.getInstance().setParsingComplete(false);
    147150
    148151                ParserThread parserThread = new ParserThread(dir, listener);
  • src/main/java/de/erichseifert/warp/gui/ReplayParserGUI.java

    rb1546e6 r21cbbb6  
    449449                setSearchEnabled(false);
    450450                setState(State.READY);
     451
     452                boolean parsingComplete = Settings.getInstance().isParsingComplete();
     453                if (!parsingComplete) {
     454                        int userChoice = JOptionPane.showConfirmDialog(this, "The replay parsing process has not been finished yet. Do you want to continue?", "Parsing incomplete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
     455                        if (userChoice == JOptionPane.YES_OPTION) {
     456                                setState(State.PARSING);
     457                                warp.parseDir(parsedDir, this);
     458                        }
     459                }
    451460        }
    452461
  • src/main/java/de/erichseifert/warp/io/Settings.java

    rb1546e6 r21cbbb6  
    3131public class Settings {
    3232        private static final String KEY_REPLAY_DIR = "replayDir";
     33        private static final String KEY_PARSING_COMPLETE = "parsingComplete";
    3334
    3435        private static Settings instance;
     
    6970                prefs.put(KEY_REPLAY_DIR, path);
    7071        }
     72
     73        public boolean isParsingComplete() {
     74                return prefs.getBoolean(KEY_PARSING_COMPLETE, false);
     75        }
     76
     77        public void setParsingComplete(boolean complete) {
     78                prefs.putBoolean(KEY_PARSING_COMPLETE, complete);
     79        }
    7180}
Note: See TracChangeset for help on using the changeset viewer.