summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-08-03 09:31:17 +0000
committerStijn Buys <ingar@osirion.org>2013-08-03 09:31:17 +0000
commitd7f292f0abbffb24dc683d754a2ab4b8b2938cc0 (patch)
treeab84004b8ab38916803ac39feea84f111b59df73 /src/mainwindow.cc
parent850441d72ad73e6bcf3570e3f62287c28eaead31 (diff)
Adds an option to mark cells with a unique solution.
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 8ab6c70..010d153 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -114,6 +114,12 @@ void MainWindow::initActions()
action_validate ->setStatusTip(tr("Validate the sudoku"));
connect(action_validate, SIGNAL(triggered()), this, SLOT(doValidate()));
+ // Settings -> Show Unique
+ action_hintunique = new QAction(tr("Mark solveable"), this);
+ action_hintunique->setStatusTip(tr("Mark cells with a unique solution"));
+ action_hintunique->setCheckable(true);
+ connect(action_hintunique, SIGNAL(triggered()), this, SLOT(doShowHintUnique()));
+
// Help -> About
action_about = new QAction(tr("About..."), this);
action_about ->setStatusTip(tr("About %1").arg(PACKAGE_NAME));
@@ -142,6 +148,9 @@ void MainWindow::initMenus()
mainwindow_movemenu->addSeparator();
mainwindow_movemenu->addAction(action_validate);
+ mainwindow_settingsmenu = menuBar()->addMenu(tr("&Settings"));
+ mainwindow_settingsmenu->addAction(action_hintunique);
+
mainwindow_helpmenu = menuBar()->addMenu(tr("&Help"));
mainwindow_helpmenu->addAction(action_about);
}
@@ -166,6 +175,8 @@ void MainWindow::updateTitle()
action_revert->setEnabled(true);
}
+
+ action_hintunique->setChecked(mainwindow_solverwindow->showHintUnique());
}
void MainWindow::updateStatus(const QString & text)
@@ -208,6 +219,13 @@ void MainWindow::doValidate()
mainwindow_solverwindow->doValidate();
}
+
+void MainWindow::doShowHintUnique()
+{
+ mainwindow_solverwindow->doShowHintUnique();
+ updateTitle();
+}
+
void MainWindow::doQuit()
{
if (QMessageBox::question(this, tr("Quit"), tr("Exit the application?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {