summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--README2
-rw-r--r--i18n.cpp31
-rw-r--r--menu.cpp4
-rw-r--r--puzzle.cpp15
-rw-r--r--puzzle.h7
-rw-r--r--setup.cpp7
-rw-r--r--setup.h3
8 files changed, 60 insertions, 11 deletions
diff --git a/HISTORY b/HISTORY
index 198af37..87944db 100644
--- a/HISTORY
+++ b/HISTORY
@@ -10,3 +10,5 @@ VDR Plugin 'sudoku' Revision History
- Fixed compiler warnings with gcc-4.0 (thanks to Ville Skyttä for reporting
this).
- Added Finnish language texts (thanks to Ville Skyttä).
+- Added setup option whether or not all cells are unmarked when the puzzle is
+ reset.
diff --git a/README b/README
index 570f69c..86d4f2e 100644
--- a/README
+++ b/README
@@ -52,6 +52,8 @@ Setup:
- Mark ambiguous numbers Cells with ambiguous numbers are marked with magenta
color (yes/no).
Default is yes.
+- Clear marks Unmark all cells when reset the puzzle (yes/no).
+ Default is no.
- Transparency (%) Set the transparency of the menu (0-100).
Default is 50.
diff --git a/i18n.cpp b/i18n.cpp
index 6241230..5f93dd4 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: i18n.cpp 15 2005-10-29 14:11:48Z tom $
+ * $Id: i18n.cpp 16 2005-10-31 21:12:41Z tom $
*
*
* Translations provided by:
@@ -191,6 +191,35 @@ const tI18nPhrase SudokuPlugin::Phrases[] = {
#endif
#endif
},
+ { "Clear marks", // English
+ "Markierungen löschen", // Deutsch / German
+ "", // Slovenski / Slovenian
+ "", // Italiano / Italian
+ "", // Nederlands / Dutch
+ "", // Português / Portuguese
+ "", // Français / French
+ "", // Norsk / Norwegian
+ "", // suomi / Finnish
+ "", // Polski / Polish
+ "", // Español / Spanish
+ "", // ÅëëçíéêÜ / Greek
+ "", // Svenska / Swedish
+ "", // Românã / Romanian
+ "", // Magyar / Hungarian
+ "", // Català / Catalanian
+#if VDRVERSNUM > 10302
+ "", // ÀãááÚØÙ / Russian
+#if VDRVERSNUM > 10307
+ "", // Hrvatski / Croatian
+#if VDRVERSNUM > 10313
+ "", // Eesti / Estonian
+#if VDRVERSNUM > 10316
+ "", // Dansk / Danish
+#endif
+#endif
+#endif
+#endif
+ },
{ "Transparency (%)", // English
"Transparenz (%)", // Deutsch / German
"", // Slovenski / Slovenian
diff --git a/menu.cpp b/menu.cpp
index 2a4e422..0276066 100644
--- a/menu.cpp
+++ b/menu.cpp
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: menu.cpp 11 2005-10-28 01:00:01Z tom $
+ * $Id: menu.cpp 16 2005-10-31 21:12:41Z tom $
*/
#include "menu.h"
@@ -155,7 +155,7 @@ eOSState Menu::ProcessKey(eKeys key)
if (puzzle.untouched())
puzzle.generate(setup.givens_count, setup.symmetric);
else
- puzzle.reset();
+ puzzle.reset(setup.clear_marks);
break;
default:
return osContinue;
diff --git a/puzzle.cpp b/puzzle.cpp
index 803c130..6e76041 100644
--- a/puzzle.cpp
+++ b/puzzle.cpp
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: puzzle.cpp 11 2005-10-28 01:00:01Z tom $
+ * $Id: puzzle.cpp 16 2005-10-31 21:12:41Z tom $
*/
#include "puzzle.h"
@@ -71,9 +71,15 @@ Puzzle::Puzzle(unsigned int givens_count, bool symmetric)
generate(givens_count, symmetric);
}
-/** Reset the puzzle. */
+/** Reset the puzzle (including marks). */
void Puzzle::reset()
{
+ reset(true);
+}
+
+/** Reset the puzzle (either with or without marks). */
+void Puzzle::reset(bool clear_marks)
+{
unsigned int i;
// Fill the puzzle with the givens.
@@ -85,8 +91,9 @@ void Puzzle::reset()
compute_numbers(i);
// Reset marked cells.
- for (i = 0; i < SDIM; ++i)
- marks[i] = false;
+ if (clear_marks)
+ for (i = 0; i < SDIM; ++i)
+ marks[i] = false;
}
/** Set the number into this cell. */
diff --git a/puzzle.h b/puzzle.h
index 4083350..6914756 100644
--- a/puzzle.h
+++ b/puzzle.h
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: puzzle.h 11 2005-10-28 01:00:01Z tom $
+ * $Id: puzzle.h 16 2005-10-31 21:12:41Z tom $
*/
#ifndef VDR_SUDOKU_PUZZLE_H
@@ -104,9 +104,12 @@ namespace Sudoku
/** Constructor */
Puzzle(unsigned int givens_count = 0, bool symmetric = true);
- /** Reset the puzzle. */
+ /** Reset the puzzle (including marks). */
virtual void reset();
+ /** Reset the puzzle (either with or without marks). */
+ virtual void reset(bool clear_marks);
+
/** Set the number into this cell. */
virtual void set(Pos pos, unsigned int number);
diff --git a/setup.cpp b/setup.cpp
index eb1ad80..b38d24a 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: setup.cpp 11 2005-10-28 01:00:01Z tom $
+ * $Id: setup.cpp 16 2005-10-31 21:12:41Z tom $
*/
#include "setup.h"
@@ -25,6 +25,7 @@ SetupData::SetupData()
symmetric = 1;
mark_errors = 1;
mark_ambiguous = 1;
+ clear_marks = 0;
transparency = 50;
}
@@ -43,6 +44,8 @@ bool SetupData::parse(const char* name, const char* value)
mark_errors = atoi(value);
else if (!strcasecmp(name, "MarkAmbiguous"))
mark_ambiguous = atoi(value);
+ else if (!strcasecmp(name, "ClearMarks"))
+ clear_marks = atoi(value);
else if (!strcasecmp(name, "Transparency"))
transparency = atoi(value);
else
@@ -62,6 +65,7 @@ SetupPage::SetupPage(SetupData& setup) :
Add(new cMenuEditBoolItem(tr("Mark errors"), &data.mark_errors));
Add(new cMenuEditBoolItem(tr("Mark ambiguous numbers"),
&data.mark_ambiguous));
+ Add(new cMenuEditBoolItem(tr("Clear marks"), &data.clear_marks));
Add(new cMenuEditIntItem(tr("Transparency (%)"), &data.transparency, 0, 100));
}
@@ -76,5 +80,6 @@ void SetupPage::Store()
SetupStore("Symmetric", setup.symmetric);
SetupStore("MarkErrors", setup.mark_errors);
SetupStore("MarkAmbiguous", setup.mark_ambiguous);
+ SetupStore("ClearMarks", setup.clear_marks);
SetupStore("Transparency", setup.transparency);
}
diff --git a/setup.h b/setup.h
index 8aaa3b3..8fec17a 100644
--- a/setup.h
+++ b/setup.h
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: setup.h 11 2005-10-28 01:00:01Z tom $
+ * $Id: setup.h 16 2005-10-31 21:12:41Z tom $
*/
#ifndef VDR_SUDOKU_SETUP_H
@@ -26,6 +26,7 @@ namespace SudokuPlugin
int symmetric;
int mark_errors;
int mark_ambiguous;
+ int clear_marks;
int transparency;
/** Constructor */