X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/f0ce4d0802d942b6813b4b520e23318fe679757a..61346c970d0d600ce7dc5fad4ea8e4a5e629a048:/src/app/main.cpp diff --git a/src/app/main.cpp b/src/app/main.cpp index f39da7a..29f36fb 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1,16 +1,85 @@ -#include +/* + * Copyright (C) 2010 Ixonos Plc. + * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl + * + * This file is part of ConfClerk. + * + * ConfClerk is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 2 of the License, or (at your option) + * any later version. + * + * ConfClerk is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * ConfClerk. If not, see . + */ +#include "mainwindow.h" + +#include "sqlengine.h" + +#include "eventdialog.h" +#include "application.h" + +#ifdef MAEMO +//#include "alarmdialog.h" +#include "alarmdbus.h" +#include "alarmdbusadaptorp.h" +#endif /* MAEMO */ -#include int main(int argc, char *argv[]) { Q_INIT_RESOURCE(icons); + Q_INIT_RESOURCE(db); + Q_INIT_RESOURCE(data); + + Application a(argc, argv); + Application::setWindowIcon(QIcon(":/confclerk.svg")); + + // needed by QDesktopServices + QCoreApplication::setOrganizationName("Toastfreeware"); + QCoreApplication::setApplicationName("ConfClerk"); + QCoreApplication::setApplicationVersion(VERSION); + + QWidget *window; + window = new MainWindow; + + +#ifdef MAEMO + // Alarm Dbus + CAlarmDBus *alarmDBus = new CAlarmDBus(window); + new AlarmDBusAdaptor(alarmDBus); + QDBusConnection connection = QDBusConnection::sessionBus(); + + if(connection.registerObject("/ConfClerk", alarmDBus) == true) + { + if( connection.registerService("at.priv.toastfreeware.confclerk") == false) + { + if(argc>1) + { + QDBusInterface *interface = new QDBusInterface("at.priv.toastfreeware.confclerk", + "/ConfClerk", + "at.priv.toastfreeware.confclerk.AlarmInterface", + connection); + interface->call("Alarm",atoi(argv[1])); + return 0; + } + } + } + + if(argc > 1) + { + EventDialog dialog(atoi(argv[1]), window); + dialog.exec(); + } +#endif - QApplication a(argc, argv); - QApplication::setWindowIcon(QIcon(":/icons/fosdem.png")); + window->show(); - MainWindow w; - w.show(); return a.exec(); }