source: src/app/main.cpp @ 68b2df2

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

Add copyright to source.

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