Diffstat (limited to 'noncore/tools/remote/recorddialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/remote/recorddialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/tools/remote/recorddialog.cpp b/noncore/tools/remote/recorddialog.cpp index cfab730..1ce5472 100644 --- a/noncore/tools/remote/recorddialog.cpp +++ b/noncore/tools/remote/recorddialog.cpp | |||
@@ -1,82 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
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 "recorddialog.h" | 17 | #include "recorddialog.h" |
18 | 18 | ||
19 | RecordDialog::RecordDialog(QWidget *parent, const char *name) | 19 | RecordDialog::RecordDialog(QWidget *parent, const char *name) |
20 | :QDialog(parent, name) | 20 | :QDialog(parent, name) |
21 | { | 21 | { |
22 | QVBoxLayout *layout = new QVBoxLayout(this); | 22 | QVBoxLayout *layout = new QVBoxLayout(this); |
23 | QHBoxLayout *hlayout = new QHBoxLayout(this); | 23 | QHBoxLayout *hlayout = new QHBoxLayout(this); |
24 | 24 | ||
25 | layout->insertSpacing(0,5); | 25 | layout->insertSpacing(0,5); |
26 | output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output"); | 26 | output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output"); |
27 | layout->insertWidget(-1, output); | 27 | layout->insertWidget(-1, output); |
28 | layout->insertSpacing(-1, 5); | 28 | layout->insertSpacing(-1, 5); |
29 | layout->insertLayout(-1, hlayout); | 29 | layout->insertLayout(-1, hlayout); |
30 | layout->insertSpacing(-1, 5); | 30 | layout->insertSpacing(-1, 5); |
31 | 31 | ||
32 | hlayout->insertSpacing(0, 5); | 32 | hlayout->insertSpacing(0, 5); |
33 | input = new QLineEdit(this, "input"); | 33 | input = new QLineEdit(this, "input"); |
34 | hlayout->insertWidget(-1, input, 1); | 34 | hlayout->insertWidget(-1, input, 1); |
35 | hlayout->insertSpacing(-1, 5); | 35 | hlayout->insertSpacing(-1, 5); |
36 | 36 | ||
37 | QPushButton *ret = new QPushButton("Return", this, "return"); | 37 | QPushButton *ret = new QPushButton("Return", this, "return"); |
38 | hlayout->insertWidget(-1, ret); | 38 | hlayout->insertWidget(-1, ret); |
39 | hlayout->insertSpacing(-1, 5); | 39 | hlayout->insertSpacing(-1, 5); |
40 | connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) ); | 40 | connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) ); |
41 | where = 0; | 41 | where = 0; |
42 | 42 | ||
43 | record = new OProcess; | 43 | record = new OProcess; |
44 | } | 44 | } |
45 | 45 | ||
46 | void RecordDialog::retPressed() | 46 | void RecordDialog::retPressed() |
47 | { | 47 | { |
48 | printf("RecordDialog::retPressed: ret pressed\n"); | 48 | printf("RecordDialog::retPressed: ret pressed\n"); |
49 | 49 | ||
50 | if(where == 0) | 50 | if(where == 0) |
51 | { | 51 | { |
52 | connect(record, SIGNAL(receivedStdout(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) ); | 52 | connect(record, SIGNAL(receivedStdout(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) ); |
53 | connect(record, SIGNAL(receivedStderr(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) ); | 53 | connect(record, SIGNAL(receivedStderr(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) ); |
54 | connect(record, SIGNAL(processExited(OProcess *)), this, SLOT(done(OProcess *)) ); | 54 | connect(record, SIGNAL(processExited(OProcess*)), this, SLOT(done(OProcess*)) ); |
55 | printf("RecordDialog::retPressed: starting irrecord\n"); | 55 | printf("RecordDialog::retPressed: starting irrecord\n"); |
56 | QString file = "/tmp/" + input->text(); | 56 | QString file = "/tmp/" + input->text(); |
57 | *record<<"irrecord"<<file.latin1(); | 57 | *record<<"irrecord"<<file.latin1(); |
58 | if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput)) | 58 | if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput)) |
59 | { | 59 | { |
60 | QMessageBox *mb = new QMessageBox("Error!", | 60 | QMessageBox *mb = new QMessageBox("Error!", |
61 | "Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord", | 61 | "Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord", |
62 | QMessageBox::NoIcon, | 62 | QMessageBox::NoIcon, |
63 | QMessageBox::Ok, | 63 | QMessageBox::Ok, |
64 | QMessageBox::NoButton, | 64 | QMessageBox::NoButton, |
65 | QMessageBox::NoButton); | 65 | QMessageBox::NoButton); |
66 | mb->exec(); | 66 | mb->exec(); |
67 | return; | 67 | return; |
68 | } | 68 | } |
69 | // record->resume(); | 69 | // record->resume(); |
70 | where = 1; | 70 | where = 1; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | void RecordDialog::incoming(OProcess *proc, char *buffer, int len) | 74 | void RecordDialog::incoming(OProcess *proc, char *buffer, int len) |
75 | { | 75 | { |
76 | //output->setText(output->text() + QString(buffer).truncate(len-1)); | 76 | //output->setText(output->text() + QString(buffer).truncate(len-1)); |
77 | printf("RecordDialog::incoming: got text from irrecord\n"); | 77 | printf("RecordDialog::incoming: got text from irrecord\n"); |
78 | } | 78 | } |
79 | 79 | ||
80 | void RecordDialog::done(OProcess *proc) | 80 | void RecordDialog::done(OProcess *proc) |
81 | { | 81 | { |
82 | } | 82 | } |