source: src/app/main.cpp @ ca90cb1

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

A header with the proper copyright/lincence statement was added into each source/header file.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[ca90cb1]1/*
2 * Copyright (C) 2010 Ixonos Plc.
3 *
4 * This file is part of fosdem-schedule.
5 *
6 * fosdem-schedule is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * fosdem-schedule is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
18 */
[e5bc908]19#include <mainwindow.h>
20
21#include <QtGui/QApplication>
[a7d8638]22#include <sqlengine.h>
23
24#include "eventdialog.h"
25
[0f86a19]26#ifdef MAEMO
[6831c6a]27//#include <alarmdialog.h>
[69820d8]28#include <alarmdbus.h>
29#include <alarmdbusadaptorp.h>
[0f86a19]30#endif /* MAEMO */
[e5bc908]31
[6831c6a]32
[e5bc908]33int main(int argc, char *argv[])
34{
[f0ce4d0]35    Q_INIT_RESOURCE(icons);
[2fc2878]36    Q_INIT_RESOURCE(maps);
[979e5be]37    Q_INIT_RESOURCE(db);
[f0ce4d0]38
[e5bc908]39    QApplication a(argc, argv);
[f0ce4d0]40    QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
[e5bc908]41
[3a8dc71]42    SqlEngine::initialize(); // creates "SQLITE" DB connection
[05afe5f]43
[6bd729b]44    QWidget *window;
[a7d8638]45
[6bd729b]46    window = new MainWindow;
[a7d8638]47
[6831c6a]48
[0f86a19]49#ifdef MAEMO
[6831c6a]50    // Alarm Dbus
51    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
52    new AlarmDBusAdaptor(alarmDBus);
53    QDBusConnection connection = QDBusConnection::sessionBus();
54
55    if(connection.registerObject("/Fosdem", alarmDBus) == true)
56    {
57        if( connection.registerService("org.fosdem.schedule") == false)
58        {
[a7d8638]59                if(argc>1)
60                {
61                        QDBusInterface *interface = new QDBusInterface("org.fosdem.schedule",
62                                                                       "/Fosdem",
63                                                                       "org.fosdem.schedule.AlarmInterface",
64                                                                       connection);
65                        interface->call("Alarm",atoi(argv[1]));
66                        return 0;
67                }
[6831c6a]68        }
69    }
[a7d8638]70
71    if(argc > 1)
72    {
73        EventDialog dialog(atoi(argv[1]),window);
74        dialog.exec();
75    }
[0f86a19]76#endif
[6831c6a]77
[a7d8638]78    window->show();
79
[e5bc908]80    return a.exec();
81}
[f0ce4d0]82
Note: See TracBrowser for help on using the repository browser.