Diffstat (limited to 'noncore/tools/remote/remote.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/remote/remote.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp index 67fc57d..5b756cb 100644 --- a/noncore/tools/remote/remote.cpp +++ b/noncore/tools/remote/remote.cpp | |||
@@ -1,60 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "mainview.h" | 17 | #include "mainview.h" |
18 | 18 | ||
19 | /* OPIE */ | 19 | /* OPIE */ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | 22 | ||
23 | /* QT */ | 23 | /* QT */ |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | #include <qtabwidget.h> | 25 | #include <qtabwidget.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qpaintdevice.h> | 28 | #include <qpaintdevice.h> |
29 | #include <qobject.h> | 29 | #include <qobject.h> |
30 | 30 | ||
31 | /* STD */ | 31 | /* STD */ |
32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
33 | #include <sys/types.h> | 33 | #include <sys/types.h> |
34 | #include <sys/un.h> | 34 | #include <sys/un.h> |
35 | #include <unistd.h> | 35 | #include <unistd.h> |
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | #include <signal.h> | 37 | #include <signal.h> |
38 | 38 | ||
39 | 39 | ||
40 | int main( int argc, char **argv ) | 40 | int main( int argc, char **argv ) |
41 | { | 41 | { |
42 | QPEApplication a( argc, argv ); | 42 | QPEApplication a( argc, argv ); |
43 | MainView w; | 43 | |
44 | a.setMainWidget( &w ); | 44 | LircHandler lh; |
45 | QPEApplication::showWidget( &w ); | 45 | |
46 | 46 | lh.disableIrDA(); | |
47 | LircHandler lh; | 47 | lh.setupModules(); |
48 | if(!lh.isLircdRunning()) { | 48 | lh.startLircd(); |
49 | QMessageBox mb("Error!", | 49 | if(!lh.isLircdRunning()) { |
50 | "Lircd is not running", | 50 | QMessageBox::critical(NULL, QObject::tr("Error"), |
51 | QMessageBox::NoIcon, | 51 | QObject::tr("Unable to start lircd"), |
52 | QMessageBox::Ok, | 52 | QMessageBox::Ok, QMessageBox::NoButton); |
53 | QMessageBox::NoButton, | 53 | } |
54 | QMessageBox::NoButton); | 54 | |
55 | mb.exec(); | 55 | MainView w; |
56 | 56 | a.setMainWidget( &w ); | |
57 | } | 57 | QPEApplication::showWidget( &w ); |
58 | 58 | int result = a.exec(); | |
59 | return a.exec(); | 59 | |
60 | lh.stopLircd(); | ||
61 | lh.cleanupModules(); | ||
62 | |||
63 | return result; | ||
60 | } | 64 | } |