summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wadham <[email protected]>2015-06-30 13:23:28 +1000
committerIan Wadham <[email protected]>2015-06-30 16:34:26 +1000
commit00234f9b40a96d8406b61b98c970c162ab138cb4 (patch)
tree8dda2f41f591773b285bd1d489e62f5ecb8516f7
parent02b59ace9ba5115b6b5d9bae281c24d7b87c0f71 (diff)
Add warning messages for actions not yet fully supported.
Facilities to generate and play Mathdoku and Killer Sudoku puzzles have been provided, but KSudoku does not yet support hints, saving, printing and entering actions for them. Hopefully some of these can be provided before the freeze of release Applications 15.08 in 15 days from now.
-rw-r--r--src/gui/ksudoku.cpp28
-rw-r--r--src/gui/welcomescreen.cpp9
2 files changed, 37 insertions, 0 deletions
diff --git a/src/gui/ksudoku.cpp b/src/gui/ksudoku.cpp
index 5e9efb9..a0341ee 100644
--- a/src/gui/ksudoku.cpp
+++ b/src/gui/ksudoku.cpp
@@ -303,6 +303,13 @@ void KSudoku::giveHint()
{
Game game = currentGame();
if(!game.isValid()) return;
+ SudokuType t = game.puzzle()->graph()->specificType();
+ if ((t == Mathdoku) || (t == KillerSudoku)) {
+ KMessageBox::information (this,
+ i18n("Sorry, hints for Mathdoku and Killer Sudoku "
+ "puzzles are not yet provided."));
+ return;
+ }
game.giveHint();
}
@@ -605,6 +612,13 @@ void KSudoku::gameSave()
Game game = currentGame();
if(!game.isValid()) return;
+ SudokuType t = game.puzzle()->graph()->specificType();
+ if ((t == Mathdoku) || (t == KillerSudoku)) {
+ KMessageBox::information (this,
+ i18n("Sorry, saving Mathdoku and Killer Sudoku "
+ "puzzles is not yet supported."));
+ return;
+ }
if(game.getUrl().isEmpty()) game.setUrl(KFileDialog::getSaveUrl(KUrl("kfiledialog:///ksudoku")));
if (!game.getUrl().isEmpty() && game.getUrl().isValid())
@@ -616,6 +630,13 @@ void KSudoku::gameSaveAs()
// this slot is called whenever the Game->Save As menu is selected,
Game game = currentGame();
if(!game.isValid()) return;
+ SudokuType t = game.puzzle()->graph()->specificType();
+ if ((t == Mathdoku) || (t == KillerSudoku)) {
+ KMessageBox::information (this,
+ i18n("Sorry, saving Mathdoku and Killer Sudoku "
+ "puzzles is not yet supported."));
+ return;
+ }
game.setUrl(KFileDialog::getSaveUrl(KUrl("kfiledialog:///ksudoku")));
if (!game.getUrl().isEmpty() && game.getUrl().isValid())
@@ -632,6 +653,13 @@ void KSudoku::gamePrint()
i18n("There seems to be no puzzle to print."));
return;
}
+ SudokuType t = game.puzzle()->graph()->specificType();
+ if ((t == Mathdoku) || (t == KillerSudoku)) {
+ KMessageBox::information (this,
+ i18n("Sorry, printing Mathdoku and Killer Sudoku "
+ "puzzles is not yet supported."));
+ return;
+ }
sendToPrinter (game.puzzle());
}
diff --git a/src/gui/welcomescreen.cpp b/src/gui/welcomescreen.cpp
index f100527..2d8af1f 100644
--- a/src/gui/welcomescreen.cpp
+++ b/src/gui/welcomescreen.cpp
@@ -24,6 +24,7 @@
#include "ksudokugame.h"
#include "globals.h"
+#include "puzzle.h"
Q_DECLARE_METATYPE(ksudoku::GameVariant*)
@@ -127,6 +128,14 @@ void WelcomeScreen::startEmptyGame() {
if(!variant) return;
Game game = variant->startEmpty();
+ if (! game.isValid()) return;
+ SudokuType t = game.puzzle()->graph()->specificType();
+ if ((t == Mathdoku) || (t == KillerSudoku)) {
+ KMessageBox::information (this,
+ i18n("Sorry, entering in Mathdoku and Killer Sudoku "
+ "puzzles is not yet supported."));
+ return;
+ }
emit newGameStarted(game, variant);
}