summaryrefslogtreecommitdiff
path: root/noncore/tools/remote
authorzecke <zecke>2002-06-23 14:19:13 (UTC)
committer zecke <zecke>2002-06-23 14:19:13 (UTC)
commitce9178fb13908eca5b7835e785fc0914a5022615 (patch) (unidiff)
treed848ef07fb25ba6c21d3729140c4e3be9d69f6f6 /noncore/tools/remote
parent3b02ead2254e59159db948d2a0980892eeb14ed8 (diff)
downloadopie-ce9178fb13908eca5b7835e785fc0914a5022615.zip
opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.gz
opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.bz2
Simon thanks for the patch. Some clean ups. Patch provided by tronical
OAOAOAOAOAOAOAOAOAOAOAOAOBOBCVS: noncore/tools/remote/dvdgroupconf.cpp
Diffstat (limited to 'noncore/tools/remote') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/buttondialog.cpp10
-rw-r--r--noncore/tools/remote/channelgroup.cpp2
-rw-r--r--noncore/tools/remote/channelgroupconf.cpp2
-rw-r--r--noncore/tools/remote/configtab.cpp2
-rw-r--r--noncore/tools/remote/dvdgroup.cpp2
-rw-r--r--noncore/tools/remote/dvdgroupconf.cpp2
-rw-r--r--noncore/tools/remote/learntab.cpp2
-rw-r--r--noncore/tools/remote/mainview.cpp2
-rw-r--r--noncore/tools/remote/remotetab.cpp8
-rw-r--r--noncore/tools/remote/topgroup.cpp2
-rw-r--r--noncore/tools/remote/topgroupconf.cpp2
-rw-r--r--noncore/tools/remote/vcrgroup.cpp2
-rw-r--r--noncore/tools/remote/vcrgroupconf.cpp2
13 files changed, 20 insertions, 20 deletions
diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp
index 7479e85..6ea4801 100644
--- a/noncore/tools/remote/buttondialog.cpp
+++ b/noncore/tools/remote/buttondialog.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "buttondialog.h" 17#include "buttondialog.h"
18 18
19ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent=0, const char*name=0, bool modal=FALSE, WFlags f=0):QDialog(parent, name, modal, f) 19ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f)
20{ 20{
21 setCaption(tr(buttonName)); 21 setCaption(tr(buttonName));
22 22
23 QVBoxLayout *layout = new QVBoxLayout(this); 23 QVBoxLayout *layout = new QVBoxLayout(this);
24 24
25 QHBoxLayout *hlayout1 = new QHBoxLayout(this); 25 QHBoxLayout *hlayout1 = new QHBoxLayout(this);
26 QHBoxLayout *hlayout2 = new QHBoxLayout(this); 26 QHBoxLayout *hlayout2 = new QHBoxLayout(this);
27 QHBoxLayout *hlayout3 = new QHBoxLayout(this); 27 QHBoxLayout *hlayout3 = new QHBoxLayout(this);
28 28
29 layout->addSpacing(5); 29 layout->addSpacing(5);
30 layout->addLayout(hlayout1); 30 layout->addLayout(hlayout1);
31 layout->addSpacing(5); 31 layout->addSpacing(5);
32 layout->addLayout(hlayout2); 32 layout->addLayout(hlayout2);
33 layout->addSpacing(5); 33 layout->addSpacing(5);
34 layout->addLayout(hlayout3); 34 layout->addLayout(hlayout3);
35 layout->addSpacing(5); 35 layout->addSpacing(5);
36 36
37 remote = new QComboBox(false, this, "remote"); 37 remote = new QComboBox(false, this, "remote");
38 QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel"); 38 QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel");
39 hlayout1->addSpacing(5); 39 hlayout1->addSpacing(5);
40 hlayout1->addWidget(remoteLabel); 40 hlayout1->addWidget(remoteLabel);
41 hlayout1->addSpacing(5); 41 hlayout1->addSpacing(5);
42 hlayout1->addWidget(remote); 42 hlayout1->addWidget(remote);
43 hlayout1->addSpacing(5); 43 hlayout1->addSpacing(5);
@@ -90,168 +90,168 @@ QString ButtonDialog::getLabel()
90QStringList ButtonDialog::getRemotes() 90QStringList ButtonDialog::getRemotes()
91{ 91{
92 const char write_buffer[] = "LIST\n"; 92 const char write_buffer[] = "LIST\n";
93 const char *readbuffer; 93 const char *readbuffer;
94 int i, numlines; 94 int i, numlines;
95 QStringList list; 95 QStringList list;
96 96
97 addr.sun_family=AF_UNIX; 97 addr.sun_family=AF_UNIX;
98 strcpy(addr.sun_path,"/dev/lircd"); 98 strcpy(addr.sun_path,"/dev/lircd");
99 99
100 fd = socket(AF_UNIX, SOCK_STREAM, 0); 100 fd = socket(AF_UNIX, SOCK_STREAM, 0);
101 if(fd == -1) 101 if(fd == -1)
102 { 102 {
103 QMessageBox *mb = new QMessageBox("Error!", 103 QMessageBox *mb = new QMessageBox("Error!",
104 "couldnt connect to socket", 104 "couldnt connect to socket",
105 QMessageBox::NoIcon, 105 QMessageBox::NoIcon,
106 QMessageBox::Ok, 106 QMessageBox::Ok,
107 QMessageBox::NoButton, 107 QMessageBox::NoButton,
108 QMessageBox::NoButton); 108 QMessageBox::NoButton);
109 mb->exec(); 109 mb->exec();
110 perror("ButtonDialog::GetRemotes"); 110 perror("ButtonDialog::GetRemotes");
111 return NULL; 111 return NULL;
112 } 112 }
113 113
114 if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) 114 if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
115 { 115 {
116 QMessageBox *mb = new QMessageBox("Error!", 116 QMessageBox *mb = new QMessageBox("Error!",
117 "couldnt connect to socket", 117 "couldnt connect to socket",
118 QMessageBox::NoIcon, 118 QMessageBox::NoIcon,
119 QMessageBox::Ok, 119 QMessageBox::Ok,
120 QMessageBox::NoButton, 120 QMessageBox::NoButton,
121 QMessageBox::NoButton); 121 QMessageBox::NoButton);
122 mb->exec(); 122 mb->exec();
123 perror("ButtonDialog::GetRemotes"); 123 perror("ButtonDialog::GetRemotes");
124 return NULL; 124 return NULL;
125 } 125 }
126 126
127 write(fd, write_buffer, strlen(write_buffer)); 127 write(fd, write_buffer, strlen(write_buffer));
128 128
129 for(i=0; i<5; i++) 129 for(i=0; i<5; i++)
130 { 130 {
131 printf("%d\n", i); 131 printf("%d\n", i);
132 readbuffer = readPacket(); 132 readbuffer = readPacket();
133 printf("%s", readbuffer); 133 printf("%s", readbuffer);
134 printf("%d\n", i); 134 printf("%d\n", i);
135 } 135 }
136 136
137 numlines = atoi(readbuffer); 137 numlines = atoi(readbuffer);
138 138
139 for(i=0; i<numlines; i++) 139 for(i=0; i<numlines; i++)
140 { 140 {
141 list+=readPacket(); 141 list+=readPacket();
142 } 142 }
143 143
144 if(strcasecmp(readPacket(), "END") != 0) 144 if(strcasecmp(readPacket(), "END") != 0)
145 { 145 {
146 QMessageBox *mb = new QMessageBox("Error!", 146 QMessageBox *mb = new QMessageBox("Error!",
147 "bad packet", 147 "bad packet",
148 QMessageBox::NoIcon, 148 QMessageBox::NoIcon,
149 QMessageBox::Ok, 149 QMessageBox::Ok,
150 QMessageBox::NoButton, 150 QMessageBox::NoButton,
151 QMessageBox::NoButton); 151 QMessageBox::NoButton);
152 mb->exec(); 152 mb->exec();
153 perror("ButtonDialog::GetRemotes"); 153 perror("ButtonDialog::GetRemotes");
154 return NULL; 154 return NULL;
155 } 155 }
156 156
157 std::close(fd); 157 ::close(fd);
158 return list; 158 return list;
159} 159}
160 160
161QStringList ButtonDialog::getButtons(const char *remoteName) 161QStringList ButtonDialog::getButtons(const char *remoteName)
162{ 162{
163 QString write_buffer = "LIST "; 163 QString write_buffer = "LIST ";
164 const char *readbuffer; 164 const char *readbuffer;
165 int i, j, numlines; 165 int i, j, numlines;
166 QStringList list; 166 QStringList list;
167 QString string; 167 QString string;
168 168
169 write_buffer += remoteName; 169 write_buffer += remoteName;
170 write_buffer += '\n'; 170 write_buffer += '\n';
171 171
172 fd = socket(AF_UNIX, SOCK_STREAM, 0); 172 fd = socket(AF_UNIX, SOCK_STREAM, 0);
173 if(fd == -1) 173 if(fd == -1)
174 { 174 {
175 QMessageBox *mb = new QMessageBox("Error!", 175 QMessageBox *mb = new QMessageBox("Error!",
176 "couldnt connect to socket", 176 "couldnt connect to socket",
177 QMessageBox::NoIcon, 177 QMessageBox::NoIcon,
178 QMessageBox::Ok, 178 QMessageBox::Ok,
179 QMessageBox::NoButton, 179 QMessageBox::NoButton,
180 QMessageBox::NoButton); 180 QMessageBox::NoButton);
181 mb->exec(); 181 mb->exec();
182 perror("ButtonDialog::GetButtons"); 182 perror("ButtonDialog::GetButtons");
183 return NULL; 183 return NULL;
184 } 184 }
185 185
186 186
187 if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) 187 if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
188 { 188 {
189 QMessageBox *mb = new QMessageBox("Error!", 189 QMessageBox *mb = new QMessageBox("Error!",
190 "couldnt connect to socket", 190 "couldnt connect to socket",
191 QMessageBox::NoIcon, 191 QMessageBox::NoIcon,
192 QMessageBox::Ok, 192 QMessageBox::Ok,
193 QMessageBox::NoButton, 193 QMessageBox::NoButton,
194 QMessageBox::NoButton); 194 QMessageBox::NoButton);
195 mb->exec(); 195 mb->exec();
196 perror("ButtonDialog::GetButtons"); 196 perror("ButtonDialog::GetButtons");
197 return NULL; 197 return NULL;
198 } 198 }
199 199
200 write(fd, write_buffer.latin1(), strlen(write_buffer) ); 200 write(fd, write_buffer.latin1(), strlen(write_buffer) );
201 201
202 for(i=0; i<5; i++) 202 for(i=0; i<5; i++)
203 { 203 {
204 readbuffer = readPacket(); 204 readbuffer = readPacket();
205 } 205 }
206 206
207 numlines = atoi(readbuffer); 207 numlines = atoi(readbuffer);
208 208
209 for(i=0; i<numlines; i++) 209 for(i=0; i<numlines; i++)
210 { 210 {
211 list+=readPacket(); 211 list+=readPacket();
212 for(j=0; j<list[i].length(); j++) 212 for(j=0; j<list[i].length(); j++)
213 { 213 {
214 if(list[i][j] == ' ') 214 if(list[i][j] == ' ')
215 break; 215 break;
216 } 216 }
217 list[i].remove(0, j+1); 217 list[i].remove(0, j+1);
218 } 218 }
219 219
220 if(strcasecmp(readPacket(), "END") != 0) 220 if(strcasecmp(readPacket(), "END") != 0)
221 { 221 {
222 QMessageBox *mb = new QMessageBox("Error!", 222 QMessageBox *mb = new QMessageBox("Error!",
223 "bad packet", 223 "bad packet",
224 QMessageBox::NoIcon, 224 QMessageBox::NoIcon,
225 QMessageBox::Ok, 225 QMessageBox::Ok,
226 QMessageBox::NoButton, 226 QMessageBox::NoButton,
227 QMessageBox::NoButton); 227 QMessageBox::NoButton);
228 mb->exec(); 228 mb->exec();
229 perror("ButtonDialog::GetButtons"); 229 perror("ButtonDialog::GetButtons");
230 return NULL; 230 return NULL;
231 } 231 }
232 232
233 std::close(fd); 233 ::close(fd);
234 return list; 234 return list;
235} 235}
236 236
237 237
238//this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html 238//this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html
239const char *ButtonDialog::readPacket() 239const char *ButtonDialog::readPacket()
240{ 240{
241 static char buffer[PACKET_SIZE+1]=""; 241 static char buffer[PACKET_SIZE+1]="";
242 char *end; 242 char *end;
243 static int ptr=0,end_len=0; 243 static int ptr=0,end_len=0;
244 ssize_t ret; 244 ssize_t ret;
245 timeout = 0; 245 timeout = 0;
246 246
247 if(ptr>0) 247 if(ptr>0)
248 { 248 {
249 memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); 249 memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1);
250 ptr=strlen(buffer); 250 ptr=strlen(buffer);
251 end=strchr(buffer,'\n'); 251 end=strchr(buffer,'\n');
252 } 252 }
253 else 253 else
254 { 254 {
255 end=NULL; 255 end=NULL;
256 } 256 }
257 alarm(TIMEOUT); 257 alarm(TIMEOUT);
diff --git a/noncore/tools/remote/channelgroup.cpp b/noncore/tools/remote/channelgroup.cpp
index 9f90284..7c33674 100644
--- a/noncore/tools/remote/channelgroup.cpp
+++ b/noncore/tools/remote/channelgroup.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "channelgroup.h" 17#include "channelgroup.h"
18 18
19ChannelGroup::ChannelGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19ChannelGroup::ChannelGroup(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QGridLayout *layout = new QGridLayout(this); 21 QGridLayout *layout = new QGridLayout(this);
22 QVBoxLayout *volLayout = new QVBoxLayout(this); 22 QVBoxLayout *volLayout = new QVBoxLayout(this);
23 QVBoxLayout *chanLayout = new QVBoxLayout(this); 23 QVBoxLayout *chanLayout = new QVBoxLayout(this);
24 24
25 layout->addRowSpacing(1,1); 25 layout->addRowSpacing(1,1);
26 layout->addRowSpacing(3,1); 26 layout->addRowSpacing(3,1);
27 layout->addRowSpacing(5,1); 27 layout->addRowSpacing(5,1);
28 28
29 layout->addColSpacing(1,1); 29 layout->addColSpacing(1,1);
30 layout->addColSpacing(3,1); 30 layout->addColSpacing(3,1);
31 layout->addColSpacing(5,1); 31 layout->addColSpacing(5,1);
32 layout->addColSpacing(7,1); 32 layout->addColSpacing(7,1);
33 33
34 QPushButton *one = new QPushButton("1", this, "one"); 34 QPushButton *one = new QPushButton("1", this, "one");
35 layout->addWidget(one, 0, 2, 0); 35 layout->addWidget(one, 0, 2, 0);
36 connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 36 connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
37 37
38 QPushButton *two = new QPushButton("2", this, "two"); 38 QPushButton *two = new QPushButton("2", this, "two");
39 layout->addWidget(two, 0, 4, 0); 39 layout->addWidget(two, 0, 4, 0);
40 connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 40 connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
41 41
42 QPushButton *three = new QPushButton("3", this, "three"); 42 QPushButton *three = new QPushButton("3", this, "three");
43 layout->addWidget(three, 0, 6, 0); 43 layout->addWidget(three, 0, 6, 0);
diff --git a/noncore/tools/remote/channelgroupconf.cpp b/noncore/tools/remote/channelgroupconf.cpp
index 2d98115..e39121e 100644
--- a/noncore/tools/remote/channelgroupconf.cpp
+++ b/noncore/tools/remote/channelgroupconf.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "channelgroupconf.h" 17#include "channelgroupconf.h"
18 18
19ChannelGroupConf::ChannelGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19ChannelGroupConf::ChannelGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QGridLayout *layout = new QGridLayout(this); 21 QGridLayout *layout = new QGridLayout(this);
22 QVBoxLayout *volLayout = new QVBoxLayout(this); 22 QVBoxLayout *volLayout = new QVBoxLayout(this);
23 QVBoxLayout *chanLayout = new QVBoxLayout(this); 23 QVBoxLayout *chanLayout = new QVBoxLayout(this);
24 24
25 layout->addRowSpacing(1,5); 25 layout->addRowSpacing(1,5);
26 layout->addRowSpacing(3,5); 26 layout->addRowSpacing(3,5);
27 layout->addRowSpacing(5,5); 27 layout->addRowSpacing(5,5);
28 28
29 layout->addColSpacing(1,1); 29 layout->addColSpacing(1,1);
30 layout->addColSpacing(3,1); 30 layout->addColSpacing(3,1);
31 layout->addColSpacing(5,1); 31 layout->addColSpacing(5,1);
32 layout->addColSpacing(7,1); 32 layout->addColSpacing(7,1);
33 33
34 QPushButton *one = new QPushButton("1", this, "one"); 34 QPushButton *one = new QPushButton("1", this, "one");
35 layout->addWidget(one, 0, 2, 0); 35 layout->addWidget(one, 0, 2, 0);
36 connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 36 connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
37 37
38 QPushButton *two = new QPushButton("2", this, "two"); 38 QPushButton *two = new QPushButton("2", this, "two");
39 layout->addWidget(two, 0, 4, 0); 39 layout->addWidget(two, 0, 4, 0);
40 connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 40 connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
41 41
42 QPushButton *three = new QPushButton("3", this, "three"); 42 QPushButton *three = new QPushButton("3", this, "three");
43 layout->addWidget(three, 0, 6, 0); 43 layout->addWidget(three, 0, 6, 0);
diff --git a/noncore/tools/remote/configtab.cpp b/noncore/tools/remote/configtab.cpp
index f5896a9..17cdc6a 100644
--- a/noncore/tools/remote/configtab.cpp
+++ b/noncore/tools/remote/configtab.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "configtab.h" 17#include "configtab.h"
18 18
19ConfigTab::ConfigTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19ConfigTab::ConfigTab(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 21
22 QVBoxLayout *layout = new QVBoxLayout(this); 22 QVBoxLayout *layout = new QVBoxLayout(this);
23 23
24 topGroupConf = new TopGroupConf(this, "topGroupConf"); 24 topGroupConf = new TopGroupConf(this, "topGroupConf");
25 layout->addWidget(topGroupConf, 1); 25 layout->addWidget(topGroupConf, 1);
26 layout->addSpacing(1); 26 layout->addSpacing(1);
27 27
28 dvdGroupConf = new DVDGroupConf(this, "dvdGroupConf"); 28 dvdGroupConf = new DVDGroupConf(this, "dvdGroupConf");
29 layout->addWidget(dvdGroupConf, 1); 29 layout->addWidget(dvdGroupConf, 1);
30 layout->addSpacing(1); 30 layout->addSpacing(1);
31 31
32 vcrGroupConf = new VCRGroupConf(this, "vcrGroupConf"); 32 vcrGroupConf = new VCRGroupConf(this, "vcrGroupConf");
33 layout->addWidget(vcrGroupConf, 1); 33 layout->addWidget(vcrGroupConf, 1);
34 layout->addSpacing(1); 34 layout->addSpacing(1);
35 35
36 channelGroupConf = new ChannelGroupConf(this, "channelGroupConf"); 36 channelGroupConf = new ChannelGroupConf(this, "channelGroupConf");
37 layout->addWidget(channelGroupConf, 1); 37 layout->addWidget(channelGroupConf, 1);
38 38
39 39
40} 40}
41 41
42void ConfigTab::setConfig(Config *newCfg) 42void ConfigTab::setConfig(Config *newCfg)
43{ 43{
diff --git a/noncore/tools/remote/dvdgroup.cpp b/noncore/tools/remote/dvdgroup.cpp
index a75c48a..d7ff515 100644
--- a/noncore/tools/remote/dvdgroup.cpp
+++ b/noncore/tools/remote/dvdgroup.cpp
@@ -1,49 +1,49 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under 5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public 6the terms of the GNU General Public
7License as published by the Free Software Foundation; either version 2 of the 7License as published by the Free Software Foundation; either version 2 of the
8License, or (at your option) any later 8License, or (at your option) any later
9version. 9version.
10 10
11This program is distributed in the hope that it will be useful, but WITHOUT ANY 11This program is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the 12WARRANTY; without even the
13implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14
15GNU General 15GNU General
16Public License for more details. 16Public License for more details.
17 17
18You should have received a copy of the GNU General Public License along with 18You should have received a copy of the GNU General Public License along with
19this program; if not, write to the Free 19this program; if not, write to the Free
20Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/ 21*/
22 22
23#include "dvdgroup.h" 23#include "dvdgroup.h"
24 24
25DVDGroup::DVDGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) 25DVDGroup::DVDGroup(QWidget *parent, const char *name):QWidget(parent,name)
26{ 26{
27 QGridLayout *layout = new QGridLayout(this); 27 QGridLayout *layout = new QGridLayout(this);
28 28
29//put rows between the buttons of size 1 29//put rows between the buttons of size 1
30 layout->addRowSpacing(1,1); 30 layout->addRowSpacing(1,1);
31 layout->addRowSpacing(3,1); 31 layout->addRowSpacing(3,1);
32 32
33//put collumns between the buttons of size 5 33//put collumns between the buttons of size 5
34 layout->addColSpacing(1,5); 34 layout->addColSpacing(1,5);
35 layout->addColSpacing(3,5); 35 layout->addColSpacing(3,5);
36 layout->addColSpacing(5,5); 36 layout->addColSpacing(5,5);
37 layout->addColSpacing(7,5); 37 layout->addColSpacing(7,5);
38 38
39//make sure that the collumns with the buttons in them stretch before the filler collumns do 39//make sure that the collumns with the buttons in them stretch before the filler collumns do
40//since there is so little room, there is no need to do this for the rows 40//since there is so little room, there is no need to do this for the rows
41 layout->setColStretch(4,1); 41 layout->setColStretch(4,1);
42 layout->setColStretch(2,1); 42 layout->setColStretch(2,1);
43 layout->setColStretch(6,1); 43 layout->setColStretch(6,1);
44 layout->setColStretch(8,1); 44 layout->setColStretch(8,1);
45 layout->setColStretch(0,1); 45 layout->setColStretch(0,1);
46 46
47//add the menu navigation buttons, and connect them to the RemoteTab slots... 47//add the menu navigation buttons, and connect them to the RemoteTab slots...
48 QPushButton *up = new QPushButton("Up", this,"up"); 48 QPushButton *up = new QPushButton("Up", this,"up");
49 layout->addWidget(up, 0, 4, 0); 49 layout->addWidget(up, 0, 4, 0);
diff --git a/noncore/tools/remote/dvdgroupconf.cpp b/noncore/tools/remote/dvdgroupconf.cpp
index 5bfe393..2a08ab6 100644
--- a/noncore/tools/remote/dvdgroupconf.cpp
+++ b/noncore/tools/remote/dvdgroupconf.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "dvdgroupconf.h" 17#include "dvdgroupconf.h"
18 18
19DVDGroupConf::DVDGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19DVDGroupConf::DVDGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QGridLayout *layout = new QGridLayout(this); 21 QGridLayout *layout = new QGridLayout(this);
22 22
23//put rows between the buttons of size 1 23//put rows between the buttons of size 1
24 layout->addRowSpacing(1,1); 24 layout->addRowSpacing(1,1);
25 layout->addRowSpacing(3,1); 25 layout->addRowSpacing(3,1);
26 26
27//put collumns between the buttons of size 5 27//put collumns between the buttons of size 5
28 layout->addColSpacing(1,5); 28 layout->addColSpacing(1,5);
29 layout->addColSpacing(3,5); 29 layout->addColSpacing(3,5);
30 layout->addColSpacing(5,5); 30 layout->addColSpacing(5,5);
31 layout->addColSpacing(7,5); 31 layout->addColSpacing(7,5);
32 32
33//make sure that the collumns with the buttons in them stretch before the filler collumns do 33//make sure that the collumns with the buttons in them stretch before the filler collumns do
34//since there is so little room, there is no need to do this for the rows 34//since there is so little room, there is no need to do this for the rows
35 layout->setColStretch(4,1); 35 layout->setColStretch(4,1);
36 layout->setColStretch(2,1); 36 layout->setColStretch(2,1);
37 layout->setColStretch(6,1); 37 layout->setColStretch(6,1);
38 layout->setColStretch(8,1); 38 layout->setColStretch(8,1);
39 layout->setColStretch(0,1); 39 layout->setColStretch(0,1);
40 40
41//add the menu navigation buttons, and connect them to the RemoteTab slots... 41//add the menu navigation buttons, and connect them to the RemoteTab slots...
42 QPushButton *up = new QPushButton("Up",this,"up"); 42 QPushButton *up = new QPushButton("Up",this,"up");
43 layout->addWidget(up, 0, 4, 0); 43 layout->addWidget(up, 0, 4, 0);
diff --git a/noncore/tools/remote/learntab.cpp b/noncore/tools/remote/learntab.cpp
index 054bc7b..998f449 100644
--- a/noncore/tools/remote/learntab.cpp
+++ b/noncore/tools/remote/learntab.cpp
@@ -1,26 +1,26 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "learntab.h" 17#include "learntab.h"
18 18
19LearnTab::LearnTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19LearnTab::LearnTab(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QVBoxLayout *layout = new QVBoxLayout(this); 21 QVBoxLayout *layout = new QVBoxLayout(this);
22 QString *string = new QString("<qt><h1>Opie-Remote Usage Instructions</h1><p>First, some definitions. A Remote is a remote entry in an lircd.conf file, it represents one remote you want to emulate. A Remote Layout is one entry in your ~/Settings/Remote.conf file. It represents the buttons that you see on your screen. Each button on a Remote Layout can be mapped to any button in a Remote. This way you can have, for example, a vcr remote layout, in which all the play/pause/etc buttons are mapped to the buttons on your vcr's remote. However, most VCR's don't have volume controls, so the volume buttons can be mapped to the volume buttons on your TV.</p><p>The first things you need the lirc and lirc-modules ipkgs. If you installed this from an ipkg, they should already be there, thanks to the wonderful world of dependencies. If not, get them. The next thing you need is an lircd.conf file. you can get these at <a href=http://www.lirc.org/>http://www.lirc.org/</a>. Read the documentation there to figure out how to make your own, if one for your remote doesn't exist, or how to have multiple remotes in one lircd.conf file. Once you have a good lircd.conf file, put it in /etc, kill the lircd daemon (if its running) and do a modprobe lirc_sir. Then, run lircd again.</p><p>The next thing you want to do is to create a remote layout. Go to the config tab, and enter a name for your remote layout in the pulldown menu. Dont use the name Remotes, as that could confuse the app. Hopefully, that will be fixed soon. after entering the name you want to use, press New, and then select the name again from the pulldown menu (another oddity that i hope to fix). Then, press each button that you want to map, and a dialog should appear. Select the remote and button that you want to use, and click OK. Once you are done, go to the Remote tab, and select the new remote from the dropdown menu. It should works fine. If at any time you want to change a remote layout, go to the Config tab, select the layout from the dropdown menu, and change the buttons you want to change.</p><p>This is program is written and maintaned by Thomas (spiralman) Stephens. <a href=mailto:spiralman@softhome.net>spiralman@softhome.net</a>. Or, look for me on #opie or #handhelds.org on irc.openprojects.net.</p></qt>"); 22 QString *string = new QString("<qt><h1>Opie-Remote Usage Instructions</h1><p>First, some definitions. A Remote is a remote entry in an lircd.conf file, it represents one remote you want to emulate. A Remote Layout is one entry in your ~/Settings/Remote.conf file. It represents the buttons that you see on your screen. Each button on a Remote Layout can be mapped to any button in a Remote. This way you can have, for example, a vcr remote layout, in which all the play/pause/etc buttons are mapped to the buttons on your vcr's remote. However, most VCR's don't have volume controls, so the volume buttons can be mapped to the volume buttons on your TV.</p><p>The first things you need the lirc and lirc-modules ipkgs. If you installed this from an ipkg, they should already be there, thanks to the wonderful world of dependencies. If not, get them. The next thing you need is an lircd.conf file. you can get these at <a href=http://www.lirc.org/>http://www.lirc.org/</a>. Read the documentation there to figure out how to make your own, if one for your remote doesn't exist, or how to have multiple remotes in one lircd.conf file. Once you have a good lircd.conf file, put it in /etc, kill the lircd daemon (if its running) and do a modprobe lirc_sir. Then, run lircd again.</p><p>The next thing you want to do is to create a remote layout. Go to the config tab, and enter a name for your remote layout in the pulldown menu. Dont use the name Remotes, as that could confuse the app. Hopefully, that will be fixed soon. after entering the name you want to use, press New, and then select the name again from the pulldown menu (another oddity that i hope to fix). Then, press each button that you want to map, and a dialog should appear. Select the remote and button that you want to use, and click OK. Once you are done, go to the Remote tab, and select the new remote from the dropdown menu. It should works fine. If at any time you want to change a remote layout, go to the Config tab, select the layout from the dropdown menu, and change the buttons you want to change.</p><p>This is program is written and maintaned by Thomas (spiralman) Stephens. <a href=mailto:spiralman@softhome.net>spiralman@softhome.net</a>. Or, look for me on #opie or #handhelds.org on irc.openprojects.net.</p></qt>");
23 23
24 QTextView *textView = new QTextView(*string, 0, this); 24 QTextView *textView = new QTextView(*string, 0, this);
25 layout->addWidget(textView); 25 layout->addWidget(textView);
26} 26}
diff --git a/noncore/tools/remote/mainview.cpp b/noncore/tools/remote/mainview.cpp
index 47027fb..a7be9e3 100644
--- a/noncore/tools/remote/mainview.cpp
+++ b/noncore/tools/remote/mainview.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software 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
19MainView::MainView(QWidget *parent, const char *name=0) : QWidget(parent, name) 19MainView::MainView(QWidget *parent, const char *name) : QWidget(parent, name)
20{ 20{
21 setIcon( Resource::loadPixmap( "remote" ) ); 21 setIcon( Resource::loadPixmap( "remote" ) );
22 setCaption(tr("Remote") ); 22 setCaption(tr("Remote") );
23 23
24 QVBoxLayout *layout = new QVBoxLayout(this); 24 QVBoxLayout *layout = new QVBoxLayout(this);
25 QTabWidget *tabs = new QTabWidget(this); 25 QTabWidget *tabs = new QTabWidget(this);
26 26
27 layout->addWidget(tabs); 27 layout->addWidget(tabs);
28 28
29 printf("MainView: 1\n"); 29 printf("MainView: 1\n");
30 remote = new RemoteTab(tabs); 30 remote = new RemoteTab(tabs);
31 printf("MainView: 2\n"); 31 printf("MainView: 2\n");
32 learn = new LearnTab(tabs); 32 learn = new LearnTab(tabs);
33 printf("MainView: 3\n"); 33 printf("MainView: 3\n");
34 config = new ConfigTab(tabs); 34 config = new ConfigTab(tabs);
35 printf("MainView: 4\n"); 35 printf("MainView: 4\n");
36 connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) ); 36 connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) );
37 printf("MainView: 5\n"); 37 printf("MainView: 5\n");
38 38
39 remote->setIRSocket(fd); 39 remote->setIRSocket(fd);
40 40
41 tabs->addTab(remote, tr("Remote") ); 41 tabs->addTab(remote, tr("Remote") );
42 tabs->addTab(learn,tr("Learn") ); 42 tabs->addTab(learn,tr("Learn") );
43 tabs->addTab(config,tr("Config") ); 43 tabs->addTab(config,tr("Config") );
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
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software 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
19RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19RemoteTab::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);
32 layout->addWidget(dvdGroup, 0, 0); 32 layout->addWidget(dvdGroup, 0, 0);
33 33
34 layout->addSpacing(1); 34 layout->addSpacing(1);
35 35
36 vcrGroup = new VCRGroup(this); 36 vcrGroup = new VCRGroup(this);
37 layout->addWidget(vcrGroup, 0, 0); 37 layout->addWidget(vcrGroup, 0, 0);
38 //vcrGroup->setMaximumHeight(45); 38 //vcrGroup->setMaximumHeight(45);
39 39
40 layout->addSpacing(1); 40 layout->addSpacing(1);
41 41
42 channelGroup = new ChannelGroup(this); 42 channelGroup = new ChannelGroup(this);
43 //channelGroup->setMaximumHeight(91); 43 //channelGroup->setMaximumHeight(91);
@@ -50,81 +50,81 @@ RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name)
50 addr.sun_family=AF_UNIX; 50 addr.sun_family=AF_UNIX;
51 strcpy(addr.sun_path,"/dev/lircd"); 51 strcpy(addr.sun_path,"/dev/lircd");
52} 52}
53 53
54int RemoteTab::sendIR() 54int RemoteTab::sendIR()
55{ 55{
56 const QObject *button = sender(); 56 const QObject *button = sender();
57 QString string = cfg->readEntry(button->name()); 57 QString string = cfg->readEntry(button->name());
58 string+='\n'; 58 string+='\n';
59 const char *write_buffer = string.latin1(); 59 const char *write_buffer = string.latin1();
60 const char *read_buffer; 60 const char *read_buffer;
61 bool done=false; 61 bool done=false;
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);
91 printf("%s", write_buffer); 91 printf("%s", write_buffer);
92 92
93 printf("1\n"); 93 printf("1\n");
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
114const char *RemoteTab::readPacket() 114const 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;
119 ssize_t ret; 119 ssize_t ret;
120 120
121 if(ptr>0) 121 if(ptr>0)
122 { 122 {
123 memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); 123 memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1);
124 ptr=strlen(buffer); 124 ptr=strlen(buffer);
125 end=strchr(buffer,'\n'); 125 end=strchr(buffer,'\n');
126 } 126 }
127 else 127 else
128 { 128 {
129 end=NULL; 129 end=NULL;
130 } 130 }
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp
index 94ea622..93cffbb 100644
--- a/noncore/tools/remote/topgroup.cpp
+++ b/noncore/tools/remote/topgroup.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "topgroup.h" 17#include "topgroup.h"
18 18
19TopGroup::TopGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); 21 QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0);
22 22
23 QPushButton *power = new QPushButton("Power",this,"power"); 23 QPushButton *power = new QPushButton("Power",this,"power");
24 layout->addWidget(power); 24 layout->addWidget(power);
25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
26 //power->setGeometry(5, 5,40, 20); 26 //power->setGeometry(5, 5,40, 20);
27 27
28 layout->addSpacing(5); 28 layout->addSpacing(5);
29 29
30 QPushButton *source = new QPushButton("Source",this,"source"); 30 QPushButton *source = new QPushButton("Source",this,"source");
31 layout->addWidget(source); 31 layout->addWidget(source);
32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
33 //source->setGeometry(50,5,40,20); 33 //source->setGeometry(50,5,40,20);
34 34
35 remotes = new QComboBox(false, this, "remotes"); 35 remotes = new QComboBox(false, this, "remotes");
36 connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); 36 connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
37 remotes->insertItem("Select Remote"); 37 remotes->insertItem("Select Remote");
38 //remotes->setGeometry(135,5,95,20); 38 //remotes->setGeometry(135,5,95,20);
39 39
40 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); 40 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
41 //remoteLabel->setGeometry(90,5,40,20); 41 //remoteLabel->setGeometry(90,5,40,20);
42 remoteLabel->setAlignment(AlignRight | AlignVCenter); 42 remoteLabel->setAlignment(AlignRight | AlignVCenter);
43 43
diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp
index eb071fb..d763a3a 100644
--- a/noncore/tools/remote/topgroupconf.cpp
+++ b/noncore/tools/remote/topgroupconf.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "topgroupconf.h" 17#include "topgroupconf.h"
18 18
19TopGroupConf::TopGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) 19TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QHBoxLayout *layout = new QHBoxLayout(this); 21 QHBoxLayout *layout = new QHBoxLayout(this);
22 22
23 QPushButton *power = new QPushButton("Power",this,"power"); 23 QPushButton *power = new QPushButton("Power",this,"power");
24 layout->addWidget(power); 24 layout->addWidget(power);
25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
26 //power->setGeometry(5, 5,40, 20); 26 //power->setGeometry(5, 5,40, 20);
27 27
28 layout->addSpacing(5); 28 layout->addSpacing(5);
29 29
30 QPushButton *source = new QPushButton("Source",this,"source"); 30 QPushButton *source = new QPushButton("Source",this,"source");
31 layout->addWidget(source); 31 layout->addWidget(source);
32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
33 //source->setGeometry(50,5,40,20); 33 //source->setGeometry(50,5,40,20);
34 34
35 remotes = new QComboBox(true, this, "remotes"); 35 remotes = new QComboBox(true, this, "remotes");
36 remotes->insertItem(QString("Remotes")); 36 remotes->insertItem(QString("Remotes"));
37 layout->addWidget(remotes); 37 layout->addWidget(remotes);
38 layout->setStretchFactor(remotes, 1); 38 layout->setStretchFactor(remotes, 1);
39 connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); 39 connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
40 40
41 41
42 QPushButton *newrem = new QPushButton("New", this, "new"); 42 QPushButton *newrem = new QPushButton("New", this, "new");
43 layout->addWidget(newrem); 43 layout->addWidget(newrem);
diff --git a/noncore/tools/remote/vcrgroup.cpp b/noncore/tools/remote/vcrgroup.cpp
index 4f07ca3..10ebe5d 100644
--- a/noncore/tools/remote/vcrgroup.cpp
+++ b/noncore/tools/remote/vcrgroup.cpp
@@ -1,49 +1,49 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under 5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public 6the terms of the GNU General Public
7License as published by the Free Software Foundation; either version 2 of the 7License as published by the Free Software Foundation; either version 2 of the
8License, or (at your option) any later 8License, or (at your option) any later
9version. 9version.
10 10
11This program is distributed in the hope that it will be useful, but WITHOUT ANY 11This program is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the 12WARRANTY; without even the
13implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14
15GNU General 15GNU General
16Public License for more details. 16Public License for more details.
17 17
18You should have received a copy of the GNU General Public License along with 18You should have received a copy of the GNU General Public License along with
19this program; if not, write to the Free 19this program; if not, write to the Free
20Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/ 21*/
22 22
23#include "vcrgroup.h" 23#include "vcrgroup.h"
24 24
25VCRGroup::VCRGroup(QWidget *parent=0, const char *name=0) : QWidget(parent, 25VCRGroup::VCRGroup(QWidget *parent, const char *name) : QWidget(parent,
26name) 26name)
27{ 27{
28 QVBoxLayout *vlayout = new QVBoxLayout(this); 28 QVBoxLayout *vlayout = new QVBoxLayout(this);
29 29
30 QHBoxLayout *hlayout1 = new QHBoxLayout(this); 30 QHBoxLayout *hlayout1 = new QHBoxLayout(this);
31 QHBoxLayout *hlayout2 = new QHBoxLayout(this); 31 QHBoxLayout *hlayout2 = new QHBoxLayout(this);
32 32
33 vlayout->addLayout(hlayout1); 33 vlayout->addLayout(hlayout1);
34 vlayout->addSpacing(1); 34 vlayout->addSpacing(1);
35 vlayout->addLayout(hlayout2); 35 vlayout->addLayout(hlayout2);
36 36
37 QPushButton *play = new 37 QPushButton *play = new
38QPushButton("Play",this, "play"); 38QPushButton("Play",this, "play");
39 hlayout1->addWidget(play); 39 hlayout1->addWidget(play);
40 connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 40 connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
41 41
42 hlayout1->addSpacing(5); 42 hlayout1->addSpacing(5);
43 43
44 QPushButton *pause = new 44 QPushButton *pause = new
45QPushButton("Pause",this, "pause"); 45QPushButton("Pause",this, "pause");
46 hlayout1->addWidget(pause); 46 hlayout1->addWidget(pause);
47 connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 47 connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
48 48
49 hlayout1->addSpacing(5); 49 hlayout1->addSpacing(5);
diff --git a/noncore/tools/remote/vcrgroupconf.cpp b/noncore/tools/remote/vcrgroupconf.cpp
index a50ed0a..2158d43 100644
--- a/noncore/tools/remote/vcrgroupconf.cpp
+++ b/noncore/tools/remote/vcrgroupconf.cpp
@@ -1,43 +1,43 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "vcrgroupconf.h" 17#include "vcrgroupconf.h"
18 18
19VCRGroupConf::VCRGroupConf(QWidget *parent=0, const char *name=0) : QWidget(parent, name) 19VCRGroupConf::VCRGroupConf(QWidget *parent, const char *name) : QWidget(parent, name)
20{ 20{
21 QVBoxLayout *vlayout = new QVBoxLayout(this); 21 QVBoxLayout *vlayout = new QVBoxLayout(this);
22 22
23 QHBoxLayout *hlayout1 = new QHBoxLayout(this); 23 QHBoxLayout *hlayout1 = new QHBoxLayout(this);
24 QHBoxLayout *hlayout2 = new QHBoxLayout(this); 24 QHBoxLayout *hlayout2 = new QHBoxLayout(this);
25 25
26 vlayout->addLayout(hlayout1); 26 vlayout->addLayout(hlayout1);
27 vlayout->addSpacing(1); 27 vlayout->addSpacing(1);
28 vlayout->addLayout(hlayout2); 28 vlayout->addLayout(hlayout2);
29 29
30 QPushButton *play = new QPushButton("Play",this, "play"); 30 QPushButton *play = new QPushButton("Play",this, "play");
31 hlayout1->addWidget(play); 31 hlayout1->addWidget(play);
32 connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 32 connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
33 33
34 hlayout1->addSpacing(5); 34 hlayout1->addSpacing(5);
35 35
36 QPushButton *pause = new QPushButton("Pause",this, "pause"); 36 QPushButton *pause = new QPushButton("Pause",this, "pause");
37 hlayout1->addWidget(pause); 37 hlayout1->addWidget(pause);
38 connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 38 connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
39 39
40 hlayout1->addSpacing(5); 40 hlayout1->addSpacing(5);
41 41
42 QPushButton *stop = new QPushButton("Stop",this, "stop"); 42 QPushButton *stop = new QPushButton("Stop",this, "stop");
43 hlayout1->addWidget(stop); 43 hlayout1->addWidget(stop);