Add maintainer information to Debian control.
[jaffas-playground:bedside.git] / main.cpp
1 #include <QtGui/QApplication>
2 #include <QtDeclarative>
3 #include "visibilityawareqmlapplicationviewer.h"
4 #include "activemonitor.h"
5 #include "backlightcontrol.h"
6 #include "applicationdata.h"
7 #include <QLocale>
8 #include <qplatformdefs.h>
9
10 int main(int argc, char *argv[])
11 {
12     QApplication app(argc, argv);
13     ApplicationData data;
14     data.initialize();
15     VisibilityAwareQmlApplicationViewer viewer;
16     viewer.engine()->addImportPath("/opt/qtm12/imports");
17     viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
18
19     ActiveMonitor *monitor = new ActiveMonitor(&viewer);
20     QObject::connect(&viewer, SIGNAL(activeChanged(bool)),
21                      monitor, SLOT(activeChanged(bool)));
22
23     BacklightControl *backlight = new BacklightControl(&viewer);
24     QObject::connect(&app, SIGNAL(aboutToQuit()), backlight, SLOT(reset()));
25
26     viewer.rootContext()->setContextProperty("activeMonitor", monitor);
27     viewer.rootContext()->setContextProperty("backlight", backlight);
28     viewer.rootContext()->setContextProperty("viewer", &viewer);
29     viewer.rootContext()->setContextProperty("applicationData", &data);
30     viewer.rootContext()->setContextProperty("ampm", data.twelveHourClock());
31
32 #ifdef MEEGO_EDITION_HARMATTAN
33     viewer.setMainQmlFile("qml/Bedside/qtc-root.qml");
34 #else
35     viewer.setMainQmlFile("qml/Bedside/Main.qml");
36 #endif
37     viewer.showFullScreen();
38
39     return app.exec();
40 }