source: src/app/main.cpp @ 6df32f2

qt5
Last change on this file since 6df32f2 was 6df32f2, checked in by gregor herrmann <gregoa@…>, 10 years ago

Update GPL blurb in source files.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * Copyright (C) 2010 Ixonos Plc.
3 *
4 * This file is part of ConfClerk.
5 *
6 * ConfClerk 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 * ConfClerk 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 * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
18 */
19#include <mainwindow.h>
20
21#include <sqlengine.h>
22
23#include "eventdialog.h"
24#include "application.h"
25
26#ifdef MAEMO
27//#include <alarmdialog.h>
28#include <alarmdbus.h>
29#include <alarmdbusadaptorp.h>
30#endif /* MAEMO */
31
32
33int main(int argc, char *argv[])
34{
35    Q_INIT_RESOURCE(icons);
36    Q_INIT_RESOURCE(maps);
37    Q_INIT_RESOURCE(db);
38
39    Application a(argc, argv);
40    Application::setWindowIcon(QIcon(":/icons/fosdem.png"));
41
42    SqlEngine::initialize(); // creates "SQLITE" DB connection
43
44    QWidget *window;
45
46    window = new MainWindow;
47
48
49#ifdef MAEMO
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        {
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                }
68        }
69    }
70
71    if(argc > 1)
72    {
73        EventDialog dialog(atoi(argv[1]),window);
74        dialog.exec();
75    }
76#endif
77
78    window->show();
79
80    return a.exec();
81}
82
Note: See TracBrowser for help on using the repository browser.