source: src/app/main.cpp @ a7d8638

qt5
Last change on this file since a7d8638 was a7d8638, checked in by hanzes <hanzes@…>, 12 years ago

Alarm dbus connection added

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[e5bc908]1#include <mainwindow.h>
2
3#include <QtGui/QApplication>
[a7d8638]4#include <sqlengine.h>
5
6#include "eventdialog.h"
7
[0f86a19]8#ifdef MAEMO
[6831c6a]9//#include <alarmdialog.h>
[69820d8]10#include <alarmdbus.h>
11#include <alarmdbusadaptorp.h>
[0f86a19]12#endif /* MAEMO */
[e5bc908]13
[6831c6a]14
[e5bc908]15int main(int argc, char *argv[])
16{
[f0ce4d0]17    Q_INIT_RESOURCE(icons);
[2fc2878]18    Q_INIT_RESOURCE(maps);
[979e5be]19    Q_INIT_RESOURCE(db);
[f0ce4d0]20
[e5bc908]21    QApplication a(argc, argv);
[f0ce4d0]22    QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
[e5bc908]23
[3a8dc71]24    SqlEngine::initialize(); // creates "SQLITE" DB connection
[05afe5f]25
[6bd729b]26    QWidget *window;
[a7d8638]27
[6bd729b]28    window = new MainWindow;
[a7d8638]29
[6831c6a]30
[0f86a19]31#ifdef MAEMO
[6831c6a]32    // Alarm Dbus
33    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
34    new AlarmDBusAdaptor(alarmDBus);
35    QDBusConnection connection = QDBusConnection::sessionBus();
36
37    if(connection.registerObject("/Fosdem", alarmDBus) == true)
38    {
39        if( connection.registerService("org.fosdem.schedule") == false)
40        {
[a7d8638]41                if(argc>1)
42                {
43                        QDBusInterface *interface = new QDBusInterface("org.fosdem.schedule",
44                                                                       "/Fosdem",
45                                                                       "org.fosdem.schedule.AlarmInterface",
46                                                                       connection);
47                        interface->call("Alarm",atoi(argv[1]));
48                        return 0;
49                }
[6831c6a]50        }
51    }
[a7d8638]52
53    if(argc > 1)
54    {
55        EventDialog dialog(atoi(argv[1]),window);
56        dialog.exec();
57    }
[0f86a19]58#endif
[6831c6a]59
[a7d8638]60    window->show();
61
[e5bc908]62    return a.exec();
63}
[f0ce4d0]64
Note: See TracBrowser for help on using the repository browser.