src/de/uapcore/sudoku/ActionHandler.java

changeset 5
8ddf4af937d7
parent 4
b8588e318001
child 6
5bab2e971333
equal deleted inserted replaced
4:b8588e318001 5:8ddf4af937d7
46 public static final String QUIT = "quit"; 46 public static final String QUIT = "quit";
47 public static final String ABOUT = "about"; 47 public static final String ABOUT = "about";
48 48
49 private Field field; 49 private Field field;
50 private Solver solver; 50 private Solver solver;
51 private DocumentHandler doc;
51 52
52 public ActionHandler(Field f) { 53 public ActionHandler(Field f) {
53 field = f; 54 field = f;
54 solver = new Solver(); 55 solver = new Solver();
56 doc = new DocumentHandler();
57 }
58
59 private boolean chooseSaveFilename() {
60 // TODO: fileselector
61 return false;
55 } 62 }
56 63
57 private boolean save() { 64 private boolean save() {
65 if (!doc.isFilenameSet()) {
66 if (!chooseSaveFilename()) {
67 return false;
68 }
69 }
58 if (solver.check(field)) { 70 if (solver.check(field)) {
59 field.setAllCellsModified(false); 71 field.setAllCellsModified(false);
60 // TODO: save to file 72 // TODO: save to file
61 return true; 73 return true;
62 } else { 74 } else {

mercurial