From kde-commits Sat Mar 29 01:30:37 2014 From: Ian Wadham Date: Sat, 29 Mar 2014 01:30:37 +0000 To: kde-commits Subject: [palapeli] src: BUG: 332589 Add "Enable all messages" action and new string. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=139605664728964 Git commit 1a0e3e6c2020c5aad4d26c47b169afff5d40bc96 by Ian Wadham. Committed on 29/03/2014 at 01:23. Pushed by ianw into branch 'master'. BUG: 332589 Add "Enable all messages" action and new string. M +4 -1 src/palapeliui.rc M +17 -0 src/window/mainwindow.cpp M +2 -0 src/window/mainwindow.h http://commits.kde.org/palapeli/1a0e3e6c2020c5aad4d26c47b169afff5d40bc96 diff --git a/src/palapeliui.rc b/src/palapeliui.rc index eebcdac..39d686f 100644 --- a/src/palapeliui.rc +++ b/src/palapeliui.rc @@ -1,5 +1,5 @@ - @@ -27,6 +27,9 @@ + + + Main toolbar diff --git a/src/window/mainwindow.cpp b/src/window/mainwindow.cpp index 7e929e5..31c3689 100644 --- a/src/window/mainwindow.cpp +++ b/src/window/mainwindow.cpp @@ -30,6 +30,7 @@ #include #include #include +#include = Palapeli::MainWindow::MainWindow(KCmdLineArgs* args) : m_game(new Palapeli::GamePlay(this)) @@ -155,6 +156,22 @@ void Palapeli::MainWindow::setupActions() // View zoom out. KStandardAction::zoomOut(m_game, SLOT(actionZoomOut()), actionCollection()); + // Settings: enable messages that the user marked "Do not show again". + KAction* enableMessagesAct =3D new KAction(i18n("Enable all messages"),0); + actionCollection()->addAction("enable_messages", enableMessagesAct); + connect(enableMessagesAct, SIGNAL(triggered()), SLOT(enableMessages())); +} + +void Palapeli::MainWindow::enableMessages() +{ + // Enable all messages that the user has marked "Do not show again". + int result =3D KMessageBox::questionYesNo(this, + i18n("Enable all messages")); + if (result =3D=3D KMessageBox::Yes) { + qDebug() << "ENABLE ALL MESSAGES"; + KMessageBox::enableAllMessages(); + KGlobal::config()->sync(); // Save the changes to disk. + } } = #include "mainwindow.moc" diff --git a/src/window/mainwindow.h b/src/window/mainwindow.h index 273f39f..fcefbb6 100644 --- a/src/window/mainwindow.h +++ b/src/window/mainwindow.h @@ -38,6 +38,8 @@ namespace Palapeli MainWindow(KCmdLineArgs* args); protected: virtual bool queryClose(); + private Q_SLOTS: + void enableMessages(); private: void setupActions(); =20