summaryrefslogtreecommitdiff
path: root/noncore/tools/remote
Side-by-side diff
Diffstat (limited to 'noncore/tools/remote') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/buttondialog.cpp4
-rw-r--r--noncore/tools/remote/recorddialog.cpp6
-rw-r--r--noncore/tools/remote/topgroup.cpp2
-rw-r--r--noncore/tools/remote/topgroupconf.cpp4
4 files changed, 8 insertions, 8 deletions
diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp
index 6ea4801..580f101 100644
--- a/noncore/tools/remote/buttondialog.cpp
+++ b/noncore/tools/remote/buttondialog.cpp
@@ -1,152 +1,152 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "buttondialog.h"
ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f)
{
setCaption(tr(buttonName));
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *hlayout1 = new QHBoxLayout(this);
QHBoxLayout *hlayout2 = new QHBoxLayout(this);
QHBoxLayout *hlayout3 = new QHBoxLayout(this);
layout->addSpacing(5);
layout->addLayout(hlayout1);
layout->addSpacing(5);
layout->addLayout(hlayout2);
layout->addSpacing(5);
layout->addLayout(hlayout3);
layout->addSpacing(5);
remote = new QComboBox(false, this, "remote");
QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel");
hlayout1->addSpacing(5);
hlayout1->addWidget(remoteLabel);
hlayout1->addSpacing(5);
hlayout1->addWidget(remote);
hlayout1->addSpacing(5);
remote->insertItem("Remote ");
remote->insertStringList(getRemotes());
- connect(remote, SIGNAL(activated(const QString &)), this, SLOT(remoteSelected(const QString&)) );
+ connect(remote, SIGNAL(activated(const QString&)), this, SLOT(remoteSelected(const QString&)) );
button = new QComboBox(false, this, "button");
QLabel *buttonLabel = new QLabel(remote, "Button: ", this, "buttonLabel");
hlayout2->addSpacing(5);
hlayout2->addWidget(buttonLabel);
hlayout2->addSpacing(5);
hlayout2->addWidget(button);
hlayout2->addSpacing(5);
button->insertItem("Button ");
- connect(button, SIGNAL(activated(const QString &)), this, SLOT(buttonSelected(const QString&)) );
+ connect(button, SIGNAL(activated(const QString&)), this, SLOT(buttonSelected(const QString&)) );
label = new QLineEdit(this, "label");
label->setText(buttonName);
QLabel *labelLabel = new QLabel(label, "Label: ", this, "labelLabel");
hlayout3->addSpacing(5);
hlayout3->addWidget(labelLabel);
hlayout3->addSpacing(5);
hlayout3->addWidget(label);
hlayout3->addSpacing(5);
}
void ButtonDialog::remoteSelected(const QString &string)
{
button->insertStringList(getButtons(string.latin1()) );
list="SEND_ONCE";
list+=string;
}
void ButtonDialog::buttonSelected(const QString &string)
{
list+=string;
}
QStringList ButtonDialog::getList()
{
return list;
}
QString ButtonDialog::getLabel()
{
return label->text();
}
QStringList ButtonDialog::getRemotes()
{
const char write_buffer[] = "LIST\n";
const char *readbuffer;
int i, numlines;
QStringList list;
addr.sun_family=AF_UNIX;
strcpy(addr.sun_path,"/dev/lircd");
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if(fd == -1)
{
QMessageBox *mb = new QMessageBox("Error!",
"couldnt connect to socket",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
mb->exec();
perror("ButtonDialog::GetRemotes");
return NULL;
}
if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
{
QMessageBox *mb = new QMessageBox("Error!",
"couldnt connect to socket",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
mb->exec();
perror("ButtonDialog::GetRemotes");
return NULL;
}
write(fd, write_buffer, strlen(write_buffer));
for(i=0; i<5; i++)
{
printf("%d\n", i);
readbuffer = readPacket();
printf("%s", readbuffer);
printf("%d\n", i);
}
numlines = atoi(readbuffer);
for(i=0; i<numlines; i++)
{
list+=readPacket();
}
if(strcasecmp(readPacket(), "END") != 0)
{
QMessageBox *mb = new QMessageBox("Error!",
"bad packet",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
mb->exec();
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 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "recorddialog.h"
RecordDialog::RecordDialog(QWidget *parent, const char *name)
:QDialog(parent, name)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *hlayout = new QHBoxLayout(this);
layout->insertSpacing(0,5);
output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output");
layout->insertWidget(-1, output);
layout->insertSpacing(-1, 5);
layout->insertLayout(-1, hlayout);
layout->insertSpacing(-1, 5);
hlayout->insertSpacing(0, 5);
input = new QLineEdit(this, "input");
hlayout->insertWidget(-1, input, 1);
hlayout->insertSpacing(-1, 5);
QPushButton *ret = new QPushButton("Return", this, "return");
hlayout->insertWidget(-1, ret);
hlayout->insertSpacing(-1, 5);
connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) );
where = 0;
record = new OProcess;
}
void RecordDialog::retPressed()
{
printf("RecordDialog::retPressed: ret pressed\n");
if(where == 0)
{
- connect(record, SIGNAL(receivedStdout(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) );
- connect(record, SIGNAL(receivedStderr(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) );
- connect(record, SIGNAL(processExited(OProcess *)), this, SLOT(done(OProcess *)) );
+ connect(record, SIGNAL(receivedStdout(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) );
+ connect(record, SIGNAL(receivedStderr(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) );
+ connect(record, SIGNAL(processExited(OProcess*)), this, SLOT(done(OProcess*)) );
printf("RecordDialog::retPressed: starting irrecord\n");
QString file = "/tmp/" + input->text();
*record<<"irrecord"<<file.latin1();
if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput))
{
QMessageBox *mb = new QMessageBox("Error!",
"Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
mb->exec();
return;
}
// record->resume();
where = 1;
}
}
void RecordDialog::incoming(OProcess *proc, char *buffer, int len)
{
// output->setText(output->text() + QString(buffer).truncate(len-1));
printf("RecordDialog::incoming: got text from irrecord\n");
}
void RecordDialog::done(OProcess *proc)
{
}
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp
index 93cffbb..427cb8f 100644
--- a/noncore/tools/remote/topgroup.cpp
+++ b/noncore/tools/remote/topgroup.cpp
@@ -1,54 +1,54 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "topgroup.h"
TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name)
{
QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0);
QPushButton *power = new QPushButton("Power",this,"power");
layout->addWidget(power);
connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
// power->setGeometry(5, 5,40, 20);
layout->addSpacing(5);
QPushButton *source = new QPushButton("Source",this,"source");
layout->addWidget(source);
connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
// source->setGeometry(50,5,40,20);
remotes = new QComboBox(false, this, "remotes");
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
remotes->insertItem("Select Remote");
// remotes->setGeometry(135,5,95,20);
QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
// remoteLabel->setGeometry(90,5,40,20);
remoteLabel->setAlignment(AlignRight | AlignVCenter);
layout->addWidget(remoteLabel);
layout->addWidget(remotes);
}
void TopGroup::updateRemotes(Config *cfg)
{
remotes->clear();
remotes->insertItem(QString("SelectRemote"));
cfg->setGroup("Remotes");
remotes->insertStringList(cfg->readListEntry("remoteList", ',') );
}
diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp
index d763a3a..0419a65 100644
--- a/noncore/tools/remote/topgroupconf.cpp
+++ b/noncore/tools/remote/topgroupconf.cpp
@@ -1,70 +1,70 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "topgroupconf.h"
TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
{
QHBoxLayout *layout = new QHBoxLayout(this);
QPushButton *power = new QPushButton("Power",this,"power");
layout->addWidget(power);
connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
// power->setGeometry(5, 5,40, 20);
layout->addSpacing(5);
QPushButton *source = new QPushButton("Source",this,"source");
layout->addWidget(source);
connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
// source->setGeometry(50,5,40,20);
remotes = new QComboBox(true, this, "remotes");
remotes->insertItem(QString("Remotes"));
layout->addWidget(remotes);
layout->setStretchFactor(remotes, 1);
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
QPushButton *newrem = new QPushButton("New", this, "new");
layout->addWidget(newrem);
connect(newrem, SIGNAL(pressed()), this->parentWidget(), SLOT(newPressed()) );
/* remotes = new QComboBox(false, this, "remotes");
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
remotes->insertItem("Select Remote");
// remotes->setGeometry(135,5,95,20);
QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
// remoteLabel->setGeometry(90,5,40,20);
remoteLabel->setAlignment(AlignRight | AlignVCenter);
layout->addWidget(remoteLabel);
layout->addWidget(remotes);
*/
}
void TopGroupConf::updateRemotes(QStringList list)
{
remotes->insertStringList(list);
}
QString TopGroupConf::getRemotesText()
{
return remotes->currentText();
}