summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/remote.cpp
Unidiff
Diffstat (limited to 'noncore/tools/remote/remote.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/remote.cpp73
1 files changed, 14 insertions, 59 deletions
diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp
index 35d06bc..67fc57d 100644
--- a/noncore/tools/remote/remote.cpp
+++ b/noncore/tools/remote/remote.cpp
@@ -37,69 +37,24 @@ 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
40/*void reconnect(int &fd)
41{
42 //struct sockaddr_un addr;
43
44 addr.sun_family=AF_UNIX;
45 strcpy(addr.sun_path,"/dev/lircd");
46 fd = socket(AF_UNIX, SOCK_STREAM, 0);
47
48 if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
49 {
50 QMessageBox *mb = new QMessageBox("error",
51 "couldnt connect to socket",
52 QMessageBox::NoIcon,
53 QMessageBox::Ok,
54 QMessageBox::NoButton,
55 QMessageBox::NoButton);
56 mb->exec();
57 }
58}
59*/
60
61int main( int argc, char **argv ) 40int main( int argc, char **argv )
62{ 41{
63 QPEApplication a( argc, argv ); 42 QPEApplication a( argc, argv );
64 MainView w; 43 MainView w;
65
66 int fd;
67 //struct sockaddr_un addr;
68 //char read_buffer[BUFFERSIZE+1];
69 //char write_buffer[] = "LIST\n";
70
71 //addr.sun_family=AF_UNIX;
72 //strcpy(addr.sun_path,"/dev/lircd");
73 //fd = socket(AF_UNIX, SOCK_STREAM, 0);
74
75 //printf("fd1: %d\n", fd);
76 /*
77 if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
78 {
79 QMessageBox *mb = new QMessageBox("error",
80 "couldnt connect to socket",
81 QMessageBox::NoIcon,
82 QMessageBox::Ok,
83 QMessageBox::NoButton,
84 QMessageBox::NoButton);
85 mb->exec();
86 }
87 */
88
89 //printf("%d\n", write(fd, write_buffer, sizeof(write_buffer) ) );
90
91 //printf("%d\n", read(fd, read_buffer, BUFFERSIZE ) );
92
93 //QMessageBox *mbtest = new QMessageBox("lirc test",
94 // *new QString((const char *) read_buffer),
95 // QMessageBox::NoIcon,
96 // QMessageBox::Ok,
97 // QMessageBox::NoButton,
98 // QMessageBox::NoButton);
99 //mbtest->exec();
100
101 a.setMainWidget( &w ); 44 a.setMainWidget( &w );
102 w.setIRSocket(fd);
103 QPEApplication::showWidget( &w ); 45 QPEApplication::showWidget( &w );
104 return a.exec(); 46
47 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
57 }
58
59 return a.exec();
105} 60}