source:
src/app/main.cpp
@
979e5be
Last change on this file since 979e5be was 979e5be, checked in by , 12 years ago | |
---|---|
|
|
File size: 946 bytes |
Rev | Line | |
---|---|---|
[e5bc908] | 1 | #include <mainwindow.h> |
2 | ||
3 | #include <QtGui/QApplication> | |
[6bd729b] | 4 | #ifdef MAEMO |
5 | #include <alarmdialog.h> | |
6 | #endif /* MAEMO */ | |
[e5bc908] | 7 | |
[05afe5f] | 8 | #include <sqlengine.h> |
9 | ||
[e5bc908] | 10 | int main(int argc, char *argv[]) |
11 | { | |
[f0ce4d0] | 12 | Q_INIT_RESOURCE(icons); |
[2fc2878] | 13 | Q_INIT_RESOURCE(maps); |
[979e5be] | 14 | Q_INIT_RESOURCE(db); |
[f0ce4d0] | 15 | |
[e5bc908] | 16 | QApplication a(argc, argv); |
[f0ce4d0] | 17 | QApplication::setWindowIcon(QIcon(":/icons/fosdem.png")); |
[e5bc908] | 18 | |
[3a8dc71] | 19 | SqlEngine::initialize(); // creates "SQLITE" DB connection |
[05afe5f] | 20 | |
[6bd729b] | 21 | QWidget *window; |
22 | #ifdef MAEMO | |
23 | // if the app is run with two cmd-line arguments | |
24 | // an alarm dialog is to be displayed | |
25 | // Usage: $ ./fosdem eventId alarmId | |
26 | // Example: $ ./fosdem 521 13 | |
27 | if(argc==3) | |
28 | window = new AlarmDialog(argc,argv); | |
[d4a8bbf] | 29 | else if(argc==2) // display Event dialog automatically |
30 | window = new MainWindow(atoi(argv[1])); // eventId = argv[1] | |
[6bd729b] | 31 | else |
32 | window = new MainWindow; | |
33 | #else | |
34 | window = new MainWindow; | |
35 | #endif /* MAEMO */ | |
36 | window->show(); | |
[e5bc908] | 37 | return a.exec(); |
38 | } | |
[f0ce4d0] | 39 |
Note: See TracBrowser
for help on using the repository browser.