[disable all dangerous editing while solving is in progress
Andreas Röver <roever@users.sourceforge.net>**20050707192658] {
hunk ./src/gui/MainWindow.cpp 172
+    updateInterface();
hunk ./src/gui/MainWindow.cpp 1108
+    BtnDelProb->deactivate();
+    BtnDelColor->deactivate();
+    BtnDelShape->deactivate();
+
+    if (assmThread->getProblem() == problemSelector->getSelection()) {
+
+      BtnColAdd->deactivate();
+      BtnColRem->deactivate();
+      BtnSetResult->deactivate();
+      BtnAddShape->deactivate();
+      BtnRemShape->deactivate();
+    }
+
+    if (puzzle->probContainsShape(assmThread->getProblem(), PcSel->getSelection())) {
+      pieceTools->deactivate();
+      pieceEdit->lock(true);
+    } else
+      pieceEdit->lock(false);
+
hunk ./src/gui/MainWindow.cpp 1128
+
+    pieceEdit->lock(false);
hunk ./src/gui/SquareEditor.cpp 81
-  fl_color(labelcolor());
+  if (locked)
+    fl_color(color());
+  else
+    fl_color(labelcolor());
hunk ./src/gui/SquareEditor.cpp 117
-      fl_color(labelcolor());
+      if (locked)
+        fl_color(color());
+      else
+        fl_color(labelcolor());
hunk ./src/gui/SquareEditor.cpp 128
+    return 1;
+
+  if (locked)
hunk ./src/gui/SquareEditor.h 66
+  bool locked;
+
hunk ./src/gui/SquareEditor.h 74
-  SquareEditor(int x, int y, int w, int h, puzzle_c * p) : Fl_Widget(x, y, w, h), puzzle(p), currentZ(0), piecenumber(0), state(0), mX(0xFFFF), mY(0xFFFF), mZ(0xFFFF), inside(false), currentColor(0) {}
+  SquareEditor(int x, int y, int w, int h, puzzle_c * p) : Fl_Widget(x, y, w, h), puzzle(p), currentZ(0), piecenumber(0), state(0), mX(0xFFFF), mY(0xFFFF), mZ(0xFFFF), inside(false), currentColor(0), locked(false) {}
hunk ./src/gui/SquareEditor.h 93
+  }
+
+  /* when locked the editor only shows but doesn't alow
+   * to edit
+   */
+  void lock(bool lock) {
+    if (locked ^ lock) {
+      locked = lock;
+      redraw();
+    }
hunk ./src/gui/WindowWidgets.h 107
+  void lock(bool lock) {
+    sqedit->lock(lock);
+  }
+
hunk ./src/lib/puzzle.cpp 896
+bool puzzle_c::probContainsShape(unsigned int prob, unsigned int shape) const {
+  assert(prob < problems.size());
+
+  if (problems[prob]->result == shape)
+    return true;
+
+  for (vector<problem_c::shape_c>::iterator i = problems[prob]->shapes.begin(); i != problems[prob]->shapes.end(); i++)
+    if (i->shapeId == shape)
+      return true;
+
+  return false;
+}
+
hunk ./src/lib/puzzle.h 183
+  /* returns true, if the given shape is in this problem (including result) */
+  bool probContainsShape(unsigned int prob, unsigned int shape) const;
+
}
