summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/remote.cpp
authorpaule <paule>2007-02-06 04:51:37 (UTC)
committer paule <paule>2007-02-06 04:51:37 (UTC)
commit97b2152a21890f05a2217dddfcba6c820c00aa24 (patch) (unidiff)
tree55b859fbea71840f15368ec7b4b9e2de2c4f9879 /noncore/tools/remote/remote.cpp
parenta505f79190d4d14a7c9595af3e9b78d9c613da21 (diff)
downloadopie-97b2152a21890f05a2217dddfcba6c820c00aa24.zip
opie-97b2152a21890f05a2217dddfcba6c820c00aa24.tar.gz
opie-97b2152a21890f05a2217dddfcba6c820c00aa24.tar.bz2
Start lircd on application start, and stop it on quit
Diffstat (limited to 'noncore/tools/remote/remote.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/remote.cpp28
1 files changed, 16 insertions, 12 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
@@ -37,24 +37,28 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37#include <signal.h> 37#include <signal.h>
38 38
39 39
40int main( int argc, char **argv ) 40int main( int argc, char **argv )
41{ 41{
42 QPEApplication a( argc, argv ); 42 QPEApplication a( argc, argv );
43 MainView w;
44 a.setMainWidget( &w );
45 QPEApplication::showWidget( &w );
46 43
47 LircHandler lh; 44 LircHandler lh;
48 if(!lh.isLircdRunning()) {
49 QMessageBox mb("Error!",
50 "Lircd is not running",
51 QMessageBox::NoIcon,
52 QMessageBox::Ok,
53 QMessageBox::NoButton,
54 QMessageBox::NoButton);
55 mb.exec();
56 45
46 lh.disableIrDA();
47 lh.setupModules();
48 lh.startLircd();
49 if(!lh.isLircdRunning()) {
50 QMessageBox::critical(NULL, QObject::tr("Error"),
51 QObject::tr("Unable to start lircd"),
52 QMessageBox::Ok, QMessageBox::NoButton);
57 } 53 }
58 54
59 return a.exec(); 55 MainView w;
56 a.setMainWidget( &w );
57 QPEApplication::showWidget( &w );
58 int result = a.exec();
59
60 lh.stopLircd();
61 lh.cleanupModules();
62
63 return result;
60} 64}