Advanced Settings Panel
[pierogi] / main.cpp
index db0d632..99a9e86 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1,15 +1,41 @@
+// main.cpp
+//
+// For the Pierogi IR remote control app.
+//
+// Copyright (C) 2012 by John Pietrzak  (john@pietrzak.org)
+//
+// Licensed under the GNU GPL version 2.0 or later.
+
 #include "mainwindow.h"
+#include "pirapplication.h"
 #include <QtGui/QApplication>
 
 int main(int argc, char *argv[])
 {
-  QApplication app(argc, argv);
+//  QApplication app(argc, argv);
+  PIRApplication app(argc, argv);
 
   MainWindow mainWindow;
   mainWindow.setOrientation(MainWindow::ScreenOrientationLockLandscape);
 //  mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
+
+  // Take control over the volume rocker switch:
+  app.setupRockerSwitch(&mainWindow);
+
   mainWindow.showExpanded();
 
+  app.connect(
+    &app,
+    SIGNAL(decreaseRockerPressed()),
+    &mainWindow,
+    SLOT(selectPrevFavKeyset()));
+
+  app.connect(
+    &app,
+    SIGNAL(increaseRockerPressed()),
+    &mainWindow,
+    SLOT(selectNextFavKeyset()));
+
   // A connection to perform any final cleanup work:
   app.connect(
     &app,