source: src/app/main.cpp @ 8bdf2d3

qt5
Last change on this file since 8bdf2d3 was babe4cd, checked in by gregor herrmann <gregoa@…>, 11 years ago

Remove ULB, Campus Solbosch maps.

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[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]34int main(int argc, char *argv[])
35{
[f0ce4d0]36    Q_INIT_RESOURCE(icons);
[979e5be]37    Q_INIT_RESOURCE(db);
[babe4cd]38    Q_INIT_RESOURCE(data);
[f0ce4d0]39
[77e06ae]40    Application a(argc, argv);
[f41638e]41    Application::setWindowIcon(QIcon(":/confclerk.svg"));
[e5bc908]42
[9f97eaf]43    // needed by QDesktopServices
44    QCoreApplication::setOrganizationName("Toastfreeware");
45    QCoreApplication::setApplicationName("ConfClerk");
46 
[3a8dc71]47    SqlEngine::initialize(); // creates "SQLITE" DB connection
[05afe5f]48
[6bd729b]49    QWidget *window;
[a7d8638]50
[6bd729b]51    window = new MainWindow;
[a7d8638]52
[6831c6a]53
[0f86a19]54#ifdef MAEMO
[6831c6a]55    // Alarm Dbus
56    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
57    new AlarmDBusAdaptor(alarmDBus);
58    QDBusConnection connection = QDBusConnection::sessionBus();
59
[8fdfc63]60    if(connection.registerObject("/ConfClerk", alarmDBus) == true)
[6831c6a]61    {
[8fdfc63]62        if( connection.registerService("at.priv.toastfreeware.confclerk") == false)
[6831c6a]63        {
[a7d8638]64                if(argc>1)
65                {
[8fdfc63]66                        QDBusInterface *interface = new QDBusInterface("at.priv.toastfreeware.confclerk",
67                                                                       "/ConfClerk",
68                                                                       "at.priv.toastfreeware.confclerk.AlarmInterface",
[a7d8638]69                                                                       connection);
70                        interface->call("Alarm",atoi(argv[1]));
71                        return 0;
72                }
[6831c6a]73        }
74    }
[a7d8638]75
76    if(argc > 1)
77    {
78        EventDialog dialog(atoi(argv[1]),window);
79        dialog.exec();
80    }
[0f86a19]81#endif
[6831c6a]82
[a7d8638]83    window->show();
84
[e5bc908]85    return a.exec();
86}
[f0ce4d0]87
Note: See TracBrowser for help on using the repository browser.