summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/recorddialog.cpp
Unidiff
Diffstat (limited to 'noncore/tools/remote/recorddialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/recorddialog.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/tools/remote/recorddialog.cpp b/noncore/tools/remote/recorddialog.cpp
index 1ce5472..a9c4c61 100644
--- a/noncore/tools/remote/recorddialog.cpp
+++ b/noncore/tools/remote/recorddialog.cpp
@@ -1,78 +1,80 @@
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 "recorddialog.h" 17#include "recorddialog.h"
18 18
19using namespace Opie::Core;
20using namespace Opie::Core;
19RecordDialog::RecordDialog(QWidget *parent, const char *name) 21RecordDialog::RecordDialog(QWidget *parent, const char *name)
20 :QDialog(parent, name) 22 :QDialog(parent, name)
21{ 23{
22 QVBoxLayout *layout = new QVBoxLayout(this); 24 QVBoxLayout *layout = new QVBoxLayout(this);
23 QHBoxLayout *hlayout = new QHBoxLayout(this); 25 QHBoxLayout *hlayout = new QHBoxLayout(this);
24 26
25 layout->insertSpacing(0,5); 27 layout->insertSpacing(0,5);
26 output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output"); 28 output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output");
27 layout->insertWidget(-1, output); 29 layout->insertWidget(-1, output);
28 layout->insertSpacing(-1, 5); 30 layout->insertSpacing(-1, 5);
29 layout->insertLayout(-1, hlayout); 31 layout->insertLayout(-1, hlayout);
30 layout->insertSpacing(-1, 5); 32 layout->insertSpacing(-1, 5);
31 33
32 hlayout->insertSpacing(0, 5); 34 hlayout->insertSpacing(0, 5);
33 input = new QLineEdit(this, "input"); 35 input = new QLineEdit(this, "input");
34 hlayout->insertWidget(-1, input, 1); 36 hlayout->insertWidget(-1, input, 1);
35 hlayout->insertSpacing(-1, 5); 37 hlayout->insertSpacing(-1, 5);
36 38
37 QPushButton *ret = new QPushButton("Return", this, "return"); 39 QPushButton *ret = new QPushButton("Return", this, "return");
38 hlayout->insertWidget(-1, ret); 40 hlayout->insertWidget(-1, ret);
39 hlayout->insertSpacing(-1, 5); 41 hlayout->insertSpacing(-1, 5);
40 connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) ); 42 connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) );
41 where = 0; 43 where = 0;
42 44
43 record = new OProcess; 45 record = new OProcess;
44} 46}
45 47
46void RecordDialog::retPressed() 48void RecordDialog::retPressed()
47{ 49{
48 printf("RecordDialog::retPressed: ret pressed\n"); 50 printf("RecordDialog::retPressed: ret pressed\n");
49 51
50 if(where == 0) 52 if(where == 0)
51 { 53 {
52 connect(record, SIGNAL(receivedStdout(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) ); 54 connect(record, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), this, SLOT(incoming(Opie::Core::OProcess*,char*,int)) );
53 connect(record, SIGNAL(receivedStderr(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) ); 55 connect(record, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), this, SLOT(incoming(Opie::Core::OProcess*,char*,int)) );
54 connect(record, SIGNAL(processExited(OProcess*)), this, SLOT(done(OProcess*)) ); 56 connect(record, SIGNAL(processExited(Opie::Core::OProcess*)), this, SLOT(done(Opie::Core::OProcess*)) );
55 printf("RecordDialog::retPressed: starting irrecord\n"); 57 printf("RecordDialog::retPressed: starting irrecord\n");
56 QString file = "/tmp/" + input->text(); 58 QString file = "/tmp/" + input->text();
57 *record<<"irrecord"<<file.latin1(); 59 *record<<"irrecord"<<file.latin1();
58 if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput)) 60 if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput))
59 { 61 {
60 QMessageBox *mb = new QMessageBox("Error!", 62 QMessageBox *mb = new QMessageBox("Error!",
61 "Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord", 63 "Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord",
62 QMessageBox::NoIcon, 64 QMessageBox::NoIcon,
63 QMessageBox::Ok, 65 QMessageBox::Ok,
64 QMessageBox::NoButton, 66 QMessageBox::NoButton,
65 QMessageBox::NoButton); 67 QMessageBox::NoButton);
66 mb->exec(); 68 mb->exec();
67 return; 69 return;
68 } 70 }
69 // record->resume(); 71 // record->resume();
70 where = 1; 72 where = 1;
71 } 73 }
72} 74}
73 75
74void RecordDialog::incoming(OProcess *proc, char *buffer, int len) 76void RecordDialog::incoming(OProcess *proc, char *buffer, int len)
75{ 77{
76 //output->setText(output->text() + QString(buffer).truncate(len-1)); 78 //output->setText(output->text() + QString(buffer).truncate(len-1));
77 printf("RecordDialog::incoming: got text from irrecord\n"); 79 printf("RecordDialog::incoming: got text from irrecord\n");
78} 80}