diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | i18n.cpp | 31 | ||||
-rw-r--r-- | menu.cpp | 4 | ||||
-rw-r--r-- | puzzle.cpp | 15 | ||||
-rw-r--r-- | puzzle.h | 7 | ||||
-rw-r--r-- | setup.cpp | 7 | ||||
-rw-r--r-- | setup.h | 3 |
8 files changed, 60 insertions, 11 deletions
@@ -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. @@ -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. @@ -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 @@ -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; @@ -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. */ @@ -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); @@ -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); } @@ -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 */ |