summaryrefslogtreecommitdiffstats
path: root/application/MainWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-03-15 09:27:45 +0100
committerPetr Mrázek <peterix@gmail.com>2018-03-15 09:27:45 +0100
commit303842a19e4893e4ac6784d60aca990b4276d0ec (patch)
tree6dcaffa82816bfa00e58c9e824be9d69cd2f0102 /application/MainWindow.cpp
parentea151ca9d4124851e96553699cee1c2832c10b8f (diff)
downloadMultiMC-303842a19e4893e4ac6784d60aca990b4276d0ec.tar
MultiMC-303842a19e4893e4ac6784d60aca990b4276d0ec.tar.gz
MultiMC-303842a19e4893e4ac6784d60aca990b4276d0ec.tar.lz
MultiMC-303842a19e4893e4ac6784d60aca990b4276d0ec.tar.xz
MultiMC-303842a19e4893e4ac6784d60aca990b4276d0ec.zip
NOISSUE Add Konami Code
Fun little thing for hiding extra debug options in the future.
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r--application/MainWindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 1d36ef8c..e690e1b7 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -89,6 +89,7 @@
#include <FolderInstanceProvider.h>
#include <InstanceImportTask.h>
#include "UpdateController.h"
+#include "KonamiCode.h"
// WHY: to hold the pre-translation strings together with the T pointer, so it can be retranslated without a lot of ugly code
template <typename T>
@@ -631,6 +632,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
connect(q, SIGNAL(activated()), qApp, SLOT(quit()));
}
+ // Konami Code
+ {
+ secretEventFilter = new KonamiCode(this);
+ connect(secretEventFilter, &KonamiCode::triggered, this, &MainWindow::konamiTriggered);
+ }
+
// Add the news label to the news toolbar.
{
m_newsChecker.reset(new NewsChecker(BuildConfig.NEWS_RSS_URL));
@@ -806,6 +813,11 @@ MainWindow::~MainWindow()
{
}
+void MainWindow::konamiTriggered()
+{
+ qDebug() << "Super Secret Mode ACTIVATED!";
+}
+
void MainWindow::skinJobFinished()
{
activeAccountChanged();
@@ -1064,6 +1076,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *ev)
{
if (ev->type() == QEvent::KeyPress)
{
+ secretEventFilter->input(ev);
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev);
switch (keyEvent->key())
{