[ca90cb1] | 1 | /* |
---|
| 2 | * Copyright (C) 2010 Ixonos Plc. |
---|
[68b2df2] | 3 | * Copyright (C) 2011 Philipp Spitzer, gregor herrmann |
---|
[ca90cb1] | 4 | * |
---|
[6df32f2] | 5 | * This file is part of ConfClerk. |
---|
[ca90cb1] | 6 | * |
---|
[6df32f2] | 7 | * ConfClerk is free software: you can redistribute it and/or modify it |
---|
[ca90cb1] | 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 | * |
---|
[6df32f2] | 12 | * ConfClerk is distributed in the hope that it will be useful, but |
---|
[ca90cb1] | 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 |
---|
[6df32f2] | 18 | * ConfClerk. If not, see <http://www.gnu.org/licenses/>. |
---|
[ca90cb1] | 19 | */ |
---|
[e5bc908] | 20 | #include <mainwindow.h> |
---|
| 21 | |
---|
[a7d8638] | 22 | #include <sqlengine.h> |
---|
| 23 | |
---|
| 24 | #include "eventdialog.h" |
---|
[77e06ae] | 25 | #include "application.h" |
---|
[a7d8638] | 26 | |
---|
[0f86a19] | 27 | #ifdef MAEMO |
---|
[6831c6a] | 28 | //#include <alarmdialog.h> |
---|
[69820d8] | 29 | #include <alarmdbus.h> |
---|
| 30 | #include <alarmdbusadaptorp.h> |
---|
[0f86a19] | 31 | #endif /* MAEMO */ |
---|
[e5bc908] | 32 | |
---|
[6831c6a] | 33 | |
---|
[e5bc908] | 34 | int main(int argc, char *argv[]) |
---|
| 35 | { |
---|
[f0ce4d0] | 36 | Q_INIT_RESOURCE(icons); |
---|
[2fc2878] | 37 | Q_INIT_RESOURCE(maps); |
---|
[979e5be] | 38 | Q_INIT_RESOURCE(db); |
---|
[f0ce4d0] | 39 | |
---|
[77e06ae] | 40 | Application a(argc, argv); |
---|
| 41 | Application::setWindowIcon(QIcon(":/icons/fosdem.png")); |
---|
[e5bc908] | 42 | |
---|
[3a8dc71] | 43 | SqlEngine::initialize(); // creates "SQLITE" DB connection |
---|
[05afe5f] | 44 | |
---|
[6bd729b] | 45 | QWidget *window; |
---|
[a7d8638] | 46 | |
---|
[6bd729b] | 47 | window = new MainWindow; |
---|
[a7d8638] | 48 | |
---|
[6831c6a] | 49 | |
---|
[0f86a19] | 50 | #ifdef MAEMO |
---|
[6831c6a] | 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 | { |
---|
[a7d8638] | 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 | } |
---|
[6831c6a] | 69 | } |
---|
| 70 | } |
---|
[a7d8638] | 71 | |
---|
| 72 | if(argc > 1) |
---|
| 73 | { |
---|
| 74 | EventDialog dialog(atoi(argv[1]),window); |
---|
| 75 | dialog.exec(); |
---|
| 76 | } |
---|
[0f86a19] | 77 | #endif |
---|
[6831c6a] | 78 | |
---|
[a7d8638] | 79 | window->show(); |
---|
| 80 | |
---|
[e5bc908] | 81 | return a.exec(); |
---|
| 82 | } |
---|
[f0ce4d0] | 83 | |
---|