33 QApplication(argc, argv) |
35 QApplication(argc, argv) |
34 { |
36 { |
35 #if !defined(Q_WS_WIN) |
37 #if !defined(Q_WS_WIN) |
36 signal(SIGINT, &terminateFrontend); |
38 signal(SIGINT, &terminateFrontend); |
37 #endif |
39 #endif |
|
40 #if 0 |
|
41 qDebug("%s called with", argv[0]); |
|
42 for (int i = 1; i < argc; i++) |
|
43 qDebug("%d: %s", i, argv[i]); |
|
44 #endif |
38 } |
45 } |
39 |
46 |
40 bool HWApplication::event(QEvent *event) |
47 bool HWApplication::event(QEvent *event) |
41 { |
48 { |
42 QFileOpenEvent *openEvent; |
49 QFileOpenEvent *openEvent; |
|
50 QString scheme, path; |
43 |
51 |
44 switch (event->type()) |
52 if (event->type() == QEvent::FileOpen) { |
45 { |
53 openEvent = (QFileOpenEvent *)event; |
46 case QEvent::FileOpen: |
54 scheme = openEvent->url().scheme(); |
47 openEvent = (QFileOpenEvent *)event; |
55 path = openEvent->url().path(); |
48 if (form) form->PlayDemoQuick(openEvent->file()); |
56 |
|
57 QFile file(path); |
|
58 if (scheme == "file" && file.exists()) { |
|
59 form->PlayDemoQuick(openEvent->file()); |
49 return true; |
60 return true; |
50 break; |
61 } else { |
51 default: |
62 const QString errmsg = tr("Not yet implemented").arg(path); |
52 return QApplication::event(event); |
63 MessageDialog::ShowErrorMessage(errmsg, form); |
53 break; |
64 return false; |
54 } |
65 } |
|
66 } |
|
67 |
|
68 return QApplication::event(event); |
55 } |
69 } |
56 |
70 |
57 |
71 |