author | sandman <sandman> | 2002-12-26 00:57:15 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-26 00:57:15 (UTC) |
commit | 918e4d4dffddc6d1a31b9b92535cd81a4f3d52e2 (patch) (unidiff) | |
tree | 80988c5dd55074af1d397e6b9d9b235d56e4e293 | |
parent | 0d54f8140e8c39bde48bc09e34e76dcc5c47fa92 (diff) | |
download | opie-918e4d4dffddc6d1a31b9b92535cd81a4f3d52e2.zip opie-918e4d4dffddc6d1a31b9b92535cd81a4f3d52e2.tar.gz opie-918e4d4dffddc6d1a31b9b92535cd81a4f3d52e2.tar.bz2 |
signature of keyRegister() QCop call changed because of the device button
rewrite
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index d6128a6..6867e82 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -142,193 +142,194 @@ static char * vmemo_xpm[] = { | |||
142 | "o c #66666A", | 142 | "o c #66666A", |
143 | "p c #505054", | 143 | "p c #505054", |
144 | "q c #838388", | 144 | "q c #838388", |
145 | "r c #A1A1A7", | 145 | "r c #A1A1A7", |
146 | "s c #A9A9AE", | 146 | "s c #A9A9AE", |
147 | "t c #A8A8B0", | 147 | "t c #A8A8B0", |
148 | "u c #5E5E63", | 148 | "u c #5E5E63", |
149 | "v c #3A3A3E", | 149 | "v c #3A3A3E", |
150 | "w c #BDBDC6", | 150 | "w c #BDBDC6", |
151 | "x c #59595E", | 151 | "x c #59595E", |
152 | "y c #76767C", | 152 | "y c #76767C", |
153 | "z c #373738", | 153 | "z c #373738", |
154 | "A c #717174", | 154 | "A c #717174", |
155 | "B c #727278", | 155 | "B c #727278", |
156 | "C c #1C1C1E", | 156 | "C c #1C1C1E", |
157 | "D c #3C3C3F", | 157 | "D c #3C3C3F", |
158 | "E c #ADADB6", | 158 | "E c #ADADB6", |
159 | "F c #54555A", | 159 | "F c #54555A", |
160 | "G c #8B8C94", | 160 | "G c #8B8C94", |
161 | "H c #5A5A5F", | 161 | "H c #5A5A5F", |
162 | "I c #BBBBC3", | 162 | "I c #BBBBC3", |
163 | "J c #C4C4CB", | 163 | "J c #C4C4CB", |
164 | "K c #909098", | 164 | "K c #909098", |
165 | "L c #737379", | 165 | "L c #737379", |
166 | "M c #343437", | 166 | "M c #343437", |
167 | "N c #8F8F98", | 167 | "N c #8F8F98", |
168 | "O c #000407", | 168 | "O c #000407", |
169 | "P c #2D3137", | 169 | "P c #2D3137", |
170 | "Q c #B0B1BC", | 170 | "Q c #B0B1BC", |
171 | "R c #3B3C40", | 171 | "R c #3B3C40", |
172 | "S c #6E6E74", | 172 | "S c #6E6E74", |
173 | "T c #95959C", | 173 | "T c #95959C", |
174 | "U c #74747A", | 174 | "U c #74747A", |
175 | "V c #1D1D1E", | 175 | "V c #1D1D1E", |
176 | "W c #91929A", | 176 | "W c #91929A", |
177 | "X c #42444A", | 177 | "X c #42444A", |
178 | "Y c #22282E", | 178 | "Y c #22282E", |
179 | "Z c #B0B2BC", | 179 | "Z c #B0B2BC", |
180 | "` c #898A90", | 180 | "` c #898A90", |
181 | " . c #65656A", | 181 | " . c #65656A", |
182 | ".. c #999AA2", | 182 | ".. c #999AA2", |
183 | "+. c #52535A", | 183 | "+. c #52535A", |
184 | "@. c #151B21", | 184 | "@. c #151B21", |
185 | "#. c #515257", | 185 | "#. c #515257", |
186 | "$. c #B5B5BE", | 186 | "$. c #B5B5BE", |
187 | "%. c #616167", | 187 | "%. c #616167", |
188 | "&. c #1A1D22", | 188 | "&. c #1A1D22", |
189 | "*. c #000713", | 189 | "*. c #000713", |
190 | "=. c #1F1F21", | 190 | "=. c #1F1F21", |
191 | " ", | 191 | " ", |
192 | " . + @ # ", | 192 | " . + @ # ", |
193 | " $ % & * = - ", | 193 | " $ % & * = - ", |
194 | " ; > , ' ) ! ~ ", | 194 | " ; > , ' ) ! ~ ", |
195 | " { ] ^ / ( _ : ", | 195 | " { ] ^ / ( _ : ", |
196 | " < [ } | 1 2 3 ", | 196 | " < [ } | 1 2 3 ", |
197 | " 4 5 6 7 8 9 0 a b c ", | 197 | " 4 5 6 7 8 9 0 a b c ", |
198 | " d e f g h i j 3 k l m n ", | 198 | " d e f g h i j 3 k l m n ", |
199 | " o p q r s t u v w n ", | 199 | " o p q r s t u v w n ", |
200 | " o x y z A B C D E n ", | 200 | " o x y z A B C D E n ", |
201 | " F G H I J K L M N O ", | 201 | " F G H I J K L M N O ", |
202 | " P Q R S T U V W X ", | 202 | " P Q R S T U V W X ", |
203 | " Y Z ` b ...+. ", | 203 | " Y Z ` b ...+. ", |
204 | " @.#.$.%.&. ", | 204 | " @.#.$.%.&. ", |
205 | " *.B =. ", | 205 | " *.B =. ", |
206 | " n n n n n n n n n "}; | 206 | " n n n n n n n n n "}; |
207 | 207 | ||
208 | 208 | ||
209 | VMemo::VMemo( QWidget *parent, const char *_name ) | 209 | VMemo::VMemo( QWidget *parent, const char *_name ) |
210 | : QWidget( parent, _name ) { | 210 | : QWidget( parent, _name ) { |
211 | setFixedHeight( 18 ); | 211 | setFixedHeight( 18 ); |
212 | setFixedWidth( 14 ); | 212 | setFixedWidth( 14 ); |
213 | 213 | ||
214 | t_timer = new QTimer( this ); | 214 | t_timer = new QTimer( this ); |
215 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); | 215 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); |
216 | 216 | ||
217 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 217 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
218 | if (uname(&name) != -1) { | 218 | if (uname(&name) != -1) { |
219 | QString release=name.release; | 219 | QString release=name.release; |
220 | 220 | ||
221 | Config vmCfg("Vmemo"); | 221 | Config vmCfg("Vmemo"); |
222 | vmCfg.setGroup("Defaults"); | 222 | vmCfg.setGroup("Defaults"); |
223 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); | 223 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); |
224 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 224 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
225 | 225 | ||
226 | qDebug("toggleKey %d", toggleKey); | 226 | qDebug("toggleKey %d", toggleKey); |
227 | 227 | ||
228 | if(release.find("embedix",0,TRUE) !=-1) | 228 | if(release.find("embedix",0,TRUE) !=-1) |
229 | systemZaurus=TRUE; | 229 | systemZaurus=TRUE; |
230 | else | 230 | else |
231 | systemZaurus=FALSE; | 231 | systemZaurus=FALSE; |
232 | 232 | ||
233 | myChannel = new QCopChannel( "QPE/VMemo", this ); | 233 | myChannel = new QCopChannel( "QPE/VMemo", this ); |
234 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), | 234 | connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), |
235 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 235 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
236 | 236 | ||
237 | if( toggleKey != -1 ) { | 237 | if( toggleKey != -1 ) { |
238 | QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); | 238 | // keyRegister(key, channel, message) |
239 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); | ||
239 | // e << 4096; // Key_Escape | 240 | // e << 4096; // Key_Escape |
240 | // e << Key_F5; //4148 | 241 | // e << Key_F5; //4148 |
241 | e << toggleKey; | 242 | e << toggleKey; |
242 | e << QString("QPE/VMemo"); | 243 | e << QString("QPE/VMemo"); |
243 | e << QString("toggleRecord()"); | 244 | e << QString("toggleRecord()"); |
244 | } | 245 | } |
245 | if(toggleKey == 1) | 246 | if(toggleKey == 1) |
246 | usingIcon=TRUE; | 247 | usingIcon=TRUE; |
247 | else | 248 | else |
248 | usingIcon=FALSE; | 249 | usingIcon=FALSE; |
249 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 250 | if( vmCfg.readNumEntry("hideIcon",0) == 1) |
250 | hide(); | 251 | hide(); |
251 | recording = FALSE; | 252 | recording = FALSE; |
252 | } | 253 | } |
253 | } | 254 | } |
254 | 255 | ||
255 | VMemo::~VMemo() { | 256 | VMemo::~VMemo() { |
256 | } | 257 | } |
257 | 258 | ||
258 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { | 259 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { |
259 | qDebug("receive"); | 260 | qDebug("receive"); |
260 | QDataStream stream( data, IO_ReadOnly ); | 261 | QDataStream stream( data, IO_ReadOnly ); |
261 | 262 | ||
262 | if (msg == "toggleRecord()") { | 263 | if (msg == "toggleRecord()") { |
263 | if (recording) { | 264 | if (recording) { |
264 | fromToggle = TRUE; | 265 | fromToggle = TRUE; |
265 | stopRecording(); | 266 | stopRecording(); |
266 | } else { | 267 | } else { |
267 | fromToggle = TRUE; | 268 | fromToggle = TRUE; |
268 | startRecording(); | 269 | startRecording(); |
269 | } | 270 | } |
270 | } | 271 | } |
271 | } | 272 | } |
272 | 273 | ||
273 | void VMemo::paintEvent( QPaintEvent* ) { | 274 | void VMemo::paintEvent( QPaintEvent* ) { |
274 | QPainter p(this); | 275 | QPainter p(this); |
275 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); | 276 | p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); |
276 | } | 277 | } |
277 | 278 | ||
278 | void VMemo::mousePressEvent( QMouseEvent * me) { | 279 | void VMemo::mousePressEvent( QMouseEvent * me) { |
279 | /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions | 280 | /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions |
280 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ | 281 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ |
281 | 282 | ||
282 | // if (!systemZaurus && me != NULL) | 283 | // if (!systemZaurus && me != NULL) |
283 | // return; | 284 | // return; |
284 | // } | 285 | // } |
285 | 286 | ||
286 | if(!recording) | 287 | if(!recording) |
287 | startRecording(); | 288 | startRecording(); |
288 | else | 289 | else |
289 | stopRecording(); | 290 | stopRecording(); |
290 | } | 291 | } |
291 | 292 | ||
292 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { | 293 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { |
293 | } | 294 | } |
294 | 295 | ||
295 | bool VMemo::startRecording() { | 296 | bool VMemo::startRecording() { |
296 | Config config( "Vmemo" ); | 297 | Config config( "Vmemo" ); |
297 | config.setGroup( "System" ); | 298 | config.setGroup( "System" ); |
298 | 299 | ||
299 | useAlerts = config.readBoolEntry("Alert",1); | 300 | useAlerts = config.readBoolEntry("Alert",1); |
300 | if(useAlerts) { | 301 | if(useAlerts) { |
301 | 302 | ||
302 | msgLabel = new QLabel( 0, "alertLabel" ); | 303 | msgLabel = new QLabel( 0, "alertLabel" ); |
303 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); | 304 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); |
304 | msgLabel->show(); | 305 | msgLabel->show(); |
305 | } | 306 | } |
306 | 307 | ||
307 | qDebug("Start recording engines"); | 308 | qDebug("Start recording engines"); |
308 | recording = TRUE; | 309 | recording = TRUE; |
309 | 310 | ||
310 | if (openDSP() == -1) { | 311 | if (openDSP() == -1) { |
311 | recording = FALSE; | 312 | recording = FALSE; |
312 | return FALSE; | 313 | return FALSE; |
313 | } | 314 | } |
314 | 315 | ||
315 | config.setGroup("Defaults"); | 316 | config.setGroup("Defaults"); |
316 | 317 | ||
317 | QDateTime dt = QDateTime::currentDateTime(); | 318 | QDateTime dt = QDateTime::currentDateTime(); |
318 | 319 | ||
319 | QString fName; | 320 | QString fName; |
320 | config.setGroup( "System" ); | 321 | config.setGroup( "System" ); |
321 | fName = QPEApplication::documentDir() ; | 322 | fName = QPEApplication::documentDir() ; |
322 | fileName = config.readEntry("RecLocation", fName); | 323 | fileName = config.readEntry("RecLocation", fName); |
323 | 324 | ||
324 | int s; | 325 | int s; |
325 | s=fileName.find(':'); | 326 | s=fileName.find(':'); |
326 | if(s) | 327 | if(s) |
327 | fileName=fileName.right(fileName.length()-s-2); | 328 | fileName=fileName.right(fileName.length()-s-2); |
328 | qDebug("pathname will be "+fileName); | 329 | qDebug("pathname will be "+fileName); |
329 | 330 | ||
330 | if( fileName.left(1).find('/') == -1) | 331 | if( fileName.left(1).find('/') == -1) |
331 | fileName="/"+fileName; | 332 | fileName="/"+fileName; |
332 | if( fileName.right(1).find('/') == -1) | 333 | if( fileName.right(1).find('/') == -1) |
333 | fileName+="/"; | 334 | fileName+="/"; |
334 | fName = "vm_"+ dt.toString()+ ".wav"; | 335 | fName = "vm_"+ dt.toString()+ ".wav"; |