Git commit e433e5c1f617a75af8b1e9d58bdf53e025975e18 by Ian Wadham. Committed on 29/03/2014 at 01:23. Pushed by ianw into branch 'KDE/4.13'. 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/e433e5c1f617a75af8b1e9d58bdf53e025975e18 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