[ca90cb1] | 1 | /* |
---|
| 2 | * Copyright (C) 2010 Ixonos Plc. |
---|
| 3 | * |
---|
[6df32f2] | 4 | * This file is part of ConfClerk. |
---|
[ca90cb1] | 5 | * |
---|
[6df32f2] | 6 | * ConfClerk is free software: you can redistribute it and/or modify it |
---|
[ca90cb1] | 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 | * |
---|
[6df32f2] | 11 | * ConfClerk is distributed in the hope that it will be useful, but |
---|
[ca90cb1] | 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 |
---|
[6df32f2] | 17 | * ConfClerk. If not, see <http://www.gnu.org/licenses/>. |
---|
[ca90cb1] | 18 | */ |
---|
[e5bc908] | 19 | #include <mainwindow.h> |
---|
| 20 | |
---|
[a7d8638] | 21 | #include <sqlengine.h> |
---|
| 22 | |
---|
| 23 | #include "eventdialog.h" |
---|
[77e06ae] | 24 | #include "application.h" |
---|
[a7d8638] | 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] | 33 | int 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 | |
---|
[77e06ae] | 39 | Application a(argc, argv); |
---|
| 40 | Application::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 | |
---|