Diffstat (limited to 'noncore/tools/remote/remotetab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/remote/remotetab.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/tools/remote/remotetab.cpp b/noncore/tools/remote/remotetab.cpp index 64b8ee4..5b02e94 100644 --- a/noncore/tools/remote/remotetab.cpp +++ b/noncore/tools/remote/remotetab.cpp | |||
@@ -7,25 +7,25 @@ License as published by the Free Software Foundation; either version 2 of the Li | |||
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 "remotetab.h" | 17 | #include "remotetab.h" |
18 | 18 | ||
19 | RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | RemoteTab::RemoteTab(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QVBoxLayout *layout = new QVBoxLayout(this); | 21 | QVBoxLayout *layout = new QVBoxLayout(this); |
22 | 22 | ||
23 | topGroup = new TopGroup(this); | 23 | topGroup = new TopGroup(this); |
24 | //topGroup->setMaximumHeight(22); | 24 | //topGroup->setMaximumHeight(22); |
25 | layout->addWidget(topGroup, 0, 0); | 25 | layout->addWidget(topGroup, 0, 0); |
26 | printf("%d %d", topGroup->width(), topGroup->height()); | 26 | printf("%d %d", topGroup->width(), topGroup->height()); |
27 | 27 | ||
28 | layout->addSpacing(1); | 28 | layout->addSpacing(1); |
29 | 29 | ||
30 | dvdGroup = new DVDGroup(this); | 30 | dvdGroup = new DVDGroup(this); |
31 | //dvdGroup->setMaximumHeight(68); | 31 | //dvdGroup->setMaximumHeight(68); |
@@ -62,29 +62,29 @@ int RemoteTab::sendIR() | |||
62 | 62 | ||
63 | fd = socket(AF_UNIX, SOCK_STREAM, 0); | 63 | fd = socket(AF_UNIX, SOCK_STREAM, 0); |
64 | if(fd == -1) | 64 | if(fd == -1) |
65 | { | 65 | { |
66 | QMessageBox *mb = new QMessageBox("Error!", | 66 | QMessageBox *mb = new QMessageBox("Error!", |
67 | "couldnt connect to socket", | 67 | "couldnt connect to socket", |
68 | QMessageBox::NoIcon, | 68 | QMessageBox::NoIcon, |
69 | QMessageBox::Ok, | 69 | QMessageBox::Ok, |
70 | QMessageBox::NoButton, | 70 | QMessageBox::NoButton, |
71 | QMessageBox::NoButton); | 71 | QMessageBox::NoButton); |
72 | mb->exec(); | 72 | mb->exec(); |
73 | perror("RemoteTab::SendIR"); | 73 | perror("RemoteTab::SendIR"); |
74 | return NULL; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | 77 | ||
78 | if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | 78 | if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) |
79 | { | 79 | { |
80 | QMessageBox *mb = new QMessageBox("Error!", | 80 | QMessageBox *mb = new QMessageBox("Error!", |
81 | "couldnt connect to socket", | 81 | "couldnt connect to socket", |
82 | QMessageBox::NoIcon, | 82 | QMessageBox::NoIcon, |
83 | QMessageBox::Ok, | 83 | QMessageBox::Ok, |
84 | QMessageBox::NoButton, | 84 | QMessageBox::NoButton, |
85 | QMessageBox::NoButton); | 85 | QMessageBox::NoButton); |
86 | mb->exec(); | 86 | mb->exec(); |
87 | perror("RemoteTab::SendIR"); | 87 | perror("RemoteTab::SendIR"); |
88 | } | 88 | } |
89 | 89 | ||
90 | printf("fd2: %d\n", fd); | 90 | printf("fd2: %d\n", fd); |
@@ -94,25 +94,25 @@ int RemoteTab::sendIR() | |||
94 | printf("%d\n", write(fd, write_buffer, strlen(write_buffer) ) ); | 94 | printf("%d\n", write(fd, write_buffer, strlen(write_buffer) ) ); |
95 | printf("2\n"); | 95 | printf("2\n"); |
96 | while(!done) | 96 | while(!done) |
97 | { | 97 | { |
98 | read_buffer=readPacket(); | 98 | read_buffer=readPacket(); |
99 | printf("%s\n", read_buffer); | 99 | printf("%s\n", read_buffer); |
100 | if(strcasecmp(read_buffer, "END") == 0) | 100 | if(strcasecmp(read_buffer, "END") == 0) |
101 | { | 101 | { |
102 | printf("done reading packet\n"); | 102 | printf("done reading packet\n"); |
103 | done=true; | 103 | done=true; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | std::close(fd); | 106 | ::close(fd); |
107 | } | 107 | } |
108 | 108 | ||
109 | // printf("%s\n", readPacket()); | 109 | // printf("%s\n", readPacket()); |
110 | // printf("%d\n", read(fd, read_buffer,sizeof(read_buffer)) ); | 110 | // printf("%d\n", read(fd, read_buffer,sizeof(read_buffer)) ); |
111 | // printf("%s", read_buffer); | 111 | // printf("%s", read_buffer); |
112 | 112 | ||
113 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html | 113 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html |
114 | const char *RemoteTab::readPacket() | 114 | const char *RemoteTab::readPacket() |
115 | { | 115 | { |
116 | static char buffer[PACKET_SIZE+1]=""; | 116 | static char buffer[PACKET_SIZE+1]=""; |
117 | char *end; | 117 | char *end; |
118 | static int ptr=0,end_len=0; | 118 | static int ptr=0,end_len=0; |